diff -ur initrd.gz.1/sbin/init initrd.gz.2/sbin/init
--- initrd.gz.1/sbin/init 2007-07-19 11:02:59.000000000 +0200
+++ initrd.gz.2/sbin/init 2007-08-07 20:11:40.000000000 +0200
@@ -9,6 +9,9 @@
KERNVER="`uname -r`"
NTFSDEV=""
+echo "QPM=$QPM"
+sleep 1
+
#Boot param PMEDIA= usbflash|usbhd|usbcd|ideflash|idehd|idecd|idezip|satahd|scsihd|scsicd
# ...good, as will know exactly what drivers to load and where to look.
#v2.15 allow 'PMEDIA=cd' a subset, could be ide, sata, usb or scsi cd drive.
@@ -1065,6 +1068,7 @@
#note: aes and cryptoloop modules may be loaded in loadpupsavefunc.
###########################################################
+if [ "$QPM" ]; then # QEMU-Puppy-on-Metal mode
#locate all partitions...
PCPARTSALL="`probepart_init -k 2> /dev/null`"
@@ -1197,6 +1201,8 @@
esac
#...exit with PDEV1= boot device name.
+fi # QPM
+
#total ram, less any shared video...
PCRAMSIZE=`free | head -n 2 | tail -n 1 | tr -s " " | cut -f 3 -d " "`
SIZEFILLK=`expr $PCRAMSIZE \/ 2` #half of ram.
@@ -1246,6 +1252,8 @@
SAVEFILE="`echo -n "$PUPSAVE" | cut -f 3 -d ','`"
fi
+if [ "$QPM" ]; then # QEMU-Puppy-on-Metal mode
+
#decide on an appropriate PUPMODE...
PUPMODE=1 #using tmpfs.
[ "$DEV1PUP" = "yes" ] && PUPMODE=`expr $PUPMODE + 2` #PDEV1 has full h.d. puppy installation.
@@ -1868,6 +1876,55 @@
echo "SATADRIVES='$SATADRIVES'" >> /pup_rw/etc/rc.d/PUPSTATE
fi
+else # QPM
+
+PCRAMSIZE=`free | head -n 2 | tail -n 1 | tr -s " " | cut -f 3 -d " "`
+SIZEFILLK=`expr $PCRAMSIZE \/ 2` #half of ram.
+
+PUPMODE=13
+PDEV1=
+FSTYPE=
+PUPSFS=
+PUPSAVE=
+PMEDIA=
+SATADRIVES=
+
+echo -n "Mounting /dev/hda..." >/dev/console
+mount -t ext3 -o noatime,rw /dev/hda /pup_ro1
+check_status $?
+echo -n "Mounting /dev/hdb..." >/dev/console
+mount -r -t squashfs -o noatime /dev/hdb /pup_ro2
+check_status $?
+echo -n "Mounting /dev/hdc..." >/dev/console
+mount -r -t squashfs -o noatime /dev/hdc /pup_ro3
+check_status $?
+echo -n "Mounting /dev/hdd..." >/dev/console
+mount -r -t squashfs -o noatime /dev/hdd /pup_ro4
+check_status $?
+echo -n "Mounting tmpfs..." >/dev/console
+mount -t tmpfs -o size=${SIZEFILLK}k tmpfs /pup_rw
+check_status $?
+
+sync
+echo -n "Creating unionfs..." >/dev/console
+zcat /modules/${KERNVER}/unionfs.ko.gz | insmod -
+mount -t unionfs -o dirs=/pup_rw=rw:/pup_ro1=ro:/pup_ro2=ro:/pup_ro3=ro:/pup_ro4=ro none /pup_new
+check_status $?
+
+mkdir -p /pup_rw/etc/rc.d
+mkdir /pup_rw/initrd 2>/dev/null
+
+echo "QPM=$QPM" > /pup_rw/etc/rc.d/PUPSTATE
+echo "PUPMODE=$PUPMODE" >> /pup_rw/etc/rc.d/PUPSTATE
+echo "PDEV1='$PDEV1'" >> /pup_rw/etc/rc.d/PUPSTATE
+echo "DEV1FS='$FSTYPE'" >> /pup_rw/etc/rc.d/PUPSTATE
+echo "PUPSFS='$PUPSFS'" >> /pup_rw/etc/rc.d/PUPSTATE
+echo "PUPSAVE='$PUPSAVE'" >> /pup_rw/etc/rc.d/PUPSTATE
+echo "PMEDIA='$PMEDIA'" >> /pup_rw/etc/rc.d/PUPSTATE
+echo "SATADRIVES='$SATADRIVES'" >> /pup_rw/etc/rc.d/PUPSTATE
+
+fi # QPM
+
#want to launch dnotify from init script as it is pristine...
#/sbin/launchpupsafe &