Support running as a regular (non-root) user
Running the whole script as root is excessive and it tremendously complicates signing the Squashfs image with GPG. It would be better to elevate to support running as a regular using, e.g. using unshare.
TODO:
-
!58 (merged): Add -rational-rocktoxorrisocommand, so that all files in the ISO (in Rock Ridge, not Squashfs) are owned by root and have sane permissions. -
Launch commands that require root privileges (i.e. manipulate files in $pacstrap_dir) usingunsharewhen the script is run as a regular user.
The things that require root are:
-
_make_custom_airootfs: file copying to airootfs andchown. -
_make_packages:pacstrap -
_make_customize_airootfs:/etc/skelcopying to airootfs andarch-chrootforcustomize_airootfs.sh. -
_make_pkglist:pacman --sysroot- to generate packages list. -
_make_boot_uefi-x64.systemd-boot.esp:mount- to mount the FAT file system image. -
_cleanup:find ... -deleteon airootfs and workdir. Also theprintfthat creates an empty/etc/machine-id. -
_mkairootfs_ext4+squashfs,_mount_airootfs,_umount_airootfs:mountandchownwithairootfs_image_type="ext4+squashfs". -
_run_mksquashfs:mksquashfs- it needs full access to airootfs to create the squashfs image.
Edited by nl6720