summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-04-07 20:15:48 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-04-07 20:15:48 +0100
commit5f82a8534769a5c5a226c190c4e68a53780c4f10 (patch)
tree7e58b1bb398c4a0a55f6b1dfb42fd6bd2ef5440f
parent1e01a44e87b5693df48df02f3634d946d24d88d7 (diff)
downloaddraklive-install-5f82a8534769a5c5a226c190c4e68a53780c4f10.tar
draklive-install-5f82a8534769a5c5a226c190c4e68a53780c4f10.tar.gz
draklive-install-5f82a8534769a5c5a226c190c4e68a53780c4f10.tar.bz2
draklive-install-5f82a8534769a5c5a226c190c4e68a53780c4f10.tar.xz
draklive-install-5f82a8534769a5c5a226c190c4e68a53780c4f10.zip
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.
-rwxr-xr-xdraklive-install7
1 files changed, 4 insertions, 3 deletions
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