Build script option : finit support for many squashfs files

a very small Live CD shaped to look and act like Puppy Linux.

Moderator: fredx181

Post Reply
trister
Posts: 90
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 19 times
Been thanked: 15 times

Build script option : finit support for many squashfs files

Post by trister »

Hello.
This is related to the discussion we did here : viewtopic.php?p=34970&hilit=finit#p34970

To sum it up : There is a problem if the size of the text of the squashfs filenames exceed a limit. This is kernel related.
Each time I run the build script I have to modify the initrd1.xz file to support more squashfs files.
If you use few squashfs files you won't notice it but if you work like me (having each program in different squashfs file) then you'll have this issue and it might be difficult to detect where it comes from.

What I suggest to @fredx181 : To have a check box in the build script that allows to add the modification needed to finit (inside initrd1.xz)

I'm attaching the kernel k-6.1.0-0.deb11.9-amd64 finit script original and modified to see whet is needed. Just compare the 2 files and you'll see the changes.

In my home frugal installation I usually have 105-140 squashfs files. In each PC(work/home etc) I have a different combination of squashfs files.

Attachments
finit_ORIGk-6.1.0-0.deb11.9-amd64.txt
Original
(7.53 KiB) Downloaded 26 times
finit_MOD_k-6.1.0.0_line213.txt
Modification
(7.88 KiB) Downloaded 27 times
User avatar
fredx181
Posts: 2663
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 294 times
Been thanked: 1050 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by fredx181 »

@trister
On itself I would love to implement the change you suggest, but problem is that some scripts (e.g. remaster script) depend on finding the mountpoint name "01-filesystem.squashfs" (and also the extension .squashfs anyway) (in /mnt/live/memory/images), so I don't like to break things that are now working well.
I've had a look at how to change finit in a safe way, but seems not possible.
EDIT: On second thought, it should be possible, naming all 'extra' squashfs module mountpoints e.g. 02.squashfs 03.squashfs 04.squashfs etc... but with the exception of "01-filesystem.squashfs" (that name should be preserved), but not sure if you (or me) like it that way.

To make it easier for you to modify initrd (instead of rebuilding initrd1.xz after mklive run):
When running mklive-bookworm, shortly after the debootstrap process, the initrdport-bullseye.tar.gz is downloaded and extracted in /tmp .
Then, at that point, if you go to bookworm/chroot/tmp/initrdport-bullseye/ and replace the finit script with yours it should work (much later in the build process the initrd1.xz will be created).
P.S. note that e.g. quick-remaster won't work properly with this change.

User avatar
fredx181
Posts: 2663
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 294 times
Been thanked: 1050 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by fredx181 »

@trister Couldn't let go ;) so tried some more , please test.

- finit-not-numbered: edit: updated 16-10-2023, see info: viewtopic.php?p=101138#p101138
mountpoints not numbered, e.g. firefox.squashfs, truncated names to 7 chars, with extension .squashfs and name "01-filesystem.squashfs" preserved as is (not truncated)

finit-not-numbered.txt
finit-not-numbered
(8.13 KiB) Downloaded 21 times

- finit-numbered:
mountpoints numbered, e.g. 02-firefox.squashfs, truncated names to 7 chars, with extension .squashfs and name "01-filesystem.squashfs" preserved as is (not truncated)

finit-numbered.txt
finit-numbered
(7.99 KiB) Downloaded 26 times

Compared to finit-not-numbered this has more chars in the name, if too much perhaps for your needs it can be truncated some more (e.g. 5 chars).

Both will be ok, i.e. not conflicting with any existing script AFAIK , so can make one of them as default for initrd1.xz for future builds.

edit: Probably "not-numbered" should be OK (I cannot really see the need for numbered mountpoints as the alphanumerical order stays the same as how it is now, without truncating), but you can test better I think.

User avatar
wiak
Posts: 3694
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1030 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by wiak »

fredx181 wrote: Sun Oct 15, 2023 5:58 pm

I cannot really see the need for numbered mountpoints as the alphanumerical order stays the same as how it is now, without truncating

