ostree host from scratch w/o anaconda



I am trying to add OSTree support in Photon. After creating a compose
server, I am learning to create a host installation. Because photon is not
using Anaconda, I am trying to see  how fedora-atomic creates a host and
building a host image from scratch by looking at the code in
ostreepayload.py at


https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/packaging/rp
mostreepayload.py


I mounted a disk partition to my running machine at /mnt/ostreeroot/ and
was able to successfully run following commands.


$ ostree admin --sysroot=/mnt/ostreeroot/ init-fs /mnt/ostreeroot/


$ ostree remote add --repo=/mnt/ostreeroot/ostree/repo
--set=gpg-verify=false fedora-atomic
http://dl.fedoraproject.org/pub/alt/fedora-atomic/repo/


$ ostree pull --repo=/mnt/ostreeroot/ostree/repo/ fedora-atomic
fa340c1e4634432fd20c15be1a02f2353bafa29fbdf8b2a3af38bbd45c27d8e9


$ ostree admin --sysroot=/mnt/ostreeroot/ os-init fedora-atomic


$ ostree admin --sysroot=/mnt/ostreeroot/ deploy --os=fedora-atomic
fa340c1e4634432fd20c15be1a02f2353bafa29fbdf8b2a3af38bbd45c27d8e9

At this point I assumed we need to install boot loader and run following
command which I think is not supposed to be called directly, which is
causing some errors.

$ ostree admin instutil --sysroot=/mnt/ostreeroot/ grub2-generate
**
ERROR:src/libostree/ostree-bootloader-grub2.c:154:_ostree_bootloader_grub2_
generate_config: assertion failed: (grub2_boot_device_id != NULL)
Aborted (core dumped)


And running grub2-15_ostree also returns errors.

$ ./src/boot/grub2-15_ostree
This script must be run as a child of grub2-mkconfig


Now I am clueless and need help.

1) How to install and configure the right bootloader? How can I run
grub2-15_ostree as a child of grub2-mkconfig.

2) I am confused on how to replicate _copyBootloaderData (in
rpmostreepayload.py) manually on my
side. What should be returned by .getTargetPhysicalRoot() and
.getSysroot()?

3) Any suggestion where to look for help on creating Host from scratch
without anaconda, and how bootloader works in ostree world? Is this the
right direction I am going so that at the end I could create photon ostree
host? Am I executing the above commands in right way?


Thanks,
Touseef




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