DDD #3: Advanced Live-CD/DVD creation

In post 19 (Creating an Arch Live-CD) I blogged about building a simple Live-CD on Arch Linux. It was the summary of my first attempts relating to that topic. In the meantime I created another ISO and published it as a first preview of my “Desktop Demo DVD” project in post 21 (The Desktop Demo DVD).

This new entry will describe how my “DDD” was built (and thus how you add things like a graphical login manager and add users to a live medium).

Preparations

First I create a new virtual machine to keep things clean and tidy and then build and install the archiso tool. Next is building AUR packages edelib and ede as well as creating a custom repo for them. (I won’t repeat it in detail here. You can look up both things in post #19 if you wish).

Configuring archiso

Just like in my previous building attempt, it’s necessary to create a new directory and copy over the “releng” dir from archiso. After that the various steps at configuring the iso can be taken.

Packages

The first thing to do is adding the right packages to the file packages.i686. Since we want a graphical environment, it’s a good idea to have xorg-server installed (we’re going to use a graphical login manager this time, so we can do without xorg-xinit).

Since the system is meant to run on about every hardware, X11 needs the proper graphic drivers. You may want to look for all xf86-video-* packages and add them. The only issue with that was that the openchrome and unichrome drivers were conflicting, but later (and older) one has been removed from the “extra” repository recently. Whatever you do, be sure to leave xf86-video-vesa in there – that’s the fallback driver that will work on most machines even if none of the others does (which is pretty rare however). Also it might be a good idea to add xf86-input-evdev just to make sure, you can use e.g. your keyboard in X. Adding virtualbox-guest-modules, too, will let X.org use the appropriate driver if running inside a VirtualBox VM.

Next I added the desktop environments that I wanted to be available. I chose mate (remember to add the additional repos for it and ede!), xfce4, lxde and e-svn as well as libxpm (needed by ede) and the packages edelib and ede. Finally the display manager lxdm is added as well.

Display manager

Thanks to systemd, much of the wiki page about archiso is outdated and no longer of any use. This is the case e.g. when it comes to starting the display manager automatically after booting. It suggests using an inittab and we could actually do so and use a sysVinit compatibility package as well. However it was already announced that this would be dropped in the forseeable future so it’s best to do things the proper way right from the beginning.

LXDM comes with its own service file for usage with systemd. So the default command to configure the system for starting it after booting is systemctl enable lxdm.service. However this will of course not work in our case: First we don’t even have LXDM installed on building system and second – even if we had – enabling it there would not affect the live system. However for that reason there’s a folder called root image where we can make changes that will affect it!

So what does the above command really do? No more actually than creating a softlink! Of course we can do that by hand, too. Let’s change our PWD (present working directory) to /root/archlive/releng/root-image/etc/systemd/system. Now let’s create the proper link, shall we? The command for that is ln -s /usr/lib/systemd/system/lxdm.service display-manager.service.

Next step is creating a new directory (that is normally created when LXDM is installed): mkdir ../../lxdm and then I change into that dir. Afterwards I install lxdm on my build system and copy its configuration file into the new dir: cp /etc/lxdm/lxdm.conf . (if you’ve got LXDM installed on any other system, you can of course also copy it from there). Now it’s time to edit lxdm.conf: I simply add user “arch” to the blacklist (right at the end of the default configuration file). It’s a user automatically created by the install scripts and I have not yet looked into how to prevent its creation. For that reason I decided to just block it there so that it’s not offered by LXDM.

Adding a user

This step is important since we disabled the user “arch” and cannot log in as “root”. The solution suggested for this on the Arch wiki is simply copying over the files passwd, shadow and group (all located in /etc) from a system set up the way we want it. This is actually a fine way and since we’re using virtual machines anyway, it does not hurt to simply clone one, adding the desired user (“desktopdemodvd” in my case) there and copying said files over to root-img/etc on our building VM (using a USB device is probably the most confortable way).

That was the easy part. Many DEs will however not work if there’s no proper /home/$username directory present. We could of course create one in root-image/home, but that would be owned by root on our live system so that’s not quite what we want. Again the wiki is outdated (while I’m at it anyway, I should dedicate some love to it when I’m done here, I guess). We want to do things the systemd way! So how to do it in this case? Let’s write a new service for it (woah)!

Luckily things are easier than it might look first. Ok, I admit that it took me a few attempts before things finally worked right. But you can save yourself some time and simply copy what I did. Change into the dir root-img/etc/systemd/system again. Now create a new service file – I called mine “autostart.service”. The content of my file is like this:

[Unit]
Description=Autostart

[Service]
Type=oneshot
ExecStart=/bin/mkdir /home/desktopdemodvd
ExecStart=/bin/chown desktopdemodvd /home/desktopdemodvd

[Install]
WantedBy=multi-user.target

Note: “ExecStart=/bin/chown desktopdemodvd /home/desktopdemodvd” is one line!

Done configuring

Yes, if I remember correctly, that was all. You should be able to build the iso now.

I don’t know if I did any changes beside these, but this blog entry at least shows two important things: Adding users and using a graphical login manager.

There are of course a lot of things you could customize as well and perhaps I’m going to explore some of these in the future, too. But right now I’m going to wait and see what happens with the “DDD”.

What’s next?

My next post will deal with what should be considered essential graphical applications – and afterwards we’re getting back into the world of toolkits.

Advertisements

DDD #2: The “Desktop Demo DVD”!

In the last entry I discussed the situation of Linux desktop environments in general and how it encourages taking various less-known DEs into account for your system, too. Now it’s time to talk about the first alpha version of the actual DDD!

If you just want to download it, have a look here.

The idea behind the DDD

There are four reasons why I decided to create the “DDD”:

  1. Because I found out that there are many Linux users today who would like to know more about alternative DEs
  2. Because I think the less known DEs deserve some publicity
  3. Not every DE can be installed easily on each distro and thus it can take a lot of time and effort to try them out
  4. Because I’m interested in different DEs and building “DDD” is another informative thing

The version I release today is just a little preview. But before I describe what 0.1 includes right now, I’d like to share my vision of what DDD 1.0 should be.

Vision

  • A perfect Desktop Demo DVD should come with all available desktop environments the Linux world has to offer.
  • If possible it should also showcase some default applications of the particular DE which are not in the menus of the other ones so things don’t get confusing.
    (I think that this can be done with the desktop files or probably by other means.)
  • Localization at least for the most common languages.
    (Better: As much languages supported as possible.)
  • Only list the real DEs in the display manager (and not probably confusing variants with different WMs).
  • A short html tutorial which helps the users to discover the most important features of the various DEs could be very beneficial.
  • Some nice artwork would be great, too.
  • A few other “cosmetics”.

Desktop Demo DVD

This project is to provide an ISO file that can be downloaded and used in either a virtual machine or burned to a disk and then used with real hardware. It is meant to showcase the various DEs that work with Linux and thus give anybody interested the oportunity to quickly take a look at them without all the hassle (i.e. finding out that they even exist, often building them yourself, getting them to run on your distro, etc.).

You can download version 0.1 of it from Bitshare.

If you want to check the integrity of the downloaded file, you can just put this into a new file and use md5sum:

f9d57debb8d83cba46f4dada042133a5 desktop_demo_dvd_0.1.iso

As you would guess when you read the version number, this release is mearly a first attempt. Right now it fits on a CD but that’s going to change. I’ll try to improve DDD if I find time for it and then release a second version.

Currently it provides a graphical login (using lxdm) and comes with as much as 5 DEs:

  • MATE
  • Xfce
  • LXDE
  • Enlightenment 17
  • Equinox DE

Using the DDD

If all goes well you should be greeted by the graphical login manager LXDM after startup. First open the list of available desktop environments (if you don’t change anything, LXDE will be started as default). To do so, click on the list to open it.

Graphical login: First step

Now select which one to start and then click on the user “desktopdemodvd”.

Graphical login: Second step

The password for the primary user desktopdemodvd is simply ddd. Enter it and then press the return key.

Graphical login: Last step

That’s it! The DE you selected from the list should be starting.

Issues with version 0.1

There are a few issues I didn’t find a solution for yet, but I didn’t want to postpone things again for an even longer delay. Probably the worst thing is performance: Even when using the ISO in a virtual machine on a fast PC it takes quite a while until the DEs finish loading. Please be patient. Because of that I can’t recommend burning it and using a disk. Also for some reason loging out of E-17 does not work.

Please report other problems, make suggestions and give feedback of any kind. I’d very much appreciate it!

What’s next?

I can’t promise when (or if!) a new DDD version will be released. The next post will be about the technical side of it and describe how to build an extended Arch live-cd including users other than root and with a graphical login (display manager).

Creating an Arch Live-CD

This post is about something which I actually wanted to try out for quite a while: Building a custom Live-CD!

Another “Rolling Release” annoyance

Today I just wanted to give a little tool called archiso a try – however it wasn’t just as easy as that. I was off for some weeks and when I returned home now, my Arch-powered machines couldn’t even connect to the net after doing an update… What happened? Well, the trifle of replacing SysVinit with Systemd

Yes, I know that it’s really my fault and that I should read the Arch news on a regular basis. But honestly: For people who have various distros in use, always keeping up with the latest changes proves be a pain in the proverbial. Once again I can only praise Gentoo for providing a news system inside the OS (“eselect news”) where important changes are announced a long time before they actually take place. This is definitely something that Arch lacks. At least IMHO.

Setting up our system

So what are we going to do this time? The idea is to be left with a bootable iso that loads Arch Linux and provides a graphical DE of some sort, preferably something not too big that needs to be installed as a custom package. I choose EDE² for that reason.

Since it’s always a good idea to start over with a clean system, let’s download the latest Arch install CD and in the meantime set up a new VirtualBox VM. In installing I follow more or less the way that the installation guide on the wiki suggests (which has not yet been updated to cover systemd).

Thanks to that change, I have to create a network profile in /etc/network.d/ (or copy one of the examples). After adding this profile to /etc/conf.d/netcfg, both netcfg.service itself and net-auto-wired.service have to be added to the services loaded at system start. That brings my network back.

Preparations

Alright. Next, I install sudo, links, git and wget (archiso needs it but it’s not listed as a dependency). Then I create a new user named “builder” and add him to the sudoers. Now I can logout and login again as the new user.

The version of archiso that’s in the repos is old and no longer working (among other things thanks to systemd). So we’re using links to go to the AUR and download the PKGBUILDs for archiso, edelib2 and ede2. Now let’s build packages for these, shall we?

Once that’s done, I log out “builder” and log in as root again. I create a new directory /root/newrepo, copy the edelib and ede packages there and change to that dir. Then I use repo-add newrepo.db.tar.gz edelib-2.0.1-1-i686.pkg.tar.xz to create a custom local repo (and add ede-2.0-3-i686.pkg.tar.xz, too, using the same script). Now I just install the archiso package I compiled from the AUR and we’re good to go.

Content of the archiso-releng

Configuring archiso and building!

First we create a new directory /root/archlive and copy the content of /usr/share/archiso/configs/releng/ there. Next I add my custom repo to the pacman.conf file in the new releng directory (that’s the one that is used for the build process, not /etc/pacman.conf! Now all that is left to do is actually adding packages to /root/archlive/releng/packages.i686.

I choose to add xorg-server, xorg-xinit, xf86-video-vesa, xf86-input-evdev, libxpm, edelib and ede. Finally I can issue the command ./build.sh -v build single netinstall afterwards. The script begins building!

Archiso scripts building the initial ram file system image

The script first syncs all repos and downloads the needed packages. Afterwards they are installed and an initramfs image is build which doesn’t take a long time. The next thing the script does is building multiple squashfs’. These are compressed read-only file systems that archiso makes heavy use of. Since it uses strong compression, their creation take quite a while.

Archiso scripts building the squashfs file systems

Once it’s done, we’re left with an iso file placed in the out folder. Yes, that’s all!

Of course, as you can see in the first image, there are some more files that would allow for some more customizing but for our basic purposes what we did here was actually all we had to!

Archiso scripts: building done!

Testing the iso

Now it’s time to test the iso. I could burn it to a real cd but that would be a pure waste. Luckily VirtualBox can boot from an iso file just like from a real cd.

Boot menu of our freshly built iso!

In my case all went well and I was able to boot from the iso. And finally I can startx into the desktop environment I chose for it!

I have to confess that I thought things would be a lot more difficult. But of course our example was about the simplest case one could come up with. Adding more files to the iso, setting up users, adding a display manager for graphical login, etc. are things some people might want to consider, too. But that’s a little beyond the scope of this entry.

Starting EDE² from the iso

What’s next?

The next post will reveal what the “DDD” is that I’ve been playing with for quite a while now.