Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish merged-usr process for generic images, move SDK over to it too #2068

Merged
merged 8 commits into from
Sep 5, 2024

Conversation

krnowak
Copy link
Member

@krnowak krnowak commented Jun 28, 2024

Current situation:

  • SDK:
    • /bin, /sbin, /lib, /lib64, /usr/bin, /usr/sbin, /usr/lib, /usr/lib64 are all directories
  • generic:
    • /usr/bin, /usr/sbin, /usr/lib, /usr/lib64 are all directories
    • /bin, /sbin, /lib, /lib64 are symlinks to their counterparts in /usr.

New situation for both (essentially known as merged-usr in Gentoo):

  • /usr/bin, /usr/lib, /usr/lib64 are all directories
  • /sbin and /usr/sbin are effectively symlinks to /usr/bin
  • /bin, /lib, /lib64 are symlinks to their counterparts in /usr.

Directories in /usr/local are left as is, so /usr/local/sbin is still a directory, not a symlink to bin.

There is quite a sizeable refactor of the baselayout ebuild, so please have a look at the commit messages.

CI: http://jenkins.infra.kinvolk.io:8080/job/container/job/sdk/1714/cldsv/

Needs flatcar/baselayout#34 and flatcar/mantle#551.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

@krnowak krnowak force-pushed the krnowak/merged-usr branch 3 times, most recently from 37ecceb to 35ea72f Compare July 1, 2024 13:22
@krnowak
Copy link
Member Author

krnowak commented Jul 2, 2024

Filed a fix for Gentoo: gentoo/gentoo#37397

Copy link

github-actions bot commented Jul 2, 2024

Build action triggered: https://github.com/flatcar/scripts/actions/runs/9758685125

@krnowak krnowak force-pushed the krnowak/merged-usr branch from 5186e41 to 51d5401 Compare August 16, 2024 15:39
@krnowak krnowak force-pushed the krnowak/merged-usr branch from 51d5401 to d746d41 Compare August 26, 2024 13:54
@krnowak krnowak force-pushed the krnowak/merged-usr branch from d746d41 to 7922c51 Compare August 26, 2024 17:23
@krnowak krnowak force-pushed the krnowak/merged-usr branch from 7922c51 to ef02adb Compare August 26, 2024 17:45
@krnowak krnowak force-pushed the krnowak/merged-usr branch from ef02adb to e4fe1e7 Compare August 27, 2024 11:30
@krnowak krnowak force-pushed the krnowak/merged-usr branch from 8a83c45 to 8c479d9 Compare August 29, 2024 12:27
@krnowak krnowak marked this pull request as ready for review August 29, 2024 13:06
@krnowak krnowak requested a review from a team August 29, 2024 13:06
@krnowak krnowak added the main label Aug 29, 2024
@krnowak krnowak force-pushed the krnowak/merged-usr branch from 8c479d9 to 57f01a1 Compare August 30, 2024 13:33
The initial goals of this commit were:

- drop symlink-usr USE flag and keep the code paths where symlink-usr
was evaluated to true,

- make sbin a symlink to its bin counterpart, effectively doing the
merged-sbin process too

- unify filesystem layouts of the SDK and generic images.

But over the course, more changes have accumulated:

- use EAPI 8,

- drop the check_sym function - it never worked due to typos
  (real_path and real_value versus read_path and read_value),

- do the SDK-specific or generic-image-specific customizations in the
  src_prepare phase,

- follow the changes made in the baselayout repository:

  - remove unnecessary tmpfiles.d conf files instead of fiddling with
    sed to edit them:

    - in the baselayout repo, the conf files were split to make it
      possible,

  - use tmpfiles.d to create core home directory:

    - used to be done differently for generic images and for SDKs,

  - use dumb-tmpfiles-proc.sh instead of systemd's tmpfile processor:

    - this removes the need to install valid passwd and group files
      into /etc before,

    - also it seems to be fixing some issues with installing files for
      users and groups that weren't there anyway,

  - drop generating of baselayout-usr in src_compile, and creating
    debug directories in pkg_preinst, these are handled by the
    Makefile now

    - this made inheriting systemd and tmpfiles eclasses unnecessary

- install files in the src_install phase and install the directory
  structure in the pkg_preinst phase:

  - empty directories created in src_install are not guaranteed to be
    preserved, and indeed at some point /usr/local/bin was not
    installed on the final rootfs,

- currently installed /etc/passwd and /etc/group are now empty

- drop DEPEND variable entirely - systemd isn't really needed, I don't
  know what was the point of depending on libidn2, and the rest were
  conflicts with some old versions of packages.
Mask split-usr globally, not only for generic images. Move some SDK
only USE flags to SDK target profile (cros_host, expat). Drop
duplicated disabling of cups USE flag.
It seems to be randomly kept or removed during installation, and we
need the directory when creating the SDK container.
@krnowak krnowak merged commit b99e666 into main Sep 5, 2024
1 check failed
@krnowak krnowak deleted the krnowak/merged-usr branch September 5, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

3 participants