-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Hi,
Thanks for your amazing tools! The customizing works great (I have had some wishes for bootconfig, but I will contribute back on that with a PR, I promise!). So 90% of what I want is solved, I need some help, insight for booting my CM4.
Setup: I have a raspi Baseboard with CM4 on it and eMMC, no SD card. II mount the a jumper on the boot pin on the baseboard. I then use rpiboot to prepare the eMMC for flashing as advised by the documentation for CM4 modules. . I then see a /dev/sdb with /dev/sdb1 for bootfs, and /dev/sdb2 for rootfs. I unmount the /dev/sdbx partitions and use sdm --burn ...
(all code below) .
After that: I remove the burn eMMC jumper from the Baseboard, reapply power and boot normally. This works perfectly with an image with limited customization. All seems OK. It always works if I keep piwiz and interactively enter some nonsense in there, after that I can login with the configured user from the customization. However, when I remove piwiz from the prepared image (with plugin disable piwiz), it gets stuck in the very beginning after boot. and goes silent Also the serial connection is silent.
I have been fighting, but clearly am too much of a beginner when it amounts to booting raspberri pi's, and can't get this resolved. Two questions: would it work in the end, or am I on a hopeless journey? And if so where should I look for solutions to continue the journey? I love the sdm tools to much to just give up here, and would be greatly helped if I got this last step working.
Thanks for shedding some light on my issue. Code below.
Working on a x86 ubuntu linux host. Installed rpiboot and sdm. Dowloaded 64 bit RaspiOS lite, bookworm.
customize image script:
sudo sdm --customize \
--plugin user:"adduser=myuser|password=mypassword" \
--plugin disables:"piwiz|bluetooth" \
--expand-root \
--regen-ssh-host-keys \
--plugin bootconfig:"dtoverlay=imx708,cam0" \
--plugin raspiconfig:"boot_behaviour=B1" \
--plugin serial:enableshell \
--restart \
--extract-log /home/martinkooij/dev/EXTRA/CM4 \
raspi.img
burn script:
sudo sdm --burn /dev/sd${DEVICE} \
--hostname camerapi \
--expand-root \
--noreboot \
raspi.img
burn output
* Start Burn
> Burn 'raspi.img' (2,8GB, 2,6GiB) to '/dev/sdb'...
> Burn command line: /usr/local/bin/sdm --burn /dev/sdb --hostname camerapi --expand-root --noreboot raspi.img
> dd command: dd if=raspi.img of=/dev/sdb status=progress bs=16M iflag=direct
2281701376 bytes (2,3 GB, 2,1 GiB) copied, 1 s, 2,3 GB/s
164+1 records in
164+1 records out
2759852032 bytes (2,8 GB, 2,6 GiB) copied, 601,712 s, 4,6 MB/s
> dd Copy completed
> Set new disk ID 'b8bc1801' on '/dev/sdb'
Disk identifier changed from 0xd9c86127 to 0xb8bc1801.
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
> Disk ID 'b8bc1801' set successfully with sfdisk
* Mount device '/dev/sdb'
mount: /dev/sdb2 mounted on /mnt/sdm.
mount: /dev/sdb1 mounted on /mnt/sdm/boot/firmware.
% sdm will use qemu 'aarch64'
% sdm will use systemd-nspawn on this 64-bit x86-64 host
Retry the command with --chroot if this fails
umount: /mnt/sdm/boot/firmware unmounted
umount: /mnt/sdm unmounted
> Expand Root: Expand root partition 'sdb2' (ext4) on device '/dev/sdb' from (2,2GB, 2,1GiB) to
(30,7GB, 28,6GiB)
* Mount /dev/sdb to resize the root file system
* Mount device '/dev/sdb'
mount: /dev/sdb2 mounted on /mnt/sdm.
mount: /dev/sdb1 mounted on /mnt/sdm/boot/firmware.
* Resize the ext4 root file system
% (Ignore 'on-line resizing required' message)
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/sdb2 is mounted on /mnt/sdm; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/sdb2 is now 7500791 (4k) blocks long.
> Set MBR rootfs partition ID 'b8bc1801' in cmdline.txt (was d9c86127)
> Set MBR partition Disk IDs in fstab
> Disable unneeded RasPiOS firstboot service and /etc/init.d/resize2fs_once
> Disable regenerate_ssh_host_keys/sshd-keygen service(s); sdm FirstBoot will run it instead
> Set hostname 'camerapi'
> First System Boot Custom Boot Scripts disabled
> First System Boot automatic restart disabled
* Burn Completed
> Burn elapsed time: 00:10:12
umount: /mnt/sdm/boot/firmware unmounted
umount: /mnt/sdm unmounted
* Storage '/dev/sdb' is ready
then remove power and jumper. Reapply power to boot.
brcm-pice fd500000.pice: link down
e2fsck 1.47.0 (5-Feb-2023)
rootfs: clean, 61850/1821008 files, 596315/7500791 blocks
[............. deep silence on both keyboard (via USB) and serial., no progress also waited >1 hour...........]