$ wget https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img.xz
$ sha256sum 2023-12-11-raspios-bookworm-armhf-lite.img.xz
$ unxz 2023-12-11-raspios-bookworm-armhf-lite.img.xz
$ ls -l 2023-12-11-raspios-bookworm-armhf-lite.img -rw-r--r-- 1 root root 2537553920 Dec 10 20:31 2023-12-11-raspios-bookworm-armhf-lite.img
# fdisk -l 2023-12-11-raspios-bookworm-armhf-lite.img Units: sectors of 1 * 512 = 512 bytes <-- 512 will therefore be used when calculating offsets in bytes. Device Boot Start End Sectors Size Id Type 2023-12-11-raspios-bookworm-armhf-lite.img1 8192 1056767 1048576 512M c W95 FAT32 (LBA) (this is the Linux "boot" partition) 2023-12-11-raspios-bookworm-armhf-lite.img2 1056768 4956159 3899392 1.9G 83 Linux (this is the Linux "root" partition)
- first ("boot") partition offset: (512 * 8192) = 4194304 - second ("root") partition offset: (512 * 1056768) = 541065216
# mount -v -o offset=4194304 -t vfat 2023-12-11-raspios-bookworm-armhf-lite.img /mnt # touch /mnt/ssh # echo -n 'fred:$6$Bt0s/9vohKr3AoE/$5AGXvO7Dl12kTT4d0WWcFPoKdPOBLF3lbqu5MvjAGo9DS4Sry16CXfH4wJdlCiUmyjm9l6kePdDq.IJMdSrXd.' > /mnt/userconf # vi /mnt/cmdline.txt (append "ip=192.168.3.5::192.168.3.11:255.255.255.0:bedrock:eth0:off" to the list of kernel arguments) # umount /mnt
# mount -v -o offset=541065216 -t ext4 2023-12-11-raspios-bookworm-armhf-lite.img /mnt vi /mnt/etc/hostname ("bedrock") vi /mnt/etc/hosts ("192.168.3.5 bedrock") vi /mnt/etc/resolv.conf ("nameserver 9.9.9.9") vi /mnt/etc/NetworkManager/NetworkManager.conf ("managed=false" under the [ifupdown] section) vi /mnt/etc/network/interfaces ( add the following five lines: ) auto eth0 iface eth0 inet static address 192.168.3.5 gateway 192.168.3.11 netmask 255.255.255.0 # umount /mnt
# dd bs=512 if=2023-12-11-raspios-bookworm-armhf-lite.img of=/dev/mmcblk0 conv=fsync # sync
$ ssh -l fred 192.168.3.5 (password is "FreeUkraine") $ passwd (something other than "FreeUkraine" or "raspberry")
$ sudo rm /userconf
$ sudo vi /boot/firmware/cmdline.txt
$ sudo systemctl enable ssh
$ sudo apt update ; sudo apt full-upgrade ; sudo apt autoremove ; sudo apt clean $ sudo reboot
$ ssh -l fred 192.168.3.5 $ sudo raspi-config
Last updated: 2024-04-12