Ade Malsasa Akbar contact
Senior author, Open Source enthusiast.
Tuesday, December 10, 2019 at 21:27


This tutorial explains the configuration file for PCLinuxOS 2019 to work in multiboot mode with GLIM. I have tested this in a USB flash drive I shipped this month to South Sulawesi, Indonesia along with Slackware, Vector, KNOPPIX, and OpenMandriva Lx (I will write about their configs next time). What we need to do is to modify grub.cfg and create a new inc-pclinuxos.cfg configuration files. It may sounds simple, but PCLinuxOS needs special codes that are different to Debian and are not available on GLIM latest version yet. I explain them below with pictures. I would love to say thanks to all GLIM and Multibootusb community I finally could finish this. Enjoy!

 
(PCLinuxOS works in Live multiboot mode!)
Subscribe to UbuntuBuzz Telegram Channel to get article updates directly.

Requirements

You will edit 3 different files:
  • grub.cfg - global configuration file
  • inc-pclinuxos.cfg - specific configuration to boot PCLinuxOS
  • pclinuxos.png - PCLinuxOS logo

grub.cfg

for isofile in ${isopath}/pclinuxos/pclinuxos*.iso; do
  if [ -e "$isofile" ]; then
    menuentry "PCLinuxOS >" --class pclinuxos {
      configfile "${prefix}/inc-pclinuxos.cfg"
    }
    break
  fi
done

inc-pclinuxos.cfg

# PCLinuxOS GNU/Linux
# KNOPPIX GNU/Linux
for isofile in $isopath/pclinuxos/pclinuxos64*.iso; do
  if [ ! -e "$isofile" ]; then break; fi
  regexp \
    --set 1:isoname \
    --set 2:version \
    --set 3:arch \
    --set 4:variant \
    "^${isopath}/pclinuxos/(pclinuxos64([^-]+)-([^-]+)-([^-]+)\.iso)\$" "${isofile}"
  menuentry "PCLinuxOS ${version} ${arch} ${variant}" "${isofile}" "${isoname}" --class pclinuxos {
    set isofile=$2
    set isoname=$3
    bootoptions="root=UUID=$rootuuid bootfromiso=$isofile livecd=livecd vga=788 keyb=us quiet splash=silent" 
    loopback loop $isofile
    linux (loop)/isolinux/vmlinuz  $bootoptions
    initrd (loop)/isolinux/initrd.gz
  }
done

Code in text editor:

Codes above should look like these selected areas in editor.


Explanation:

I try to explain things I understand here. GLIM code to boot a specific distro is separated in two files, one in grub.cfg, and one in inc-distroname.cfg. The former is the global declaration that points to the latter, the actual code to run the ISO image of that distro. Thus, there are 2 explanations,

1) Regarding grub.cfg:
${isopath}/pclinuxos/pclinuxos*.iso
This code instructs computer to find ISO image file name started with pclinuxos and ended with .iso. This matches with pclinuxos64-kde.iso file name for example.
PCLinuxOS >
This code appears on the first page of the bootloader (see pictures below). On bootloader, you select this and press Enter to go to second page with PCLinuxOS ISO selection.
--class pclinuxos
Instructs computer to use pclinuxos.png logo stored at /boot/themes/icon/invader/. This is why the logo is PCLinuxOS logo and not Ubuntu logo.
      configfile "${prefix}/inc-pclinuxos.cfg"
This code calls the specific configuration from /boot/grub/ directory. Every distro should have one specific configuration file.


2) Regarding inc-pclinuxos.cfg:
bootoptions="root=UUID=$rootuuid bootfromiso=$isofile livecd=livecd vga=788 keyb=us quiet splash=silent" 
This is the boot options specific to PCLinuxOS (different to Debian's) and particularly the 2019 one I tested. This code is declared once and later being called from the boot command. I could not understand this code, unless at least we know here that PCLinuxOS booting here relies on UUID, needs declaration of $isofile manually, and runs in livecd mode. I am sorry I could not explain better.
    loopback loop $isofile
    linux (loop)/isolinux/vmlinuz  $bootoptions
    initrd (loop)/isolinux/initrd.gz
This code is crucial. This means PCLinuxOS runs in loopback mode. And finally, the ultimate duo commands, linux and initrd, being performed respectively to call kernel and initramfs, with directory addresses following the content of PCLinuxOS ISO image file. For you not familiar with this duo, you might ask question why your GNU/Linux system could boot, the answer is because GRUB bootloader works by running these two commands for every GNU/Linux system.


The secret:
The secret resides inside the ISO image file. We should know what is exactly the file name of the kernel and the initramfs, and then where exactly they are. I opened the ISO with Ark Archive Manager and you should see the kernel is vmlinuz and the initramfs is initrd.gz under isolinux directory. By knowing this, I could edit codes above and PCLinuxOS could run.


Icon:

Put a logo file named pclinuxos.png in /boot/grub/themes/invader/icons/ along with other logos.



Result, bootloader:

Now PCLinuxOS should appears on the USB's bootloader.

 

Result, live session:

For the first time, after many failures, I could make PCLinuxOS runs in multiboot USB. You could too!



See you next time for either Slackware, Vector, KNOPPIX, or OpenMandriva configurations.


This article is licensed under CC BY-SA 3.0.