diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-05-30 13:50:09 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-05-30 13:50:09 +0000 |
commit | 1ef5a14b44aeffc12f5c122cef408f7a9ed4d6bb (patch) | |
tree | bc28849b6e693a2594658b7a8ea7c42a1efe91c8 | |
parent | 8766b8af115825fa9abd23c67a907b585537b400 (diff) | |
download | draklive-install-1ef5a14b44aeffc12f5c122cef408f7a9ed4d6bb.tar draklive-install-1ef5a14b44aeffc12f5c122cef408f7a9ed4d6bb.tar.gz draklive-install-1ef5a14b44aeffc12f5c122cef408f7a9ed4d6bb.tar.bz2 draklive-install-1ef5a14b44aeffc12f5c122cef408f7a9ed4d6bb.tar.xz draklive-install-1ef5a14b44aeffc12f5c122cef408f7a9ed4d6bb.zip |
do not install bootloader on live device
-rwxr-xr-x | draklive-install | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/draklive-install b/draklive-install index 78231d6..9a54891 100755 --- a/draklive-install +++ b/draklive-install @@ -3,10 +3,12 @@ use lib qw(/usr/lib/libDrakX); use standalone; use interactive; +use fs; use fs::any; use fs::type; use fs::partitioning; use fs::partitioning_wizard; +use partition_table; use MDK::Common; use common; use feature qw(state); @@ -49,9 +51,10 @@ sub install_live() { my %settings = getVarsFromSh($system_file); my $copy_source = $settings{SOURCE} || '/'; + my $live_media = '/live/media'; display_start_message(); - init_hds($in, $all_hds, $fstab); + init_hds($in, $all_hds, $fstab, $live_media); ask_partitions_loop($in, $all_hds, $fstab, $copy_source); prepare_root($in, $all_hds); copy_root($in, $copy_source); @@ -116,10 +119,22 @@ sub umount_first_pass() { } sub init_hds { - my ($in, $all_hds, $fstab) = @_; + my ($in, $all_hds, $fstab, $live_media) = @_; my $wait = $in->wait_message('', N("Please wait")); umount_first_pass(); eval { fs::any::get_hds($all_hds, $fstab, [], {}, 'skip_mtab', $in) }; + + #- fs::any::get_hds does not return mounts that are not in fstab + my @mounted = fs::read_fstab('', '/proc/mounts'); + my $live_part = find { $_->{mntpoint} eq $live_media } @mounted; + my $live_device = $live_part && $live_part->{device}; + #- remove live device from the detected hds, so that bootloader is not installed on it: + #- bootloader installation uses first device from detect_devices::get, which tries to list devices + #- by booting order, and our live system is likely to be here in first position + @{$all_hds->{hds}} = grep { + !member($live_device, map { $_->{device} } partition_table::get_normal_parts_and_holes($_)); + } @{$all_hds->{hds}} if $live_device; + my $err = $@; umount_all($fstab); if ($err) { |