Page 1 of 1

Building a root filesystem for use with WDL initrd

Posted: Sat Dec 11, 2021 11:22 am
by wiak

You may have seen some of the WDL initrd-related Void Linux builds rockedge has made and wonder how he does it.

They are made using a single, simple shell script called build_firstrib_rootfsXXX.sh plus a single simple plugin file (generally named something like f_XXXXXX.plug), which is simply a further list of shell script commands, that is used (sourced) by build_firstrib_rootfsXXX.sh to complete the build. It is easy to read the simple build_firstrib_rootfsXXX.sh script to see how it works, and equally easy (usually) to read and understand the plugin file created for the build.

It is particularly easy to understand how build_firstrib_rootfs makes a root_filesystem that using Void Linux and its official xbps package manager, which simply uses busybox plus a static compiled version of xbps. The same build script can however also build an Arch Linux, or a Debian/Ubuntu/or Devuan rootfilesystem (though these use archbootstrap and debootstrap scripts per common build Arch Linux or build Debian-based system practice).

So here is a quick run-down of how to build a basic Void-based root filesystem, which can be easily booted via WDL skeleton initrd.gz along with a suitable kernel (such as Puppy huge kernel plus its related modules and firmware, or via Void Linux official kernel+modules+firmware):

1. Get build_firstrib_rootfsLATESTVERSION.sh via the get_WDL_build_firstrib_rootfs script that is attached to post: viewtopic.php?p=37093#p37093
2. Remove the dummy tar and make that executable and then run it in, say, an empty folder where you want to create the Void-Linux-based root filesystem.
3. Create your own f_XXX.plug file, or fetch an already created one such as the simple f_00_Void_generic_NoX_WDLteam_v100rc1.plug, which you can also find at post: viewtopic.php?p=37093#p37093
4. You can now build that minimum commandline-based root filesystem using command:
./build_firstrib_rootfsXXXXX.sh void default amd64 f_00_Void_generic_NoX_WDLteam_v100rc1.plug
and answering the questions regarding the Void Linux repo you want to use.
5. Of course you probably want to boot it. One way to do that is to use the WDL skeleton initrd.gz. Various posts explain how to use that. For example, this post here seems about right: viewtopic.php?p=37474#p37474
You can get the WDL skeleton initrd (use latest version number usually) from here (along with a suitable gtkdialog sfs addon if you want it): https://weedoglinux.rockedge.org/viewto ... d4ab0#p355

Just of course you wonder what the f_XXX.plug file contains, just use geany to look inside it. Actually it is simplicity itself since it just contains simple xbps-install the shell script commands as follows:

Code: Select all

xbps-install -y base-minimal ncurses-base bash eudev
xbps-install -y file mc 
xbps-install -y wpa_supplicant  # if required
#xbps-install -y linux           # (kernel/firmware) if required

# set up passwd system
pwconv
grpconv
printf "root\nroot\n" | passwd >/dev/null 2>&1 # Quietly set default root passwd to "root"

# set root to use /bin/bash
usermod --shell /bin/bash root

# Set locale to en_US.UTF-8 
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/default/libc-locales
xbps-reconfigure -f glibc-locales

# Set Bash as shell
xbps-alternatives --set bash

echo "desktop build process finished"

If you want to build a Void-based rootfilesystem that includes X windows and JWM functionality, just download the simple exemplar from rockedge here: viewtopic.php?p=37122#p37122

Again, use geany to look inside it and see what extra stuff gets done...

Voila. Cheers to "Easy distro building..."