Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/README.profile.rst
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2020-11-14 11:43:13 +0200
committernl6720 <nl6720@gmail.com>2020-11-30 08:46:24 +0200
commit42d9e4f983e9dbafb94a6fc52df1b25973afb63a (patch)
tree7829f50747c432567aaaee0a51f5738524ae3ab6 /README.profile.rst
parent2c99df5c9bb89308231a0281d3b8399bb06cc4c0 (diff)
Allow specifying ownership and mode of custom airootfs files and directories
profiledef.sh can now contain an associative array called file_permissions which can be used to set custom ownership and mode of custom airootfs files. The array's keys contain the path and the value is a colon separated list of owner UID, owner GID and access mode. For example: file_permissions=( ["/etc/shadow"]="0:0:400" ) This means that mkarchiso now copies airootfs files (and directores) without permissions and anything that should be owned by a user other than root and/or if the mode should be something other than 644 for files and 755 for directories must to be listed in ${file_permission[@]} in profiledef.sh. Fixes https://gitlab.archlinux.org/archlinux/archiso/-/issues/61 .
Diffstat (limited to 'README.profile.rst')
-rw-r--r--README.profile.rst8
1 files changed, 6 insertions, 2 deletions
diff --git a/README.profile.rst b/README.profile.rst
index fef34f9..1729319 100644
--- a/README.profile.rst
+++ b/README.profile.rst
@@ -52,6 +52,9 @@ The image file is constructed from some of the variables in **profiledef.sh**: `
- `ext4+squashfs`: Create an ext4 partition, copy the airootfs work directory to it and create a squashfs image from it
* `airootfs_image_tool_options`: An array of options to pass to the tool to create the airootfs image. Currently only
`mksquashfs` is supported - see `mksquashfs --help` for all possible options (defaults to `('-comp' 'xz')`).
+ - `file_permissions`: An associative array that lists files and/or directories who need specific ownership or
+ permissions. The array's keys contain the path and the value is a colon separated list of owner UID, owner GID and
+ access mode. E.g. `file_permissions=(["/etc/shadow"]="0:0:400")`.
packages.arch
=============
@@ -91,8 +94,9 @@ airootfs
This - optional - directory may contain files and directories that will be copied to the work directory of the resulting
image's root filesystem.
The files are copied before packages are being installed to work directory location.
-Ownership of files and directories from the profile's `airootfs` directory are not preserved (permissions are currently
-the same as in the profile's `airootfs` - see `#61 <https://gitlab.archlinux.org/archlinux/archiso/-/issues/73>`_).
+Ownership and permissions of files and directories from the profile's `airootfs` directory are not preserved. The mode
+will be `644` for files and `755` for directories, all of them will be owned by root. To set custom ownership and/or
+permissions, use `file_permissions` in **profiledef.sh**.
With this overlay structure it is possible to e.g. create users and set passwords for them, by providing
`airootfs/etc/passwd`, `airootfs/etc/shadow`, `airootfs/etc/gshadow` (see `man 5 passwd`, `man 5 shadow` and `man 5