Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb-scan->media-scan: usb-init calling media-scan usb #1297

Merged
merged 1 commit into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions initrd/bin/usb-scan → initrd/bin/media-scan
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ if grep -q /boot /proc/mounts ; then
|| die "Unable to unmount /boot"
fi

# Mount the USB boot device
mount_usb || die "Unable to mount /media"
available_partitions="$(blkid | while read line; do echo $line | awk -F ":" {'print $1'}; done )"

if [ "$1" == "usb" ]; then
# Mount the USB boot device
mount_usb || die "Unable to mount /media"
elif $(echo $available_partitions | grep -q "$1"); then
if grep -q /media /proc/mounts; then
umount /media \
|| die "Unable to unmount /media"
fi
mount "$1" /media \
|| die "Unable to mount $1 to /media"
fi

# Get USB boot device
USB_BOOT_DEV=$(grep "/media" /etc/mtab | cut -f 1 -d' ')
Expand Down
2 changes: 1 addition & 1 deletion initrd/bin/usb-init
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [ "$CONFIG_TPM" = "y" ]; then
tpm extend -ix 4 -ic usb
fi

usb-scan
media-scan usb
recovery "Something failed during USB boot"