Troubleshooters.Com®, Linux Library, and DIY Linux Present:

DIY Continuing Education: Installing Plop Linux

Contents:

Introduction

This document walks you through installing Plop Linux on a VirtualBox VM, and is probably valid for bare metal too. Plop Linux is a bare bones, boot-to-root Linux that's indispensable for experimentation. Plop experimentation will be detailed in later web pages, and linked from here as they're completed.

The other cool thing about installing Plop is it's one of the simplest no-script installations. See the next section...

The Dao of Linux Installation

Most Linuxes I've used perform the installation for me, using scripts. Redhat, Caldera, Mandrake/Mandriva (may it rest in peace), Ubuntu, Debian, Manjaro: Their install CDs all boot up and script you through the entire process. Easy.

Others, like Slackware, Arch, Gentoo and Funtoo, make the user do it manually. Plop is like those, but much simpler. Plop installation could serve as a proof of concept for installing the rest.

Here's the distinctive concept of manual installation: What you're really doing is preparing one or more file systems on a hard disk, copying all files to that/those file system(s), doing just enough configuration to enable booting, and installing a bootloader. Once again:

  1. Partition the hard disk and mount the partitions into a tree.
  2. Copy all files to that tree.
  3. chroot to the root of the new tree.
  4. Perform bare minimum configuration to enable booting.
  5. Install a bootloader.
  6. Exit the chroot.
  7. Unmount all hard disk partitions.
  8. Reboot

If you're not doing RAID, LVM or disk encryption, it's actually pretty simple. With Plop Linux, the bare minimal configuration turns out to be preparing /etc/fstab.

So think about it once more. When you do that big, bad, 40 manual step Arch installation, what you're really doing is the following:

  1. Partition the hard disk and mount the partitions into a tree.
  2. Copy all files to that tree.
  3. chroot to the root of the new tree.
  4. Perform bare minimum configuration to enable booting.
  5. Install a bootloader.
  6. Exit the chroot.
  7. Unmount all hard disk partitions.
  8. Reboot

Note:

It's very possible that, under the hood, the scripting type installations of distros like Redhat, Debian, Ubuntu, Manjaro and the like follow this very same process, but you don't see it. With the Plop Linux installation, this process is up close, personal, and in your face.

Gotchas

If you examine the eight steps, it's obvious you must already be running Linux to perform those eight steps. You've either stuck the new hard disk in a running Linux box, or much more likely, you booted to Linux with a CD, DVD or thumb drive, and are performing the actions from that booted Linux.

Here's your main gotcha: You must keep in mind whether to use programs from the currently booted Linux, or from the Linux you've copied to the hard disk. This is why most installations include a chroot. By using chroot, you're limited exclusively to the programs that have been copied to the hard disk. You'd better believe that you need to do all bootloader installation with the bootloader commands copied to the hard disk.

A second gotcha is that the booted kernel must bear some resemblance to the kernel on the new system you're builting. Otherwise you might get a "Panic: Kernel too old" when you try a chroot, or you might get errors on installing the bootloader. If you're installing from an installation CD, that install CD is guaranteed to have a similar kernel. Otherwise, you just have to hope. I can safely tell you that installing Plop Linux while booted to System Rescue CD is difficult to impossible. Luckily, there is a Plop Live CD, so you can boot to that and then copy software from the Plop Desktop .tgz file.

There are some gotchas specific to Plop Linux, but those are covered in the Plop installation section.

Installing Plop in a VirtualBox VM

This section assumes you're familiar with VirtualBox. If not, read my VirtualBox documentation.

Warning!

Plop Linux uses the ancient /dev/hda designation for hard drives, instead of the 21st century /dev/sda designation like every other distro made in the last 10 years. I have no idea why.

What I do know is that if you aren't constantly aware of this, it will kick you in the shins over and over again. Remember it when you change /etc/fstab. Remember it when you change /etc/lilo.conf. Remember it when you do your lilo -M /dev/hda command.

