HOWTO build KL/FirstRib-based distros

Moderator: Forum moderators

Post Reply
User avatar
wiak
Posts: 3627
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 56 times
Been thanked: 994 times
Contact:

HOWTO build KL/FirstRib-based distros

Post by wiak »

HOWTO build a KL/FirstRib-based distro

is possibly best learned/understood via a simple but relatively complete little example build such as the one provided in below link single build script. (Note that KLV_xorg_minimal_JWM_bash.sh is a single build script that downloads other scripts and core parts and runs them and/or organises them as part of its simple build process recipe).

Build KLV xorg-minimal JWM mini
https://forum.puppylinux.com/viewtopic. ... 507#p97507

Run the above script per the post instructions.

That will produce a grub2 (or grub4dos) bootable distro.

To understand how the build works is simply a matter of:

1. Read the simple (quite short) KLV_xorg_minimal_JWM_bash.sh shell script to see what parts were downloaded (usually via wget command) and used, and

2. Read the simple f_00_Void_xorg_minimal_JWM_bash_no-kernel.plug that was downloaded by above script and is simply a text file of commands (mainly just package manager install commands with a few configuration commands).

The key build distro line in this example KLV_xorg_minimal_JWM_bash.sh script is:

Code: Select all

./build_firstrib_rootfs.sh void default amd64 f_00_Void_xorg_minimal_JWM_bash_no-kernel.plug

That main FirstRib build_firstrib_rootfs.sh script is also auto-downloaded by above KLV_xorg_minimal_JWM_bash.sh shell script.

The above code line instructs build_firstrib_rootfs.sh to:

use Void Linux amd64 repos (can alternatively use i686 for a 32bit distro build). It then creates a skeleton root filesystem structure automatically including busybox and Void Linux's xbps package manager and then automatically passes control over to the user-created build PLUGIN, which, for example installs any apps/utilities/desktop managers wanted... simple as that really. (Alternative builds for the likes of Arch Linux, Debian, Devuan, Ubuntu, and Fedora can be done instead with a suitable PLUGIN for their use; refer to some of the other KL_minis for a few examples).

That's pretty much all there is to building a KL/FirstRib-based distro root filesystem.

All that is then needed to complete the job is to boot it with a suitable initrd.gz and vmlinuz kernel (plus addon modules and firmware sfs files for that kernel).

FirstRib provides that initrd.gz boot component in the form of FR skeleton initrd.gz; also downloaded automatically, in above example build, by that KLV_xorg_minimal_JWM_bash.sh script (though again you could use wget yourself to download the latest FR skeleton initrd.gz manually if you so wished).

The KLV_xorg_minimal_JWM_bash.sh script exemplar also automatically downloads a suitable (huge-kernel type) vmlinuz along with its related zdrv (modules) sfs and fdrv (firmware) sfs. Any suitable usrlib arranged huge-kernel/zdrv/fdrv can be used instead (rockedge and several other forum members often build such kernels and most recent Puppy Linux huge kernels are in that usr/lib zdrv and fdrv required structure so you can swap in most any of these).

On boot, FR initrd.gz uses overlayfs to arrange everything in layers which are simply 2-digit numerically ordered addons (in sfs or uncompressed directory form). For example, the main root filesystem is often given name 07anyname/ (if left as an uncompressed directory) or as 07anyname.sfs (if squashed up to save space), which places it at layer 07 of the overlayfs structure. The modules are generally added in at layer 00 so that 'addon' has filename such as 00whatever.sfs and the firmware often at layer 01 so given filename 01whatever.sfs. Note that only the 2-digit part of the name is important (that and the .sfs extension if using a squashed filesystem layer addon). FirstRib allows up to 99 layers (albeit Linux system configuration dependent - plenty by default anyway...).

Finally, a script utility called wd_grubconfig is provided to exactly tell you a working boot stanza for you to manually add to your grub config. You simply run that from the build directory with the command:

Code: Select all

./wd_grubconfig

and configure your grub boot loader (or similar) according to what wd_grubconfig tells you...

SUMMARY is: just run that single KLV_xorg_minimal_JWM_bash.sh in an empty directory and a KL distro will be automatically built! ;-)
STUDY it and you can see how it did it...

Then boot. END OF STORY

After you've mastered the above, you can similarly check out how the other KL_mini distros were made and thereafter should understand what rockedge, Sofiya, geo_c, williwaw, and occasionally myself, are doing for their own KL build creations (they usually detail the PLUGIN they are writing).
For basic Wayland build with Sway compositor (tiling), see: https://forum.puppylinux.com/viewtopic. ... 555#p98555

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

Post Reply

Return to “How-To”