Unless (as I do in FirstRib) want the numbering capability to arrange layering positions where you may chose to overwrite existing mounts via a higher layer overlay mount, or do numbered .squashfs addons get mounted at the filename number used?

One thing I kind of regret in FR is that I used .sfs instead of .squashfs; yes, it is shorter, but seems to me might mess with convention except that the result is a three-letter extension. Of course, using .sfs potentially made it easier to use some existing Puppy Linux sfs files, but over time that is a faded reason I feel. Also, the extension sfs is used in too many other ways. Anyway, too late now... ;-)

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
fredx181
Posts: 2663
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 294 times
Been thanked: 1050 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by fredx181 »

wiak wrote: Mon Oct 16, 2023 3:26 am
fredx181 wrote: Sun Oct 15, 2023 5:58 pm

I cannot really see the need for numbered mountpoints as the alphanumerical order stays the same as how it is now, without truncating

Unless (as I do in FirstRib) want the numbering capability to arrange layering positions where you may chose to overwrite existing mounts via a higher layer overlay mount, or do numbered .squashfs addons get mounted at the filename number used?
...

Difference with FirstRib is that the .squashfs files do not need to be numbered in the first place (in frugal install dir).
It's up to the user how to name them (numbered or not), but the alphanumerical order is important, say you have these .squashfs modules (random order):

2.squashfs
b.squashfs
01-filesystem.squashfs
a.squashfs

Sorted will be (numbered comes first):

Code: Select all

ls | grep .squashfs | sort
01-filesystem.squashfs
2.squashfs
a.squashfs
b.squashfs

Then higher in alphanumerical order (e.g. b.squashfs) has priority over the others (overwriting files).
Then the overlay stack would be like this:
lowerdir=/memory/images/b.squashfs:/memory/images/a.squashfs:/memory/images/2.squashfs:/memory/images/01-filesystem.squashfs

User avatar
wiak
Posts: 3694
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1030 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by wiak »

fredx181 wrote: Mon Oct 16, 2023 7:50 am

Difference with FirstRib is that the .squashfs files do not need to be numbered in the first place (in frugal install dir).
It's up to the user how to name them (numbered or not), but the alphanumerical order is important, say you have these .squashfs modules (random order):
...
Sorted will be (numbered comes first):

Oh I see.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
fredx181
Posts: 2663
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 294 times
Been thanked: 1050 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by fredx181 »

Updated finit-not-numbered :
Re-Attached here: viewtopic.php?p=101079#p101079

Now it will avoid duplicate names (which can happen because of truncating).
Say for example you have:
myprogram-a.squashfs
myprogram-b.squashfs
myprogram-c.squashfs

Then names truncated to 7 chars they all would become myprogr.squashfs.
To avoid that, these will be numbered, so will load in the correct order, see pic.

Screenshot2.png
Screenshot2.png (78.6 KiB) Viewed 701 times
User avatar
rockedge
Site Admin
Posts: 5857
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2102 times
Been thanked: 2196 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by rockedge »

Of course, using .sfs potentially made it easier to use some existing Puppy Linux sfs files, but over time that is a faded reason I feel.

I prefer .sfs over .squashfs but I don't know why the initrd couldn't use either or. Somehow my feeling is .squashfs is too long for the extension.

I still use Puppy Linux SFS's in KL's because there are a lot of them around Cyberspace to mess with to get quick results in experimentation

User avatar
fredx181
Posts: 2663
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 294 times
Been thanked: 1050 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by fredx181 »

.sfs is easier to remember than .sqaushfs (or is it squashsf, no, sqashfs then, no... squahsfs, ok then squashfs :D )

trister
Posts: 90
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 19 times
Been thanked: 15 times

Re: Build script option : finit support for many squashfs files

Post by trister »

fredx181 wrote: Sun Oct 15, 2023 5:58 pm

@trister Couldn't let go ;) so tried some more , please test.

- finit-not-numbered: edit: updated 16-10-2023, see info: viewtopic.php?p=101138#p101138
mountpoints not numbered, e.g. firefox.squashfs, truncated names to 7 chars, with extension .squashfs and name "01-filesystem.squashfs" preserved as is (not truncated)
finit-not-numbered.txt

