mirror of
https://github.com/linuxboot/heads.git
synced 2025-04-07 19:34:26 +00:00
Merge pull request #759 from Nitrokey/usb_label
Add partition Label to list of mount-usb
This commit is contained in:
commit
d5262f11d4
@ -62,9 +62,11 @@ if [ -z ${USB_MOUNT_DEVICE} ]; then
|
||||
# remove block device from list if numeric partitions exist, since not bootable
|
||||
let USB_NUM_PARTITIONS=`ls -1 $i* | wc -l`-1
|
||||
if [ ${USB_NUM_PARTITIONS} -eq 0 ]; then
|
||||
echo $i >> /tmp/usb_disk_list
|
||||
echo $i $(blkid | grep $i | grep -o 'LABEL=".*"' | cut -f2 -d '"') >> /tmp/usb_disk_list
|
||||
else
|
||||
ls $i* | tail -${USB_NUM_PARTITIONS} >> /tmp/usb_disk_list
|
||||
for j in $(ls $i* | tail -${USB_NUM_PARTITIONS}); do
|
||||
echo $j $(blkid | grep $j | grep -o 'LABEL=".*"' | cut -f2 -d '"') >> /tmp/usb_disk_list
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
@ -102,7 +104,7 @@ if [ -z ${USB_MOUNT_DEVICE} ]; then
|
||||
if [ "$option_index" = "a" ]; then
|
||||
exit 1
|
||||
fi
|
||||
USB_MOUNT_DEVICE=`head -n $option_index /tmp/usb_disk_list | tail -1`
|
||||
USB_MOUNT_DEVICE=`head -n $option_index /tmp/usb_disk_list | tail -1 | sed 's/\ .*$//'`
|
||||
fi
|
||||
|
||||
if [ "$1" = "rw" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user