Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • A archiso
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
    • Locked Files
  • Issues 41
    • Issues 41
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Arch LinuxArch Linux
  • archiso
  • Issues
  • #61
Closed
Open
Issue created Aug 26, 2020 by nl6720@nl6720Developer

Copy custom airootfs files with correct permissions and ownership

mkarchiso in _make_custom_airootfs copies airootfs files from the profile directory to the working directory using cp -af --no-preserve=ownership.

  • Since the script is run as root, root becomes the owner of all files. This is an issue for custom files that should not be root owned, like those in user home directories. That's why a chown is used to fix it.
  • File permissions on the system where mkarchiso runs affect the permissions of the files in the resulting airootfs. This can be observed by setting umask 0027 before cloning archiso git repo or before copying a profile from /usr/share/archiso/configs/*. For a few files like /etc/shadow and /etc/gshadow, this is corrected with chmod.

Both of these things are ugly and I want to get rid of them. That requires some way to specify user and group ownership, and permissions when copying. My idea is to create a airootfs.filelist in the profile directory which would list the UID, GID, mode and file name of each and every file in the custom airootfs directory. E.g., something like this:

0:0:0640:/root/.zlogin
0:0:0750:/root/.automated_script.sh

Listed files would then be copied using install by going over this list.

_make_customize_airootfs also has a cp command (cp -RdT --preserve=mode,timestamps,links), but that preserves permissions and timestamps while copying files withing the confines of airootfs. Since install cannot preserve permissions, it sadly cannot be used.

Now, the problem is the airootfs.filelist file format. File paths can contain any character except NUL. That means entries cannot be newline separated, but using NUL as a separator will make the file hard to read and edit.

Edited Aug 26, 2020 by nl6720
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking