Tux the builder

Welcome to ARGLinux - a How-to for Arch Linux based live systems.

There are several reasons to build an own live system. For special purposes, for exotic hardware or just because it is possible. ARGLinux "exists" because it is possible.

What do you need?

An installed Arch Linux, archiso and some patience.

How it works

At first the base system:

mkarchiso -v init

After this you can install any program you find in the Arch Linux Repositories. The xserver, windowsmanager OpenBox, chromium for browsing the internet, lxterminal as terminal emulator, feh to draw the background image, lxdm to login automatically and a few other programs and libraries.

mkarchiso -v -p "xorg-server xorg-server-utils xorg-xinit mesa xf86-video-ati xf86-video-intel xf86-video-nouveau xf86-video-vesa xf86-input-evdev xf86-input-synaptics openbox obconf obmenu oblogout lxdm lxterminal chromium feh xfce4-power-manager volumeicon ttf-droid ttf-linux-libertine tint2 networkmanager usb_modeswitch network-manager-gnome evince mplayer lxmusic gpicview leafpad mc lynx openssh gksu faenza-icon-theme openbox-themes tightvnc " install

After this chroot into the working directory to configure your live system.

cp /etc/resolv.conf work/airootfs/etc/resolv.conf
mkarchiso -r "bash" run

Add an user, here it is "arg" for example:

useradd -m -g users -s /bin/bash arg

Change the password of the user:

passwd arg

Add the user to sudoers because the live-system should be able to use without a password.

echo "arg ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

Set the timezone, f.e. for germany:

ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime

Set the hostname:

echo "arglinux" > /etc/hostname

Set the encoding, f.e. german, UTF-8:

echo 'LANG="de_DE.UTF-8"' > /etc/locale.conf

set keymap, f. e. for standard german:

echo "KEYMAP=de-latin1" > /etc/vconsole.conf

Set up programs to start with systemd, f.e. networkmanager, modemmanager and the displaymanager LXDM.

ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
ln -s '/usr/lib/systemd/system/NetworkManager.service' '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
ln -s '/usr/lib/systemd/system/ModemManager.service' '/etc/systemd/system/dbus-org.freedesktop.ModemManager.service'
ln -s '/usr/lib/systemd/system/ModemManager.service' '/etc/systemd/system/multi-user.target.wants/ModemManager.service'
ln -s '/usr/lib/systemd/system/lxdm.service' '/etc/systemd/system/display-manager.service'

Make pacman usable:

echo "Server = http://ftp.tu-chemnitz.de/pub/linux/archlinux/$repo/os/$arch" > /etc/pacman.d/mirrorlist
haveged &
pacman -Syy
pacman-key --init
pacman-key --populate archlinux
pkill haveged

Login livesession user automatically

echo "autologin=arg" >> /etc/lxdm/lxdm.conf

Set up session:

echo "session=/usr/bin/openbox-session" >> /etc/lxdm/lxdm.conf"

Set up programs to autostart with OpenBox into /etc/xdg/openbox/autostart :

feh --bg-scale /usr/share/wallpapers/wallpaper.png &
tint2 &
nm-applet &
volumeicon &
xfce4-power-manager &

Leave chroot


Prepare hooks

cp /usr/lib/initcpio/hooks/archiso work/airootfs/usr/lib/initcpio/hooks
cp /usr/lib/initcpio/install/archiso work/airootfs/usr/lib/initcpio/install

Create file work/airootfs/etc/mkinitcpio-archiso.conf and put in

HOOKS="base udev archiso modconf block filesystems usbinput"

Make directory for kernelimage and write into it:

mkdir work/airootfs/boot/x86_64
mkarchiso -r "mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/x86_64/archiso.img" run
mkdir -p work/iso/arch/boot/x86_64
mv work/airootfs/boot/vmlinuz-linux work/iso/arch/boot/x86_64/vmlinuz
mv work/airootfs/boot/x86_64/archiso.img work/iso/arch/boot/x86_64/archiso.img
cp work/airootfs/usr/lib/syslinux/menu.c32 work/iso/arch/boot/syslinux/
mkdir work/iso/isolinux
cp work/airootfs/usr/lib/syslinux/isolinux.bin work/iso/isolinux/
cp work/airootfs/usr/lib/syslinux/isohdpfx.bin work/iso/isolinux/

Make the bootloader directory:

mkdir -p work/iso/arch/boot/syslinux

Make file work/iso/arch/boot/syslinux/syslinux.cfg and put into:

DEFAULT menu.c32

LABEL arch
LINUX /arch/boot/x86_64/vmlinuz
INITRD /arch/boot/x86_64/archiso.img
APPEND archisolabel=ARGLinux_0.8.15


Create file work/iso/isolinux/isolinux.cfg and put into:

DEFAULT loadconfig

LABEL loadconfig
  CONFIG /arch/boot/syslinux/syslinux.cfg
  APPEND /arch/boot/syslinux/

Make the aitab

echo "airootfs      /                     x86_64     xz          ext4       50%" > work/iso/arch/aitab 

Load loop module.

modprobe loop

Prepare creation of the iso:

mkarchiso -v prepare

Make the iso

mkarchiso -v -L "ARGLinux_0.8.15" iso "ARGLinux_0.8.15.iso"

You will find it in the directory out.