Boot 4.3 from EXT4?

Using applications, configuring, problems
Message
Author
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

pupsave.4fs

#16 Post by gyro »

Jim1911 wrote:The next problem to overcome is to be able to use pupsave.4fs save files on ext4 partitions.
The file system inside the pupsave file is not related to the file system the pupsave file resides in. (e.g. a pupsave.2fs file stored in an NTFS partition has an ext2 file system inside it.)

Most flexible if "init" implements the following naming scheme:
pupsave.2fs -> ext2
pupsave.3fs -> ext3
pupsave.4fs -> ext4

gyro

User avatar
piratesmack
Posts: 100
Joined: Wed 16 Sep 2009, 14:22

#17 Post by piratesmack »

Well, I modified the puppy init script to also check for a pupsave.4fs. (but haven't tested it yet) Just need someone's rc.shutdown so I can modify it to create 4fs save file

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

#18 Post by Jim1911 »

tulindo's modified rc.shutdown is attached to his post on page 1.

User avatar
piratesmack
Posts: 100
Joined: Wed 16 Sep 2009, 14:22

#19 Post by piratesmack »

lol, thanks :oops:

User avatar
piratesmack
Posts: 100
Joined: Wed 16 Sep 2009, 14:22

#20 Post by piratesmack »

Here it is

I just added a simple dialog menu that lets you select what filesystem you want to use for the save file.

Code: Select all

FILESYSTEM=`dialog \
--stdout \
--no-cancel \
--no-collapse \
--menu "Select a filesystem for your pupsave file" 0 0 0 \
ext2 "Second extended filesystem" \
ext3 "Third extended filesystem" \
ext4 "Fourth extended filesystem"`

....

JOPT=''
[ "$FILESYSTEM" = "ext3" ] && JOPT='-j'
[ "$FILESYSTEM" = "ext4" ] && JOPT='-t ext4'

mke2fs $JOPT blah blah blah
The save file will still be called pupsave.2fs, but will be formatted as whatever filesystem you choose. I tried to make it 2fs for ext2, 3fs for ext3, and 4fs for ext4, but that was too much work :P

I haven't gotten to test it yet, so let me know if it works.
Attachments
rc.zip
/etc/rc.d/rc.shutdown
(13.08 KiB) Downloaded 357 times

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#21 Post by gyro »

piratesmack wrote:The save file will still be called pupsave.2fs, but will be formatted as whatever filesystem you choose.
Sorry, but this is not enough.
I haven't tested your stuff, but I have edited the "init" script in "initrd.gz", including the one for Puppy 4.3. And the bad news is that the lines for mounting the "pupsave" file have "-t ext2" hard coded into them.

The current patches for "init" add ext4 to the list of filesystems that Puppy accepts as the container of the pupsave file, but do not change the type of filesystem that gets mounted inside the pupsave file. It is still hardcoded to ext2.

So, even if your patch to "rc.shutdown" works, check to see if the resultant pupsave file actually gets mounted by "init" as anything other than ext2.

gyro

User avatar
piratesmack
Posts: 100
Joined: Wed 16 Sep 2009, 14:22

#22 Post by piratesmack »

gyro wrote:
piratesmack wrote:The save file will still be called pupsave.2fs, but will be formatted as whatever filesystem you choose.
Sorry, but this is not enough.
I haven't tested your stuff, but I have edited the "init" script in "initrd.gz", including the one for Puppy 4.3. And the bad news is that the lines for mounting the "pupsave" file have "-t ext2" hard coded into them.

The current patches for "init" add ext4 to the list of filesystems that Puppy accepts as the container of the pupsave file, but do not change the type of filesystem that gets mounted inside the pupsave file. It is still hardcoded to ext2.

So, even if your patch to "rc.shutdown" works, check to see if the resultant pupsave file actually gets mounted by "init" as anything other than ext2.

gyro
Thanks, I'll see if I can fix the init script

User avatar
piratesmack
Posts: 100
Joined: Wed 16 Sep 2009, 14:22

#23 Post by piratesmack »

OK, here's my modified init script. sorry, I kinda rushed it.

I just added

Code: Select all

[ $psavefs ] && PSAVEFS=$psavefs 

MNTOPTS='-t ext2'
[ $PSAVEFS = "ext3" ] && MNTOPTS='-t ext3' 
[ $PSAVEFS = "ext4" ] && MNTOPTS='-t ext4'
And replaced all the "-t ext2" with "$MNTOPTS"

You'll have to add "psavefs=ext4" as a boot parameter.

Example grub config:

Code: Select all

title Puppy
root (hd0,0)
kernel /boot/vmlinuz psavefs=ext4
initrd=/boot/initrd.gz
Again, this is not tested so I have no idea if it works.
I don't have access to a puppy linux machine and probably won't for a while.
Attachments
init.zip
init script, replace the one in initrd.gz
(19.18 KiB) Downloaded 345 times

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

#24 Post by Jim1911 »

Barry wrote: Boot and save ext4 partition fixed
Thanks to help from forum members piratesmack and tulindo, this is now fixed. Forum thread where they posted:

http://murga-linux.com/puppy/viewtopic.php?t=46902

Thanks very much guys. I'm very pleased when you guys get stuck in and find the solution to a problem. It sure does make things easier for me.

Note to tulindo: there are two places in rc.shutdown where "ext4" has to be inserted.

These fixes will of course be in the upcoming 431.
Congratulations guys, Well done,
Jim

User avatar
piratesmack
Posts: 100
Joined: Wed 16 Sep 2009, 14:22

#25 Post by piratesmack »

Awesome

EDIT:
I see a couple of people have downloaded the rc.shutdown and init scripts I posted. Are they working?

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#26 Post by gyro »

piratesmack wrote:OK, here's my modified init script. sorry, I kinda rushed it.
I guess I didn't make myself clear, I didn't mean to imply that the "mount" commands are the only place in "init" that requires changing. I should have said that at least the "mount" commands means that you have to fix "init", not just "rc.shutdown".

With my limited experience in changing "init" to work with either "ext2" or "ext3" pup_save files, I am aware of at least 3 places in "init" that require attention:
1) The "mount" commands.
2) When it searches for the puppy files.
3) In the routine that does the "fsck."
There may, be more. I would suggest that you check all of the "init" code that touches pupsave files.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

