All pastes #739703 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-17 12:17 UTC
rendered paste body
# to put at the end of /opt/src/oma-image/live-config/config/auto_inst.cfg.pl

use install::install2;

undef *formatPartitions;
*formatPartitions = sub {
    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") };
    }

    install::any::create_minimal_files();

    eval { fs::mount::mount('none', "$::prefix/proc", 'proc') };
    eval { fs::mount::mount('none', "$::prefix/sys", 'sysfs') };
    eval { fs::mount::usbfs($::prefix) };

    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});

    #- needed by lilo
    if (-d '/dev/mapper' && !$::local_install) {
	my @vgs = map { $_->{VG_name} } @{$o->{all_hds}{lvms}};
	cp_af("/dev/$_", "$::prefix/dev") foreach 'mapper', @vgs;
    }
};