summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-07-05 18:53:16 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-07-05 19:03:18 +0200
commit325ab8add83e19c9dacd1b10ef6791441660f63a (patch)
tree452909123d0b50f71978098403a9740c99f79747
parent767048570e8c44061cb0d6faf689698d3313870c (diff)
downloaddrakx-325ab8add83e19c9dacd1b10ef6791441660f63a.tar
drakx-325ab8add83e19c9dacd1b10ef6791441660f63a.tar.gz
drakx-325ab8add83e19c9dacd1b10ef6791441660f63a.tar.bz2
drakx-325ab8add83e19c9dacd1b10ef6791441660f63a.tar.xz
drakx-325ab8add83e19c9dacd1b10ef6791441660f63a.zip
restrict fdisk -l output to usefull disks
-rw-r--r--perl-install/any.pm7
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/steps.pm4
3 files changed, 10 insertions, 2 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 85d454f88..6809a522f 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -9,6 +9,7 @@ use strict;
use common;
use detect_devices;
use partition_table;
+use fs::proc_partitions;
use fs::type;
use lang;
use run_program;
@@ -1313,6 +1314,12 @@ sub header { "
********************************************************************************";
}
+sub fdisk() {
+ my @devs = grep { !m!^/dev/(loop|ram)\d+! && !/\d$/ } map { "/dev/$_->{dev}" } fs::proc_partitions::read_raw();
+ `fdisk -l @devs`;
+
+}
+
sub report_bug {
my (@other) = @_;
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index beb86f164..de6be8362 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,5 +1,6 @@
- partionning:
o GPT: prevent geometry issue on last partition (mga#18666, mga#17796)
+ o restrict fdisk -l output to usefull disks
- recognize new kernel-4.7 drivers
- try to get patch from ext[2-4] removable media instead of just ext2
diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm
index a58b70b7c..aa3d6b4ec 100644
--- a/perl-install/install/steps.pm
+++ b/perl-install/install/steps.pm
@@ -176,7 +176,7 @@ sub selectInstallClass {
#------------------------------------------------------------------------------
sub doPartitionDisksBefore {
my ($o) = @_;
- log::l("fdisk before:\n" . `fdisk -l`);
+ log::l("fdisk before:\n" . any::fdisk());
eval {
eval { fs::mount::umount("$::prefix/sys/kernel/debug/usb") };
eval { fs::mount::umount("$::prefix/sys") };
@@ -191,7 +191,7 @@ sub doPartitionDisksAfter {
my ($o) = @_;
fs::any::write_hds($o->{all_hds}, $o->{fstab}, !$o->{isUpgrade}, sub { $o->rebootNeeded }, $o);
- log::l("fdisk after\n" . `fdisk -l`);
+ log::l("fdisk after\n" . any::fdisk());
if ($::local_install) {
my $p = fs::get::mntpoint2part($::prefix, [ fs::read_fstab('', '/proc/mounts') ]);