Files
odroid-stamper/fixups/S90-firstboot
Dongjin Kim f2e8d5071a firstboot: add 'UUID_BOOFS' to replace with its UUID
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Id40294fcc24e37286ef131aaea24200a56f59e53
2022-07-20 17:03:05 +09:00

32 lines
710 B
Bash
Executable File

#!/bin/sh
if [ -f /root/firstboot.sh ]; then
chmod +x /root/firstboot.sh
chown root:root /root/firstboot.sh
sed -i "s,@@UUID_BOOTFS@@,@@DEFAULT_DEV_BOOT@@,g" /root/firstboot.sh
sed -i "s,@@UUID_ROOTFS@@,@@DEFAULT_DEV_ROOTFS@@,g" /root/firstboot.sh
fi
cat <<__EOF | tee -a /lib/systemd/system/firstboot.service >/dev/null
[Unit]
Description=FirstBoot
After=network.target
Before=rc-local.service
ConditionFileNotEmpty=/root/firstboot.sh
[Service]
ExecStart=/root/firstboot.sh
ExecStartPost=/bin/mv /root/firstboot.sh /root/firstboot.sh.done
Type=oneshot
RemainAfterExit=no
[Install]
WantedBy=multi-user.target
__EOF
systemctl enable firstboot.service
systemctl disable ondemand
systemctl disable ssh