SFS loading bugfix, continued

I was going to post this as a comment to the previous post, but it's too long.

For the record, the bug in 'init' was a dumb little thing. The path was wrong. In the code below, the 'find' line removes the leading '.' in the path. The current directory had previously been set to $OLFILESMNTPT, which is /pup_rw (or in the case of PUPMODE=13 it is /pup_ro2) which is the save-file. The fix is I needed to put ${OLDFILESMNTPT} in front of ${ONEOPAQUE}:
 #need to cleanup whiteout files if a new .sfs layer has been added...

if [ "$NEWUNIONRECORD" != "" -o "$PPURGE" = "yes" ];then
#find all .wh.__dir_opaque files at the OLDFILESMNTPT layer...
cd $OLDFILESMNTPT
find ./ -noleaf -type f -name ".wh.*" | sed -e 's/^\.//g' |
while read ONEOPAQUE #example: /usr/src/.wh.__dir_opaque
do
ONEDIR="`dirname $ONEOPAQUE`"
WHBASE="`basename $ONEOPAQUE`"
if [ "$WHBASE" != ".wh.__dir_opaque" ];then
#example, .wh.bin alongside bin directory means it is deleted...
ONEDEL="`echo -n "$WHBASE" | sed -e 's/^\.wh\.//g'`"
BASEDIR="`basename $ONEDIR`"
[ "$BASEDIR" != "$ONEDEL" ] && continue
fi
#if same dir exists lower layer, then wipe the opaque file... v424 fix path...
[ -d /pup_ro3${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro4${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro5${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE}
[ -d /pup_ro6${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE} #v412
[ -d /pup_ro7${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE} #v424
[ -d /pup_ro8${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE} #v424
[ -d /pup_ro9${ONEDIR} ] && rm -f ${OLDFILESMNTPT}${ONEOPAQUE} #v424
done
cd /
fi


foo,
The above fix is only for directories. The problem of files "coming back" can occur for both Unionfs and Aufs. At a version upgrade, the 'init' script also checks that the "official" files are visible on top. So if you have deleted an official .desktop file, it will come back. If you have replaced an official file with another, the official one will only come back if it is a newer modify date.


Posted on 17 Aug 2009, 6:36


Comments:

Posted on 17 Aug 2009, 14:16 by Terryphi
Upgrade annoyance
I wish there was a solution for this. The most annoying thing about Puppy is the way it ignores my file changes at version upgrade.


Posted on 17 Aug 2009, 15:43 by wuxiandianzi
can you help me ? my teacher
the kernel of the 4.1.2 is 2.6.25.16.
so I want to compile the kernel to the 2.6.29.1
I have saved my pup_save.2fs file into my disk sda1 and put the devx_412.sfs together,it can runing GCC right.

frist:

I download the linux-2.6.29.1-source-patched_loglevel_unionfs.tar.gz into /usr/src folder
then
# cd /usr/src
# tar -zxf linux-2.6.29.1.tar.gz
so I got a folder of linux-2.6.29.1
then
# ln -sf linux-2.6.29.1 linux

Second:

# cd /usr/src/linux-2.6.29.1
# make clean
# make mrproper
then copy "DOTconfig-K2.6.29.1-17APR09-TICKS-UNIPROC" to the folder of /usr/src/linux-2.6.29.1 and rename as ".config"
then
# make menuconfig
I loaded the".config" and I did not change anything,then saved as .config too.
# make bzImage
it was about 40 min later. i got the bzImage in the folder /usr/src/linux-2.6.29.1/arch/i386/boot




Posted on 17 Aug 2009, 15:44 by wuxiandianzi
can you help me ? my teacher
third:

# cd /usr/src/linux-2.6.29.1
# make modules
# make modules_install
about 50 min later I found a new folder"2.6.29.1" in the /lib/modules/
it contains "kernel/ " "modules.alias" ,"modules.dep" and so on about 12 files
the I open the "pup_412.sfs" and copy all to /mnt/sda2/pup412/, I delete the folder /lib/modules/2.6.25.16
and put the folder "2.6.29.1" there!
then
# cd /mnt/sda2
# mksquashfs pup412 pup_412.sfs
5 min later. I got the pup_412.sfs

the end:

I copy initrd.gz from ISO into /mnt/sda2/initrd then
# cd /mnt/sda2/initrd
# gzip -d initrd.gz
# cpio -i -d initrd
I got alot of folders
I changed the----"modules.alias" ,"modules.dep" and so on about 12 files and the folder"kernel" in /lib/modules/2.6.25.16
then renmae 2.6.25.16 as 2.6.29.1
then
# find . | cpio -o -H newc > ../initrd.img
# cd ../
# gzip -9 initrd.img
I got initrd.gz


I copy the pup_412.sfs initrd.gz vmlinuz to make iso by tools
then I boot from cdrom
it dispy:

setting up the layered filesystem..... failed
Dumping last lines of /tmp/bootinit.log..
can not rename "2.6.29.1" ,no this folder or file..
mount: /dev/sro is write-protectd, mounting red-only....

and so on
pausing for 60 seconds


Posted on 17 Aug 2009, 15:49 by wuxiandianzi
can you help me ? my teacher
here is the picture:
http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=18272


Posted on 17 Aug 2009, 21:38 by BarryK
Compiling the kernel
You must have done something wrong, I don't know what.

It is far easier to do a full hard drive install of Puppy and use that for compiling kernels.

The live-CD requires the Unionfs 3rd-party driver to work, perhaps you left that out. And the squashfs driver. Neither of these will be needed to boot a full hd installed Puppy.



Posted on 18 Aug 2009, 11:13 by wuxiandianzi
Thankyou!
Thank you very much ! my teacher