summaryrefslogtreecommitdiffstats
path: root/perl-install/install/Makefile
blob: 405cd9904d6e78d2d796403e38884e13de3ed3d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
include ../../Makefile.config
include ../Makefile.config

PRODUCT=drakx-installer-stage2

ROOTDEST = /export
STAGE2_DEST = $(ROOTDEST)/install/stage2
DEST = $(STAGE2_DEST)/live

REP4PMS     = /usr/lib/libDrakX
DESTREP4PMS = $(DEST)$(REP4PMS)

all: xs

clean xs:
	make -C .. $@

dist-svn:
	mkdir -p $(PRODUCT)-$(VERSION)
	svn export -q -rBASE .. $(PRODUCT)-$(VERSION)/perl-install
	svn export -q -rBASE ../../tools $(PRODUCT)-$(VERSION)/tools
	svn export -q -rBASE ../../kernel $(PRODUCT)-$(VERSION)/kernel
	cp ../../Makefile.config $(PRODUCT)-$(VERSION)/
	tar cfa $(PRODUCT)-$(VERSION).tar.xz $(PRODUCT)-$(VERSION)
	rm -rf $(PRODUCT)-$(VERSION)

dist-git:
	@cd ../..; git archive --prefix=$(PRODUCT)-$(VERSION)/ HEAD kernel perl-install tools Makefile.config | xz >$(PRODUCT)-$(VERSION).tar.xz;
	@echo WARNING: rpmsrate is MISSING!!!

tar:
	rm -rf $(PRODUCT)*.tar* $(PRODUCT)-$(VERSION)
	@if [ -e "../../.svn" ]; then \
		$(MAKE) dist-svn; \
	elif [ -e "../../.git" ]; then \
		$(MAKE) dist-git; \
	else \
		echo "Unknown SCM (not SVN nor GIT)";\
		exit 1; \
	fi;
	$(info $(PRODUCT)-$(VERSION).tar.xz is ready)

install:
	$(MAKE) full_stage2
	echo $(VERSION) > $(STAGE2_DEST)/VERSION

