From 325ab8add83e19c9dacd1b10ef6791441660f63a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 5 Jul 2016 18:53:16 +0200 Subject: restrict fdisk -l output to usefull disks --- perl-install/any.pm | 7 +++++++ perl-install/install/NEWS | 1 + perl-install/install/steps.pm | 4 ++-- 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') ]); -- cgit v1.2.1