Page 1 of 1

WDL new initrd with WDL_manjaXFCE example

Posted: Sat Aug 28, 2021 9:41 am
by wiak

<-- Back to WDL Cheatsheet menu: viewtopic.php?p=36426#p36426

New Skeleton initrd.gz release v502-rc2
Just small bugfix release - doesn't effect most current projects but should now use this one with, for example, KLV-Airedale anyway.

For more information and the WDL skeleton construction kit download script itself, visit:

https://weedoglinux.rockedge.org/viewto ... p=355#p355

Rough HowTo produce frugal install WDL_manjaXFCE using official Manjaro XFCE iso is here:

viewtopic.php?p=35536#p35536

gtkdialog_filemnt addon sfs module for that is introduced here:

viewtopic.php?p=36081#p36081

You can discuss progress and/or any issues you are having in already started discussion/information thread here:

viewtopic.php?p=34673#p34673

Consider this post a 'Fast Track' into WeeDog Linux system builds and usage. The overall brief 'HowTo' and initial downloads are under preparation and should become available within the next day or two. I will make further announcement at the time - probably on WeeDog Blog section with link back to a more completed version of this thread. My writing this early information is just my way of getting started - the 'being quickly written' rough WDL_manjaXFCE 'HowTo' will likely be the first output of the latest development work - I've been using most of it for months personally, but wasn't sure whether I'd be publishing further work or not, but better late than never....

Announcing the Release of the very Latest General Purpose WeeDogLinux initrd.

This can be used not only with WeeDogLinux built distro variants, but can also be used to create an alternative, overlayfs-based, frugal installation and boot mechanism for many other distributions including official Arch Linux, Manjaro, Slackware, Slitaz, and even Puppy Linux and the various Dogs.

The booted distro that results will be controlled by WeeDog's initrd/init layer and save persistence mechanisms, rather than by their usual official distro's initrd files (which are not used with WDL variation). WeeDog initrd not only provides scope for up to 100 overlay modules but these can be either sfs files or normal directories (which have not been compressed using mksquashfs) or any mixture of these.

Of course, a few of the utilities used in some of these various distros will not work or not work as intended when run as a WeeDogLinux frugal install since some are expecting an aufs layout and different layer names - but these are generally minor issues (and the larger distros such as Arch, Manjaro, Slackware and so on are usually 100% fine) that are generally easy to address. The key to using the WDL version is to instead learn how to achieve similar functionality using the many features WeeDog initrd overlayfs init provides and simply tweak the (usually very few if any) distro-specific utils to use WDL features instead. So, if running a WDL_pup, for example, you would not use 'pupmodes' at all, but instead use WDL w_changes modes for generally similar functionality. With the likes of official Arch, Mandrake, Slackware, and Void) you get the same WDL frugal install benefits exactly (so nothing new to learn...).

Documentation for WDL is however in short supply, so if you try it you should be prepared for some failures until you master the WDL organisation and approach (though if you do it carefully it should work first time though depends on how bad the HowTo I write is...), but you can always supply details of the issues you have and ask for help here. Good thing, at least, about the documentation for WDL being short is that there isn't much to read!!! Indeed, for the most part, the main documentation is found at the very end of the main WDL build scripts, though many of the above WDL-booted systems don't require you to use the build scripts at all - all you need is the WDL initrd and simple instructions for using it with your distro of choice.

To get you started, the next information I post will include a "How To boot official Manjaro XFCE edition as a WDL frugal installation" (WDL_manjaXFCE). But prior to my preparing that (sorry, just working on it), please find below the very short, and probably extremely cryptic form, the options that will become available to you (or at least most of them) is you choose to experiment with such WDL frugal installations. If you can decipher this cryptic brevity you are almost 'ready'! More to come... But only for anyone that is interested of course. (NOTE that I will NOT be covering booting mechanisms at all - be these BIOS, UEFI, grub2, grub4dos - except for providing help with menu.lst or grub.cfg stanzas - I am not producing any isos here either... Rather, this info is for those who are comfortable creating a directory, putting vmlinuz and initrd in it along with the necessary sfs modules and booting these via your already established grub setups... AND I provide no guarantee any of this will work on your systems - it does on my computers - and whatever you do is at your own risk entirely).

