Dream LiveUSB: ArchPup

Recently, I found that Puppy Linux has a higher (visits of page) ranking than KNOPPIX in DistroWatch. Furthermore, Puppy Linux is also well-known for its old computer support. This is interesting.

Previously, I tried KNOPPIX, which I liked most is that it is able to save the user session. That means, if you installed any package or save the files in $HOME, reboot the KNOPPIX in the USB, those settings are still preserved. This is a feature which I didn’t found in other Live Media. I tried KNOPPIX because it is a distro targets on Live Media.

Yet, there is something I don’t like. That is the Debian repository. That is why, KNOPPIX is using Iceweasel instead of Firefox. And some of the packages are not cutting edge.

So, I tried Puppy Linux. It has the exact feature like KNOPPIX, i.e. saves the session. The next thing I found about Puppy Linux something interesting is the term “Slackware-compatible” and “Ubuntu-compatible” from the community site. A Linux distro which has different built with different compatibility. As a result, I discovered ArchPup which is based on Arch Linux.

Previously, I tried to built my dream LiveCD or LiveUSB based on Arch Linux and ArchBang but failed. Several reasons. One of the reasons is the difficulty to load the packages I want.  Even I successfully built the LiveCD, the startup in the X Windows is not satisfying. Furthermore, difficult to test the LiveCD and waste a lot of time to build the LiveCD. The building script provided was not working well.

Now, this ArchPup, it is using pacman (package manager), which I am familiar with. After creating the archsave.4fs (save session), reboot it, then I can install any packages I like. However, the repository used is not the official Arch Linux repository. Thus, one may not get the latest package. Furthermore, Linux kernel and some libraries are ignored. As a result, there is no upgrade of these libraries. (I think the archsave.4fs is compatible with the newer version when it is released, thus I don’t mind there is no upgrade of the kernel.)

So, I installed all the important packages as much as possible, especially utilities for rescuing, such as ddrescue, gparted, chntpw, etc.

Now, the only problem I face is the size of the archsave.4fs. The size can be changed by replacing it with another file. I did it manually using some commands.

ArchPup (Puppy Linux) is really awesome.

(Skip the following for those who are not interested.)

Technical part

I was very interested on how the save session works on Puppy Linux. I knew the SquashFS. It is read-only. And I know that is is possible to save the files in $HOME. This can be done by mounting a file or partition on /home with read-write. That is why archsave.*fs can be ext2, ext3, or ext4. But when I use the pacman to install the packages, the packages are not saved in /home but in root and other directories.

After some studies, then I only know that, there is something called union mount, which can be done by unionfs or aufs. This is the component that used by both Puppy Linux and KNOPPIX.

By doing this, both the ext2/3/4 and squashfs can be mounted in union. As a result, whatever changes to the “/” (root), this will affect the read-write mount. And this effect is happened directly to the archsave.*fs. So, we need not to do some thing like “save on exit”.

Resize save session manually

Actually it is not resizing. The following is what I did. Firstly, create a filesystem using “dd”,

dd if=/dev/zero of=archsave.4fs bs=1024 count=1M
#1 mega of for block size 1024 will produce 1 gigabyte file
#1000 x 1024 

Then, format the file.

mkfs.ext4 archsave.4fs

Now, mount the archsave.4fs in a directory, eg, ~/new/. And we also need to mount the current archsave in the USB in another directory, eg, ~/old/.

Then, we copy from old to new,

