Conversation
It creates library directories (through passed LIB_DIRS variable from outside), the binary directories and necessary symlinks (sbin to bin, or lib to /usr/lib and the likes). The rest of the basic filesystem directories (/dev, /proc and so on) will be created by tmpfiles.
"sbin" is about to become a symlink to its "bin" counterpart, so having "sbin" in PATH is pointless since its "bin" counterparts are already there.
This is so that the dumb tmpfiles processor will know how to create a parent directory of `/home/core`.
8ec52c7 to
65af4cd
Compare
It's a temporary solution, which will be dropped once we migrate to Gentoo's baselayout. It is quite a dubm and simple processor, because it is very limited in its functionality compared to systemd's tmpfiles processor, and it requires the user and group to be passed up front through the environment variables. This is because the script is tailored to be used only in the ebuild, when installing baselayout in src_install and pkg_preinst phases. In src_install the script will be used to install the files and symlinks, together with their parent directories, thus excluding the empty directories. These will get created in the pkg_preinst phase. The point of adding the script was to stop using systemd's tmpfiles processor, which requires user and group information to exist in /etc/passwd or /etc/group. Obviously it would be even better to not abuse the tmpfiles for the package installation purposes, but I think that this will come with the switch to Gentoo's baselayout.
Sort the files and directories that the Makefile installs into categories, so that everything that gets installed to `/etc` is inside `etc` directory. Same for `/usr/bin` and `bin`, `/usr/lib` and `lib`, and `/usr/share` and `share`. The files in `scripts` (one script and one systemd unit) were moved to `bin` and to `share`. For SDK builds these will be removed before installation, which is why the `bin` part is made optional in Makefile.
These seem to be unwanted by either SDK (flatcar-profile.sh, vimrc) or generic image (issue). Avoiding installing them can be done in the ebuild by just removing the file in src_prepare phase now, instead of fiddling with sed to edit the tmpfiles.
65af4cd to
d95d5ca
Compare
|
I don't understand why you've added this "dumb" tmpfiles implementation. The ebuild used to call systemd-tmpfiles itself, and this was fine? The dependencies were wrong though, sys-apps/systemd should have been under |
|
Thanks for the review, will fix the issues and get back to you. I just added Gentoo baselayout to SDK too just to see what the structure it actually installs. Should have done that in the beginning.
It wasn't entirely fine - some files were either installed with wrong user or not installed at all. I think it was mostly the former, so stuff ended up being installed as root. So the script requires passing this infos through env vars instead. This also required some special casing for installing home directory for
I don't think sys-apps/systemd is really needed at all, so I dunno if it should be a dependency of baselayout with my changes. But I didn't tinker with dependencies at all, left the as they were thinking that this will need a cleanup anyway later. |
f92cc16 to
8e203be
Compare
The Makefile is already aware of LIBDIRS so use it to generate the tmpfiles config file for the /lib to usr/lib symlinks.
Those are always going to look like this, so no point in having those generated in the ebuild or Makefile.
`/usr/local/sbin` is not a symlink, it should be a separate directory. Also `/sbin` should be a symlink directly to `usr/bin`. Similar fixes were needed for the debug directories and symlinks.
8e203be to
b432a05
Compare
Please read the commit messages for detailed information.
The high level goals of this PR and it's parent PR in scripts (flatcar/scripts#2068) is to convert SDK from split-usr to merged-usr layout and finish that process for generic images (merged-bin).
High level changes:
share,bin,libandetcCI: http://jenkins.infra.kinvolk.io:8080/job/container/job/sdk/1697/cldsv/ (it passed once, but I made some more changes, so rerunning it to make sure nothing broke)