Once a WDL system build has been prepared (e.g. after following the example WDL ManjaroXFCE HowTo or, alternatively, following a normal build script build) the following applies:

initrd.gz and, unless "nosfs", NNfirstrib_rootfs.sfs are now
ready and, usually, appropriate vmlinuz kernel in the same directory.
Copy these to your chosen boot partition/directory if not already in it.

You need either NNfirstrib_rootfs.sfs
OR:
a copy of the uncompressed firstrib_rootfs directory renamed to
NNfirstrib_rootfs, where NN can be 01 up to 99
(depending on layer position required). Default is currently NN=08
You can also copy additional sfs files named NNsomething.sfs or an
unsquashed directory (e.g. of any such sfs) named NNsomething.

Finally create appropriate grub.cfg or grub4dos menu.lst boot entry
using kernel-line bootparams:
w_bootfrom=/mnt/partition/directory, or w_bootfrom=LABEL|UUID=/bootdir

Optional w_changes=[option] where option can be (uc is upper_changes):
media for uc saved direct to media (such as hard disk),
RAM0 for uc in RAM but external media uc contents not included at all,
RAM1 for uc in RAM but external media uc contents copied in,
RAM2 for uc in RAM but external media uc highest layer RO loopmounted,
/mnt/partition/dir for alt direct to uc media location,
no_uc0 or no_uc1, are only for rare special cases - refer to main docs.

Optional w_copy2ram, to copy all NNsfs, NNdirs, w_rdshN.plug to RAM.

Optional w_altNN=path2dir for alternative location for NNsfs/dirs.
Optional w_rmmodule="list of modules" or w_addmodule="list of modules".

Optional w_rdshN arguments (where N=0,1,2,3,4 or 5) to force debug sh,
Optional w_rdshN.plug files, which will be sourced by initrd/init,
Optional w_inram00.plug, which will be sourced by initrd/init,
Optional w_pre_switch_root.plug, which will be sourced by initrd/init,

Example grub4dos and grub2 configs:

Code: Select all

title WDL_manjaXFCE
find --set-root uuid () b812c597-8099-4bee-9bb3-8b9c10f1e902
kernel /WDL_manjaXFCE/vmlinuz-5.13-x86_64 w_bootfrom=UUID=b812c597-8099-4bee-9bb3-8b9c10f1e902=/WDL_manjaXFCE w_changes=RAM2
initrd /WDL_manjaXFCE/initrd.gz
Or use w_bootfrom=LABEL=xxx.../WDLtype or w_bootfrom=/mnt/sda4/WDLtype

menuentry "WDL_arch64" {
    insmod ext2
    search --no-floppy --fs-uuid --set 78683fe5-0323-4030-9ddd-39464a8fbf80
    linux /WDL_arch64/vmlinuz-linux w_bootfrom=UUID=78683fe5-0323-4030-9ddd-39464a8fbf80=/WDL_arch64 w_changes=RAM2
    initrd /WDL_arch64/initrd.gz
}

I've already posted what the WDL_manjaXFCE file layout looks like here: viewtopic.php?p=34673#p34673


Re: new WDL release and fast track info

Posted: Sat Aug 28, 2021 11:02 am
by wiak

Next part maybe tomorrow...


New WeeDogLinux now released for download

Posted: Mon Aug 30, 2021 9:20 am
by wiak

<-- Back to WDL Cheatsheet menu: viewtopic.php?p=36426#p36426

NEW (06Sept2021): Better quick HowTo use to produce WDL_manjaXFCE (Manjaro XFCE) post by fredx181 here:

viewtopic.php?p=36144#p36144

Also (08Sept2021) see here for Fred's implemented Thomas M (linux live) method for reducing initrd finished size:
viewtopic.php?p=36345#p36345

----------------------------------------------------------------------------------------------------------------

Announcing release of distro-agnostic WDL skeleton_initrd construction kit, which should allow you to frugal install most distros and boot them using the flexible, multi-featured WeeDogLinux initrd.

To get you started, I've roughly described how to boot official Manjaro XFCE via the creation of WDL_manjaXFCE, which simply involves extracting the main Manjaro sfs files from its iso, its vmlinuzXXX kernel (from /boot) and the insertion of its /usr/lib/modules/<kernel_version> in to the WDL-provided skeleton initrd.gz. Note that one of the kit-provided shell scripts uncompresses the skeleton initrd.gz for you, at which time you can insert the needed modules you have extracted from the Manjaro iso - then on pressing exit, the modify_initrd_gz.sh script auto recompressed the initrd.gz (and date stamps it - you can of course rename it back to simply initrd.gz thereafter if you wish).

Sorry, I have not had time to write any polished HowTo as yet, though if you are used to manually making frugal installs you will probably have no difficulty.

For more information and the WDL skeleton construction kit download script itself, visit:

https://weedoglinux.rockedge.org/viewto ... p=355#p355

You can discuss progress and/or any issues you are having in already started discussion/information thread here:

viewtopic.php?p=34673#p34673

-------------------------------------------------------------------------------------------
NOTES:

1. By default Manjaro auto-boots into normal user "manjaro". I recommend that you use WDL_manjaXFCE from that login situation since that avoids complexities of some apps not liking to run nowadays under root user login. My recommended way of doing that is:

a. open a terminal and start filemanager 'thunar' in root user mode via command: sudo thunar

Any work you then do from that filemanager will be as "root", including any terminal you subsequently open from that filemanager.

b. As far as making it easy to download and work on files outside user Manjaro's home directory, which is in /home/manjaro, which is in any save folder, my recommended practice is to create other directories elsewhere that are also owned by user manjaro. For example, I boot from /mnt/sda4 and what I do is that I create a directory such as /mnt/sda4/myself whilst in a root owned terminal (as above via filemanager thunar). I then make that directory belong to myself (which is user manjaro if I don't create a new username for my own use). To do that I use the command:

sudo chown -R manjaro:manjaro /mnt/sda4/myself # the -R stands for 'Recursive', which makes any already existing subdir of /mnt/sda4/myself owned by user manjaro too.

