Welcome |
---|
Welcome to refracta You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today! |
# Copy system from the running live system
# If system is running from a custom live-media-path, copy from there.
copy_livemount () {
if [[ $copy_syslinux = "TRUE" ]] && [[ $save_syslinux = "TRUE" ]] ; then
conflict_warning
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
live_dir=$(grep -o "live-media-path=.*" /proc/cmdline |sed 's: .*::' |sed 's:live-media-path=/::' |sed 's:/live::')
if [[ -z "$live_dir" ]] ; then
live_dir="live"
fi
# Don't overwrite an existing /live folder without warning.
# if [[ $live_dir = "live" ]] ; then
if [[ -e "$usb_mountpoint"/"$live_dir" ]] ; then
$DIALOG --$WARNING --title="$TITLE" --text="A $live_dir folder already exists on the target usb drive. If you Proceed, it will be replaced
with the one from the currently running system. If you don't want that, then exit." \
--${BUTTON0}="Continue"${BUTTON0NUM} --${BUTTON1}="Exit"${BUTTON1NUM}
if [[ $? = 1 ]] ; then
cleanup
exit 0
else
rm -rf "$usb_mountpoint"/"$live_dir"
fi
fi
# fi
image_size=$(du -sh ${image_mountpoint}/${live_dir})
check_size
rsync -av "$image_mountpoint"/${live_dir} "$usb_mountpoint"
if [[ -e "$image_mountpoint"/isolinux ]] ; then
if [[ $save_syslinux = "TRUE" ]] ; then
cp -a "$image_mountpoint"/isolinux "$usb_mountpoint"/isolinux-$(date +%m%d%H%M)
elif [[ $copy_syslinux = "TRUE" ]] ; then
rsync -av "$image_mountpoint"/isolinux "$usb_mountpoint"
mv "$usb_mountpoint"/isolinux "$usb_mountpoint"/isolinux-$(date +%m%d%H%M)
if [[ -e "$usb_mountpoint"/syslinux ]] ; then
mv "$usb_mountpoint"/syslinux "$usb_mountpoint"/syslinux-$(date +%m%d%H%M)
fi
rsync -av /usr/lib/refracta2usb/syslinux "$usb_mountpoint"
else
rsync -av "$image_mountpoint"/isolinux "$usb_mountpoint"
isolinux2syslinux
fi
elif [[ -e "$image_mountpoint"/syslinux ]] ; then
if [[ $save_syslinux = "TRUE" ]] ; then
cp -a "$image_mountpoint"/syslinux "$usb_mountpoint"/syslinux.new-$(date +%m%d%H%M)
elif [[ $copy_syslinux = "TRUE" ]] ; then
if [[ -e "$usb_mountpoint"/syslinux ]] ; then
mv "$usb_mountpoint"/syslinux "$usb_mountpoint"/syslinux.orig-$(date +%m%d%H%M)
fi
rsync -av "$image_mountpoint"/syslinux "$usb_mountpoint"
mv "$usb_mountpoint"/syslinux "$usb_mountpoint"/syslinux.new-$(date +%m%d%H%M)
rsync -av /usr/lib/refracta2usb/syslinux "$usb_mountpoint"
else
if [[ -e "$usb_mountpoint"/syslinux ]] ; then
mv "$usb_mountpoint"/syslinux "$usb_mountpoint"/syslinux.orig-$(date +%m%d%H%M)
$DIALOG --$INFO --title="$TITLE" --text="An existing syslinux folder on the target device
was saved as syslinux.orig-(date-time). " --${BUTTON0}="OK"${BUTTON0NUM}
fi
rsync -av "$image_mountpoint"/syslinux "$usb_mountpoint"
fi
fi
if [[ $add_hooks = "TRUE" ]] ; then
echo " Adding Refracta custom hooks..."
rsync -av /usr/lib/refracta2usb/hooks "$usb_mountpoint"/${live_dir}
fi
finished_message="Live image copied."
finished_dialog
}
Users browsing this forum: No registered users and 0 guests