hacks/fix-raspian-defaults/rc.local.txt

24 lines
884 B
Plaintext
Raw Normal View History

2019-10-04 13:41:13 +00:00
#!/bin/sh # can't assume bash yet
2019-10-04 13:46:23 +00:00
if [ ! -d /boot/root.overlay ]; then
2019-10-04 13:41:13 +00:00
logger -s -t rc.local.txt cant find root overlay in /boot
else
2019-10-04 13:46:23 +00:00
rsync -avP /boot/root.overlay/ /
2019-10-04 13:57:35 +00:00
ln -s /etc/systemd/system/raspberrypi-initial-setup.service \
/etc/systemd/system/multi-user.target.wants/raspberrypi-initial-setup.service
# we only need to run once
rm -rf /boot/rc.local.txt /boot/root.overlay
2019-10-04 16:02:55 +00:00
# after the above rsync has replaced the init_resize.sh with our
# more sane version (it only doubles the size of the root, not
# consuming the entire sd card), set the kernel command line to use the
# init resizer on the next boot (like raspbian normally does)
# this will only run this once, as we have already deleted ourselves in
# the previous command.
sed -i 's|$| init=/usr/lib/raspi-config/init_resize.sh|' /boot/cmdline.txt
2019-10-04 13:41:13 +00:00
fi
reboot