Talk:Archiso

From ArchWiki
Latest comment: 4 March by Kinifwyne in topic Faulty `run_archiso` script

Archiso doesn't create home directory if there's no new line at the ned of passwd

If there is no new line at the end of the passwd file, the home directory for the user doesn't get created! but it's not refrenced in the wiki. should i add it? NimaIsTaken (talk) 12:50, 25 July 2023 (UTC)Reply

Ok, i added it. NimaIsTaken (talk) 14:46, 25 July 2023 (UTC)Reply

Archiso doesn't work on non stock kernel

I've been having on and off issues when building ISOs with archiso and the other day when I was working on one I did a pacman -Syu before working but didn't reboot. I was running on the stock kernel at that point because the linux-ck kernel had not updated yet. My ISO built fine. Later that day I rebooted and was now running on the updated linux-ck kernel and suddenly the build process would simply die without any errors, even with the -v option. Right after installing all the custom packages, a dd output appears and then a mkfs.vfat version message appears and that's where it dies. Rebooting back to the stock arch kernel fixed the issue. I'm guessing it has something to do with hardcoded names or something like that in the build scripts.

Is this normal behaviour? I don't mind using the stock kernel on the ISOs I build but I figured I'd at least be able to build them on a different one.

On that note, is it possible to use a kernel other than the stock one within the ISOs we build? Biltong (talk) Sun May 6 2012, 21:47 SAST

Estimating size? Starting over?

How do you best estimate the size?

How do you start over? Suppose just take `etc/`, delete the `releng/` directory recopy, put stuff back. Jasper1984 (talk) 13:46, 1 July 2013 (UTC)Reply

Best way to start over is delete releng/{work,out} it keeps cached packages, and there is no need to do every step from the beginning. —This unsigned comment is by Jqvillanova (talk) 14:08, 5 October 2013‎. Please sign your posts with ~~~~!

Encryption

  • with «cryptsetup», encrypt the file «airootfs.sfs» built with «mkarchiso» :
# cd /path/to/buildir/
# cd ./work/iso/arch/x86_64/
# cryptsetup --verify-passphrase plainOpen ./airootfs.sfs encrypt
# dd < ./airootfs.sfs > /dev/mapper/encrypt
# sync
# cryptsetup plainClose encrypt
# md5sum ./airootfs.sfs > ./airootfs.md5
# cd -

(note that you can't decrypt the encrypted file «airootfs.sfs» in the same «dd» way, instead use dd of=./airootfs.sfs conv=nocreat,notrunc < /dev/mapper/encrypt)

  • add the hook «encrypt» in «mkinitcpio.conf» :
# grep HOOKS ./work/airootfs/etc/mkinitcpio.conf
HOOKS="... encrypt"


  • insert these lines in «archiso» hook :
--- a/work/airootfs/usr/lib/initcpio/hooks/archiso
+++ b/work/airootfs/usr/lib/initcpio/hooks/archiso
@@ -65,6 +65,10 @@
     fi
     sfs_dev=$(losetup --find --show --read-only "${img}")
     echo ${sfs_dev} >> /run/archiso/used_block_devices
+    msg ":: Mapping encrypted squashfs..."
+    local map="${sfs_dev##*/}.map"
+    cryptsetup plainOpen "${sfs_dev}" "${map}"
+    sfs_dev="/dev/mapper/${map}"
     _mnt_dev "${sfs_dev}" "${mnt}" "-r" "defaults"
 }


  • rebuild initramfs and iso with «mkarchiso» and test :
# mkarchiso -r "mkinitcpio -p linux" run
# mkarchiso iso encrypted.iso
# qemu ... ./out/encrypted.iso


Lacsap (talk) 21:51, 20 Feb 2016 (UTC)

@Lacsap Can't manage to make it working. I managed to build the iso but it can't find /run/iso_name/bootmnt. I think I have missed the decryption part. Tallero (talk) 11:43, 17 October 2021 (UTC)Reply

Example configurations

Where should sets of ArchISO customizations go? Should there be an "Examples" header added to the bottom? Like for how to enable remote ssh login, boot with serial console support for headless systems, etc? Or a separate page? [Archiso offline] is a separate page, but it was marked for possible merging since it's an (out of date) clone of this page. Jamespharvey20 (talk) 02:38, 25 April 2019 (UTC)Reply

