Skip to content

Commit

Permalink
mount-external-storage: move mount-usb to mount-external-storage and …
Browse files Browse the repository at this point in the history
…change all references in codebase.
  • Loading branch information
tlaurion committed Jan 23, 2021
1 parent 4d607dc commit 5e16ae4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 139 deletions.
2 changes: 1 addition & 1 deletion initrd/.ash_history
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#remove invalid kexec_* signed files
mount /dev/sda1 /boot && mount -o remount,rw /boot && rm /boot/kexec* && mount -o remount,ro /boot
#Generate keys from GPG smartcard:
mount-usb && gpg --home=/.gnupg/ --card-edit
mount-external-storage && gpg --home=/.gnupg/ --card-edit
#Copy generated public key, private_subkey, trustdb and artifacts to external media for backup:
mount -o remount,rw /media && mkdir -p /media/gpg_keys; gpg --export-secret-keys --armor [email protected] > /media/gpg_keys/private.key && gpg --export --armor [email protected] > /media/gpg_keys/public.key && gpg --export-ownertrust > /media/gpg_keys/otrust.txt && cp -r ./.gnupg/* /media/gpg_keys/ 2> /dev/null
#Insert public key and trustdb export into reproducible rom:
Expand Down
132 changes: 0 additions & 132 deletions initrd/bin/mount-usb

This file was deleted.

8 changes: 4 additions & 4 deletions initrd/bin/oem-factory-reset
Original file line number Diff line number Diff line change
Expand Up @@ -365,20 +365,20 @@ if [ "$prompt_output" == "y" \
echo -e "\nChecking for USB media...\n"
# ensure /media not mounted
umount /media 2>/dev/null
# mount-usb will detect and prompt if no USB inserted
if ! mount-usb rw 2>/tmp/error; then
# mount-external-storage will detect and prompt if no USB inserted
if ! mount-external-storage rw 2>/tmp/error; then
ERROR=$(tail -n 1 /tmp/error | fold -s)
whiptail_error_die "Unable to mount USB on /media:\n\n${ERROR}"
fi
else
GPG_EXPORT=0
# needed for USB Security dongle below and is ensured via mount-usb in case of GPG_EXPORT=1
# needed for USB Security dongle below and is ensured via mount-external-storage in case of GPG_EXPORT=1
enable_usb
fi

# ensure USB Security Dongle connected
echo -e "\nChecking for USB Security Dongle...\n"
# USB kernel modules already loaded via mount-usb
# USB kernel modules already loaded via mount-external-storage
if ! gpg --card-status >/dev/null 2>&1 ; then
whiptail_error "Can't access USB Security Dongle; \nPlease remove and reinsert, then press Enter."
if ! gpg --card-status >/dev/null 2>/tmp/error ; then
Expand Down
4 changes: 2 additions & 2 deletions initrd/etc/gui_functions
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ mount_usb()
umount /media || die "Unable to unmount /media"
fi
# Mount the USB boot device
mount-usb && USB_FAILED=0 || ( [ $? -eq 5 ] && exit 1 || USB_FAILED=1 )
mount-external-storage && USB_FAILED=0 || ( [ $? -eq 5 ] && exit 1 || USB_FAILED=1 )
if [ $USB_FAILED -ne 0 ]; then
whiptail --title 'USB Drive Missing' \
--msgbox "Insert your USB drive and press Enter to continue." 16 60
mount-usb && USB_FAILED=0 || ( [ $? -eq 5 ] && exit 1 || USB_FAILED=1 )
mount-external-storage && USB_FAILED=0 || ( [ $? -eq 5 ] && exit 1 || USB_FAILED=1 )
if [ $USB_FAILED -ne 0 ]; then
whiptail $BG_COLOR_ERROR --title 'ERROR: Mounting /media Failed' \
--msgbox "Unable to mount USB device" 16 60
Expand Down

0 comments on commit 5e16ae4

Please sign in to comment.