From dcb691439b832faa7c3a252e7810116bc114c20e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 7 May 2015 13:30:43 +0200 Subject: Select the first available block device by default. --- src/fripost-partman-udeb/base.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/fripost-partman-udeb') diff --git a/src/fripost-partman-udeb/base.sh b/src/fripost-partman-udeb/base.sh index 163134f..23fcdeb 100644 --- a/src/fripost-partman-udeb/base.sh +++ b/src/fripost-partman-udeb/base.sh @@ -601,6 +601,18 @@ getIPv4() { +############################################################################## +# List all block devices that are not mounted on /cdrom +# +fripost_list_devices() { + local cdrom=$( sed -rn '\#^(\S+) /cdrom\s.*# {s//\1/p; q}' /proc/mounts ) + [ "$cdrom" ] || fatal "Error: Is /cdrom a mountpoint?" + + find /dev -type b | grep -v '[0-9]$' | grep -vFx "$cdrom" +} + + + ############################################################################## # Remove a partition from a device # -- cgit v1.2.3