Skip to content

Instantly share code, notes, and snippets.

@fsmithred
Created July 6, 2015 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fsmithred/cca6f68c20a598393097 to your computer and use it in GitHub Desktop.
Save fsmithred/cca6f68c20a598393097 to your computer and use it in GitHub Desktop.
select_initrd () {
initrd_image=$($DIALOG --file-selection --width=640 --height=640 \
--title="Select initrd image" --text="\n Select the initrd image file. (default: /live/initrd.img) \n${select_initrd_text}\n${custom_initrd_message}" \
--filename="${image_source_dir}/*" ${OKBUTTON} ${QUITBUTTON})
if [[ $? = 1 ]] ; then
run_task
fi
if [[ -z "$initrd_image" ]]; then
warning_message="You did not select an initrd image file.
If you continue, your boot menu entry
will need to be edited manually. "
warning_dialog
fi
initrd_name="${initrd_image##*/}"
if [[ $IS_LUKS = "yes" ]] ; then
testmount=$(mktemp -d testinitrd.XXXXX)
archivemount "$initrd_image" "$testmount"
if ! [ -f ${testmount}/lib/cryptsetup/askpass ] ; then
echo "This initrd will not work with encrypted persistence.
You will need to do extra stuff."
warning_message="This initrd will not work with encrypted persistence.
Reboot into the system with persistence, and run update-init-crypt.sh.
You will find it somewhere under /lib/live/mount/
See the Help section on Encryption for more information."
warning_dialog
fi
fusermount -u "$testmount"
rmdir "$testmount"
if ! [ -f ${usb_mountpoint}/update-init-crypt.sh ] ; then
cp ${r2u_library}/update-init-crypt.sh "$usb_mountpoint"
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment