Skip to content

Commit 7be67e4

Browse files
authored
Merge pull request #1297 from tlaurion/usb-scan_moved_to-media-scan
usb-scan->media-scan: usb-init calling media-scan usb
2 parents f440ad3 + 2999779 commit 7be67e4

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,19 @@ if grep -q /boot /proc/mounts ; then
1111
|| die "Unable to unmount /boot"
1212
fi
1313

14-
# Mount the USB boot device
15-
mount_usb || die "Unable to mount /media"
14+
available_partitions="$(blkid | while read line; do echo $line | awk -F ":" {'print $1'}; done )"
15+
16+
if [ "$1" == "usb" ]; then
17+
# Mount the USB boot device
18+
mount_usb || die "Unable to mount /media"
19+
elif $(echo $available_partitions | grep -q "$1"); then
20+
if grep -q /media /proc/mounts; then
21+
umount /media \
22+
|| die "Unable to unmount /media"
23+
fi
24+
mount "$1" /media \
25+
|| die "Unable to mount $1 to /media"
26+
fi
1627

1728
# Get USB boot device
1829
USB_BOOT_DEV=$(grep "/media" /etc/mtab | cut -f 1 -d' ')

initrd/bin/usb-init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ if [ "$CONFIG_TPM" = "y" ]; then
99
tpm extend -ix 4 -ic usb
1010
fi
1111

12-
usb-scan
12+
media-scan usb
1313
recovery "Something failed during USB boot"

0 commit comments

Comments
 (0)