site  news  contact

Easy frugal installation

September 05, 2017 — BarryK

Easy OS is supplied as an image file, named like easy-*.img.gz, to be written to a USB Flash stick or SD-card, which can then be booted. Easy is then installed to that drive, and can be used that way indefinitely, as long as you don't mind a Flash drive sticking out of your laptop!

There is an alternative, which is to install to the internal hard drive of the PC. You can open up the image file and copy the files out of it to the hard drive -- this is what this web page is all about.

You can be running any Linux distro to do this hard drive install of Easy, however, it is recommended to go the route of writing the image file to Flash stick and bootup Easy, and then install to hard drive.
The reason is that Easy has features that simplify the process.

Download

The file you download is named easy-<version>-<architecture>.img.gz, for example easy-0.1.6-amd64.img.gz. The ".gz" on the end means that it is gzip compressed, and with Puppy (and derivatives), if you click on it, there will be an offer to uncompress it. With many other distributions, you have to open a terminal and do it manually:

# gunzip easy-0.1.6-amd64.img.gz

Having done so, you will have easy-0.1.6-amd64.img:
image

As mentioned above, this image file can be written to a Flash drive, and booted from. However, this web page is showing how to extract the contents of the image file, and install to a internal hard drive.

How to "open up" the image file and extract the contents?

Inside the image file

The file easy-0.1.6-amd64.img (or whichever version you have downloaded) is only 521MB. However, at first bootup it will expand to use the entire drive. So any drive, from 2GB upwards, is suitable (although at least 8GB is recommended for ongoing usage).

Internally, the file contains a 519MB fat32 partition. If you are already running Easy Linux, you can just click on this file to open it up and see inside. With other Linux distributions, you have to do it from the commandline:

# mkdir mntpt
# mount -t vfat -o loop,offset=1048576 easy-0.1.6-amd64.img mntpt

The fat32 partition actually starts 1MB into the file (which is 1048576 bytes), the first 1MB has partition table and other stuff.

One vital detail. Puppy Linux and derivatives may actually run the Busybox mount utility, which does not support that offset parameter. However, they all (or nearly all) have mount-FULL, which is the full mount utility.

With Easy, being easy, you just click on the file, and you can see what is in the vfat partition:
image

You should immediately recognise one file in there, vmlinuz, which is the Linux kernel. The image file has Syslinux installed in it, which is a boot manager. The files boot.msg, help.msg, ldlinux.sys, logo.16, syslinux.cfg, and more in the EFI folder, are part of Syslinux.

Before installing to internal hard drive, a special concept needs to be explained, the frugal installation. This technique was pioneered by Puppy Linux.

Frugal introduction

The concept of the frugal installation is, basically, that it is installed in a folder in a hard drive partition, instead of occupying the entire partition as a normal "full" installation does.

With Puppy Linux, a frugal installation can be to any partition, even those with fat and ntfs filesystems, as used by MS Windows. And do so without interfering with the Windows installation. This is because Puppy saves a session, that is, all the new files, setup, downloads, etc., in what is called a "save file". This save-file internally has a Linux filesystem, usually ext3 or ext4.

Puppy also supports a frugal installation to a partition with a Linux filesystem, in which case a session can be saved to a folder in that partition. This has a big advantage, that it can use the entire partition, whereas the save-file would need to be increased in size as required -- which in practice is a bit of a hassle.

Now onto Easy. Easy supports the latter only, a frugal install to a partition with a Linux filesystem. Not a fat or ntfs filesystem!

Anyone with a bit of interest in Linux is likely to have created a partition with Linux filesystem (usually ext2, ext3, or ext4) on their hard drive. if not, check it out, it is easy-peasy to create one.

Now onto the actual installation...

Frugal installation

So how to do a frugal install? Currently, there is no GUI application to do it, but it is so easy, that it can be done manually in just a few minutes.

There is one big prerequisite though, that you already have a boot manager installed on your hard drive, such as GRUB or GRUB4DOS. There is another easy method of installation that does not require any boot manager, but that will have to be for another tutorial page.