Download the Plop live ISO file and the desktop tarball to your host's (not guest's, host's) /tmp/xfer directory (create it on the host if need be). For the purpose of this document, I'm assuming you put both your Plop live ISO file and your Plop desktop TGZ file on your host's /tmp/xfer directory. If you put them elsewhere, change commands during this process to reflect their locations.

For the purpose of this document, those files are:

  1. ploplinux-4.3.0-x86_64.iso is the live CD ISO.
  2. ploplinux-desktop-4.3.0-x86_64.tar.gz is the desktop tarball.

The preceding files are obviously for Intel/AMD type 64 bit hardware. If your hardware is 32 bit, or ARM, or whatever, your files will be named differently. They'll also be named differently as time goes on and new versions are made.

First, you need to get your VM up and running. Run VirtualBox, click the "New" button, and make a VM whose RAM is 2 to 4GB, disk space 8GB, and whose CD drive is /tmp/xfer/ploplinux-4.3.0-x86_64.iso. Start your VM. You'll be operating live off the Plop Live ISO, and will have 8GB of disk space in the guest's /dev/hda (remember Plop's device naming?) This is pretty much the same situation as you'd have if you were installing to bare metal, except on bare metal your IP address would be different from the VM standard 10.0.2.whatever.

Warning!

Don't even think of using a live CD except Plop. It will make things much more difficult or downright impossible. System Rescue CD is the wrong tool for this job.

The following is a summary of the rest of your install job:

Partition and prepare the hard disk (back to install process)

After booting your new VM, you're left at a command prompt of the live CD, logged in as root. Run startx to access your Xfce GUI. If you don't like the transparent terminals (I don't, bad vision), handle it in ~/.config/xfce4/terminal/terminalrc file. Then run the gparted program either from the menu (under "System") or from the command prompt. From the menu, Gparted->devices and choose /dev/hda, then Device->Create_partition_table to give /dev/hda an MSDOS partition table, and then create and format /dev/hda1 as an ext3 (Plop can't use ext4) partition that uses all but 1000MB of the disk space. Then create and format /dev/hda2 as a swap partition. Make sure the formatting gets done in both cases.

Last but not least, use gparted to make /dev/hda1 bootable. This is necessary when installing LILO later on.

Exit gparted, and use lsblk and blkid to make sure the partitions are the way you think they are.

Copy all files to the new root. (back to install process)

  1. mkdir /mnt/rute
  2. mkdir /mnt/xfer
  3. mount /dev/hda1 /mnt/rute
  4. sshfs your_id@10.0.2.2:/tmp/xfer /mnt/xfer
    • Where your_id is your username on the host, not the guest.
    • 10.0.2.2 is the default IP address of your host.
    • You'll need to input your password for your host login.
  5. cd /mnt/rute
  6. tar xzvf /mnt/xfer/ploplinux-desktop-4.3.0-x86_64.tar.gz
  7. cd ploplinux-desktop-4.3.0-x86_64
  8. Make sure you're not still in cd /mnt/rute, but instead one directory below it in a directory with a name like ploplinux-desktop-4.3.0-x86_64
  9. mv * ..
  10. The preceding command put all the OS files and directories in /mnt/rute, where they belong, so you can now do the following command:
  11. cd ..
  12. rmdir ploplinux-desktop-4.3.0-x86_64

You're almost done with copying all files to the new root directory. Your last copy is to copy the live CD's /dev directory to the /dev directory on the new root. If this sounds sketchy to you, it's because most serious distros require you to do all sorts of work to build the /dev directory, and most likely /proc and maybe /sys too. Plop Linux is so ultra-simple that, as long as you're booted to the same Plop version as you're creating on the hard disk, you can simply do the copy. So perform the following to finalize your copy to the new root:

  1. cd /
  2. cp -rp /dev /mnt/rute
  3. umount /mnt/rute
  4. mount /dev/hda1 /mnt/rute
  5. The preceding two commands made sure the files actually got written to the drive.

That's it. All the necessary files have been copied to the new root.

Chroot to the root of your new tree. (back to install process)

Perform the following commands:

  1. cd /
  2. chroot /mnt/rute bash

Now you cannot see anything from the booted CD. The only vestiges of the booted CD are its running kernel, which is presumably the same kernel as is installed on the new root, and the $PATH, which theoretically should be changed, but in this case is good enough to leave alone. Now, any programs you run, are programs from the new installation, not from the booted CD.

Note that in this chroot environment, many GUI programs, including gvim, won't run. You could probably fix that, but it's easier just to run CLI programs in your existing GUI terminal program (xfce4-terminal).

Perform bare minimum configuration to enable booting. (back to install process)

Get into the /etc directory and edit files fstab and lilo.conf. In fstab, make sure to change all "sda" to "hda", and make sure the right partitions are mounted to the right places. In file lilo.conf, make sure to change all "sda" to "hda", change the timeout figure near the top to 70, so you have lots of time to explore different boot options. Save both files.

Install the LILO bootloader. (back to install process)

Remembering that you already prepared /etc/lilo.conf and that you already copied /dev from the CD to the new installation, perform the following two commands to install the bootloader:

  1. lilo -r /
  2. lilo -M /dev/hda

Undo the chroot. (back to install process)

exit

The preceding command exits the chroot environment so you can unmount everything and perform an orderly shutdown.

Unmount all hard disk partitions. (back to install process)

Your hard disk won't get written, or it will be corrupted, unless its partitions are unmounted. Unmount them by doing the following:

  1. cd /
  2. umount /mnt/rute
  3. umount /mnt/xfer
  4. Use the mount command to make sure nothing from /dev/hda is mounted.

Shut down the VM. (back to install process)

Use the GUI or the poweroff or halt command or whatever.

Set the VM so it boots to hard disk. (back to install process)

If you don't do this, it will boot to the live CD again, instead of to the OS you just laid down on the VM's /dev/hda1. This is the equivalent of pulling out the CD after installation on bare metal.

Reboot. (back to install process)

It should boot into the VM's hard disk installation's boot menu, from which you can select the default and run plop.

Lessons Learned

Arch, Slackware, Gentoo, and Funtoo all share this: The main component of installation is copying the files to their file structure. In the case of Gentoo and Funtoo, compiling goes along with the copying. Although all of them seem like neverending recipes of commands, in fact they all operate pretty much like this:

  1. Boot Linux, with a compatible kernel, from a CD
  2. Prepare disks, partitions and mounts.
  3. Copy all files to the new directory tree.
  4. chroot to the root of your new directory tree so that all commands run will be from the OS being installed, not from the CD.
  5. Perform bare minimum configuration to enable booting. This includes fstab, and usually also involves /dev, /proc, /sys and the like. For more complex disk schemes like encryption, LVM and RAID, it involves even more.
  6. Install and configure the bootloader.
  7. Undo the chroot
  8. Unmount all hard disk partitions.
  9. Shut down
  10. Remove the CD, or change VM boot order.
  11. Boot your new OS.

If you can put a 40 step install recipe within the preceding framework, you'll be much more aware of where you are in your install, why you're doing what you're doing, and perhaps how to perform steps that are ambiguously documented. Above all, when viewed in the preceding framework, manual installation isn't rocket science.

Plop Linux is an outlier. A distro made for experimentation. It boots into the root user, for gosh sakes. Few if any would use it for "real work." The beauty of Plop Linux is it's so incredibly simple that its actual activities closely parallel Linux concepts. For instance, actually installing Plop is almost a one to one correspondence with the conceptual steps of manually installing a complex distro. Plop is the picture that's worth a thousand words.

Summary

This document detailed how to install Plop Linux on a VirtualBox VM. This is very easy because of Plop's simplicity. That simplicity aids learning, because the technical steps correspond to the concepts. If you're wondering about a Linux concept, Plop on a VM is a very quick way to learn and test.

Don't delete your Plop VM, because in the near future I'll be write more articles whose experiments involve Plop Linux. The whole reason I picked up Plop in the first place was as a test bed for Suckless Init.


[ Training | Troubleshooters.Com | Email Steve Litt ]