From 00563db3c1cde21495327c9aeed4dfc707e76ad0 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sun, 7 Nov 2021 18:48:01 +0100 Subject: [PATCH] first try to add a systemd unit on boot, it still doesn't launch: uncommented --- leaves/bh.cfg | 53 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/leaves/bh.cfg b/leaves/bh.cfg index 8daf56b..d144d1a 100644 --- a/leaves/bh.cfg +++ b/leaves/bh.cfg @@ -24,37 +24,46 @@ guestfs-tools # Complementary tools useful for interacting with vith guest syste %end # End of the packages section -%post --nochroot --log=/mnt/sysimage/root/bh.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting +%post --nochroot --log=/root/bh.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting +# %post --log=/root/bh.log # Beginning of %post section. Those commands are executed outside the chroot environment. Logging is enabled to help with post-installation troubleshooting mkdir /mnt/sysimage/var/lib/libvirt/iso # Create a directory to store iso images wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso -P /mnt/sysimage/var/lib/libvirt/iso/ -wget https://github.com/PhyllomeOS/PhyllomeOS/blob/main/post-installation/post-install.sh -P /mnt/sysimage/root/ +wget https://git.phyllo.me/home/PhyllomeOS/raw/branch/main/post-installation/post-install.sh -P /mnt/sysimage/usr/sbin/ +chmod +x /mnt/sysimage/usr/sbin/post-install.sh -# Create new file /mnt/sysimage/etc/systemd/system/postinstall.service using cat: - -``` -cat > /mnt/sysimage/etc/systemd/system/postinstall.service<< EOF -[Unit] -Description=post-installation configuration for Phyllome OS -After=systemd-remount-fs.service -Before=systemd-sysusers.service sysinit.target shutdown.target -ConditionFirstBoot=yes - -[Service] -Type=oneshot -ExecStart=/bin/bash /root/post-install.sh -RemainAfterExit=no - -[Install] -WantedBy=multi-user.target -EOF -``` +# Create new file /etc/systemd/system/postinstall.service using cat: +# +# cat > /mnt/sysimage/etc/systemd/system/post-install.service<< EOF +# [Unit] +# Description=post-installation configuration for Phyllome OS +# After=systemd-remount-fs.service +# Before=systemd-sysusers.service sysinit.target shutdown.target +# ConditionFirstBoot=yes +# +# [Service] +# Type=oneshot +# ExecStart=/bin/bash /usr/sbin/post-install.sh +# RemainAfterExit=yes +# +# [Install] +# WantedBy=multi-user.target +# EOF +# +# systemctl enable post-install.service # Enable systemd unit # Add a network bridge. Still need to declare it to libvirt/virt-manager nmcli con add ifname br0 type bridge con-name br0 nmcli con add type bridge-slave ifname enp1s0 master br0 # to-do : generalize this command so that it could regardless of the name of the ethernet device nmcli con up br0 -%end # End of the %post section \ No newline at end of file +%end # End of the %post section + +# %post # Beginning of the post-installation section. +# +# systemctl enable post-install.service +# +# %end # End of the %post section +