caleb on Nostr: slowly losing my will to live as i dive deeper into apk-tools + Alpine + /usr merge + ...
slowly losing my will to live as i dive deeper into apk-tools + Alpine + /usr merge + pmbootstrap
i mean, it's solvable, the constraints are just so tight. Like... dynamically fixing Alpine packages so they work on a /usr merge system at runtime requires handling every possible case, like all of these symlinks needs to be detected and skipped (since with /usr merge they become recursive):<li>/bin/foo -> /usr/bin/foo</li><li>/bin/foo -> ../usr/bin/foo</li><li>/usr/bin/foo -> /bin/food</li><li>/usr/bin/foo -> ../../bin/foo</li>
then the same for /lib -> /usr/lib and /usr/sbin
Plus, simply making them absolute symlinks is extremely bad behaviour since it breaks operating on a foreign rootfs (apk --root ...), we just ignore this for now...
And then you get caught out by crap like /bin/go being a symlink to /usr/lib/go/bin/go
i think im getting close, but hitting some weird issues with pmb and apk3...
it would probably not be so bad if I didn't also have to write all this in C
https://gitlab.com/postmarketOS/apk-tools/-/commit/954af7ba48c492cca87b333b0be578a9877cce7a
i mean, it's solvable, the constraints are just so tight. Like... dynamically fixing Alpine packages so they work on a /usr merge system at runtime requires handling every possible case, like all of these symlinks needs to be detected and skipped (since with /usr merge they become recursive):<li>/bin/foo -> /usr/bin/foo</li><li>/bin/foo -> ../usr/bin/foo</li><li>/usr/bin/foo -> /bin/food</li><li>/usr/bin/foo -> ../../bin/foo</li>
then the same for /lib -> /usr/lib and /usr/sbin
Plus, simply making them absolute symlinks is extremely bad behaviour since it breaks operating on a foreign rootfs (apk --root ...), we just ignore this for now...
And then you get caught out by crap like /bin/go being a symlink to /usr/lib/go/bin/go
i think im getting close, but hitting some weird issues with pmb and apk3...
it would probably not be so bad if I didn't also have to write all this in C
https://gitlab.com/postmarketOS/apk-tools/-/commit/954af7ba48c492cca87b333b0be578a9877cce7a