Elevate to root only when necessary
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 root only when it is absolutely necessary.
!58 (merged): Add
xorrisocommand, 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 using
sudowhen the script is run as a regular user.
The things that require root are:
_make_custom_airootfs: file copying to airootfs and
/etc/skelcopying to airootfs and
pacman --sysroot- to generate packages list.
mount- to mount the FAT file system image.
find ... -deleteon airootfs and workdir. Also the
printfthat creates an empty
mksquashfs- it needs full access to airootfs to create the squashfs image.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information