- finit-numbered:
mountpoints numbered, e.g. 02-firefox.squashfs, truncated names to 7 chars, with extension .squashfs and name "01-filesystem.squashfs" preserved as is (not truncated)
finit-numbered.txt
Compared to finit-not-numbered this has more chars in the name, if too much perhaps for your needs it can be truncated some more (e.g. 5 chars).

Both will be ok, i.e. not conflicting with any existing script AFAIK , so can make one of them as default for initrd1.xz for future builds.

edit: Probably "not-numbered" should be OK (I cannot really see the need for numbered mountpoints as the alphanumerical order stays the same as how it is now, without truncating), but you can test better I think.

Thanks fred

I've added the 01-filesystem.squashfs exception in my initrd .
After loading my "/mnt/live/memory/images/" folder in one of my frugal installations looks like this :

I didn't notice any difference in behavior cause of the old-truncated 01-filessystem.squashfs.

User avatar
fredx181
Posts: 2663
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 294 times
Been thanked: 1050 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by fredx181 »

trister wrote:

I didn't notice any difference in behavior cause of the old-truncated 01-filessystem.squashfs.

Probably it would be noticeable only if you'd use script e.g. remaster as it depends on some things.
I'd be happy to change the default code in the initrd but the mounted module names all need to have .squashfs extension, not as you showed now without it (as I pointed to in choice for finit-numbered or finit-not-numbered, squashfs extension required), else it could break the remaster script and possibly more (I don't want to take the risk of things happening unexpected).

trister
Posts: 90
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 19 times
Been thanked: 15 times

Re: Build script option : finit support for many squashfs files

Post by trister »

fredx181 wrote: Wed Oct 25, 2023 5:11 pm
trister wrote:

I didn't notice any difference in behavior cause of the old-truncated 01-filessystem.squashfs.

Probably it would be noticeable only if you'd use script e.g. remaster as it depends on some things.
I'd be happy to change the default code in the initrd but the mounted module names all need to have .squashfs extension, not as you showed now without it (as I pointed to in choice for finit-numbered or finit-not-numbered, squashfs extension required), else it could break the remaster script and possibly more (I don't want to take the risk of things happening unexpected).

I have added .squashfs but I had to cut the filename to 9 characters (NAME="${NAME:0:9}""-$a"".squashfs" from NAME="${NAME:0:14}""-$a"".squashfs" ) because It also reached the max character limit.
Counter ($a) is obligatory to avoid duplicates.

Hadn't tried remaster but so far system seems working ok.

Attachments
finit_07_231101c_addedSFSext.txt
NAME="${NAME:0:9}""-$a"".squashfs"
(8.23 KiB) Downloaded 16 times
User avatar
fredx181
Posts: 2663
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 294 times
Been thanked: 1050 times
Contact:

Re: Build script option : finit support for many squashfs files

Post by fredx181 »

trister wrote: Sun Nov 05, 2023 7:57 pm
fredx181 wrote: Wed Oct 25, 2023 5:11 pm
trister wrote:

I didn't notice any difference in behavior cause of the old-truncated 01-filessystem.squashfs.

Probably it would be noticeable only if you'd use script e.g. remaster as it depends on some things.
I'd be happy to change the default code in the initrd but the mounted module names all need to have .squashfs extension, not as you showed now without it (as I pointed to in choice for finit-numbered or finit-not-numbered, squashfs extension required), else it could break the remaster script and possibly more (I don't want to take the risk of things happening unexpected).

I have added .squashfs but I had to cut the filename to 9 characters (NAME="${NAME:0:9}""-$a"".squashfs" from NAME="${NAME:0:14}""-$a"".squashfs" ) because It also reached the max character limit.
Counter ($a) is obligatory to avoid duplicates.

Hadn't tried remaster but so far system seems working ok.

Thanks, now I've made it the default (in initrd1.xz) (replaced finit with yours after testing), when making a new build with mklive-... build script (bullseye, bookworm and sid) , there's better support now loading 100+ .squashfs modules because of the truncated mountpoint names. :thumbup:
edit: accordingly, also updated the "upgrade-kernel" package (so will create a similar initrd1.xz including this change)

Post Reply

Return to “DebianDogs”