diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2015-05-07 13:30:43 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 04:28:15 +0200 |
commit | dcb691439b832faa7c3a252e7810116bc114c20e (patch) | |
tree | 7d747cc8280e2c7afc6f1b0be066bc4f71bc597f /src/fripost-partman-udeb | |
parent | 632c24fb791b624d859e0c210c538830a5fdb4ba (diff) |
Select the first available block device by default.
Diffstat (limited to 'src/fripost-partman-udeb')
-rw-r--r-- | src/fripost-partman-udeb/base.sh | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ -602,6 +602,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 # # Usage: fripost_rmpart device partition |