install_pms:
	[ -d $(DEST) ] || ../../tools/mdkinst_stage2_tool --uncompress $(STAGE2_DEST)

	for i in `perl -ne 's/sub (\w+?)_?(\(\))? {.*/$$1/ and print' commands.pm` sync; do ln -sf commands $(DEST)/usr/bin/$$i; done

	install -d $(DESTREP4PMS)
	cd .. ; for i in $(PMS); do \
		dest=$(DESTREP4PMS)/`dirname $$i`; \
		install -d $$dest; \
		perl -pe 's/#[-+].*//; $$_ = "\n" if (/^=(head|begin)/ .. /^=cut/) || /use (diagnostics|strict|vars|warnings)/' $$i > $(DESTREP4PMS)/$$i; \
	done

	cp ../share/*.rc share/*.rc $(DESTREP4PMS)
	chmod a+x $(DESTREP4PMS)/install/install2
	chmod a+x $(DESTREP4PMS)/install/commands

get_needed_files: xs
	REP4PMS=$(REP4PMS) ../../tools/install-xml-file-list share/list.xml $(DEST)
	chmod u-s -R $(DEST) # for mount/umount
	share/generate-xlocales $(DEST)

	mv -f $(DEST)/usr/$(LIB)/*.so* $(DEST)/$(LIB)
	../../tools/simplify-drakx-modules $(DEST)/usr/*/*/*/utf8_heavy.pl

	perl -I.. -Mlang -e 'symlink "UTF-8", "$(DEST)/usr/share/locale/$$_" foreach lang::list_langs()'

	perl -ane 'symlink "$$F[1]", "$(DEST)$$F[0]"' share/aliases
ifeq (ia64,$(ARCH))
	ln -sf bash $(DEST)/bin/sh
else
	ln -sf ash $(DEST)/bin/sh
endif

	mkfontdir $(DEST)/usr/share/fonts
	fc-cache -f $(DEST)/usr/share/fonts

	$(MAKE) -C ../share/po install SUDO= LOCALEDIR=$(DEST)/usr/share/locale_special
	$(MAKE) -C help/po install SUDO= LOCALEDIR=$(DEST)/usr/share/locale_special
	$(MAKE) -C share/po install SUDO= LOCALEDIR=$(DEST)/usr/share/locale_special
# POFILES to disable for installation:
# be,fur: too few messages translated; 
# ta: font problem
	rm -rf $(DEST)/usr/share/locale_special/{be,fur,ta}

full_stage2:
	$(MAKE) stage2
	@if [ "$${DEBUG_INSTALL+xxx}" ]; then make dont_run_directly_stage2; else : ; fi
	$(MAKE) compress

compress:
	../../tools/mdkinst_stage2_tool --clean --compress $(STAGE2_DEST)

stage2:
	rm -rf $(DEST)
	mkdir -p $(DEST)
	$(MAKE) get_needed_files 
	$(MAKE) install_pms

dont_run_directly_stage2:
	[ -d $(DEST) ] || ../../tools/mdkinst_stage2_tool --uncompress $(STAGE2_DEST)
	install -m 755 share/runinstall2.sh share/gdb-inst $(DEST)/usr/bin/
	ln -sf runinstall2.sh $(DEST)/usr/bin/runinstall2

trace_stage2:
	[ -d $(DEST) ] || ../../tools/mdkinst_stage2_tool --uncompress $(STAGE2_DEST)
	f=`perldoc -l Devel::Trace`; install -m 644 -D $$f $(DEST)$$f
	perl -pi -e 's|(#!/usr/bin/perl).*|$$1 -d:Trace|' $(DEST)/usr/bin/runinstall2

# [pixel] after make install_pms:
# sudo sh -c 'CLEAN=1 perl ../../tools/drakx-in-chroot /export /tmp/rr --useless_thing_accepted --kickstart install/auto_inst.cfg.local.pl'
'n550' href='#n550'>550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671
package install::install2; # $Id: install2.pm 255825 2009-04-08 11:54:23Z tv $

use diagnostics;
use strict;
use vars qw($o);

BEGIN { $::isInstall = 1 }

#-######################################################################################
#- misc imports
#-######################################################################################
use install::steps_list;
use common;
use install::any 'addToBeDone';
use install::steps;
use install::any;
use lang;
use keyboard;
use mouse;
use devices;
use partition_table;
use modules;
use detect_devices;
use run_program;
use any;
use log;
use fs;
use fs::any;

#-#######################################################################################
#-$O
#-the big struct which contain, well everything (globals + the interactive methods ...)
#-if you want to do a kickstart file, you just have to add all the required fields (see for example
#-the variable $default)
#-#######################################################################################
$o = $::o = {
#    bootloader => { linear => 0, message => 1, timeout => 5, restricted => 0 },
#-    packages   => [ qw() ],
    partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0 }, #-, readonly => 0 },
    authentication => { blowfish => 1, shadow => 1 },
    locale         => { lang => 'en_US' },
#-    isUpgrade    => 0,
    toRemove     => [],
    toSave       => [],
#-    simple_themes => 1,

    timezone => {
#-                   timezone => "Europe/Paris",
#-                   UTC      => 1,
                },
#-    superuser => { password => 'a', shell => '/bin/bash', realname => 'God' },
#-    user => { name => 'foo', password => 'bar', home => '/home/foo', shell => '/bin/bash', realname => 'really, it is foo' },

#-    keyboard => 'de',
#-    display => "192.168.1.19:1",
    steps        => \%install::steps_list::installSteps,
    orderedSteps => \@install::steps_list::orderedInstallSteps,

    #- for the list of fields available, see network/network.pm
    net => {
	    #- network => { HOSTNAME => 'abcd' },
	    #- resolv => { DOMAINNAME => 'foo.xyz' },
	    #- ifcfg => {
	    #-   eth0 => { DEVICE => "eth0", IPADDR => '1.2.3.4', NETMASK => '255.255.255.128' }
	    #- },
	    },

#-step : the current one
#-prefix
#-mouse
#-keyboard
#-netc
#-methods
#-packages compss

};


sub installStepsCall {
    my ($o, $auto, $fun, @args) = @_;
    $fun = "install::steps::$fun" if $auto;
    $o->$fun(@args);
}
sub getNextStep {
    my ($o) = @_;
    find { !$o->{steps}{$_}{done} && $o->{steps}{$_}{reachable} } @{$o->{orderedSteps}};
}

#-######################################################################################
#- Steps Functions
#- each step function are called with two arguments : clicked(because if you are a
#- beginner you can force the the step) and the entered number
#-######################################################################################

#------------------------------------------------------------------------------
sub selectLanguage {
    my ($auto) = @_;
    installStepsCall($o, $auto, 'selectLanguage');
}

sub acceptLicense {
    my ($auto) = @_;
    installStepsCall($o, $auto, 'acceptLicense');
}

#------------------------------------------------------------------------------
sub selectMouse {
    my ($auto) = @_;
    installStepsCall($o, $auto, 'selectMouse');

    addToBeDone { mouse::write($o->do_pkgs, $o->{mouse}) if !$o->{isUpgrade} } 'installPackages';
}

#------------------------------------------------------------------------------
sub setupSCSI {
    my ($auto) = @_;

    installStepsCall($o, $auto, 'setupSCSI');
}

#------------------------------------------------------------------------------
sub selectKeyboard {
    my ($auto) = @_;

    my $force;
    if (my $keyboard = keyboard::read()) {
	$o->{keyboard} = $keyboard; #- for uprade
    } elsif ($o->{isUpgrade}) {
	#- oops, the keyboard config is wrong, forcing prompt and writing
	$force = 1;
    }

    installStepsCall($o, $auto, 'selectKeyboard', $force);
}

#------------------------------------------------------------------------------
sub selectInstallClass {
    my ($auto) = @_;

    installStepsCall($o, $auto, 'selectInstallClass');

    if ($o->{isUpgrade}) {
	@{$o->{orderedSteps}} = uniq(map {
	    $_ eq 'selectInstallClass' ? ($_, 'doPartitionDisks', 'formatPartitions') : $_;
	} @{$o->{orderedSteps}});
    }
}

#------------------------------------------------------------------------------
sub doPartitionDisks {
    my ($auto) = @_;
    $o->{steps}{formatPartitions}{done} = 0;
    installStepsCall($o, $auto, 'doPartitionDisksBefore');
    installStepsCall($o, $auto, 'doPartitionDisks');
    installStepsCall($o, $auto, 'doPartitionDisksAfter');
}

sub formatPartitions {
    my ($auto) = @_;

    $o->{steps}{choosePackages}{done} = 0;
    installStepsCall($o, $auto, 'choosePartitionsToFormat') if !$o->{isUpgrade} && !$::local_install;
    my $want_root_formated = fs::get::root($o->{fstab})->{toFormat};
    if ($want_root_formated) {
	foreach ('/usr') {
	    my $part = fs::get::mntpoint2part($_, $o->{fstab}) or next;
	    $part->{toFormat} or die N("You must also format %s", $_);
	}
    }
    installStepsCall($o, $auto, 'formatMountPartitions') if !$::testing;

    if ($want_root_formated) {
	#- we formatted /, ensure /var/lib/rpm is cleaned otherwise bad things can happen
	#- (especially when /var is *not* formatted)
	eval { rm_rf("$::prefix/var/lib/rpm") };
    }

    fs::any::prepare_minimal_root();

    install::any::screenshot_dir__and_move();
    install::any::move_compressed_image_to_disk($o);

    any::rotate_logs($::prefix);

    require raid;
    raid::write_conf($o->{all_hds}{raids});
}

#------------------------------------------------------------------------------
sub choosePackages {
    my ($auto) = @_;
    require install::pkgs;

    #- always setPackages as it may have to copy hdlist and synthesis files.
    installStepsCall($o, $auto, 'setPackages');
    installStepsCall($o, $auto, 'choosePackages');
    my @flags = map_each { if_($::b, $::a) } %{$o->{rpmsrate_flags_chosen}};
    log::l("rpmsrate_flags_chosen's: ", join(' ', sort @flags));

    #- check pre-condition that basesystem package must be selected.
    install::pkgs::packageByName($o->{packages}, 'basesystem')->flag_available or die "basesystem package not selected";

    #- check if there are packages that need installation.
    $o->{steps}{installPackages}{done} = 0 if $o->{steps}{installPackages}{done} && install::pkgs::packagesToInstall($o->{packages}) > 0;
}

#------------------------------------------------------------------------------
sub installPackages {
    my ($auto) = @_;

    installStepsCall($o, $auto, 'beforeInstallPackages');
    installStepsCall($o, $auto, 'installPackages');
    installStepsCall($o, $auto, 'afterInstallPackages');
}
#------------------------------------------------------------------------------
sub miscellaneous {
    my ($auto) = @_;

    installStepsCall($o, $auto, 'miscellaneousBefore');
    installStepsCall($o, $auto, 'miscellaneous');
    installStepsCall($o, $auto, 'miscellaneousAfter');
}

#------------------------------------------------------------------------------
sub summary {
    my ($auto) = @_;
    installStepsCall($o, $auto, 'summaryBefore') if $o->{steps}{summary}{entered} == 1;
    installStepsCall($o, $auto, 'summary');
    installStepsCall($o, $auto, 'summaryAfter');
}
#------------------------------------------------------------------------------
sub configureNetwork {
    my ($auto) = @_;
    #- get current configuration of network device.
    require network::network;
    eval { network::network::read_net_conf($o->{net}) };
    modules::load_category($o->{modules_conf}, list_modules::ethernet_categories());
    require network::connection::ethernet;
    if (!$o->{isUpgrade}) {
        installStepsCall($o, $auto, 'configureNetwork');
    } else {
        network::connection::ethernet::configure_eth_aliases($o->{modules_conf});
    }
}
#------------------------------------------------------------------------------
sub installUpdates {
    my ($auto) = @_;
    installStepsCall($o, $auto, 'installUpdates');
}
#------------------------------------------------------------------------------
sub configureServices {
    my ($auto) = @_;
    installStepsCall($o, $auto, 'configureServices');
}
#------------------------------------------------------------------------------
sub setRootPassword_addUser {
    my ($auto) = @_;

    installStepsCall($o, $auto, 'setRootPassword_addUser') if !$o->{isUpgrade};
}

#------------------------------------------------------------------------------
sub setupBootloader {
    my ($auto) = @_;
    return if $::local_install;

    $o->{modules_conf}->write;

    installStepsCall($o, $auto, 'setupBootloaderBefore');
    installStepsCall($o, $auto, 'setupBootloader');
}
#------------------------------------------------------------------------------
sub configureX {
    my ($auto) = @_;

    #- done here and also at the end of install2.pm, just in case...
    install::any::write_fstab($o);
    $o->{modules_conf}->write;

    require install::pkgs;
    installStepsCall($o, $auto, 'configureX') if !$::testing && eval { install::pkgs::packageByName($o->{packages}, 'task-x11')->flag_installed } && !$o->{X}{disabled};
}
#------------------------------------------------------------------------------
sub exitInstall {
    my ($auto) = @_;
    installStepsCall($o, $auto, 'exitInstall', getNextStep($::o) eq 'exitInstall');
}


sub start_udev() {
    # Ensure /run is mounted
    mkdir("/run", 0755);
    run_program::run("mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run");

    # Fake dracut boot (due to checks employed when running dracut during install)
    # as we know that we'll have the needed metadata in udevadm db due to us
    # starting udev nice and early here.
    mkdir_p("/run/initramfs");

    # Start up udev and trigger cold plugs
    run_program::run("mount", "-t", "devtmpfs", "-o", "mode=0755,nosuid", "devtmpfs", "/dev");
    mkdir("/dev/$_", 0755) foreach qw(pts shm);
    run_program::run("mount", "-t", "devpts", "-o", "gid=5,mode=620,noexec,nosuid", "devpts", "/dev/pts");
    run_program::run("mount", "-t", "tmpfs", "-o", "mode=1777,nosuid,nodev", "tmpfs", "/dev/shm");

    mkdir_p("/run/udev/rules.d");
    $ENV{UDEVRULESD} = "/run/udev/rules.d";
    run_program::run("/lib/udev/udevd", "--daemon", "--resolve-names=never");
    run_program::run("udevadm", "trigger", "--type=subsystems", "--action=add");
    run_program::run("udevadm", "trigger", "--type=devices", "--action=add");
}

sub stop_udev() {
    kill 15, fuzzy_pidofs('^udevd\b');
    require fs::mount;
    fs::mount::umount($_) foreach '/dev/pts', '/dev/shm', '/run', '/dev';
}

#-######################################################################################
#- MAIN
#-######################################################################################
sub main {
    $SIG{SEGV} = sub { 
	my $msg = "segmentation fault: install crashed (maybe memory is missing?)\n" . backtrace();
	log::l("$msg\n");
	# perl_checker: require UNIVERSAL
	UNIVERSAL::can($o, 'ask_warn') and $o->ask_warn('', $msg);
	setVirtual(1);
	require install::steps_auto_install;
	install::steps_auto_install_non_interactive::errorInStep($o, $msg);
    };
    $ENV{PERL_BADLANG} = 1;
    delete $ENV{TERMINFO};
    umask 022;

    $::isWizard = 1;
    $::no_ugtk_init = 1;

    push @::textdomains, 'DrakX', 'drakx-net', 'drakx-kbd-mouse-x11';

    my ($cfg, $patch);
    my %cmdline = map { 
	my ($n, $v) = split /=/;
	$n => defined($v) ? $v : 1;
    } split ' ', cat_("/proc/cmdline");

    my $opt; foreach (@_) {
	if (/^--?(.*)/) {
	    $cmdline{$opt} = 1 if $opt;
	    $opt = $1;
	} else {
	    $cmdline{$opt} = $_ if $opt;
	    $opt = '';
	}
    } $cmdline{$opt} = 1 if $opt;

    #- from stage1
    put_in_hash(\%ENV, { getVarsFromSh('/tmp/env') });
    exists $ENV{$_} and $cmdline{lc($_)} = $ENV{$_} foreach qw(METHOD PCMCIA KICKSTART);

    map_each {
	my ($n, $v) = @_;
	my $f = ${{
	    lang      => sub { $o->{lang} = $v },
	    flang     => sub { $o->{lang} = $v; push @::auto_steps, 'selectLanguage' },
	    langs     => sub { $o->{locale}{langs} = +{ map { $_ => 1 } split(':', $v) } },
	    method    => sub { $o->{method} = $v },
	    pcmcia    => sub { $o->{pcmcia} = $v },
	    vga16     => sub { $o->{vga16} = $v },
	    vga       => sub { $o->{vga} = $v =~ /0x/ ? hex($v) : $v },
	    step      => sub { $o->{steps}{first} = $v },
	    meta_class => sub { $o->{meta_class} = $v },
	    freedriver => sub { $o->{freedriver} = $v },
	    no_bad_drives => sub { $o->{partitioning}{no_bad_drives} = 1 },
	    nodmraid  => sub { $o->{partitioning}{nodmraid} = 1 },
	    debug_urpmi  => sub { $o->{debug_urpmi} = 1 },
	    readonly  => sub { $o->{partitioning}{readonly} = $v ne "0" },
	    display   => sub { $o->{display} = $v },
	    askdisplay => sub { print "Please enter the X11 display to perform the install on ? "; $o->{display} = chomp_(scalar(<STDIN>)) },
	    security  => sub { $o->{security} = $v },
	    noauto    => sub { $::noauto = 1 },
	    testing   => sub { $::testing = 1 },
	    patch     => sub { $patch = 1 },
	    defcfg    => sub { $cfg = $v },
	    newt      => sub { $o->{interactive} = "curses" },
	    text      => sub { $o->{interactive} = "curses" },
	    stdio     => sub { $o->{interactive} = "stdio" },
	    use_uuid  => sub { $::no_uuid_by_default = !$v },
	    kickstart => sub { $::auto_install = $v },
	    local_install => sub { $::local_install = 1 },
	    uml_install => sub { $::uml_install = $::local_install = 1 },
	    auto_install => sub { $::auto_install = $v },
	    simple_themes => sub { $o->{simple_themes} = 1 },
	    theme     => sub { $o->{theme} = $v },
	    doc       => sub { $o->{doc} = 1 },  #- will be used to know that we're running for the doc team,
	                                         #- e.g. we want screenshots with a good B&W contrast
	    useless_thing_accepted => sub { $o->{useless_thing_accepted} = 1 },
	    alawindows => sub { $o->{security} = 0; $o->{partitioning}{clearall} = 1; $o->{bootloader}{crushMbr} = 1 },
	    fdisk => sub { $o->{partitioning}{fdisk} = 1 },
	    nomouseprobe => sub { $o->{nomouseprobe} = $v },
	    updatemodules => sub { $o->{updatemodules} = 1 },
	    suppl => sub { $o->{supplmedia} = $v },
	    askmedia => sub { $o->{askmedia} = 1 },
	    restore => sub { $::isRestore = 1 },
	    compsslistlevel => sub { $o->{compssListLevel} = $v },
	}}{lc $n}; &$f if $f;
    } %cmdline;

    if ($::testing) {
	$ENV{SHARE_PATH} ||= "/export/install/stage2/live/usr/share";
	$ENV{SHARE_PATH} = "/usr/share" if !-e $ENV{SHARE_PATH};
    } else {
	$ENV{SHARE_PATH} ||= "/usr/share";
    }

    undef $::auto_install if $cfg;

    $o->{stage2_phys_medium} = install::media::stage2_phys_medium($o->{method});

    log::l("second stage install running (", install::any::drakx_version($o), ")");

    eval { output('/proc/sys/kernel/modprobe', "\n") } if !$::local_install && !$::testing; #- disable kmod
    eval { fs::mount::mount('none', '/sys', 'sysfs', 1) };
    eval { touch('/root/non-chrooted-marker.DrakX') }; #- helps distinguishing /root and /mnt/root when we don't know if we are chrooted

    start_udev() if !$::local_install;

    if ($::local_install) {
	push @::auto_steps, 
#	  'selectLanguage', 'selectKeyboard', 'miscellaneous', 'selectInstallClass',
	  'doPartitionDisks', 'formatPartitions';
	fs::mount::usbfs(''); #- do it now so that when_load doesn't do it
	$o->{nomouseprobe} = 1;
	$o->{mouse} = mouse::fullname2mouse('Universal|Any PS/2 & USB mice');
    }

    $o->{prefix} = $::prefix = $::testing ? "/tmp/test-perl-install" : "/mnt";
    mkdir $::prefix, 0755;

    #-  make sure we do not pick up any gunk from the outside world
    my $remote_path = "$::prefix/sbin:$::prefix/bin:$::prefix/usr/sbin:$::prefix/usr/bin:$::prefix/usr/X11R6/bin";
    $ENV{PATH} = "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin:$remote_path";

    eval { install::any::spawnShell() };

    list_modules::load_default_moddeps();
    require modules::any_conf;
    require modules::modules_conf;
    $o->{modules_conf} = modules::modules_conf::read(modules::any_conf::vnew(), '/tmp/modules.conf');
    modules::read_already_loaded($o->{modules_conf});

    #- done before auto_install is called to allow the -IP feature on auto_install file name
    if (-e '/tmp/network') {
	require network::network;
	#- get stage1 network configuration if any.
	log::l('found /tmp/network');
	add2hash($o->{net}{network} ||= {}, network::network::read_conf('/tmp/network'));
	if (my ($file) = glob_('/tmp/ifcfg-*')) {
	    log::l("found network config file $file");
	    my $l = network::network::read_interface_conf($file);
	    $o->{net}{ifcfg}{$l->{DEVICE}} ||= $l;
	}
	my $dsl_device = find { $_->{BOOTPROTO} eq 'adsl_pppoe' } values %{$o->{net}{ifcfg}};
	if ($dsl_device) {
	    $o->{net}{type} = 'adsl';
	    $o->{net}{net_interface} = $dsl_device->{DEVICE};
	    $o->{net}{adsl} = {
		method => 'pppoe',
		device => $dsl_device->{DEVICE},
		ethernet_device => $dsl_device->{DEVICE},
		login => $dsl_device->{USER},
		password => $dsl_device->{PASS},
	    };
	    %$dsl_device = ();
	} else {
	    $o->{net}{type} = 'lan';
	    $o->{net}{net_interface} = first(values %{$o->{net}{ifcfg}});
	}
    }

    #- done after module dependencies are loaded for "vfat depends on fat"
    if ($::auto_install) {
	if ($::auto_install =~ /-IP(\.pl)?$/) {
	    my ($ip) = cat_('/tmp/stage1.log') =~ /configuring device (?!lo)\S+ ip: (\S+)/;
	    my $normalized_ip = join('', map { sprintf "%02X", $_ } split('\.', $ip)); 
	    $::auto_install =~ s/-IP(\.pl)?$/-$normalized_ip$1/;
	}
	require install::steps_auto_install;
	eval { $o = $::o = install::any::loadO($o, $::auto_install) };