Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • apk-tools apk-tools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 95
    • Issues 95
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alpinealpine
  • apk-toolsapk-tools
  • Issues
  • #10778
Closed
Open
Issue created Nov 05, 2021 by Daniel Kolesa@q66Contributor

initdb and usrmerge-style systems

I'm using apk-tools as a downstream in https://chimera-linux.org. It works quite well, I've been able to deal with most aspects of the package manager (not yet sure about apk3 though; going to do the migration as soon as that goes stable). There is just one thing, and that is the --initdb option for initializing fresh roots.

Chimera has a usrmerge-style layout, i.e. /lib is a symlink to /usr/lib and so on. That means if you use --initdb and it populates the intial structure, it will create lib in the root as a directory (https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/50ab589e/src/database.c#L1341) and once one of the base packages (base-files, it is installed first, before everything else) attempts to install the symlink, it all goes wrong.

What I do for now is avoid --initdb and populate the structure manually (the package build system does that internally, and for installing systems i have a special root bootstrap script similar to the likes of debootstrap). I'm not completely happy about having to do that though, so I'm looking for potential solutions. Something like a pre-install script that would fix it up would not work since at the point the package is extracted, a script environment is not available yet, and also I would like to avoid having to run any hooks or triggers for all dependencies of the minimal root metapackage (for robustness)

Assignee
Assign to
Time tracking