Empty save file causes kernel panic (Solved)
Empty save file causes kernel panic (Solved)
Hello!
I want to make a usb stick for somebody pre-loaded with Puppy, but the person is a little dense, so I don't want him to have to make his own save file. So I created an empty one with this command:
dd if=/dev/zero of=puppy_save.4fs bs=1M count=1024
yes y | mkfs.ext4 puppy_save.4fs
sync
But when the usb stick boots, it gives "kernel panic".
I want to make a usb stick for somebody pre-loaded with Puppy, but the person is a little dense, so I don't want him to have to make his own save file. So I created an empty one with this command:
dd if=/dev/zero of=puppy_save.4fs bs=1M count=1024
yes y | mkfs.ext4 puppy_save.4fs
sync
But when the usb stick boots, it gives "kernel panic".
Last edited by Ghost Dog on Mon 12 Aug 2013, 06:28, edited 3 times in total.
The Way of the Samurai
When I make a regular save file on the stick the usual way at first shutdown, on the usb stick, it works like it's supposed to. Puppy finds it and merges the filesystem.
But when I make it fresh using the commands in the previous post, it doesn't work for some reason.
But when I make it fresh using the commands in the previous post, it doesn't work for some reason.
Last edited by Ghost Dog on Sun 11 Aug 2013, 05:58, edited 1 time in total.
The Way of the Samurai
The PUPPY_VERSION_SAVE file name is hardcoded in the initrd.gz .
A Wary would not offer to load a slackosave-DATE.4fs at boot for example, only warysave*.4fs .
Probably name it -NAMESTRING with dash . The dash might be used as a delimiter in the /init code .
It might have been different with Puppy-4 series, though, that seem to be named pupsave-STRING.2fs anyways .
lupusave-STRING.3fs naming came with Puppy-5 series me thinks .
puppy_VERSION-STRING.3fs is also "newer" .
A Wary would not offer to load a slackosave-DATE.4fs at boot for example, only warysave*.4fs .
Probably name it -NAMESTRING with dash . The dash might be used as a delimiter in the /init code .
It might have been different with Puppy-4 series, though, that seem to be named pupsave-STRING.2fs anyways .
lupusave-STRING.3fs naming came with Puppy-5 series me thinks .
puppy_VERSION-STRING.3fs is also "newer" .
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P
Code: Select all
yes y | mkfs.ext4 puppy_save.4fs
Never seen such .
Code: Select all
mkfs.ext4 puppy_save.4fs
Also
Code: Select all
fsck puppy_save.4fs
Hi Karl,
Sorry, I was naming the folder the same as PupSaveConfig did it. Creating a save file with the appropriate name in the root directory results in it being found at boot. But now I get a kernel panic.
I have tried creating the file in two ways. One is using the code Dejan55 originally used in his script, later used by RSH and ANSI Education in theirs:
And using code adapted from rc.shutdown:
Both result in the kernel panic error. Why does a savefile created in the normal way at shutdown get found and work great, but ones created manually don't work?
Sorry, I was naming the folder the same as PupSaveConfig did it. Creating a save file with the appropriate name in the root directory results in it being found at boot. But now I get a kernel panic.
I have tried creating the file in two ways. One is using the code Dejan55 originally used in his script, later used by RSH and ANSI Education in theirs:
Code: Select all
dd if=/dev/zero of=slackosave.4fs bs=1M count=1024
yes y | mkfs.ext4 slackosave.4fs
sync
Code: Select all
dd if=/dev/zero of=slackosave.4fs bs=1k count=1024000
yes y | mkfs.ext4 -q -m 0 -F slackosave.4fs
The Way of the Samurai
yes y | mkfs.whateverfs whaterveroptions whatever.file is not the Puppy way .
Current it should be
no yes y anywhere .. need to get fresh air to stop rolling on the floor laughing ..
Will have to play with
yes y PIPE OR mkfs* * *
yes itself is a good hand warmer on a laptop , good for arctic conditions .
Probably yes y makes mkfs write Y into it instead of ZEROS ..
The page Semme liks to by MHHP says that some files are needed in the new savefile .
To make sure I would
-BASICALLY mount the savefile and copy the content from /initrd/pup_rw/* into it , remove everything below /root/ therein and create the main folder structure on top rootfs inside it ( /var, /sys, etcetc ) .
Current it should be
Code: Select all
dd if=/dev/zero of=${SMNTPT}$SAVEFILE bs=1k count=$SIZEPFILE
sync
pupkill $w1PID
echo "`eval_gettext \"Creating a \\\${SFFS} filesystem in \\\${NAMEONLY}...\"`" >/dev/console
if [ "$CRYPTO" = "" ];then
case $SFFS in
ext2) mkfs.ext2 -q -m 0 -F ${SMNTPT}$SAVEFILE ;;
ext3) mkfs.ext3 -q -m 0 -F ${SMNTPT}$SAVEFILE ;;
ext4) mkfs.ext4 -q -m 0 -F ${SMNTPT}$SAVEFILE ;;
esac
Will have to play with
yes y PIPE OR mkfs* * *
yes itself is a good hand warmer on a laptop , good for arctic conditions .
Probably yes y makes mkfs write Y into it instead of ZEROS ..
The page Semme liks to by MHHP says that some files are needed in the new savefile .
To make sure I would
Code: Select all
mkdir /mnt/savefile
mount -o loop savefile.4fs /mnt/savefile
[ "$?" = 0 ] || exit
cp -a /initrd/pup_rw/* /mnt/savefile/
rm -rf /mnt/savefile/ /root/*
mkdir -p /mnt/savefile/proc
mkdir -p /mnt/savefile/sys
mkdir -p /mnt/savefile/mnt
mkdir -p /mnt/savefile/tmp
chmod 1777 /mnt/savefile/tmp
mkdir -p /mnt/savefile/var
I should have mentioned that I tried both Dejan555 and Barry's approaches without using the "yes" part that you find so amusing, ie:
The reason I used that was because it is in the script that Dejan555, RSH, and ANSI Education made, with help from Bruce B.
So it needs files, huh? I thought it was supposed to be an empty savefile. I'm going to try what you suggested later today.
Thanks!
Code: Select all
mkfs.ext4 slackosave.4fs
sync
Code: Select all
mkfs.ext4 -q -m 0 -F slackosave.4fs
So it needs files, huh? I thought it was supposed to be an empty savefile. I'm going to try what you suggested later today.
Thanks!
Last edited by Ghost Dog on Sun 11 Aug 2013, 21:53, edited 1 time in total.
The Way of the Samurai
I should have been more careful, and checked those commands you posted before running them.
should have been
So much for all those important files I had in my root directory...
Code: Select all
rm -rf /mnt/slackosave/ /root/*
Code: Select all
rm -rf /mnt/slackosave/root/*
Last edited by Ghost Dog on Sun 11 Aug 2013, 23:43, edited 1 time in total.
The Way of the Samurai
Yo I'm back.
Ok, so I created all of the folders you mentioned except for /initrd/pup_rw, because I want to create an empty file not one with all the modules and stuff, plus I'm on a full installation which doesn't seem to have /initrd/pup_rw.
These are the commands I issued from a terminal opened in the usb stick folder:
If you click the .4fs file after, it shows the newly-created directories. So the resulting file must be good. However, it causes a kernel panic at boot.
Ok, so I created all of the folders you mentioned except for /initrd/pup_rw, because I want to create an empty file not one with all the modules and stuff, plus I'm on a full installation which doesn't seem to have /initrd/pup_rw.
These are the commands I issued from a terminal opened in the usb stick folder:
Code: Select all
dd if=/dev/zero of=slackosave.4fs bs=1k count=1024000
mkfs.ext4 -q -m 0 -F slackosave.4fs #mkfs.ext4 slackosave.4fs
mkdir /mnt/slackosave
mount -o loop slackosave.4fs /mnt/slackosave
mkdir -p /mnt/slackosave/proc
mkdir -p /mnt/slackosave/sys
mkdir -p /mnt/slackosave/mnt
mkdir -p /mnt/slackosave/lib/modules
mkdir -p /mnt/slackosave/tmp
chmod 1777 /mnt/slackosave/tmp
mkdir -p /mnt/slackosave/var
umount /mnt/slackosave && rm -rf /mnt/slackosave
Last edited by Ghost Dog on Mon 12 Aug 2013, 04:32, edited 1 time in total.
The Way of the Samurai
Ok , FULL installation explains it .
Basically MHHP mentions the file
/etc/rc.d/BOOTCONFIG
That looks different in frugal and full installation mode .
In full installation it is an empty file, since it gets written by the initrd.gz/init .
Such a file could look like
( just copied it outside a mounted pupsave file - am running full also )
The PUPMODE changes from 5(RAM) to 12(intHD) or 13(extHD) when a savefile gets loaded .
The initrd.gz/init should check VARIABLES for contend it seems
and if $PREVUNIONRECORD =""
default back to PUPMODE 5 or set some default VARIABLES .
It is a kind of a rare corner case bug .
Basically MHHP mentions the file
/etc/rc.d/BOOTCONFIG
That looks different in frugal and full installation mode .
In full installation it is an empty file, since it gets written by the initrd.gz/init .
Such a file could look like
Code: Select all
PREVUNIONRECORD='pupsave-2013_07_12.2fs pup-430.sfs zp430305.sfs'
LASTUNIONRECORD='pupsave-2013_07_12.2fs pup-430.sfs zp430305.sfs'
The PUPMODE changes from 5(RAM) to 12(intHD) or 13(extHD) when a savefile gets loaded .
The initrd.gz/init should check VARIABLES for contend it seems
and if $PREVUNIONRECORD =""
default back to PUPMODE 5 or set some default VARIABLES .
It is a kind of a rare corner case bug .
noob asks:
i'd like to manually create a pupsave file. i'm trying to simplify the script posted above by karl godt:
i've read through the mke2fs manual, but still a noob.
in any case, i want to hardcode everything (such as filename, size, mount-point, and format), rather than using variables/arguments as in karl's version. here's my version so far, but needless to say it's not working
first, manually create a folder in /mnt called "mytest". Then:
feel free to laugh
plz assist after ROFL.
thx!
i'd like to manually create a pupsave file. i'm trying to simplify the script posted above by karl godt:
Code: Select all
dd if=/dev/zero of=${SMNTPT}$SAVEFILE bs=1k count=$SIZEPFILE
sync
pupkill $w1PID
echo "`eval_gettext \"Creating a \\\${SFFS} filesystem in \\\${NAMEONLY}...\"`" >/dev/console
if [ "$CRYPTO" = "" ];then
case $SFFS in
ext2) mkfs.ext2 -q -m 0 -F ${SMNTPT}$SAVEFILE ;;
ext3) mkfs.ext3 -q -m 0 -F ${SMNTPT}$SAVEFILE ;;
ext4) mkfs.ext4 -q -m 0 -F ${SMNTPT}$SAVEFILE ;;
esac
in any case, i want to hardcode everything (such as filename, size, mount-point, and format), rather than using variables/arguments as in karl's version. here's my version so far, but needless to say it's not working
first, manually create a folder in /mnt called "mytest". Then:
Code: Select all
# dd if=/mnt/mytest bs=1k count=100000
dd: reading `/mnt/mytest': Is a directory
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000167725 s, 0.0 kB/s
# sync
# mkfs -t ext4 /mnt/mytest
mke2fs 1.41.14 (22-Dec-2010)
/mnt/mytest is not a block special device.
Proceed anyway? (y,n) y
mkfs.ext4: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.
plz assist after ROFL.
thx!
[b]Now[/b]: X-Tahr 2.0! StretchDog! DevuanDog!
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]
appreciate the reply, mikeb. questions in red...
so, we're copying a megabyte of zero's, 1 kilobit at a time, from a non-existent dir into our mountpoint. Correct?
if /dev/zero does not exist, could we use anything. Like, /dev/banana or /mnt/dogpoo?
why 'force'? i understand what it does, but why needed here?
i'm guessing we need 'sync' to apply the writes to disk, since puppy runs in RAM, so the changes might not have gotten written to disk yet. Correct?
Tho they will eventually get written, even without sync. Correct?
Question, where does the .4fs file come from?
i find a get a bit more detail by looking at the man page, than i get from --help. i need all the help i can get
many thx!
so, we're copying a megabyte of zero's, 1 kilobit at a time, from a non-existent dir into our mountpoint. Correct?
if /dev/zero does not exist, could we use anything. Like, /dev/banana or /mnt/dogpoo?
why 'force'? i understand what it does, but why needed here?
i'm guessing we need 'sync' to apply the writes to disk, since puppy runs in RAM, so the changes might not have gotten written to disk yet. Correct?
Tho they will eventually get written, even without sync. Correct?
Question, where does the .4fs file come from?
i find a get a bit more detail by looking at the man page, than i get from --help. i need all the help i can get
many thx!
[b]Now[/b]: X-Tahr 2.0! StretchDog! DevuanDog!
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]
in no particular order
-t ext4 sets the resultant file system... you add the .4fs...its just a name and pretty meaningless except in puppy.
Force means it won't ask you to force...better for scripts...you are formatting an image file not a real partition so seen as an odd request.
/dev/zero is a kernel special file/device that supplies dummy null data... not tried it but I believe its important to use that rather than bananas.
sync..unlikely you need it unless you type really fast...meant for scripts really.
yes is a copy of dummy data in the required quantity...the 1kb sort of gives a block size...not sure how relevant it is to formatting...more of a convenient figure.
hope that helps
mike
-t ext4 sets the resultant file system... you add the .4fs...its just a name and pretty meaningless except in puppy.
Force means it won't ask you to force...better for scripts...you are formatting an image file not a real partition so seen as an odd request.
/dev/zero is a kernel special file/device that supplies dummy null data... not tried it but I believe its important to use that rather than bananas.
sync..unlikely you need it unless you type really fast...meant for scripts really.
yes is a copy of dummy data in the required quantity...the 1kb sort of gives a block size...not sure how relevant it is to formatting...more of a convenient figure.
hope that helps
mike
Thx again, Mikeb!
But I don't understand how the .4fs file gets created. That code fills a mount point with zeros. Ok. But what's the code that creates the 4fs file?
Thx!
But I don't understand how the .4fs file gets created. That code fills a mount point with zeros. Ok. But what's the code that creates the 4fs file?
Thx!
[b]Now[/b]: X-Tahr 2.0! StretchDog! DevuanDog!
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]
i'm sure you were clear, and i'm just dense.mikeb wrote:mkfs -t ext4 /mnt/mytest
so that command will create a 4fs file called mytest.4fs? Where will the file be located?
i'm confused, because i'm only seeing a mountpoint in this command.
thx!
[b]Now[/b]: X-Tahr 2.0! StretchDog! DevuanDog!
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]
[b]Tops[/b]: TarhNOP Vlina-R2 Racy
[b]Used[/b]: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
[i]i ♥ Puppy[/i]