|
| 1 | +Title: Building a Custom Arch Linux Live ISO in the Cloud |
| 2 | +Date: 2024-03-11 |
| 3 | +Category: Linux |
| 4 | +Tags: AWS, Arch Linux, How-to |
| 5 | +Slug: custom-live-arch-linux-iso |
| 6 | +Author: Benson Muite |
| 7 | +Summary: Build a live iso that can be booted from a USB stick |
| 8 | + |
| 9 | +# Building a Custom Arch Linux Live ISO in the Cloud |
| 10 | + |
| 11 | +[Arch Linux](https://archlinux.org/) has a number of packages that may not be available |
| 12 | +in other distributions, in particular [Ink/Stitch](https://aur.archlinux.org/packages/inkstitch). |
| 13 | +It can be helpful to be able to run such a program on another computer which may not have it |
| 14 | +installed. A live iso can help one do this. Building a bootable live ISO image on the cloud |
| 15 | +can be convenient as it can be automated and allow saving on bytes needed to download build |
| 16 | +dependencies to a local computer. The following steps enable building on [AWS](https://aws.amazon.com) |
| 17 | +using the [Arch Linux image](https://console.aws.amazon.com/ec2/home?region=us-east-1#launchAmi=ami-0ec4fc08d715411ba). |
| 18 | + |
| 19 | +Log into the instance |
| 20 | + |
| 21 | +``` |
| 22 | + |
| 23 | +``` |
| 24 | + |
| 25 | +After logging in, first repopulate the keys and update the system |
| 26 | + |
| 27 | +``` |
| 28 | +sudo pacman -Scc |
| 29 | +sudo rm -rf /etc/pacman.d/gnupg |
| 30 | +sudo pacman-key --init |
| 31 | +sudo pacman-key --populate |
| 32 | +sudo pacman -Syu |
| 33 | +``` |
| 34 | + |
| 35 | +Next install [archuseriso](https://github.com/laurent85v/archuseriso) |
| 36 | +``` |
| 37 | +sudo pacman --needed -Sy git arch-install-scripts bash dosfstools e2fsprogs \ |
| 38 | + erofs-utils grub libarchive libisoburn make mtools parted squashfs-tools syslinux |
| 39 | +git clone https://github.com/laurent85v/archuseriso.git |
| 40 | +sudo make -C archuseriso install |
| 41 | +``` |
| 42 | + |
| 43 | +Inkstitch is available in [Aur](https://aur.archlinux.org/packages/inkstitch), but not |
| 44 | +in the main Arch repositories. To add it to the live iso image, first create a local |
| 45 | +repository with a locally built Ink/Stitch package. |
| 46 | + |
| 47 | +``` |
| 48 | +sudo pacman --noconfirm -S basedevel inkscape |
| 49 | +git clone |
| 50 | +cd inkstitch |
| 51 | +makepkg --install |
| 52 | +cd .. |
| 53 | +mkdir inkstitchdb |
| 54 | +cd inkstitchdb |
| 55 | +repo-add inkstitch.tar.gz ../inkstitch/*.pkg.tar.zst |
| 56 | +cd .. |
| 57 | +cp inkstitch/*.zst inkstitchdb/ |
| 58 | +``` |
| 59 | + |
| 60 | +Create a profile for the image using the lxqt image as the starting point |
| 61 | +``` |
| 62 | +cd archuseriso |
| 63 | +cd profiles |
| 64 | +cp -r lxqt inkstitch |
| 65 | +cd inkstitch |
| 66 | +echo inkscape >> packages.x86_64 |
| 67 | +echo inkstitch >> packages.x86_64 |
| 68 | +sed -i 's/\#[custom]/[inkstitch]/g' pacman.conf |
| 69 | +sed -i 's/\#SigLevel = Optional TrustAll/SigLevel = Optional TrustAll/g' \ |
| 70 | +pacman.conf |
| 71 | +sed -i 's|\#Server = file:///home/custompkgs|Server = file:///home/arch/inkstitchdb|g' \ |
| 72 | +pacman.conf |
| 73 | +sed -i 's|iso_name="aui-lxqt-inkstitch"|iso_name="aui-lxqt-inkstitch"|g' \ |
| 74 | +profiledef.sh |
| 75 | +cd ../../.. |
| 76 | +``` |
| 77 | + |
| 78 | +Build the live iso image |
| 79 | +``` |
| 80 | +sudo aui-mkiso archuseriso/profiles/inkstitch/ |
| 81 | +``` |
| 82 | +Once done, the resulting iso should be available at |
| 83 | +``` |
| 84 | +/home/arch/out/aui-lxqt-inkstitch-linux_6_7_9-0310-x64.iso |
| 85 | +``` |
| 86 | + |
| 87 | +## References |
| 88 | + |
| 89 | +- https://wiki.archlinux.org/title/Install_Arch_Linux_on_a_removable_medium |
| 90 | +- https://wiki.archlinux.org/title/Archiso |
| 91 | +- https://mags.zone/help/arch-usb.html |
| 92 | +- https://wiki.archlinux.org/title/Pacman/Tips_and_tricks#Custom_local_repository |
| 93 | + |
| 94 | +*Available under a [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license* |
0 commit comments