FYI

#27 Post by gyro »

I have attached an edited version of the "init" script from "initrd.gz" from pup-430.
It's been edited to fix all the places I can find where ext2 was specified.
The edits are marked by "#gyro" so they can easily be found.
This has not been tested.

gyro
Attachments
init_patched_pupsave_ext234.tar.gz
init script patched to support ext2 ext3 and ext4 pupsave files
(19.58 KiB) Downloaded 330 times

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

#28 Post by Jim1911 »

gyro,

Thanks for continuing to work on this feature. I've downloaded your file, but don't really know what to do with it.

I posted a link to this topic on technosaurus's topic concerning what he should work on for the new CE http://www.murga-linux.com/puppy/viewto ... rt=75http: Hope that your excellent work will show up in the new CE as it did in Barry's 431.

I asked him to consider adding code to the shutdown dialogue that would detect the type partition (ext2, ext3, ext4) that the frugal installation is on and create a corresponding pupsave.2fs, 3fs, or 4fs. Alternatively, let the user make a choice of pupsave files on the first shutdown.

The pupsave should also identify itself as 2fs, 3fs or 4fs.

Thanks,
Jim

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#29 Post by gyro »

Jim1911 wrote:I've downloaded your file, but don't really know what to do with it.
Just click on the .tar.gz file to open it with "PupZip". You can then extract the file called "init_pupsave_234fs". This file is an edited version of the "init" script from within initrd.gz of pup-430.iso.

The short answer is that my attachment is aimed at those who are modifying the "init" script with a view to inclusion of this facility into the initrd.gz of the next release.

The long answer follows:

To install the file, you would need to:
Rename "init_pupsave_234fs" to "init"
Unpack initrd.gz
Replace the current "init" within initrd.gz with the new "init"
repack initrd.gz.
Replace your current initrd.gz with the new intird.gz.
Reboot.

Otherwise you could review my changes by editing "init_pupsave_234fs", and searching for "gyro". And make similar changes to the "init" script in your current initrd.gz.

Or you could generate a "patch" by running a diff of "init_pupsave_234fs" and the released "init" script in the initrd.gz of the pup-430.iso.

gyro

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

#30 Post by Jim1911 »

gyro,
Thanks, I'll wait and hope that it gets in the updates.
Jim

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

replacement "initrd.gz" file for puppy-4.3.1-rc2

#31 Post by gyro »

I've looked at the "init" script in puppy-4.3.1-rc2 and while it supports storing pupsave.2fs in an ext4 partition, it does not seem to support storing the pupsave file as an ext4 filesystem.

I have generated a replacement "initrd.gz" file for puppy-4.3.1-rc2, that includes an "init" script which will mount pupsave.2fs as ext2, pupsave.3fs as ext3, and pupsave.4fs as ext4.
(I have tested using pupsave.2fs (ext2) and pupsave.3fs (ext3), and they both work fine. I have not tested ext4.)

To use this file:
1) In the directory that contains the file pup-431.sfs for puppy-4.3.1-rc2, rename the file initrd.gz to initrd.gz.bak
2) Download the attached initrd.gz and place it in that directory
3) Reboot into puppy-4.3.1-rc2.

Note1: It's probably best to do this while booted into something other than puppy-4.3.1-rc2.
Note2: You can use tune2fs to convert an ext2 filesystem into an ext3 filesystem.

I don't know how to convert an ext2 filesystem into an ext4 filesystem.

gyro

Post Reply