From d10aa62d765294124a43fb4afd6263312fbdba59 Mon Sep 17 00:00:00 2001 From: mavrothal Date: Mon, 2 Jun 2014 12:57:34 +0300 Subject: [PATCH] Support of adrv and ydrv in puppy installers and PPM --- .../usr/local/petget/removepreview.sh | 8 ++- woof-code/rootfs-skeleton/usr/sbin/bootflash | 4 +- .../rootfs-skeleton/usr/sbin/puppyinstaller | 58 ++++++++++++++++--- 3 files changed, 60 insertions(+), 10 deletions(-) diff --git a/woof-code/rootfs-skeleton/usr/local/petget/removepreview.sh b/woof-code/rootfs-skeleton/usr/local/petget/removepreview.sh index a74fceb64dd..33305631c29 100755 --- a/woof-code/rootfs-skeleton/usr/local/petget/removepreview.sh +++ b/woof-code/rootfs-skeleton/usr/local/petget/removepreview.sh @@ -80,7 +80,13 @@ if [ -f /root/.packages/${DB_pkgname}.files ];then do if [ ! -d "$ONESPEC" ];then #120103 shinobar: better way of doing this, look all lower layers... - S=$(ls /initrd/pup_ro{?,??}"$ONESPEC" 2>/dev/null| grep -v '^/initrd/pup_ro1/'| head -n 1) # pup_ro2 - pup_ro99 + Sx=$(ls /initrd/pup_{a,y,ro[0-9]*}"$ONESPEC" 2>/dev/null| grep -v '^/initrd/pup_ro1/') + INAY=$(echo $Sx | grep -E 'pup_a|pup_y') + if [ "$INAY" != "" ]; then + S=$(ls /initrd/pup_{a,y}"$ONESPEC" 2>/dev/null| grep -v '^/initrd/pup_ro1/'| tail -n 1) + else + S=$(ls /initrd/pup_ro{?,??}"$ONESPEC" 2>/dev/null| grep -v '^/initrd/pup_ro1/'| head -n 1) + fi # pup_ro2 - pup_ro99 if [ "$S" ]; then #the problem is, deleting the file on the top layer places a ".wh" whiteout file, #that hides the original file. what we want is to remove the installed file, and diff --git a/woof-code/rootfs-skeleton/usr/sbin/bootflash b/woof-code/rootfs-skeleton/usr/sbin/bootflash index f7ed91aa8f4..4c06a8e03a2 100755 --- a/woof-code/rootfs-skeleton/usr/sbin/bootflash +++ b/woof-code/rootfs-skeleton/usr/sbin/bootflash @@ -51,7 +51,7 @@ echo 'export HELP_DIALOG="Upgrading Puppy')' -'$(gettext 'You could use the Puppy Universal Installer, however it is a piece of cake to do it manually. When a new version of Puppy is released, download the live-CD iso file, then just click on it to open it. Drag the files vmlinuz, initrd.gz and puppy.sfs (and zdrv.sfs if it exists) (some builds of Puppy have different names for these files, for example: wary_092.sfs and zw092345.sfs) to the USB drive, and that is it, you have upgraded! +'$(gettext 'You could use the Puppy Universal Installer, however it is a piece of cake to do it manually. When a new version of Puppy is released, download the live-CD iso file, then just click on it to open it. Drag the files vmlinuz, initrd.gz and puppy.sfs (and ardv, ydrf and zdrv.sfs if they exist) (some builds of Puppy have different names for these files, for example: wary_092.sfs and zw092345.sfs) to the USB drive, and that is it, you have upgraded! It is super-simple, but just a warning: if there are files of an old installation, for example wary_091.2fs and zw091346.sfs, just delete those.')' '$(gettext 'WARNING: There is one caveat to the above. Be careful before deleting the old puppy.sfs that it is not in use by Puppy. If the PC has 256MB or more of RAM, Puppy will normally copy puppy.sfs into RAM, so the original is not being used and can be deleted. To find out, open a terminal and type losetup -- if you see something like /mnt/tmpfs/puppy.sfs then it is in RAM. If not, or uncertain, boot another Puppy from a different drive/CD.')' @@ -443,6 +443,8 @@ fi rm -f /mnt/${PUPBOOTPART}/*-[0-9][0-9][0-9].sfs 2>/dev/null rm -f /mnt/${PUPBOOTPART}/*_[0-9][0-9][0-9].sfs 2>/dev/null #101026 [ -f /mnt/${PUPBOOTPART}/${DISTRO_PUPPYSFS} ] && rm -f /mnt/${PUPBOOTPART}/${DISTRO_PUPPYSFS} #100913 +[ -f /mnt/${PUPBOOTPART}/${DISTRO_ADRVSFS} ] && rm -f /mnt/${PUPBOOTPART}/${DISTRO_ADRVSFS} +[ -f /mnt/${PUPBOOTPART}/${DISTRO_YDRVSFS} ] && rm -f /mnt/${PUPBOOTPART}/${DISTRO_YDRVSFS} [ -f /mnt/${PUPBOOTPART}/${DISTRO_ZDRVSFS} ] && rm -f /mnt/${PUPBOOTPART}/${DISTRO_ZDRVSFS} #100913 #[ -f /mnt/${PUPBOOTPART}/${DISTRO_DEVXSFS} ] && rm -f /mnt/${PUPBOOTPART}/${DISTRO_DEVXSFS} #100913 #create a syslinux.cfg file... diff --git a/woof-code/rootfs-skeleton/usr/sbin/puppyinstaller b/woof-code/rootfs-skeleton/usr/sbin/puppyinstaller index 9a2f475c63c..6a3de3dd66e 100755 --- a/woof-code/rootfs-skeleton/usr/sbin/puppyinstaller +++ b/woof-code/rootfs-skeleton/usr/sbin/puppyinstaller @@ -278,7 +278,7 @@ do done [ -f /tmp/srcpath.txt ] && SRCPATH="`cat /tmp/srcpath.txt`" if [ "$SRCPATH" = "" ];then - Xdialog --wmclass "gtkdialog2" --left --buttons-style text --title "$(gettext 'Puppy universal installer')" --ok-label "CD" --cancel-label "$(gettext 'DIRECTORY')" --yesno "`eval_gettext \"Puppy consists of 2 to 4 files:\nvmlinuz The Linux kernel\ninitrd.gz The initial ramdisk.\n\\\${DISTRO_PUPPYSFS} This has all the Puppy files (sometimes inside initrd.gz).\n (if built inside initrd.gz then only initrd.gz is required)\n\\\${DISTRO_ZDRVSFS} Extra kernel drivers and firmware (optional).\n (most builds have a usable selection of drivers in \\\${DISTRO_PUPPYSFS})\nIf you booted Puppy from a live-CD, those files will be on it.\nOtherwise, they are in the .iso file and can be extracted -- in that\ncase, just click on the .iso file and it will be mounted (opened) in\na directory (do not forget to click on the file later to unmount it!)\n\nWhere are the Puppy files?...\"`" 0 0 + Xdialog --wmclass "gtkdialog2" --left --buttons-style text --title "$(gettext 'Puppy universal installer')" --ok-label "CD" --cancel-label "$(gettext 'DIRECTORY')" --yesno "`eval_gettext \"Puppy consists of 2 to 6 files:\nvmlinuz The Linux kernel\ninitrd.gz The initial ramdisk.\n\\\${DISTRO_PUPPYSFS} This has all the Puppy files (sometimes inside initrd.gz).\n (if built inside initrd.gz then only initrd.gz is required)\n\\\${DISTRO_ADRVSFS} and \\\${DISTRO_YDRVSFS} if a modular main SFS is used (optional).\n\\\${DISTRO_ZDRVSFS} Extra kernel drivers and firmware (optional).\n (most builds have a usable selection of drivers in \\\${DISTRO_PUPPYSFS})\nIf you booted Puppy from a live-CD, those files will be on it.\nOtherwise, they are in the .iso file and can be extracted -- in that\ncase, just click on the .iso file and it will be mounted (opened) in\na directory (do not forget to click on the file later to unmount it!)\n\nWhere are the Puppy files?...\"`" 0 0 RETVAL=$? if [ $RETVAL -eq 0 ];then #CD CDDRIVE="`readlink /dev/cdrom`" @@ -812,13 +812,15 @@ SRCPATH="$2" FINALPMEDIA="$3" DISTRO_FILE_PREFIX="$4" DISTRO_PUPPYSFS="$5" -DISTRO_ZDRVSFS="$6" +DISTRO_ADRVSFS="$6" +DISTRO_YDRVSFS="$7" +DISTRO_ZDRVSFS="$8" #DISTRO_DEVXSFS="$7" PREFIX1CHAR="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1`" echo "'$(gettext 'ABSOLUTE FINAL SANITY CHECK!')'" echo "'$(gettext 'You are about to install Puppy to /dev/')'$DESTPART, '$(gettext 'with boot parameter')'" echo "pmedia=$FINALPMEDIA. '$(gettext 'The files vmlinuz, initrd.gz,')' ${DISTRO_PUPPYSFS}, syslinux.cfg" -echo "('$(gettext 'and maybe the')' ${DISTRO_ZDRVSFS} '$(gettext 'if it exists.')' ${DISTRO_PUPPYSFS} '$(gettext 'may be inside')' initrd.gz)" +echo "('$(gettext 'and maybe the')' ${DISTRO_ZDRVSFS} ${DISTRO_ZDRVSFS} '$(gettext 'and')' ${DISTRO_ZDRVSFS} '$(gettext 'if they exist.')' ${DISTRO_PUPPYSFS} '$(gettext 'may be inside')' initrd.gz)" echo "'$(gettext 'will be written to /dev/')'$DESTPART '$(gettext 'and Syslinux will be used to make it bootable.')'" echo echo -n "'$(gettext 'Press ENTER key to continue, CTRL-C to abort:')' " @@ -853,6 +855,8 @@ else rm -f /mnt/data/z${PREFIX1CHAR}*.sfs 2>/dev/null rm -f /mnt/data/${DISTRO_PUPPYSFS} 2>/dev/null #100913 rm -f /mnt/data/${DISTRO_ZDRVSFS} 2>/dev/null #100913 + rm -f /mnt/data/${DISTRO_ADRVSFS} 2>/dev/null + rm -f /mnt/data/${DISTRO_YDRVSFS} 2>/dev/null #rm -f /mnt/data/${DISTRO_DEVXSFS} 2>/dev/null #100913 fi sync @@ -941,6 +945,10 @@ sync echo "'$(gettext 'Copying .sfs files...')'" cp -f $SRCPATH/${DISTRO_PUPPYSFS} /mnt/data/ 2>/dev/null sync +cp -f $SRCPATH/${DISTRO_ADRVSFS} /mnt/data/ 2>/dev/null +sync +cp -f $SRCPATH/${DISTRO_YDRVSFS} /mnt/data/ 2>/dev/null +sync cp -f $SRCPATH/${DISTRO_ZDRVSFS} /mnt/data/ 2>/dev/null sync #cp -f $SRCPATH/${DISTRO_DEVXSFS} /mnt/data/ 2>/dev/null @@ -950,7 +958,7 @@ echo -n "'$(gettext 'Finished, press ENTER key to continue:')' " read moo ' > /tmp/installpup.sh chmod 755 /tmp/installpup.sh - rxvt -bg "orange" -title "$(gettext 'Puppy Universal Installer')" -geometry 80x10 -e /tmp/installpup.sh $DESTPART $SRCPATH $FINALPMEDIA $DISTRO_FILE_PREFIX $DISTRO_PUPPYSFS $DISTRO_ZDRVSFS #$DISTRO_DEVXSFS + rxvt -bg "orange" -title "$(gettext 'Puppy Universal Installer')" -geometry 80x10 -e /tmp/installpup.sh $DESTPART $SRCPATH $FINALPMEDIA $DISTRO_FILE_PREFIX $DISTRO_PUPPYSFS $DISTRO_ADRVSFS $DISTRO_YDRVSFS $DISTRO_ZDRVSFS #$DISTRO_DEVXSFS ;; ext2|ext3|ext4) #params passed in: $DESTPART "$SRCPATH" $FINALPMEDIA @@ -961,13 +969,15 @@ FINALPMEDIA="$3" DESTFS="$4" DISTRO_FILE_PREFIX="$5" DISTRO_PUPPYSFS="$6" -DISTRO_ZDRVSFS="$7" +DISTRO_ADRVSFS="$7" +DISTRO_YDRVSFS="$8" +DISTRO_ZDRVSFS="$9" #DISTRO_DEVXSFS="$8" PREFIX1CHAR="`echo -n "$DISTRO_FILE_PREFIX" | cut -c 1`" echo "'$(gettext 'ABSOLUTE FINAL SANITY CHECK!')'" echo "'$(gettext 'You are about to install Puppy to /dev/')'$DESTPART, '$(gettext 'with boot parameter')'" echo "pmedia=$FINALPMEDIA. '$(gettext 'The files vmlinuz, initrd.gz,')' ${DISTRO_PUPPYSFS}, extlinux.conf" -echo "('$(gettext 'and maybe')' ${DISTRO_ZDRVSFS} '$(gettext 'if it exists.')' ${DISTRO_PUPPYSFS} '$(gettext 'may be inside initrd.gz')')" +echo "('$(gettext 'and maybe')' ${DISTRO_ADRVSFS} ${DISTRO_YDRVSFS} '$(gettext 'and')' ${DISTRO_ZDRVSFS} '$(gettext 'if they exist.')' ${DISTRO_PUPPYSFS} '$(gettext 'may be inside initrd.gz')')" echo "'$(gettext 'will be written to /dev/')'$DESTPART '$(gettext 'and Extlinux will be used to make it bootable.')'" echo echo -n "'$(gettext 'Press ENTER key to continue, CTRL-C to abort:')' " @@ -1025,6 +1035,8 @@ else rm -f /mnt/data/z${PREFIX1CHAR}*.sfs 2>/dev/null rm -f /mnt/data/${DISTRO_PUPPYSFS} 2>/dev/null #100913 rm -f /mnt/data/${DISTRO_ZDRVSFS} 2>/dev/null #100913 + rm -f /mnt/data/${DISTRO_ADRVSFS} 2>/dev/null + rm -f /mnt/data/${DISTRO_YDRVSFS} 2>/dev/null #rm -f /mnt/data/${DISTRO_DEVXSFS} 2>/dev/null #100913 fi sync @@ -1106,6 +1118,10 @@ sync echo "Copying .sfs files..." cp -f $SRCPATH/${DISTRO_PUPPYSFS} /mnt/data/ 2>/dev/null sync +cp -f $SRCPATH/${DISTRO_ADRVSFS} /mnt/data/ 2>/dev/null +sync +cp -f $SRCPATH/${DISTRO_YDRVSFS} /mnt/data/ 2>/dev/null +sync cp -f $SRCPATH/${DISTRO_ZDRVSFS} /mnt/data/ 2>/dev/null sync #cp -f $SRCPATH/${DISTRO_DEVXSFS} /mnt/data/ 2>/dev/null @@ -1115,7 +1131,7 @@ echo -n "'$(gettext 'Finished, press ENTER key to continue:')' " read moo ' > /tmp/installpup.sh chmod 755 /tmp/installpup.sh - rxvt -bg "orange" -title "$(gettext 'Puppy Universal Installer')" -geometry 80x10 -e /tmp/installpup.sh $DESTPART $SRCPATH $FINALPMEDIA $DESTFS $DISTRO_FILE_PREFIX $DISTRO_PUPPYSFS $DISTRO_ZDRVSFS #$DISTRO_DEVXSFS + rxvt -bg "orange" -title "$(gettext 'Puppy Universal Installer')" -geometry 80x10 -e /tmp/installpup.sh $DESTPART $SRCPATH $FINALPMEDIA $DESTFS $DISTRO_FILE_PREFIX $DISTRO_PUPPYSFS $DISTRO_ADRVSFS $DISTRO_YDRVSFS $DISTRO_ZDRVSFS #$DISTRO_DEVXSFS ;; *) pupmessage -bg '#FF8080' "`eval_gettext \"Your \\\$DESTPART has a \\\$DESTFS filesystem. Currently only install @@ -1158,7 +1174,7 @@ $PREVPUPMSG $(gettext 'There are two ways to install Puppy to the partition:') $(gettext '1. FRUGAL (recommended)') -`eval_gettext \"Copies the files vmlinuz, initrd.gz, \\\${DISTRO_PUPPYSFS} and \\\${DISTRO_ZDRVSFS} to the\"` +`eval_gettext \"Copies the files vmlinuz, initrd.gz, \\\${DISTRO_PUPPYSFS}, \\\${DISTRO_ADRVSFS}, \\\${DISTRO_YDRVSFS} and \\\${DISTRO_ZDRVSFS} to the\"` `eval_gettext \"partition, saving your personal settings inside a \\\${DISTRO_FILE_PREFIX}save file (like when\"` $(gettext 'running from CD) and leaving the previous contents of the partition') $(gettext 'untouched. PROS:') @@ -1249,6 +1265,10 @@ $(gettext 'Enter a unique name for the folder. Note, Puppy will search 2-deep, s sync cp -f ${SRCPATH}/${DISTRO_PUPPYSFS} $DESTMNTPT/$NEWPSUBDIR/ #v424 sync + [ -f $SRCPATH/${DISTRO_ADRVSFS} ] && cp -f $SRCPATH/${DISTRO_ADRVSFS} $DESTMNTPT/$NEWPSUBDIR/ + sync + [ -f $SRCPATH/${DISTRO_YDRVSFS} ] && cp -f $SRCPATH/${DISTRO_YDRVSFS} $DESTMNTPT/$NEWPSUBDIR/ + sync [ -f $SRCPATH/${DISTRO_ZDRVSFS} ] && cp -f $SRCPATH/${DISTRO_ZDRVSFS} $DESTMNTPT/$NEWPSUBDIR/ sync sync @@ -1377,6 +1397,28 @@ ${grubEXTRAMSG}" 0 0 #v2.12 external modules file... #w482 fix handling if separate zdrv file... + [ -f $SRCPATH/${DISTRO_ADRVSFS} ] && cp -af $SRCPATH/${DISTRO_ADRVSFS} $DESTMNTPT/ + [ -f /${DISTRO_ADRVSFS} ] && cp -af /${DISTRO_ADRVSFS} $DESTMNTPT/ + if [ -f $DESTMNTPT/${DISTRO_ADRVSFS} ];then #w482 + mkdir -p $DESTMNTPT/data + mount -t squashfs -o loop $DESTMNTPT/${DISTRO_ADRVSFS} $DESTMNTPT/data + cp -a -f --remove-destination $DESTMNTPT/data/* $DESTMNTPT/ + depmod -b $DESTMNTPT + sync + umount $DESTMNTPT/data + rm -f $DESTMNTPT/${DISTRO_ADRVSFS} + fi + [ -f $SRCPATH/${DISTRO_YDRVSFS} ] && cp -af $SRCPATH/${DISTRO_YDRVSFS} $DESTMNTPT/ + [ -f /${DISTRO_YDRVSFS} ] && cp -af /${DISTRO_YDRVSFS} $DESTMNTPT/ + if [ -f $DESTMNTPT/${DISTRO_YDRVSFS} ];then #w482 + mkdir -p $DESTMNTPT/data + mount -t squashfs -o loop $DESTMNTPT/${DISTRO_YDRVSFS} $DESTMNTPT/data + cp -a -f --remove-destination $DESTMNTPT/data/* $DESTMNTPT/ + depmod -b $DESTMNTPT + sync + umount $DESTMNTPT/data + rm -f $DESTMNTPT/${DISTRO_YDRVSFS} + fi [ -f $SRCPATH/${DISTRO_ZDRVSFS} ] && cp -af $SRCPATH/${DISTRO_ZDRVSFS} $DESTMNTPT/ [ -f /${DISTRO_ZDRVSFS} ] && cp -af /${DISTRO_ZDRVSFS} $DESTMNTPT/ if [ -f $DESTMNTPT/${DISTRO_ZDRVSFS} ];then #w482