The steps are simple. Decide which partition, then create a folder that you want to install Easy in. This can be nested as deep as you want. Let's say you have Easy version 0.2.5, and you want to install it in /easy/easy-0.2.5, in partition sda3 (and say sda3 is mounted at /mnt/sda3, which will be the case for all Puppy-derivatives).
Organising this into steps:

  1. Create the folder /mnt/sda3/easy/easy-0.2.5
  2. Copy vmlinuz, initrd.q and q.sfs into the easy-0.2.5 folder.
  3. Click on initrd.q to open it up SEE NOTES BELOW
  4. Edit file BOOT_SPECS.
  5. Click on initrd.q to close it up.
  6. Edit the boot manager.

OK, some of those steps need to be fleshed out a little:

3.
This is so easy to do if already running Easy Linux, just click on the initrd.q file in the ROX-Filer file manager. For other linuxes, you need to use the cpio utility.

4.
Edit file BOOT_SPECS, that you will find in the opened-up initrd.q, so it looks like this:

BOOT_DISKID='0x50e598ae'
BOOT_PARTNUM=3
BOOT_FS='ext4'
BOOT_DIR='easy/easy-0.2.5/'
WKG_DISKID='0x50e598ae'
WKG_PARTNUM=3
WKG_FS='ext4'
WKG_DIR='easy/easy-0.2.5/'
Q_DISTRO_VERSION=0.2.5

But change the values to suit your installation. The disk id is obtained by running fdisk -l /dev/sda, it is the "Disk identifier" parameter. Note the folder path does not have a leading "/" and must have a trailing "/".

5.
Again, you should be running Easy Linux, you will find this very easy. Just click on initrd.q again to save the changes and close it up. Otherwise, see notes at the bottom of this page.

6. This step depends on what boot manager is installed. In the case of GRUB4DOS, insert this into file menu.lst:

title Easy 0.2.5 (frugal install in sda3)
 uuid 05eafb05-c801-458a-9405-c3c437cc683b
 kernel /easy/easy-0.2.5/vmlinuz
 initrd /easy/easy-0.2.5/initrd.q

Again, modify to suit your installation. Obtain the "uuid" by running blkid /dev/sda3 in a terminal.

That's it, done. Shutdown, unplug the Easy Linux USB stick, and bootup, choose Easy from the boot manager menu.

After booting up the frugal installation of Easy, this is what you will see, using the ROX-Filer file manager:
image

The files initrd.q, q.sfs and vmlinuz are what you dragged into that easy-0.2.5 folder. Those directories "containers", "home" and "repository" were created at bootup -- read the "How Easy works" page!

Note that for the frugal install example given above, unlike the Flash stick, the boot and working partitions (and folder) are the same. No problem with that. It can be whatever you want. The only restriction is that the BOOT_DEV can have any filesystem, including fat and ntfs, but the WKG_DEV must have a Linux filesystem.

Conclusions

Why go for a frugal install, as opposed to a traditional "full" install? Ah, that is a very long story. Heaps of advantages.

Itemizing a few: you can have as many installations of Easy as you want, maybe one for each family member, each in its own folder, totally isolated. All kinds of security advantages. Super easy to upgrade (and downgrade). Easy to rollback to earlier sessions. Very small. A fundamentally "container friendly" architecture.

Anyway, the advantages of frugal are something that you have to discover for yourself, to really appreciate.


NOTES

Using cpio to open up initrd.q

If you are in the situation of currently running some other Linux distribution, you will have to use the cpio utility to open up initrd.q. Like this, open a terminal where initrd.q is:

# mkdir initrd-tree
# cd initrd-tree
# cat ../initrd.q | cpio -i -d -m
# cd ..

Then edit file BOOT_SPECS as described above. Then, close up initrd.q like this:

# sync
# rm initrd.q
# cd initrd-tree
# find . | cpio -o -H newc > ../initrd.q
# sync
# cd ..

Tags: easy