From 37b7a9920f605e7383c0f1ce5f1763b3425e893e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 19 Mar 2020 15:27:53 +0100 Subject: Restoring displaying found version And also display a shorter distribution name (eg: "Mageia (Cauldron)" which is still longer than just "Mageia"). history: commit fd8bbba2f02b8bccd69e67c326fd320c0827941d wrongly introduced a "%s" in place of "Mandriva" (w/o adding any argument) Then commit e95388927be1f0de67413bdb5430cf0031710f54 fixed it by replacing "%s" with the displayed release info at end. However commit 3928e119899ee844bc0ac90e963d913782b8ae9c enables us to have the info we want, so just use that --- rescue/NEWS | 1 + rescue/bin/guessmounts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rescue/NEWS b/rescue/NEWS index ab773729e..3030ba281 100644 --- a/rescue/NEWS +++ b/rescue/NEWS @@ -1,5 +1,6 @@ - do not preload all fs modules uselessly - guessmount: + o fix displaying the version of the distro o just use the fs reported by blkid instead of doing brute force guessing Version 1.63 - 19 March 2020 by Thierry Vignaud diff --git a/rescue/bin/guessmounts b/rescue/bin/guessmounts index a4d1fa7f7..683e47c70 100755 --- a/rescue/bin/guessmounts +++ b/rescue/bin/guessmounts @@ -67,12 +67,12 @@ foreach (@$normal_parts) { system("mount -t $fs $dev $target 2>/dev/null"); if (my $release_file = common::release_file($target)) { - my $release = chomp_(cat_("$target$release_file")); - print STDERR "=> found a $release root partition on $dev\n=> type $fs, version `\n"; my @fstab = fs::read_fstab($target, '/etc/fstab'); my $h = common::parse_release_file($target, $release_file, $_); add2hash($h, { dev => $dev, fs => $fs, fstab => \@fstab, pretty_name => "$h->{release} $h->{version} $h->{arch} on $dev" }); + my $release = chomp_(cat_("$target$release_file")); + printf STDERR "=> found a %s root partition on $dev\n=> type $fs, version `$release'\n", $h->{release}; # Offer to rescue only same arch: $h->{pretty_name} .= " (cannot be rescued: $h->{arch} ne $arch;)" if $h->{arch} ne $arch; push @roots, $h; -- cgit v1.2.1