Page 1 of 1
Build script option : finit support for many squashfs files
Posted: Sun Oct 15, 2023 8:48 am
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.
Re: Build script option : finit support for many squashfs files
Posted: Sun Oct 15, 2023 3:21 pm
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.
Re: Build script option : finit support for many squashfs files
Posted: Sun Oct 15, 2023 5:58 pm
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-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)
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.
Re: Build script option : finit support for many squashfs files
Posted: Mon Oct 16, 2023 3:26 am
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... ![Wink ;-)](./images/smilies/icon_e_wink.gif)
Re: Build script option : finit support for many squashfs files
Posted: Mon Oct 16, 2023 7:50 am
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
Re: Build script option : finit support for many squashfs files
Posted: Mon Oct 16, 2023 1:14 pm
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.
Re: Build script option : finit support for many squashfs files
Posted: Mon Oct 16, 2023 1:33 pm
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](./download/file.php?id=19369&sid=1d0f93cf8bee04bc873c139f258e0d5c)
- Screenshot2.png (78.6 KiB) Viewed 1213 times
Re: Build script option : finit support for many squashfs files
Posted: Mon Oct 16, 2023 2:58 pm
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
Re: Build script option : finit support for many squashfs files
Posted: Mon Oct 16, 2023 3:27 pm
by fredx181
.sfs is easier to remember than .sqaushfs (or is it squashsf, no, sqashfs then, no... squahsfs, ok then squashfs
)
Re: Build script option : finit support for many squashfs files
Posted: Tue Oct 24, 2023 7:33 pm
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.
Re: Build script option : finit support for many squashfs files
Posted: Wed Oct 25, 2023 5:11 pm
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).
Re: Build script option : finit support for many squashfs files
Posted: Sun Nov 05, 2023 7:57 pm
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.
Re: Build script option : finit support for many squashfs files
Posted: Mon Nov 06, 2023 4:56 pm
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 :thumbup:](./images/smilies/thumbup.gif)
edit: accordingly, also updated the "upgrade-kernel" package (so will create a similar initrd1.xz including this change)