Re: Running an ostree deployment in a container




On 04/27/2018 10:11 PM, Philip Withnall wrote:
You can use nspawn’s --pivot-root argument to simulate the OSTree pivot
root done during a normal boot:

sudo systemd-nspawn -i ~/image.raw \
   --bind +/sysroot/ostree/deploy/$os/var:/var \
   --pivot-sysroot /ostree/deploy/$os/deploy/$checksum.0

See my earlier e-mail on it here:

https://mail.gnome.org/archives/ostree-list/2017-February/msg00007.html

Thanks, indeed I've seen this discussion, and the command you mention
here is even documented in `man systemd-nspawn`. What I found is that it
works for a raw image (ie. `-i ~/image.raw`), however it doesn't work
with a directory (ie. `-D ~/image/`). systemd-nspawn complains with:

    Directory /usr/src/deployment doesn't look like an OS root directory
(os-release file is missing). Refusing.

It looks like in this case systemd-nspawn checks the OS root dir before
pivot-rooting, probably looking for the file /etc/os-release. And before
pivot-rooting there's no such file. So it might just be something to fix
in systemd-nspawn. Do you remember using `systemd-nspawn -D` (ie.
--directory), and seeing it working? Or was it outside of your use-case?

  Arnaud




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]