From 5f82a8534769a5c5a226c190c4e68a53780c4f10 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 7 Apr 2017 20:15:48 +0100 Subject: Fix removing Live device from the detected hds. The old code searched for /live/media in /proc/mounts, but that mount point no longer exists (most likely due to the switch from unionfs to overlayfs). So search for a matching disk label in /dev/disk/by-label instead. --- draklive-install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'draklive-install') diff --git a/draklive-install b/draklive-install index 0dd21d6..26a6550 100755 --- a/draklive-install +++ b/draklive-install @@ -19,6 +19,7 @@ use partition_table; use MDK::Common; use common; use feature qw(state); +use File::Basename; ($::real_windowwidth, $::real_windowheight) = (600, 400); @@ -59,7 +60,7 @@ sub install_live() { my %settings = getVarsFromSh($system_file); my $copy_source = $settings{SOURCE} || '/'; - my $live_media = '/live/media'; + my $live_media = 'Mageia-*-*-LiveDVD'; # match disk label for all Mageia Live ISOS display_start_message(); init_hds($in, $all_hds, $fstab, $live_media); @@ -136,8 +137,8 @@ sub init_hds { #- 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}; + + my $live_device = basename(readlink(glob "/dev/disk/by-label/$live_media")); #- 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 -- cgit v1.2.1