I guess your changes (adding ssh configs) should be done airootfs directory. But I did not yet explored how to add another systemd services to archiso. Adding info about how to enable ssh login to this page seems useful for me. Ashark (talk) 17:42, 25 April 2019 (UTC)Reply

ISO does not build with secure boot enabled

It seems that if you have secure boot enabled and have signed the Linux kernel, the ISO will fail to build, saying that /boot/vmlinuz-linux does not exist. However, once you disable secure boot, the ISO starts getting built again. Just tried this, and it appears to go back at least to archiso version 36.

Sunflsks (talk) 18:58, 26 May 2020 (UTC)Reply

To clarify, I don't really know why it doesn't work. If possible, could someone else test this, to see if it's just a problem on my computer or more widespread. If so, then maybe we should add a warning to the wiki page.
Sunflsks (talk) 04:54, 27 May 2020 (UTC)Reply
I don't use secure boot myself, so I don't know how it works. Since 5.3.8.1 the linux package does not install the kernel to /boot/vmlinuz-linux, but to /usr/lib/modules/VERSION/vmlinuz and mkinitcpio's pacman hooks copy it to /boot/. If the kernel image is not getting copied somewhere in the ISO's chroot, maybe there is something wrong with the hooks... -- Lahwaacz (talk) 09:39, 30 May 2020 (UTC)Reply

Add a section to Tips and Tricks to build an ISO for installation entirely over a serial console

I've been looking all over for a good way to do this. I think I have an approach that could work (although it's still to be tried). What do we think about adding this? Has anyone got a recipe? If not, I'm happy to give it a go.

Bradwood (talk) 11:33, 14 November 2020 (UTC)Reply

The solution is to simply add a console=ttyS* kernel parameter to boot loader configuration. As for why it's not done by default in releng, see https://gitlab.archlinux.org/archlinux/archiso/-/issues/75. -- nl6720 (talk) 12:28, 14 November 2020 (UTC)Reply
I get that, but you need to _get_ to the bootloader menu first, and that currently doesn't happen over the console to my knowledge... Bradwood (talk) 13:55, 14 November 2020 (UTC)Reply
I meant editing the boot loader configuration for the ISO and then building the ISO. As for seeing the boot loader over serial, it should work when booting in BIOS mode (this doesn't prevent installing the system for UEFI booting, you just need to install the boot loader to the default/fallback boot path). -- nl6720 (talk) 05:23, 15 November 2020 (UTC)Reply

mention mkosi

It seems that mkosi offers similar functionalities. What about mentioning mkosi in Category:Live_Arch_systems and under archiso#See_also? PXf (talk) 07:33, 7 March 2023 (UTC)Reply

pacman.conf

When copying the releng profile, `pacman.conf` is not in profile/airootfs/etc but in profile/. Is that normal? Tid91 (talk) 18:21, 15 February 2024 (UTC)Reply

Yes, it's for creating the image (see [1] versus Archiso#Adding repositories to the image). --Indigo (talk) 15:50, 16 February 2024 (UTC)Reply

Troubleshooting workdir permissions

Failed to read file /home/xzntrc/Arch/work/x86_64/airootfs/proc/kallsyms, creating empty file appears to hit some users (https://www.reddit.com/r/archlinux/comments/10p0i1f/archiso_creating_empty_file_error/) due to permissions on the work directory. Possibly when compression is on for BTRFS? The workaround appears to be changing the build dir.

Maybe it's worth adding in a troubleshoot entry in the wiki?

Torxed (talk) 15:02, 1 March 2024 (UTC)Reply

Faulty `run_archiso` script

On my machine, run_archiso -u -i out/archlinux-2024.03.04-x86_64.iso resulted in the following error:

qemu-system-x86_64: could not stat pidfile /run/user/1000/pulse/pid: No such file or directory

I was able to fix it by copying the run_archiso script and changing the following line:

-audiodev pa,id=snd0 \ to -audiodev pa,id=snd0 \

I do have pipewire-pulse installed. Should the wiki be changed, or should the archiso package be changed? Kinifwyne (talk) 17:50, 4 March 2024 (UTC)Reply