Hello community, here is the log from the commit of package live-fat-stick for openSUSE:Factory checked in at 2016-07-14 09:48:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/live-fat-stick (Old) and /work/SRC/openSUSE:Factory/.live-fat-stick.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "live-fat-stick" Changes: -------- --- /work/SRC/openSUSE:Factory/live-fat-stick/live-fat-stick.changes 2016-01-12 16:12:56.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.live-fat-stick.new/live-fat-stick.changes 2016-07-14 09:48:36.000000000 +0200 @@ -1,0 +2,17 @@ +Sat Jul 2 14:21:14 UTC 2016 - cyberorg@opensuse.org + +- added --suse-persistent and --ubuntu-persistent + with these options a cowfile is created to store changes + made while in live mode + +------------------------------------------------------------------- +Wed Jun 29 10:20:01 UTC 2016 - cyberorg@opensuse.org + +- many cross distribution fixes + +------------------------------------------------------------------- +Thu Jun 23 07:41:31 UTC 2016 - cyberorg@opensuse.org + +- Shortname for Li-f-e + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ live-fat-stick ++++++ --- /var/tmp/diff_new_pack.hVpGkP/_old 2016-07-14 09:48:38.000000000 +0200 +++ /var/tmp/diff_new_pack.hVpGkP/_new 2016-07-14 09:48:38.000000000 +0200 @@ -82,7 +82,9 @@ To add various distribution iso to the stick, run the following: For openSUSE : live-fat-stick --suse /path/to/openSUSE-filename.iso /dev/sdXY - For Ubuntu : live-fat-stick --ubuntu /path/to/ubuntu-filename.iso /dev/sdXY + For openSUSE with persistence : live-fat-stick --suse-persistent /path/to/openSUSE-filename.iso /dev/sdXY + For Ubuntu clones : live-fat-stick --ubuntu /path/to/ubuntu-filename.iso /dev/sdXY + For Ubuntu clones with persistence : live-fat-stick --ubuntu-persistent /path/to/ubuntu-filename.iso /dev/sdXY For Mint : live-fat-stick --mint /path/to/mint-filename.iso /dev/sdXY For Fedora : live-fat-stick --fedora /path/to/fedora-filename.iso /dev/sdXY For iPXE : live-fat-stick --ipxe /path/to/ipxe.iso /dev/sdXY @@ -94,6 +96,9 @@ The stick partition has to be vfat/fat32 format if the image is not isohybrid. + Persistent option requires minimum 500M free space on the USB device apart from the spare needed by iso image. + To allocate more space for cow file use cowfile variable like this example: "export cowfile=1000M" before running the script + Please note that using isohybrid option will remove all existing data on the USB device and create new partitions. @@ -120,6 +125,14 @@ --ubuntu|--mint) distroname=ubuntu ;; + --suse-persistent|--opensuse-persistent) + distroname=suse + PERSISTENT_IMAGE=true + ;; + --ubuntu-persistent|--mint-persistent) + distroname=ubuntu + PERSISTENT_IMAGE=true + ;; --isohybrid) distroname=isohybrid ;; @@ -165,6 +178,10 @@ echo "fuseiso not found, please install fuseiso package" exit 1 fi +if [[ ! -e $(which qemu-img) ]]; then + echo "qemu-img not found, please install qemu-tools package" + exit 1 +fi if [[ ! -e $1 ]]; then echo "File $1 does not exist" exit 1 @@ -192,6 +209,7 @@ stickdevpart=$2 liveusbgui=/tmp/liveusbgui benice="nice ionice -c3" +cowsize=${cowsize:-500M} if [[ $isoname != $isonametr ]]; then echo "removing space/s from iso name copied to the destination disk" @@ -202,8 +220,8 @@ echo "wrong uuid detected, please file bug with output of: blkid $2" fi -if echo $isoname | grep -qi "Li-f-e"; then - isonameshort=openSUSE-Edu-Li-f-e +if echo $isoname | grep -qi "Li-f-e" | grep -qi "suse"; then + isonameshort=openSUSE-Li-f-e fi are_you_sure () { echo -n "$1 [$2/$3]? " @@ -221,7 +239,7 @@ if [ -x /usr/bin/dd_rescue ]; then $benice dd_rescue -A -b 4M -y 4M "$iso_symlink" "$2" elif [ -x /usr/bin/ddrescue ]; then - $benice ddrescue --force --block-size=4M "$iso_symlink" "$2" + $benice ddrescue --force -b 4M "$iso_symlink" "$2" else echo "dd_rescue or ddrescue not found, please install one of them, using dd for now" $benice dd if="$iso_symlink" of="$2" bs=4M @@ -231,6 +249,14 @@ fuseiso $isopath $isomount &>/dev/null echo "copying kernel and initrd from iso image to $stickdevpart" if [[ $distroname == suse ]]; then + if [[ $PERSISTENT_IMAGE == true ]]; then + echo "Creating image file for persistent data" + if ! qemu-img create $stickmount/boot/$isonameshort-cowfile $cowsize &>/dev/null;then + echo "Can't create cow file" + else + persistopts="kiwi_cowdevice=/dev/disk/by-uuid/$stickuuid kiwi_cowsystem=/boot/$isonameshort-cowfile" + fi + fi rm $stickmount/syslinux.cfg &>/dev/null if [[ ! -f $stickmount/fatstick ]]; then cp -r $isomount/boot $stickmount/ @@ -240,11 +266,22 @@ fi cp $isomount/boot/*/loader/linux $syslinuxpath/linux-$isonameshort cp $isomount/boot/*/loader/initrd $syslinuxpath/initrd-$isonameshort - appendsection="append initrd=initrd-$isonameshort isofrom=/dev/disk/by-uuid/$stickuuid:/$isoname isofrom_device=/dev/disk/by-uuid/$stickuuid isofrom_system=/$isoname loader=syslinux splash=silent quiet showopts" + appendsection="append initrd=initrd-$isonameshort isofrom=/dev/disk/by-uuid/$stickuuid:/$isoname isofrom_device=/dev/disk/by-uuid/$stickuuid isofrom_system=/$isoname loader=syslinux splash=silent $persistopts quiet showopts" isolinux_msg="display isolinux.msg" ui="ui gfxboot bootlogo isolinux.msg" fi if [[ $distroname == ubuntu ]]; then + if [[ $PERSISTENT_IMAGE == true ]]; then + mkdir -p $stickmount/$isonameshort + echo "Creating image file for persistent data" + if ! qemu-img create $stickmount/$isonameshort/casper-rw $cowsize &>/dev/null;then + echo "Can't create cow file" + else + echo "Creating filesystem for persistent data" + mkfs.ext4 -F -O^has_journal -L casper-rw $stickmount/$isonameshort/casper-rw + persistopts="persistent persistent-path=/$isonameshort/" + fi + fi mkdir -p $syslinuxpath if [[ -e $isomount/casper/vmlinuz ]]; then cp $isomount/casper/vmlinuz $syslinuxpath/linux-$isonameshort @@ -252,7 +289,7 @@ cp $isomount/casper/vmlinuz.efi $syslinuxpath/linux-$isonameshort fi cp $isomount/casper/initrd.lz $syslinuxpath/initrd-$isonameshort - appendsection="append initrd=initrd-$isonameshort boot=casper iso-scan/filename=/$isoname" + appendsection="append initrd=initrd-$isonameshort boot=casper iso-scan/filename=/$isoname $persistopts quiet splash" fi if [[ $distroname == fedora ]]; then mkdir -p "$syslinuxpath" @@ -275,6 +312,8 @@ echo "replacing mbr of $stickdevice with syslinux mbr.bin" if [[ -e /usr/share/syslinux/mbr.bin ]]; then dd if=/usr/share/syslinux/mbr.bin of=$stickdevice &>/dev/null + elif [[ -e /usr/lib/syslinux/mbr/mbr.bin ]]; then + dd if=/usr/lib/syslinux/mbr/mbr.bin of=$stickdevice &>/dev/null else dd if=/usr/lib/syslinux/mbr.bin of=$stickdevice &>/dev/null fi @@ -323,9 +362,11 @@ EOF else if [[ -e /usr/share/syslinux/vesamenu.c32 ]]; then - cp /usr/share/syslinux/vesamenu.c32 $syslinuxpath/ || echo "/usr/share/syslinux/vesamenu.c32 is missing or cannot be copied" + cp /usr/share/syslinux/vesamenu.c32 $syslinuxpath/ || echo "vesamenu.c32 cannot be copied" + elif [[ -e /usr/lib/syslinux/modules/bios/vesamenu.c32 ]]; then + cp /usr/lib/syslinux/modules/bios/* $syslinuxpath/ || echo "vesamenu.c32 cannot be copied" else - cp /usr/lib/syslinux/vesamenu.c32 $syslinuxpath/ || echo "/usr/lib/syslinux/vesamenu.c32 is missing or cannot be copied" + cp -r /usr/lib/syslinux/* $syslinuxpath/ || echo "vesamenu.c32 is missing or cannot be copied" fi cat <<EOF >$syslinuxpath/syslinux.cfg default vesamenu.c32 ++++++ live-grub-stick ++++++ --- /var/tmp/diff_new_pack.hVpGkP/_old 2016-07-14 09:48:38.000000000 +0200 +++ /var/tmp/diff_new_pack.hVpGkP/_new 2016-07-14 09:48:38.000000000 +0200 @@ -82,7 +82,9 @@ To add various distribution iso to the stick, run the following: For openSUSE : live-grub-stick --suse /path/to/openSUSE-filename.iso /dev/sdXY - For Ubuntu : live-grub-stick --ubuntu /path/to/ubuntu-filename.iso /dev/sdXY + For openSUSE with persistence : live-grub-stick --suse-persistent /path/to/openSUSE-filename.iso /dev/sdXY + For Ubuntu clones : live-grub-stick --ubuntu /path/to/ubuntu-filename.iso /dev/sdXY + For Ubuntu clones with persistence : live-grub-stick --ubuntu-persistent /path/to/ubuntu-filename.iso /dev/sdXY For Mint : live-grub-stick --mint /path/to/mint-filename.iso /dev/sdXY For Fedora : live-grub-stick --fedora /path/to/fedora-filename.iso /dev/sdXY For iPXE : live-grub-stick --ipxe /path/to/ipxe.iso /dev/sdXY @@ -94,6 +96,9 @@ The stick partition has to be vfat/fat32 format if the image is not isohybrid. + Persistent option requires minimum 500M free space on the USB device apart from the spare needed by iso image. + To allocate more space for cow file use cowfile variable like this example: "export cowfile=1000M" before running the script + Please note that using isohybrid option will remove all existing data on the USB device and create new partitions. @@ -120,6 +125,14 @@ --ubuntu|--mint) distroname=ubuntu ;; + --suse-persistent|--opensuse-persistent) + distroname=suse + PERSISTENT_IMAGE=true + ;; + --ubuntu-persistent|--mint-persistent) + distroname=ubuntu + PERSISTENT_IMAGE=true + ;; --isohybrid) distroname=isohybrid ;; @@ -157,8 +170,17 @@ echo "$(for i in $(find /dev/disk/by-path/ |grep usb); do readlink -f $i;done)" exit 1 fi -if [[ ! -e $(which grub2-install) ]]; then - echo "grub2-install command not found, please install grub2 package" +if lsb_release -i | grep -qi suse; then + grubinstall='grub2-install' + if [[ ! -e $(which qemu-img) ]]; then + echo "qemu-img not found, please install qemu-tools package" + exit 1 + fi +else + grubinstall='grub-install' +fi +if [[ ! -e $(which $grubinstall) ]]; then + echo "$grubinstall command not found, please install grub2 package" exit 1 fi if [[ ! -e $(which fuseiso) ]]; then @@ -187,11 +209,10 @@ stickuuid=$(blkid -s UUID -o value $2) isolabel=$(blkid -s LABEL -o value $1) stickpart=$(basename $2 | sed 's/[a-z]*//g') -grub2path=$stickmount/boot/grub2 -grubcfgpath=$grub2path/grub.cfg stickdevpart=$2 liveusbgui=/tmp/liveusbgui benice="nice ionice -c3" +cowsize=${cowsize:-500M} if [[ $isoname != $isonametr ]]; then echo "removing space/s from iso name copied to the destination disk" @@ -202,8 +223,8 @@ echo "wrong uuid detected, please file bug with output of: blkid $2" fi -if echo $isoname | grep -qi "Li-f-e"; then - isonameshort=openSUSE-Edu-Li-f-e +if echo $isoname | grep -qi "Li-f-e" | grep -qi "suse"; then + isonameshort="openSUSE-Li-f-e" fi are_you_sure () { echo -n "$1 [$2/$3]? " @@ -221,7 +242,7 @@ if [ -x /usr/bin/dd_rescue ]; then $benice dd_rescue -A -b 4M -y 4M "$iso_symlink" "$2" elif [ -x /usr/bin/ddrescue ]; then - $benice ddrescue --force --block-size=4M "$iso_symlink" "$2" + $benice ddrescue --force -b 4M "$iso_symlink" "$2" else echo "dd_rescue or ddrescue not found, please install one of them, using dd for now" $benice dd if="$iso_symlink" of="$2" bs=4M @@ -229,24 +250,54 @@ } cfg_setup() { fuseiso $isopath $isomount &>/dev/null - if [[ -d $stickmount/boot ]];then - mkdir -p $stickmount/boot/ - fi + if [[ -d $stickmount/boot/grub2 ]]; then + grub2path=$stickmount/boot/grub2 + grub2pathrealusb=/boot/grub2 + else + grub2path=$stickmount/boot/grub + grub2pathrealusb=/boot/grub + fi + grubcfgpath=$grub2path/grub.cfg + if [[ ! -f $stickmount/grubstick ]]; then + echo "copying grub files to $stickmount/boot/" + if [[ -d "$isomount/boot/grub2" ]];then + cp -r $isomount/boot/grub2/* $grub2path/ + elif [[ -d "$isomount/boot/grub" ]];then + cp -r $isomount/boot/grub/* $grub2path/ + else + cp -r $grub2pathreal/* $grub2path/ + fi + fi if [[ $distroname == suse ]]; then - if [[ ! -f $stickmount/grubstick ]]; then - echo "copying grub2 files to $stickmount/boot/" - cp -r $isomount/boot/grub2 $stickmount/boot/ + if [[ $PERSISTENT_IMAGE == true ]]; then + echo "Creating image file for persistent data" + if ! qemu-img create $stickmount/boot/$isonameshort-cowfile $cowsize &>/dev/null;then + echo "Can't create cow file" + else + persistopts="kiwi_cowdevice=/dev/disk/by-uuid/$stickuuid kiwi_cowsystem=/boot/$isonameshort-cowfile" + fi fi - appendsection="\$linux (loop)/boot/x86_64/loader/linux isofrom=/dev/disk/by-uuid/$stickuuid:/$isoname isofrom_device=/dev/disk/by-uuid/$stickuuid isofrom_system=/$isoname loader=syslinux splash=silent quiet showopts" + appendsection="\$linux (loop)/boot/x86_64/loader/linux isofrom=/dev/disk/by-uuid/$stickuuid:/$isoname isofrom_device=/dev/disk/by-uuid/$stickuuid isofrom_system=/$isoname $persistopts loader=syslinux splash=silent quiet showopts" appendsection2="\$initrd (loop)/boot/x86_64/loader/initrd" fi if [[ $distroname == ubuntu ]]; then + if [[ $PERSISTENT_IMAGE == true ]]; then + mkdir -p $stickmount/$isonameshort + echo "Creating image file for persistent data" + if ! qemu-img create $stickmount/$isonameshort/casper-rw $cowsize &>/dev/null;then + echo "Can't create cow file" + else + echo "Creating filesystem for persistent data" + mkfs.ext4 -F -O^has_journal -L casper-rw $stickmount/$isonameshort/casper-rw + persistopts="persistent persistent-path=/$isonameshort/" + fi + fi if [[ -e $isomount/casper/vmlinuz ]]; then vmlinuzfile=/casper/vmlinuz else vmlinuzfile=/casper/vmlinuz.efi fi - appendsection="linux (loop)/$vmlinuzfile boot=casper iso-scan/filename=/$isoname quiet splash" + appendsection="linux (loop)/$vmlinuzfile boot=casper iso-scan/filename=/$isoname $persistopts quiet splash" appendsection2="initrd (loop)/casper/initrd.lz" fi if [[ $distroname == fedora ]]; then @@ -256,12 +307,16 @@ if [[ $distroname == ipxe ]]; then appendsection="linux16 (loop)/ipxe.krn" fi + if ! grep -q $isonameshort $grubcfgpath | grep -qi menuentry; then + echo "adding new image to boot menu" + add_menu_section + fi umount $isomount &>/dev/null } grub2_stuff () { echo "installing grub2 on $stickdevice" mkdir -p $stickmount/boot - grub2-install --target=i386-pc --boot-directory=$stickmount/boot $stickdevice + $grubinstall --target=i386-pc --boot-directory=$stickmount/boot $stickdevice echo "setting $stickdevice partition $stickpart active" parted $stickdevice set $stickpart boot on &>/dev/null cfg_setup @@ -283,6 +338,8 @@ fi } create_grub_cfg() { +cp /usr/share/grub*/unicode.pf2 $grub2path/ 2>/dev/null +export themename=$(echo /$grub2path/themes/*|rev | cut -d / -f1|rev) cat <<EOF >$grubcfgpath insmod fat insmod ext2 @@ -317,24 +374,16 @@ set initrd=initrd fi set default=0 -set font=/boot/grub2/fonts/unicode.pf2 -if loadfont \$font ;then - set gfxmode=auto - insmod gfxterm - insmod gfxmenu - terminal_input gfxterm - if terminal_output gfxterm; then true; else - terminal gfxterm - fi -fi -if loadfont /boot/grub2/themes/openSUSE/ascii.pf2;then - loadfont /boot/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2 - loadfont /boot/grub2/themes/openSUSE/DejaVuSans10.pf2 - loadfont /boot/grub2/themes/openSUSE/DejaVuSans12.pf2 - loadfont /boot/grub2/themes/openSUSE/ascii.pf2 - set theme=/boot/grub2/themes/openSUSE/theme.txt - background_image -m stretch /boot/grub2/themes/openSUSE/background.png +set font=$grub2pathrealusb/unicode.pf2 +set gfxmode=auto +insmod gfxterm +insmod gfxmenu +terminal_input gfxterm +if terminal_output gfxterm; then true; else + terminal gfxterm fi +set theme=$grub2pathrealusb/themes/$themename/theme.txt +export theme set timeout=10 EOF @@ -384,13 +433,14 @@ echo "copying $isoname to usb stick" try_cp_with_progress "$1" "$stickmount/$isoname" fi + if [[ -d /boot/grub2 ]]; then + grub2pathreal=/boot/grub2 + else + grub2pathreal=/boot/grub + fi if [[ -f $stickmount/grubstick ]]; then echo "the stick is already bootable stick" - if ! grep -q $isonameshort $grubcfgpath; then - echo "adding new image to boot menu" - cfg_setup - add_menu_section - fi + cfg_setup else grub2_stuff echo "creating menu entries" ++++++ live-usb-gui ++++++ --- /var/tmp/diff_new_pack.hVpGkP/_old 2016-07-14 09:48:38.000000000 +0200 +++ /var/tmp/diff_new_pack.hVpGkP/_new 2016-07-14 09:48:38.000000000 +0200 @@ -30,9 +30,9 @@ which zenity &>/dev/null && popup=zenity fi popup=${popup:-zenity} - +scriptorun=${scriptorun:-live-fat-stick} which $popup &>/dev/null || echo "$popup not found, please install to use this tool" -which live-fat-stick &>/dev/null || echo "live-fat-stick script not found in PATH, please install it and make it executable" +which $scriptorun &>/dev/null || echo "$scriptorun script not found in PATH, please install it and make it executable" export liveusbgui=/tmp/liveusbgui touch /tmp/liveusbgui @@ -46,8 +46,9 @@ fileselectpath="/" fileselectfilter="*iso" usbselecttitle="Select the target USB device" -distributionlist="suse fedora mint ubuntu ipxe isohybrid" +distributionlist="suse suse-persistent fedora mint ubuntu ubuntu-persistent ipxe isohybrid" distrotitle="Select the distribution of the iso" +scriptlist="live-grub-stick live-fat-stick" usbdevicelist=$(for i in `echo $(for i in $(find /dev/disk/by-path/ |grep usb); do readlink -f $i;done)` do # if [[ $(blkid -s TYPE -o value $i) == vfat ]];then @@ -63,6 +64,10 @@ printf "%s %s %s" $distro $distro off printf "\n" done) +scriptlistkd=$(for script in $scriptlist; do + printf "%s %s %s" $script $script off + printf "\n" +done) check_variable () { if [ ! "$1" ]; then clean_up @@ -76,13 +81,17 @@ check_variable $usbdevice distroname=$(zenity --list --title="distrotitle" --column="Distribution:" $distributionlist) check_variable $distroname + scriptorun=$(zenity --list --title="Select script to run" --column="Scripts:" $scriptlist) + check_variable $scriptorun else sourceiso=$(kdialog --title "$fileselecttitle" --getopenfilename "$fileselectpath" "$fileselectfilter") check_variable $sourceiso - usbdevice=$(kdialog --separate-output --title "$usbselecttitle" --checklist "USB device:" $usbdevicelistkd) + usbdevice=$(kdialog --separate-output --title "$usbselecttitle" --radiolist "USB device:" $usbdevicelistkd) check_variable $usbdevice - distroname=$(kdialog --separate-output --title "$distrotitle" --checklist "Distribution:" $distributionlistkd) + distroname=$(kdialog --separate-output --title "$distrotitle" --radiolist "Distribution:" $distributionlistkd) check_variable $distroname + scriptorun=$(kdialog --separate-output --title "Select script to run" --radiolist "Scripts:" $scriptlistkd) + check_variable $scriptorun fi case $distroname in @@ -95,6 +104,12 @@ ubuntu) option="--ubuntu" ;; + suse-persistent) + option="--suse-persistent" + ;; + ubuntu-persistent) + option="--ubuntu-persistent" + ;; mint) option="--ubuntu" ;; @@ -128,9 +143,9 @@ if [[ $option == isohybrid ]]; then usbdev=$(echo $usbdevice | sed 's/[0-9]*//g') - xterm -e "live-fat-stick --isohybrid $sourceiso $usbdev" + xterm -e "$scriptorun --isohybrid $sourceiso $usbdev" else - xterm -e "live-fat-stick $option $sourceiso $usbdevice" + xterm -e "$scriptorun $option $sourceiso $usbdevice" fi if [ $? != 0 ]; then