usbinstall.sh: update from dracut custom 99squash-live to upsteam 90dmsquash-live mechanism for persistent installation into a USB pendrive

This commit is contained in:
Silvan Calarco 2019-05-25 17:53:53 +02:00
parent cb0151c061
commit 7347b55a3b

View File

@ -10,7 +10,7 @@
#~ # scaricherà direttamente la versione attuale dal sito di openmamba.
#~ # se il file iso è presente nella home verrà usato direttamente altrimenti si aprirà un dialogo dove sarà possibile cercarlo.
#~ # (c) 2009 ercole 'ercolinux' carpanetto - ercole69@gmail.com
#~ # (c) 2009-2014 Silvan Calarco - silvan.calarco@mambasoft.it
#~ # (c) 2009-2019 Silvan Calarco - silvan.calarco@mambasoft.it
# License: GPL v.3
@ -303,26 +303,6 @@ fi
pushd $MOUNTDIR >/dev/null
set_status $"Copying ISO..."
echo $"Copying ISO..."
# Copy code
ORIG_SIZE=`stat -c %s $SELECT_ISO`
cp $SELECT_ISO ./ &
export CPPID=$!
DEST_SIZE=0
DEST_FILE=./"`basename $SELECT_ISO`"
ps $CPPID >/dev/null
while [ $? -eq 0 ]; do
if [ -e $DEST_FILE ]; then
DEST_SIZE=$(stat -c %s $DEST_FILE)
percentuale=$((30 + ( 50 * $DEST_SIZE ) / $ORIG_SIZE ))
set_pbar $percentuale
fi
sleep 2
ps $CPPID >/dev/null
done
ln -fs `basename $SELECT_ISO` ./openmamba-live.iso
sudo chmod 777 ./
if [ "$SELECT_BOOT" ]; then
set_status $"Extracting bootusb archive..."
@ -339,9 +319,28 @@ else
errorAndExit $"Error: unable to mount ISO image"
}
mkdir boot
mkdir LiveOS boot rwroot ovlwork
cp $ISOMOUNTDIR/boot/{initrd*,vmlinuz*} boot/
set_status $"Copying SquashFS image from ISO image..."
echo $"Copying SquashFS image..."
# Copy code
ORIG_SIZE=`stat -c %s $ISOMOUNTDIR/LiveOS/squashfs.img`
cp $ISOMOUNTDIR/LiveOS/squashfs.img LiveOS/ &
export CPPID=$!
DEST_SIZE=0
DEST_FILE=LiveOS/squashfs.img
ps $CPPID >/dev/null
while [ $? -eq 0 ]; do
if [ -e $DEST_FILE ]; then
DEST_SIZE=$(stat -c %s $DEST_FILE)
percentuale=$((30 + ( 50 * $DEST_SIZE ) / $ORIG_SIZE ))
set_pbar $percentuale
fi
sleep 2
ps $CPPID >/dev/null
done
# basic extlinux.conf -> grub.cfg conversion
echo "\
#
@ -353,7 +352,7 @@ insmod all_video
insmod gfxterm
insmod gettext
terminal_output=gfxterm
timeout=30
timeout=10
# theme
insmod=png
set menu_color_normal=white/black
@ -386,7 +385,7 @@ search --no-floppy --label --set=root openmamba_live
esac
done < $ISOMOUNTDIR/boot/isolinux/isolinux.cfg
[ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
sed -i "s|root=live:LABEL=[^[:space:]]* |root=live:/openmamba_live/openmamba-live.iso |" $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
sed -i "s|root=live:LABEL=.*|root=live:LABEL=openmamba_live rd.live.overlay=/dev/disk/by-label/openmamba_live:/rwroot selinux=0 quiet splash rw|" $MOUNTDIR_EFI/EFI/BOOT/grub.cfg
mkdir boot/grub
cp $MOUNTDIR_EFI/EFI/BOOT/grub.cfg boot/grub/grub.cfg