2. The main thing I usually miss is the filemnt ability of the Dogs (and Puppy) that auto-opens up any clicked on sfs file or iso. Therefore on my WDL_Arch64 system, I include that utility along with a copy of gtkdialog via a separate sfs module that gets loaded at boot (e.g. 10gtkdialog.sfs. I will be creating similar for WDL_manjaXFCE in the near future. That will also allow you to easily run most Dog and Pup gtkdialog app/utils.

3. I find that the Manjaro-provided Firefox uses a lot of CPU on my computer system. I therefore personally install Arch repo Chromium install as an alternative since that runs very efficiently I find. You may not have that problem, but if you do then I highly recommend that nice Arch Chromium compilation.

4. Could well be that many portable apps already available on the forum will also work quite well with WDL_manjaXFCE; you just need to rename them with a two digit beginning to their filename - these two-digits tell WeeDog what layer to overlay them at.

5. By default with no w_changes stipulated on your grub config kernel commandline, WeeDog will automatically provide direct save persistence to the bootfrom directory location in folder upper_changes. In general, I usually run a new system in that default mode for a while until I have installed the main apps I want. Thereafter, I often rename that upper_changes folder to NNupper_changes (for example 50upper_changes/); it is unnecessary to convert it into a squashfs (.sfs file) since WDL initrd accept either 2-digit numbered normal folders or 2-digit numbered sfs files for its on-boot overlayfs layers. You can of course convert that to .sfs form if you wish to save extra disk space. On next boot it will be loaded like any other layer and a new non-numbered upper_changes folder will be automatically created by WDL init, which will be the topmost (read/write layer). You can repeat that process many times if you wish (currenly I have a 50upper_changes and a 51upper_changes on my system and of course the unnumbered upper_changes session layer (which via this WDL session rollback process can be kept extremely small...).

6. Of course you can use WDL initrd to boot most any other distro you wish (including other forum distros). All you need is to extract and suitably 2-digit rename the .sfs boot files involved. So plenty to try out. Note that you can easily disable any sfs module simply by making sure it does not start with 2-digits! For example, I often during WeeDog development disable some sfs modules simply by putting a letter (such as D) in front of the file name...

7. Also, as you will discover if you try it, WDL initrd contains most of its init control code in an optional external file (w_init) which, if you use it, you put in the directory you boot from. It's just a text file containing most of the shell script boot code so you can directly modify the system boot functionality simply by editing w_init with for example geany. This is a very powerful WDL feature and excellent for quick development work - but, be careful, that code is critical so if you modify it inappropriately your system may thereafter refuse to boot. Still, even if that happens you can quickly return system to normal by booting a different system and simply removing that external w_init file (or renaming it) - a copy of a working w_init file is also kept inside the compressed initrd though the external one, if present, takes precedence... You can in fact consider that external w_init as a further WDL plugin that you can modify to add new features to your heart's content (and I will be happy to receive copies of your individual modified w_inits for publication as plugins for the benefit of other WDL users).

8. Later, you may be interested in using one of the keep changes in RAM modes. In particular w_changes=RAM2, which is similar to what you can achieve in Puppy Linux and with changes=EXIT in the DebianDogs. I will need to provide you with a simple shell script for these modes that rsyncs any changes back to the boot media (when you want it to); I'll upload these rsync scripts later but let's keep things simple for now and just use direct save back to bootmedia save persistence for the time being. Note however, that you can examine all the layers mounted via the overlayfs - you find them at directory /mnt/layers once the system has finished booting, which should help you understand WDL layout and organisation and allow you to implement further user scripts/utilities for additional functionality.

9. Note that an upstream repos provides considerable modules, most of which are not actually needed in the initrd. You can later therefore prune the list of modules down to suit your own computer(s) and keep the initrd really small (though in practice the final initrd size isn't important at all in terms of actual resource usage and efficiency - except for ease of download and the initrd skeleton will likely always be under 1 MB in size).

Code: Select all

Example grub4dos and grub2 configs (use your own appropriate UUID info and vmlinuz and initrd.gz filenames and so on):

title WDL_manjaXFCE
find --set-root uuid () b812c597-8099-4bee-9bb3-8b9c10f1e902
kernel /WDL_manjaXFCE/vmlinuz-5.13-x86_64 w_bootfrom=UUID=b812c597-8099-4bee-9bb3-8b9c10f1e902=/WDL_manjaXFCE
initrd /WDL_manjaXFCE/initrd.gz

Or use w_bootfrom=LABEL=xxx.../WDLtype or (less reliable in practice:) w_bootfrom=/mnt/sda4/WDLtype

menuentry "WDL_manjaXFCE" {
    insmod ext2
    search --no-floppy --fs-uuid --set 78683fe5-0323-4030-9ddd-39464a8fbf80
    linux /WDL_manjaXFCE/vmlinuz-linux w_bootfrom=UUID=78683fe5-0323-4030-9ddd-39464a8fbf80=/WDL_arch64
    initrd /WDL_manjaXFCE/initrd.gz
}

Cheers, wiak


Re: WDL new initrd release

Posted: Sat Feb 12, 2022 3:27 pm
by wiak

<-- Back to WDL Cheatsheet menu: viewtopic.php?p=36426#p36426

New Skeleton initrd.gz release v502-rc2
Just small bugfix release - doesn't effect most current projects but should now use this one with, for example, KLV-Airedale anyway.
Download details on first post of thread.

I'll be documenting using it with a tricky case root-filesystem tomorrow, which is one that could prove useful for some.


Re: WDL new initrd with WDL_manjaXFCE example

Posted: Sat Feb 12, 2022 8:16 pm
by rockedge

@wiak

I have swapped the new 502 into the base rootfs of KLV-Airedale. Tested booting as pseudo full and frugal regular also both RAM0 and RAM2. All good!