summaryrefslogtreecommitdiffstats
path: root/perl-install/patch/patch-drakx-in-chroot-with-LVM-present.pl
blob: eb13ab5692034732ac06d666eaf7515750f010be (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
use install::install2;
package install::install2;

log::l("PATCH: not copying LVM devices in local_install's");

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