~alpine/users

3 2

A persistent mini root filesystem, apk add errors, and --force-non-repository

Details
Message ID
<CAPxz1+ZZwr7kdWDbRvGotxy7U_f9OehBwy9xtWFBDDyjFu2yBA@mail.gmail.com>
DKIM signature
missing
Download raw message
Hello,

I am running a version 3.15.0 Alpine mini root filesystem in a chroot
environment.

When I run 'apk add' to install a custom-built package, I get this error:

ERROR: You tried to add a non-repository package to system, but it
would be lost on next reboot. Enable package caching (apk cache
--help) or use --force-non-repository if you know what you are doing.

In my case, the underlying filesystem is persistent, so I don't
believe enabling package caching is appropriate.

Additionally, the mini root filesystem is not aware of reboots at all.
I simply chroot into the filesystem when I want to use it.  (Actually,
I am using lxroot, not chroot, but that probably makes no difference.)

My question is:  How do I configure the extracted mini root filesystem
so that it believes it is persistent?  I'd like to avoid using
--force-non-repository if possible.

Thank you,

Parke
Details
Message ID
<CGY656PM53SZ.146H6XKCYPUFL@psykose>
In-Reply-To
<CAPxz1+ZZwr7kdWDbRvGotxy7U_f9OehBwy9xtWFBDDyjFu2yBA@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> ERROR: You tried to add a non-repository package to system, but it
> would be lost on next reboot. Enable package caching (apk cache
> --help) or use --force-non-repository if you know what you are doing.
>
> Additionally, the mini root filesystem is not aware of reboots at all.
> I simply chroot into the filesystem when I want to use it. (Actually,
> I am using lxroot, not chroot, but that probably makes no difference.)
>
> My question is: How do I configure the extracted mini root filesystem
> so that it believes it is persistent? I'd like to avoid using
> --force-non-repository if possible.

That warning is printed when apk detects that its database is on a tmpfs
(and is missing either the cache or the override flag, as you saw). A
regular chroot always worked for me, so I'm not sure if lxroot is doing
something different here.
Details
Message ID
<CAPxz1+Zivs-x7UskYzOB-1Si6LoctjW=1t+RrCuf9eQ7TH=sEQ@mail.gmail.com>
In-Reply-To
<CGY656PM53SZ.146H6XKCYPUFL@psykose> (view parent)
DKIM signature
missing
Download raw message
On Wed, Jan 5, 2022 at 4:35 PM alice <alice@ayaya.dev> wrote:
> That warning is printed when apk detects that its database is on a tmpfs
> (and is missing either the cache or the override flag, as you saw). A
> regular chroot always worked for me, so I'm not sure if lxroot is doing
> something different here.

Interesting.  I do happen to be running on tmpfs in this particular
case, although just for testing purposes.

Thanks for the explanation.
Details
Message ID
<CGY7WSTLY2PL.1JORB7GGFI6QA@psykose>
In-Reply-To
<CAPxz1+Zivs-x7UskYzOB-1Si6LoctjW=1t+RrCuf9eQ7TH=sEQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> Interesting. I do happen to be running on tmpfs in this particular
> case, although just for testing purposes.

Then i would guess it is caused by having the apk db (i think it is
/lib/apk/db/) on the tmpfs- that will always throw that error.
Reply to thread Export thread (mbox)