Mon Dec 23, 2013 6:05 pm
Tue Dec 24, 2013 12:47 pm
if [[ $save_syslinux = "TRUE" ]] ; then
[[ -e "$usb_mountpoint"/syslinux ]] || \
warning_message="Options are set to save the existing syslinux folder, but there is none.
Check the Setup Options and un-check \"Preserve existing syslinux\" to use the one from
the currently running system."
warning_dialog
setup_options
return
fi
if [[ $save_syslinux = "TRUE" ]] ; then
if ! [[ -e "$usb_mountpoint"/syslinux ]] ; then
warning_message="Options are set to save the existing syslinux folder, but there is none.
Check the Setup Options and un-check Preserve existing syslinux to use the one from
the currently running system."
warning_dialog
setup_options
return
fi
fi
Tue Dec 24, 2013 6:46 pm
Re: findiso
Is it necessary to put vmlinuz and initrd with the iso file and name them on the boot cmdline? Or does live-boot just find the iso and boot from that?
label Sid snap
menu Sid snap findiso
kernel /sid/vmlinuz
append initrd=/sid/initrd.img boot=live union=aufs findiso=/sid/sidsnap.iso
Wed Dec 25, 2013 3:32 pm
# Select iso file, mount it, select kernel and initrd from mounted iso.
# Copy kernel, initrd and iso file to same target directory.
copy_iso_file () {
isofile=$($DIALOG --file-selection --file-filter="*.[iI][sS][oO]" --file-filter="*" \
--width=640 --height=640 --title=$"Select Live ISO" --text="Select the CD image file." \
--filename="" ${OKBUTTON} ${QUITBUTTON})
if [[ $? = 1 ]] ; then
cleanup
run_task
fi
if [[ -z "$isofile" ]]; then
exit_message="\nYou did not select a CD image file."
exit_dialog
fi
if ! $(echo $isofile | grep -q .[Ii][Ss][Oo]$); then
exit_message="\nYou did not select a CD image file.."
exit_dialog
fi
fuseiso -p "$isofile" "$image_mountpoint"
image_size=$(du -h "$isofile" )
check_size
kernel_image=$($DIALOG --file-selection --width=640 --height=640 \
--title=$"Select kernel image" --text="Select the kernel image file." \
--filename="${image_mountpoint}/*" ${OKBUTTON} ${QUITBUTTON})
if [[ $? = 1 ]] ; then
cleanup
run_task
fi
if [[ -z "$kernel_image" ]]; then
exit_message="\nYou did not select a kernel image file."
exit_dialog
fi
initrd_image=$($DIALOG --file-selection --width=640 --height=640 \
--title=$"Select initrd image" --text="Select the initrd image file." \
--filename="${image_mountpoint}/*" ${OKBUTTON} ${QUITBUTTON})
if [[ $? = 1 ]] ; then
cleanup
run_task
fi
if [[ -z "$initrd_image" ]]; then
exit_message="\nYou did not select an initrd image file."
exit_dialog
fi
cp "$kernel_image" "$usb_mountpoint"/${target_dir}
cp "$initrd_image" "$usb_mountpoint"/${target_dir}
cp "$isofile" "$usb_mountpoint"/${target_dir}
sleep 2
fusermount -u "$image_mountpoint"
finished_message="ISO file copied."
finished_dialog
}
setup_findiso () {
target_name=$($DIALOG --entry --title=$TITLE --text=" For multi-boot live-USB, a CD image will be copied to its own directory on your USB drive.
Enter a name for that directory. The name will also be used in your boot menu. " \
--${BUTTON0}="OK"${BUTTON0NUM} --${BUTTON1}="Exit"${BUTTON1NUM})
if [[ $? = 1 ]] ; then
cleanup
exit 0
fi
if [[ -n $target_name ]] ; then
target_dir="${target_name}/"
target_message="Target directory: /$target_dir"
else
target_dir=""
exit_message="No target directory selected for iso file. "
exit_dialog
fi
kernel_name="${kernel_image##*/}"
initrd_name="${initrd_image##*/}"
isofile_name="${isofile##*/}"
menu_text="
label $target_name
menu label $target_name
kernel /${target_name}/${kernel_name} quiet
append initrd=/${target_name}/${initrd_name} boot=live ip=frommedia union=aufs findiso=/${target_name}/${isofile_name}
"
echo "$menu_text" > /tmp/boot_menu_text
}
if [[ $adv_opt =~ Boot_ISO ]] ; then
image_mountpoint="/tmp/isomount"
check_device
usb_mountpoint="/media/${device##*/}1"
pmount ${device}1
setup_findiso
copy_iso_file
finished_message=" An entry for $target_name will be
added to your boot menu, and the menu will be
opened in a text editor for your review. "
finished_dialog
if [[ -f /tmp/boot_menu_text ]] ; then
edit_boot_menu
rm -f /tmp/boot_menu_text
fi
fi
Fri Dec 27, 2013 11:23 am
Fri Dec 27, 2013 3:45 pm
Sun Dec 29, 2013 8:43 pm
refracta2usb (0.9.4q) unstable; urgency=low
* Added option for user-set loopback file size.
* Moved function check_size to functions file, so mkloopback could use it.
* Renamed mkloopback.sh to mkloopback.
* Update (replace_live) now works with multiboot.
-- fsmithred <fsmithred@gmail.com> Sun, 29 Dec 2013 14:35:00 -0500
Tue Dec 31, 2013 8:17 pm
if ! $(file "$loopfile" | grep -q "filesystem data") ; then
if ! $(file "$loopfile" | grep -q "LUKS") ; then
warning_message="That does not look like a loopback file. Try again."
warning_dialog
umount -l "$selected_partition"
exit 1
fi
fi
check_exit () {
exit_code="$?"
if [[ $exit_code -ne 0 ]] ; then
$DIALOG --question --title="$TITLE error" --window-icon=error \
--${BUTTON0}="Continue"${BUTTON0NUM} --${BUTTON1}="Exit"${BUTTON1NUM} \
--text="Error detected: $exit_code $error_message
\nSee $error_log for details. Press \"Continue\" to proceed anyway"
if [[ $? -ne 0 ]] ; then
cleanup
exit 1
fi
fi
}
Wed Jan 01, 2014 4:49 pm
refracta2usb (0.9.4r) unstable; urgency=low
* select-loop-mount now recognizes encrypted loopback file.
* Fixed bug in function check_exit that reported wrong exit code.
-- fsmithred <fsmithred@gmail.com> Sun, 01 Jan 2014 11:45:00 -0500
Thu Jan 02, 2014 3:41 pm