Hi all!
As per title, I am adding my config to an archlinux arm aarch64 image and trying to repack it so I can install it on multiple raspberrypi.
In order to save space with the image, I shrink it, so when I flash it with dd or balenahatcher the root partition has only few free MBs and some stuff is not starting, to avoid this I am trying to expand the partition automatically on the first boot.
To achieve my goal I took inspiration from the raspberryPiOS repo where they do have an init_resize.sh that is used on the very first boot instead of starting systemd.
I took the shell script, I dropped the NOOBS bit and adjusted it accordingly (https://github.com/MattBlack85/astroarc ... _resize.sh) and the resize + fs expansion seems to work pretty well, the only thing I can't achieve is a reboot after the script is done.
I understand systemd is not started and I can't use a clean reboot, but shouldn't $this->bbcode_second_pass_code('', 'reboot -f') just work?
These are the errors I get:
$this->bbcode_second_pass_code('', '
Reboot failed -- system halted
')
Is there a clean solution to achieve this goal?
PS: I also tried $this->bbcode_second_pass_code('', 'echo b > /proc/sysrq-trigger') with the same exact result and a clean reboot without -f, but the latter fails and the kernel panics cause systemd is not active