cp -a ~/old/* ~/new/

Replace the file in pendrive. Boot and you will get extra space.

initrd and Linux distros

Recently, I was thinking about to use Puppy Linux with my old computer. Yet my computer is already installed with Arch Linux. I wish not to uninstall or replace the Arch Linux, because installing Arch Linux is time consuming and exhaustive.

Puppy Linux is a live media like KNOPPIX. The official website mentioned that it can be installed into the computer without affecting the original OS, that is, installed side-by-side. This makes me re-called side-by-side installation of Ubuntu and Linux Mint. I tried this feature before using Linux Mint installed in a computer with Windows. It works fine until I give up because of the upgrade problem.

I was interested to test how does it work for Puppy Linux to be installed with Arch Linux side-by-side without affecting the partitions. Thus, I tried it with VirtualBox. Finally, I learnt some interesting things.

To install side-by-side, is actually copying the sfs (SquashFS) and some other related files to a computer filesystem path, such as C:\somewhere (for Windows) or /mount_point/somewhere (for Linux). The sfs contains the compressed filesystem for the Linux distro. That means, it will contains the important binary files such as bash, vim, grep, firefox, thunderbird, and so on. However, the question is, how the computer boots and mount the sfs file?

There is a file, called initrd (or initramfs), may be given with different name based on the Linux distro. It is a small file which is archived with “cpio”. It is small enough to load in the computer RAM. It contains a very limited command-line environment, normally using busybox so that it can perform the commands such as cp, mv, ls, grep, [, etc. Therefore, this initrd is responsible to run an “init” script to load the Linux kernel, mount the filesystem, and so on. It actually happens for other Linux distros like Arch Linux, not necessarily the live media like Puppy Linux.

Now, another question is how does computer load this initrd? This can be done through the boot loader such as GRUB, LILO, or Syslinux. The boot loader, will run the initrd so to load into the RAM. Therefore, the filesystem which contains these sfs and initrd must be recognisable by the boot loader. That is why, the filesystem such as FAT32, NTFS, and ext2/3/4, is able to be installed with Puppy Linux (or other distros) without affecting the partitions (side-by-side installation).

So, after trying this, now I have better knowledge about how Linux doing the booting,

  1. starts from the boot loader, such as GRUB,
  2. loads the initrd or initramfs, and finally
  3. initialises the Linux distro.

So, this initrd is actually part of the Linux distro. Different Linux distro may have a little difference for the filesystem structure, as a result, initrd may also work differently.

IBus (input) 1.5 problems and solutions

I am using Arch Linux. Recently updated an old computer, the IBus from 1.4 to 1.5. As a result, there were two problems.

  1. Cannot input anymore in any window, except Opera(?)
  2. IBus Pinyin cannot change to “Full pinyin” mode, but only “Double pinyin” mode.

For the first problem, it doesn’t happen in my other computers. For the second problem, it happened in my other laptops.

To solve the first problem, I tried several ways. Deleting the “~/.ibus”, “~/.cache/ibus”, “~/.config/ibus”, and “.gconf/desktop/ibus”, none of them can reset IBus to the default setting (initial setting). I wanted to reset the configuration because I know that it should work well, because it does work well in my other computers. However, none of the directories is able to solve the problem, finally I chose to reset the GConf and dconf. (I personally think that dconf is the one storing the latest version’s setting).

So, before reset, I backup the GConf and dconf first,

gconftool-2 --dump / > backup.xml
dconf dump / > backup.txt 

Then, start to reset,

gconftool-2 --recursive-unset /desktop/ibus
gconftool-2 --recursive-unset /schemas/desktop/ibus
dconf reset -f /desktop/ibus/ #trailing / is important

(Please note that, for the GConf, even we unset the keys, some of the keys will still appear.  They are generated automatically.)

By making the reset, start the IBus daemon, now, it works fine.

For the second problem, I don’t have exact solution for IBus Pinyin. I tried to solve this problem before, by using git version. Then revert back to non-git version after new version released. Yet this time, the git version is unable to be compiled. Therefore, my solution is to use another pinyin method, such as ibus-googlepinyin and ibus-sunpinyin. Furthermore, Fcitx is another possible solution to solve the problem.

Arch Linux and Canon PIXMA iP1600

I tried to escape from the Windows dependency problem. Wishing that all my devices can work without problem with Linux. But one of the greatest problems is that Canon PIXMA iP1600 does not have driver for Linux, except using iP2200 which is compatible.

Previously, I solved this problem with the virtualisation. This work perfectly to do my printing. However, it is still depending on Windows. Without Windows, the virtualisation is almost useless.

Looking for several internet solutions, I found that iP2200 driver is mentioned to be compatible with iP1600. I tried it before, but it didn’t work in Arch Linux. Furthermore, the Linux driver for iP2200 is in the RPM (Red Hat Package Manager) format. As a result, I decided to use virtualisation with Linux distro based on Red Hat and installing iP2200 driver, hoping that the driver will work without error.

RPM based Linux distro

There are several RPM based Linux distros. Based on lifehacker.com, I chose OpenSUSE instead of Fedora, though Fedora is more popular than OpenSUSE. This is because Fedora is cutting edge distro, and support for free and open source software, thus no proprietary license is supported. Therefore, I chose OpenSUSE which I think it is more stable and general.

Booted into OpenSUSE through VirtualBox, then I downloaded the driver. When I wanted to install it, it showed some errors with missing package dependency, “libxml”. I tried to search “libxml” in the repository, it was not found in OpenSUSE. This made me feel a little disappointed to OpenSUSE.

Then I was looking for other repositories which may contain “libxml”. I expected there is something like Arch Linux AUR. Yet I found none, maybe I am too new to OpenSUSE, don’t know how to get the old library.

Back to Arch Linux

As a result, I tried to solve it again with Arch Linux. Based on some forums (such as this one), in order to install iP2200 driver, there are two packages needed: cnijfilter-common and cnijfilter-ip2200. cnijfilter-common can be found in AUR. But there is no cnijfilter-ip2200. So, I made one.

However, after the installation (not the current one in the AUR), I failed to print anything as usual. This is because I didn’t have libxml. Yet it can be found in AUR as well. After installing libxml, the printer still could not work. So, I think there might be some missing libraries like libxml. So, I used the following commands to find out what are those libraries.

for i in `pacman -Ql cnijfilter-ip2200|cut -d ' ' -f 2|grep bin` ; do ldd "$i" |grep 'not found' ; done

(This is why I like command-line.) This command lets me check what shared objects (shared libraries) which are not found. By this, I added all the packages that are missing into the PKGBUILD dependencies.

Re-installed the package, and tried to print again. Yeah! Now it can print.


Now, I can do the Canon iP1600 printing using Linux without any Windows. But it is not yet perfect. The Linux driver of iP2200 does not have grayscale printing. I failed to print the the light colour document. It is always black and white.

I tried adding the grayscale option based on other PPD files, yet it does not work also. Though I can get the option to choose grayscale printing after modifying PPD, the result is still the same.

May be I will try using printuiip2200 command next time. But I don’t think it will work well.