-
Notifications
You must be signed in to change notification settings - Fork 10
Build Pre-Post-Installed Images #41
Comments
I've started testing your build chain in order to reproduce this LDAP issue. |
Thanks. If you or anyone go into that direction (LXC, containers), the first step is to make sure we can extract the output file system and make it an image. |
Thinking about this, I'm not really sure you can convert an LXC to an ISO image ? Naively I'd think an LXC is built to be ran as an LXC, but can't be turned into a bare-metal system. That might be the point of systemd-nspawn ? (i.e. taking any filesystem and turning it into an "alive" system...?) That's just an intuition though ... |
So I made a few tests tonight with systemd-nspawn. I created a fresh Debian Stretch VPS. Note that :
Summary of the steps used : # Get dependencies
apt install zip qemu-user qemu-user-static binfmt-support psmisc systemd-container
# Fetch and unzip orangepicpcplus image
wget https://build.yunohost.org/yunohost-stretch-3.0.0-orangepipcplus-stable.img.zip
unzip yunohost-stretch-3.0.0-orangepipcplus-stable.img.zip
# Mount image on 'mytest'
mkdir mytest
mount -o loop,offset=4194304 yunohost-stretch-3.0.0-orangepipcplus-stable.img mytest
# We need this for cross-containeurization?
cp /usr/bin/qemu-arm-static ./mytest/usr/bin/
# Annnd now for the black magic
systemd-nspawn -b -D mytest
# <the system should boot as in real life and then you should be able to log inside as a real tty ô.O> During the boot, you might notice that a few service (e.g. dnsmasq) don't start properly for mystical reasons. But basically my understanding so far is that QEMU don't emulate 100% of everything to perfection. But you can at least run Then I yolotried to postinstall and got : root@orangepipcplus:~# yunohost tools postinstall
Main domain: yolo.swag
New administration password:
Confirm new administration password:
Error: [Errno 52] Invalid url https://dyndns.yunohost.org/domains (does this site exists ?)
Warning: dyndns_provider_unreachable
Installing YunoHost...
The configuration file '/etc/nsswitch.conf' is now managed by the service nsswitch.
Success! The configuration has been updated for service 'nsswitch'
The configuration file '/etc/nslcd.conf' is now managed by the service nslcd.
Success! The configuration has been updated for service 'nslcd'
Warning: Unknown host QEMU_IFLA type: 40
Warning: Unknown host QEMU_IFLA type: 41
Warning: Unknown host QEMU_IFLA type: 40
Warning: Unknown host QEMU_IFLA type: 41
Warning: Unknown host QEMU_IFLA type: 40
Warning: Unknown host QEMU_IFLA type: 41
Warning: Unknown host QEMU_IFLA type: 40
Warning: Unknown host QEMU_IFLA type: 41
Error: LDAP initialization failed to create admin user
Error: Installation failed Not sure what those Naively I tried to investigate by re-running with
Gotta dig moar... |
I just managed to build an image with LXC too with changes in my fork: https://github.com/pitchum/build.labriqueinter.net/tree/replace-chroot-with-lxc |
A lot of the process that is happening during an install-party, that is, the installation of an InternetCube using install.labriqueinter.net is repeated in each installation. I would like to create InternetCube images that already ran the YunoHost post-install process to avoid repetition and reduce errors during installations.
To do so, I started modifying the image build script to run the post-install with default values. The idea is to only have to change some configuration during the install-party (user name and domain).
However, I run into issues during the post-install step.
The code of my latest attempt is available here:
https://github.com/keomabrun/build.labriqueinter.net
The only interesting adding is the following line:
chroot_deb $TARGET_DIR "yunohost tools postinstall -d foo.bar.labriqueinter.net -p yunohost --ignore-dyndns"
When I run this code, I run into the following error during the post-install:
Error: Unable to reach LDAP server
This might be because we are running in a chroot environment as documented here.
Because we are running in a chroot environment I can not assess the status of services, including slapd.
Should we use
systemd-nspawn
orlxc
to build our images ?https://superuser.com/questions/688733/start-a-systemd-service-inside-chroot
Note that the raspbian build script does not.
The text was updated successfully, but these errors were encountered: