Subject: diskless mode: apk add + lbu commit + reboot: miss a lot of packages!

From: [email-masked]
Date: Sat, 9 May 2020 19:38:25 +0200

Hi,

I’m installing a few packages (with lots of dependencies) in diskless mode:
that’s about 128 total.
They do all install fine, no errors and do work live.

I then do: lbu commit -d and reboot.
Lots of packages and services are missing after reboot.
I do same reinstall again: 106 get re-installed…
(so 22 were retained, but most were skimmed-out)

How does lbu decides to skim-out some of the packages?
How can I check, before rebooting, which ones will be skimmed & why?

Or does this skimming happen at early boot stage?
How to check what happens then?

Thanks for any tip!

PS: some are pinned to EDGE repo, logs here:
https://pastebin.com/Jby28SjF

---

From: Konstantin Kulikov <[email-masked]>
Date: Sat, 9 May 2020 22:04:13 +0300

> How does lbu decides to skim-out some of the packages?

Do you have apk cache enabled? /etc/apk/cache should be a symlink.
If not (if symlink does not exist), run setup-apkcache and see if that helps.

---

From: [email-masked]
Date: Sat, 9 May 2020 21:48:25 +0200

Hi,

Thanks for feedback. Yes cache is enabled and packages are
all in there. (when I re-install manually, files are not downloaded, they come
from cache). 

However at boot system do not reinstall them…
Unsure how install is managed at boot, if it follows some list hidden somewhere.

apk -v cache clean would remove them all obviously :(

> On 9 May 2020, at 21:04, Konstantin Kulikov <[email-masked]> wrote:
>

---

From: Konstantin Kulikov <[email-masked]>
Date: Sun, 10 May 2020 15:57:39 +0300

Start by examining apkovl file, use "lbu ci -v" to find where it is saved. Check that /etc/apk/world in apkovl contains your packages.
Remove "quiet" option from kernel cmdline in bootloader config and reboot.
Verify that initram loads correct file.

Code that loads apkovl at boot is here https://git.alpinelinux.org/mkinitfs/tree/initramfs-init.in#n563

---

From: [email-masked]
Date: Sun, 10 May 2020 16:42:15 +0200

Thanks.

I found the problem finally: I was doing install with --repositories-file REPO
option. Unexpectedly, when system reboots (with std repositories) it does not
seem to validate such cached apps.

If I set my REPO file into /etc/apk/repositories, then all is good, and all
cached apps are reloaded at boot time!

Really strange behaviour for cache validation, and I could not find any
detailed information about this.
Is that a feature or bug?
Would like to understand the reasoning to not get trapped in the future.

> On 10 May 2020, at 14:57, Konstantin Kulikov <[email-masked]> wrote:
>