Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Bookworm #231

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open

Upgrade to Bookworm #231

wants to merge 2 commits into from

Conversation

kmic5
Copy link

@kmic5 kmic5 commented Mar 13, 2024

No description provided.

FooDeas and others added 2 commits August 20, 2023 15:08
build:
  - add variables: cleanup (build.sh), debug_cache (update.sh)
  - /etc/mdev.conf: /dev/(null|zero|full|u?random) mode 666 (a=rw) fixes
    installer apt failure
  - output repo name for selected packages (update.sh)

installer:
  - release: bookworm replaces bullseye
  - Debian Bookworm package changes: ntpsec replaces ntp, sysvinit-utils
    replaces lsb-base, systemd-resolved/systemd-timesyncd become presets
  - network time sync: remove ntpdate (python dep.), update rdate servers,
    http fallback: new http-date method replaces defunct method
  - add cdebootstrap_debug variable
  - resolve apt warnings, deprecated apt-key: install main repo gpg keys to
    /etc/apt/trusted.gpg.d/

doc:
  - preset packages reflect Debian Bookworm convention
  - add cdebootstrap_debug advanced install parameter
@chris18890
Copy link

Hopefully this fixes #229 !

@detly
Copy link

detly commented Jun 3, 2024

I just tried this and it tripped on

Copying executable tmp/sbin/start-stop-daemon
cp: cannot stat 'tmp/sbin/start-stop-daemon': No such file or directory

As far as I can tell, this is because dpkg 1.21.22 (in regular Debian bookworm) has this file in /sbin/, but Raspberry Pi's bookworm distro uses 1.22.6~bpo12+rpt2, which has it in /usr/sbin. I am about to try patching build.sh to use the new path and I'll let you know how that goes, but I'm not in a position to make a PR right now, sorry.

@detly
Copy link

detly commented Jun 3, 2024

Well, changing that path allows build.sh to proceed just fine. Unfortunately the resulting image triggers a kernel panic almost immediately upon boot (Kernel panic - not syncing: VFS: Unable to mount root fs on unkown-block(0,0)). I wonder if it's related to some /boot/ config location changes in Bookworm.

@detly
Copy link

detly commented Jun 3, 2024

No, it was the 20 byte initramfs that did that. I was missing cpio in my build environment. I've remedied that and the installer is running.

@detly
Copy link

detly commented Jun 4, 2024

Would you prefer me to file separate issues on Bookworm-related issues, or keep them here in this PR, by the way?

@FooDeas
Copy link
Owner

FooDeas commented Jun 4, 2024

You can keep them here if you want. Thanks for your effort!

@detly
Copy link

detly commented Jun 4, 2024

Well, I built the installer, and it ran through almost the entire process on my ancient RPi 2B without issue 🎊

Unfortunately it fell over at installing packages into the new system:

  Building dependency tree...
  Reading state information...
  Package aptitude is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package raspi-copies-and-fills is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package nano is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package vim is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  E: Unable to locate package firmware-atheros
  E: Unable to locate package firmware-brcm80211
  E: Unable to locate package firmware-libertas
  E: Unable to locate package firmware-misc-nonfree
  E: Unable to locate package firmware-realtek
  E: Package 'aptitude' has no installation candidate
  E: Unable to locate package avahi-daemon
  E: Unable to locate package curl
  E: Unable to locate package hdparm
  E: Unable to locate package htop
  E: Unable to locate package iptables-persistent
  E: Unable to locate package micro
  E: Package 'nano' has no installation candidate
  E: Unable to locate package ncdu
  E: Unable to locate package netfilter-persistent
  E: Unable to locate package tmux
  E: Package 'vim' has no installation candidate
  E: Unable to locate package raspberrypi-bootloader
  E: Unable to locate package raspberrypi-kernel
  E: Unable to locate package raspberrypi-sys-mods
  E: Unable to locate package libraspberrypi-bin
  E: Package 'raspi-copies-and-fills' has no installation candidate
ERROR: 100, FAILED !

Error: The installation could not be completed!
Full log (~1000 lines!).
==================================================
raspberrypi-ua-netinst
==================================================
Revision unknown
Built on Mon Jun  3 15:11:50 UTC 2024
Running on Raspberry Pi version 2 Model B
==================================================
https://github.com/FooDeas/raspberrypi-ua-netinst/
==================================================
Remounting TempFS... OK
Mounting boot partition... OK
Copying boot files... OK
Executing installer-config.txt...
OK

Searching for deprecated variables...

Checking if config.txt needs to be modified before starting installation...
  Setting HDMI options... OK
OK

Unmounting boot partition... OK

Network configuration:
  ifname = eth0
  ip_addr = dhcp
  ip_ipv6 = 0
  online_config = 

Waiting for eth0... OK
Configuring eth0 with DHCP... 192.168.1.101
Set time using timeserver 'au.pool.ntp.org'... 'time.nist.gov'... OK

Installation started at Mon Jun  3 16:21:44 UTC 2024 (UTC).


Resulting installer configuration:
  preset = server
  packages = aptitude,avahi-daemon,curl,hdparm,htop,iptables-persistent,micro,nano,ncdu,netfilter-persistent,tmux,vim
  firmware_packages = 1
  mirror = http://mirror.aarnet.edu.au/pub/raspbian/raspbian
  mirror_cache = 
  release = bookworm
  arch = armhf
  hostname = han
  domainname = 
  user_ssh_pubkey = /home/jason/.ssh/id_rsa.pub
  root_ssh_pubkey = 
  root_ssh_pwlogin = 0
  ssh_pwlogin = 0
  username = jason
  usergpio = 
  usergpu = 
  usergroups = 
  usersysgroups = 
  userperms_admin = 1
  userperms_sound = 0
  cdebootstrap_cmdline = --flavour=minimal --include=locales,kmod,gnupg,libpam-systemd,rng-tools,cpufrequtils,openssh-server,dosfstools,iproute2,systemd-resolved,systemd-timesyncd,vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,cron,dialog,locales,tzdata,less,man-db,logrotate,bash-completion,console-setup,apt-utils,systemd-sysv,sudo
  cdebootstrap_debug = 0
  packages_postinstall = firmware-atheros,firmware-brcm80211,firmware-libertas,firmware-misc-nonfree,firmware-realtek,aptitude,avahi-daemon,curl,hdparm,htop,iptables-persistent,micro,nano,ncdu,netfilter-persistent,tmux,vim,raspberrypi-bootloader,raspberrypi-kernel,raspberrypi-sys-mods,libraspberrypi-bin,raspi-copies-and-fills
  boot_volume_label = 
  root_volume_label = 
  bootsize = +128M
  bootoffset = 8192
  rootsize = 
  timeserver = au.pool.ntp.org
  timezone = Australia/Perth
  rtc = 
  dt_overlays = 
  keyboard_layout = 
  locales = en_AU.UTF-8,en_US.UTF-8
  system_default_locale = en_AU.UTF-8
  wlan_country = 
  ip_ipv6 = 0
  cmdline = dwc_otg.lpm_enable=0 ipv6.disable=1 console=tty1 fsck.repair=yes
  drivers_to_load = 
  gpu_mem = 
  console_blank = 
  hdmi_type = 
  hdmi_tv_res = 1080p
  hdmi_monitor_res = 1024x768
  hdmi_disable_overscan = 0
  hdmi_system_only = 0
  usbroot = 0
  usbboot = 0
  rootdev = /dev/mmcblk0
  rootpartition = /dev/mmcblk0p2
  rootfstype = f2fs
  rootfs_mkfs_options = -f
  rootfs_install_mount_options = noatime
  rootfs_mount_options = noatime
  final_action = reboot
  quiet_boot = 0
  disable_raspberries = 0
  disable_splash = 0
  cleanup = 1
  cleanup_logfiles = 1
  spi_enable = 0
  i2c_enable = 0
  i2c_baudrate = 
  sound_enable = 0
  sound_usb_enable = 0
  sound_usb_first = 0
  camera_enable = 0
  camera_disable_led = 0
  use_systemd_services = 1

OTP dump:
  16:00280000
  17:1020000a
  18:1020000a
  27:00005050
  28:f29d7eb2
  29:0d62814d
  30:00a21041

Waiting 5 seconds.....
Waiting for /dev/mmcblk0... 
  Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
  Disklabel type: dos
  Disk identifier: 0x3260d9c4
OK
Applying new partition table... OK
Initializing /boot as vfat... OK
Copying /boot files in... OK
Initializing / as f2fs...   
      F2FS-tools: mkfs.f2fs Ver: 1.15.0 (2022-05-13)
  
  Info: Disable heap-based policy
  Info: Debug level = 0
  Info: Trim is enabled
    /dev/mmcblk0p2 appears to contain an existing filesystem (f2fs).
  Info: Segments per section = 1
  Info: Sections per zone = 1
  Info: sector size = 512
  Info: total sectors = 15253504 (7448 MB)
  Info: zone aligned segment0 blkaddr: 512
  Info: format version with
    "Linux version 6.1.21-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642 SMP Mon Apr  3 17:20:52 BST 2023"
  Info: [/dev/mmcblk0p2] Discarding device
  Info: This device doesn't support BLKSECDISCARD
  Info: Discarded 7448 MB
  Info: Overprovision ratio = 2.330%
  Info: Overprovision segments = 176 (GC reserved = 93)
  Info: format successful
OK
Mounting new filesystems... OK
Starting HWRNG... OK

Starting install process...
  P: Retrieving Release
  P: Retrieving Release.gpg
  P: Validating Release
  I: Good signature from "Mike Thompson (Raspberry Pi Debian armhf ARMv6+VFP) <[email protected]>"
  P: Parsing Release
  P: Retrieving Packages.xz
  P: Validating Packages.xz
  P: Parsing Packages
  P: Retrieving gcc-12-base
  P: Validating gcc-12-base
  P: Retrieving libgcc-s1
  P: Validating libgcc-s1
  P: Retrieving libc6
  P: Validating libc6
  P: Retrieving libbz2-1.0
  P: Validating libbz2-1.0
  P: Retrieving liblzma5
  P: Validating liblzma5
  P: Retrieving libmd0
  P: Validating libmd0
  P: Retrieving libpcre2-8-0
  P: Validating libpcre2-8-0
  P: Retrieving libselinux1
  P: Validating libselinux1
  P: Retrieving libzstd1
  P: Validating libzstd1
  P: Retrieving zlib1g
  P: Validating zlib1g
  P: Retrieving libacl1
  P: Validating libacl1
  P: Retrieving tar
  P: Validating tar
  P: Retrieving dpkg
  P: Validating dpkg
  P: Retrieving debianutils
  P: Validating debianutils
  P: Retrieving libcrypt1
  P: Validating libcrypt1
  P: Retrieving perl-base
  P: Validating perl-base
  P: Retrieving perl-modules-5.36
  P: Validating perl-modules-5.36
  P: Retrieving libdb5.3
  P: Validating libdb5.3
  P: Retrieving libgdbm6
  P: Validating libgdbm6
  P: Retrieving libgdbm-compat4
  P: Validating libgdbm-compat4
  P: Retrieving libperl5.36
  P: Validating libperl5.36
  P: Retrieving perl
  P: Validating perl
  P: Retrieving libnumber-compare-perl
  P: Validating libnumber-compare-perl
  P: Retrieving libtext-glob-perl
  P: Validating libtext-glob-perl
  P: Retrieving libfile-find-rule-perl
  P: Validating libfile-find-rule-perl
  P: Retrieving usrmerge
  P: Validating usrmerge
  P: Retrieving init-system-helpers
  P: Validating init-system-helpers
  P: Retrieving libaudit-common
  P: Validating libaudit-common
  P: Retrieving libcap-ng0
  P: Validating libcap-ng0
  P: Retrieving libaudit1
  P: Validating libaudit1
  P: Retrieving debconf
  P: Validating debconf
  P: Retrieving libpam0g
  P: Validating libpam0g
  P: Retrieving libsemanage-common
  P: Validating libsemanage-common
  P: Retrieving libsepol2
  P: Validating libsepol2
  P: Retrieving libsemanage2
  P: Validating libsemanage2
  P: Retrieving libpam-modules-bin
  P: Validating libpam-modules-bin
  P: Retrieving libpam-modules
  P: Validating libpam-modules
  P: Retrieving passwd
  P: Validating passwd
  P: Retrieving adduser
  P: Validating adduser
  P: Retrieving libgpg-error0
  P: Validating libgpg-error0
  P: Retrieving libgcrypt20
  P: Validating libgcrypt20
  P: Retrieving gpgv
  P: Validating gpgv
  P: Retrieving liblz4-1
  P: Validating liblz4-1
  P: Retrieving libstdc++6
  P: Validating libstdc++6
  P: Retrieving libcap2
  P: Validating libcap2
  P: Retrieving libsystemd0
  P: Validating libsystemd0
  P: Retrieving libudev1
  P: Validating libudev1
  P: Retrieving libxxhash0
  P: Validating libxxhash0
  P: Retrieving libapt-pkg6.0
  P: Validating libapt-pkg6.0
  P: Retrieving libassuan0
  P: Validating libassuan0
  P: Retrieving readline-common
  P: Validating readline-common
  P: Retrieving libtinfo6
  P: Validating libtinfo6
  P: Retrieving libreadline8
  P: Validating libreadline8
  P: Retrieving gpgconf
  P: Validating gpgconf
  P: Retrieving sysvinit-utils
  P: Validating sysvinit-utils
  P: Retrieving lsb-base
  P: Validating lsb-base
  P: Retrieving libgmp10
  P: Validating libgmp10
  P: Retrieving libnettle8
  P: Validating libnettle8
  P: Retrieving libhogweed6
  P: Validating libhogweed6
  P: Retrieving libunistring2
  P: Validating libunistring2
  P: Retrieving libidn2-0
  P: Validating libidn2-0
  P: Retrieving libffi8
  P: Validating libffi8
  P: Retrieving libp11-kit0
  P: Validating libp11-kit0
  P: Retrieving libtasn1-6
  P: Validating libtasn1-6
  P: Retrieving libgnutls30
  P: Validating libgnutls30
  P: Retrieving libksba8
  P: Validating libksba8
  P: Retrieving libsasl2-modules-db
  P: Validating libsasl2-modules-db
  P: Retrieving libsasl2-2
  P: Validating libsasl2-2
  P: Retrieving libldap-2.5-0
  P: Validating libldap-2.5-0
  P: Retrieving libnpth0
  P: Validating libnpth0
  P: Retrieving dirmngr
  P: Validating dirmngr
  P: Retrieving gnupg-l10n
  P: Validating gnupg-l10n
  P: Retrieving gnupg-utils
  P: Validating gnupg-utils
  P: Retrieving libsqlite3-0
  P: Validating libsqlite3-0
  P: Retrieving gpg
  P: Validating gpg
  P: Retrieving libncursesw6
  P: Validating libncursesw6
  P: Retrieving pinentry-curses
  P: Validating pinentry-curses
  P: Retrieving gpg-agent
  P: Validating gpg-agent
  P: Retrieving gpg-wks-client
  P: Validating gpg-wks-client
  P: Retrieving gpg-wks-server
  P: Validating gpg-wks-server
  P: Retrieving gpgsm
  P: Validating gpgsm
  P: Retrieving gnupg
  P: Validating gnupg
  P: Retrieving raspbian-archive-keyring
  P: Validating raspbian-archive-keyring
  P: Retrieving libseccomp2
  P: Validating libseccomp2
  P: Retrieving apt
  P: Validating apt
  P: Retrieving dash
  P: Validating dash
  P: Retrieving diffutils
  P: Validating diffutils
  P: Retrieving libattr1
  P: Validating libattr1
  P: Retrieving coreutils
  P: Validating coreutils
  P: Retrieving gzip
  P: Validating gzip
  P: Retrieving mawk
  P: Validating mawk
  P: Retrieving base-files
  P: Validating base-files
  P: Retrieving bash
  P: Validating bash
  P: Retrieving libblkid1
  P: Validating libblkid1
  P: Retrieving libmount1
  P: Validating libmount1
  P: Retrieving libsmartcols1
  P: Validating libsmartcols1
  P: Retrieving libuuid1
  P: Validating libuuid1
  P: Retrieving util-linux-extra
  P: Validating util-linux-extra
  P: Retrieving util-linux
  P: Validating util-linux
  P: Retrieving libdebconfclient0
  P: Validating libdebconfclient0
  P: Retrieving base-passwd
  P: Validating base-passwd
  P: Retrieving sed
  P: Validating sed
  P: Retrieving bsdutils
  P: Validating bsdutils
  P: Retrieving findutils
  P: Validating findutils
  P: Retrieving grep
  P: Validating grep
  P: Retrieving libpam-runtime
  P: Validating libpam-runtime
  P: Retrieving login
  P: Validating login
  P: Retrieving hostname
  P: Validating hostname
  P: Retrieving libc-bin
  P: Validating libc-bin
  P: Retrieving ncurses-bin
  P: Validating ncurses-bin
  P: Retrieving ncurses-base
  P: Validating ncurses-base
  P: Extracting gcc-12-base
  P: Extracting libgcc-s1
  P: Extracting libc6
  P: Extracting libacl1
  P: Extracting libpcre2-8-0
  P: Extracting libselinux1
  P: Extracting tar
  P: Extracting libbz2-1.0
  P: Extracting liblzma5
  P: Extracting libmd0
  P: Extracting libzstd1
  P: Extracting zlib1g
  P: Extracting dpkg
  P: Extracting debianutils
  P: Extracting libcrypt1
  P: Extracting perl-base
  P: Extracting perl-modules-5.36
  P: Extracting libdb5.3
  P: Extracting libgdbm6
  P: Extracting libgdbm-compat4
  P: Extracting libperl5.36
  P: Extracting perl
  P: Extracting libnumber-compare-perl
  P: Extracting libtext-glob-perl
  P: Extracting libfile-find-rule-perl
  P: Extracting usrmerge
  P: Extracting init-system-helpers
  P: Extracting sysvinit-utils
  P: Extracting dash
  P: Extracting diffutils
  P: Extracting libattr1
  P: Extracting libgmp10
  P: Extracting coreutils
  P: Extracting gzip
  P: Extracting mawk
  P: Extracting base-files
  P: Extracting libtinfo6
  P: Extracting bash
  P: Extracting libblkid1
  P: Extracting libcap-ng0
  P: Extracting libmount1
  P: Extracting libaudit-common
  P: Extracting libaudit1
  P: Extracting debconf
  P: Extracting libpam0g
  P: Extracting libsmartcols1
  P: Extracting libcap2
  P: Extracting libgpg-error0
  P: Extracting libgcrypt20
  P: Extracting liblz4-1
  P: Extracting libsystemd0
  P: Extracting libudev1
  P: Extracting libuuid1
  P: Extracting util-linux-extra
  P: Extracting util-linux
  P: Extracting libdebconfclient0
  P: Extracting base-passwd
  P: Extracting sed
  P: Extracting bsdutils
  P: Extracting findutils
  P: Extracting grep
  P: Extracting libpam-modules-bin
  P: Extracting libpam-modules
  P: Extracting libpam-runtime
  P: Extracting login
  P: Extracting hostname
  P: Extracting libc-bin
  P: Extracting ncurses-bin
  P: Extracting ncurses-base
  P: Unpacking package dpkg
  P: Configuring package dpkg
  P: Unpacking package base-passwd
  P: Configuring package base-passwd
  P: Configuring helper cdebootstrap-helper-rc.d
  P: Configuring helper cdebootstrap-helper-makedev
  P: Unpacking package tar
  P: Unpacking package debianutils
  P: Unpacking package perl-base
  P: Unpacking package perl-modules-5.36
  P: Unpacking package perl
  P: Unpacking package libnumber-compare-perl
  P: Unpacking package libtext-glob-perl
  P: Unpacking package libfile-find-rule-perl
  P: Unpacking package usrmerge
  P: Unpacking package init-system-helpers
  P: Unpacking package sysvinit-utils
  P: Unpacking package dash
  P: Unpacking package diffutils
  P: Unpacking package coreutils
  P: Unpacking package gzip
  P: Unpacking package mawk
  P: Unpacking package base-files
  P: Unpacking package bash
  P: Unpacking package libaudit-common
  P: Unpacking package debconf
  P: Unpacking package util-linux-extra
  P: Unpacking package util-linux
  P: Unpacking package sed
  P: Unpacking package bsdutils
  P: Unpacking package findutils
  P: Unpacking package grep
  P: Unpacking package libpam-modules-bin
  P: Unpacking package libpam-runtime
  P: Unpacking package login
  P: Unpacking package hostname
  P: Unpacking package libc-bin
  P: Unpacking package ncurses-bin
  P: Unpacking package ncurses-base
  P: Configuring package libtext-glob-perl
  P: Configuring package libaudit-common
  P: Configuring package debconf
  P: Configuring package libnumber-compare-perl
  P: Configuring package ncurses-base
  P: Configuring package sysvinit-utils
  P: Configuring package debianutils
  P: Configuring package mawk
  P: Configuring package base-files
  P: Configuring package bash
  P: Configuring package libc-bin
  P: Configuring package ncurses-bin
  P: Configuring package diffutils
  P: Configuring package hostname
  P: Configuring package util-linux-extra
  P: Configuring package sed
  P: Configuring package findutils
  P: Configuring package bsdutils
  P: Configuring package tar
  P: Configuring package libpam-modules-bin
  P: Configuring package coreutils
  P: Configuring package util-linux
  P: Configuring package dash
  P: Configuring package grep
  P: Configuring package perl-base
  P: Configuring package perl-modules-5.36
  P: Configuring package gzip
  P: Configuring package libpam-runtime
  P: Configuring package login
  P: Configuring package perl
  P: Configuring package libfile-find-rule-perl
  P: Configuring package usrmerge
  P: Configuring package init-system-helpers
  P: Unpacking package libsemanage-common
  P: Unpacking package passwd
  P: Unpacking package adduser
  P: Unpacking package gpgv
  P: Unpacking package readline-common
  P: Unpacking package gpgconf
  P: Unpacking package lsb-base
  P: Unpacking package dirmngr
  P: Unpacking package gnupg-l10n
  P: Unpacking package gnupg-utils
  P: Unpacking package gpg
  P: Unpacking package pinentry-curses
  P: Unpacking package gpg-agent
  P: Unpacking package gpg-wks-client
  P: Unpacking package gpg-wks-server
  P: Unpacking package gpgsm
  P: Unpacking package gnupg
  P: Unpacking package raspbian-archive-keyring
  P: Unpacking package apt
  P: Configuring package libsemanage-common
  P: Configuring package readline-common
  P: Configuring package lsb-base
  P: Configuring package gnupg-l10n
  P: Configuring package passwd
  P: Configuring package adduser
  P: Configuring package gpgv
  P: Configuring package gpgconf
  P: Configuring package dirmngr
  P: Configuring package gnupg-utils
  P: Configuring package gpg
  P: Configuring package pinentry-curses
  P: Configuring package gpg-agent
  P: Configuring package gpg-wks-client
  P: Configuring package gpg-wks-server
  P: Configuring package gpgsm
  P: Configuring package gnupg
  P: Configuring package raspbian-archive-keyring
  P: Configuring package apt
  P: Configuring helper cdebootstrap-helper-apt
  P: Retrieving liblocale-gettext-perl
  P: Retrieving mount
  P: Retrieving cron-daemon-common
  P: Retrieving sensible-utils
  P: Retrieving cron
  P: Retrieving libatomic1
  P: Retrieving libssl3
  P: Retrieving libargon2-1
  P: Retrieving dmsetup
  P: Retrieving libdevmapper1.02.1
  P: Retrieving libjson-c5
  P: Retrieving libcryptsetup12
  P: Retrieving libfdisk1
  P: Retrieving libkmod2
  P: Retrieving libapparmor1
  P: Retrieving libip4tc2
  P: Retrieving libsystemd-shared
  P: Retrieving systemd
  P: Retrieving systemd-sysv
  P: Retrieving libdbus-1-3
  P: Retrieving dbus-bin
  P: Retrieving dbus-session-bus-common
  P: Retrieving libexpat1
  P: Retrieving dbus-daemon
  P: Retrieving dbus-system-bus-common
  P: Retrieving dbus
  P: Retrieving kbd
  P: Retrieving xkb-data
  P: Retrieving keyboard-configuration
  P: Retrieving console-setup-linux
  P: Retrieving console-setup
  P: Retrieving libcpufreq0
  P: Retrieving cpufrequtils
  P: Retrieving libbsd0
  P: Retrieving libedit2
  P: Retrieving libcbor0.8
  P: Retrieving libfido2-1
  P: Retrieving libcom-err2
  P: Retrieving libkrb5support0
  P: Retrieving libk5crypto3
  P: Retrieving libkeyutils1
  P: Retrieving libkrb5-3
  P: Retrieving libgssapi-krb5-2
  P: Retrieving openssh-client
  P: Retrieving openssh-sftp-server
  P: Retrieving libproc2-0
  P: Retrieving procps
  P: Retrieving ucf
  P: Retrieving runit-helper
  P: Retrieving libtirpc-common
  P: Retrieving libtirpc3
  P: Retrieving libnsl2
  P: Retrieving libwrap0
  P: Retrieving openssh-server
  P: Retrieving mksh
  P: Retrieving udev
  P: Retrieving rng-tools-debian
  P: Retrieving rng-tools
  P: Retrieving sudo
  P: Retrieving tzdata
  P: Retrieving apt-utils
  P: Retrieving libuchardet0
  P: Retrieving groff-base
  P: Retrieving libelf1
  P: Retrieving libbpf1
  P: Retrieving libmnl0
  P: Retrieving libxtables12
  P: Retrieving libcap2-bin
  P: Retrieving iproute2
  P: Retrieving iputils-ping
  P: Retrieving kmod
  P: Retrieving less
  P: Retrieving libpopt0
  P: Retrieving logrotate
  P: Retrieving bsdextrautils
  P: Retrieving libpipeline1
  P: Retrieving man-db
  P: Retrieving vim-common
  P: Retrieving vim-tiny
  P: Retrieving bash-completion
  P: Retrieving openssl
  P: Retrieving ca-certificates
  P: Retrieving libc-l10n
  P: Retrieving libpam-systemd
  P: Retrieving locales
  P: Retrieving systemd-timesyncd
  P: Retrieving libpsl5
  P: Retrieving wget
  P: Retrieving dialog
  P: Retrieving dosfstools
  P: Retrieving libestr0
  P: Retrieving libfastjson4
  P: Retrieving liblognorm5
  P: Retrieving rsyslog
  P: Retrieving systemd-resolved
  P: Unpacking package liblocale-gettext-perl
  P: Unpacking package mount
  P: Unpacking package cron-daemon-common
  P: Unpacking package sensible-utils
  P: Configuring package cron-daemon-common
  P: Unpacking package cron
  P: Unpacking package dmsetup
  P: Unpacking package systemd
  P: Configuring package mount
  P: Configuring package systemd
  P: Configuring package dmsetup
  P: Unpacking package systemd-sysv
  P: Unpacking package dbus-bin
  P: Unpacking package dbus-session-bus-common
  P: Unpacking package dbus-daemon
  P: Unpacking package dbus-system-bus-common
  P: Unpacking package dbus
  P: Unpacking package kbd
  P: Unpacking package xkb-data
  P: Unpacking package keyboard-configuration
  P: Unpacking package console-setup-linux
  P: Unpacking package console-setup
  P: Unpacking package libcpufreq0
  P: Unpacking package cpufrequtils
  P: Unpacking package openssh-client
  P: Unpacking package openssh-sftp-server
  P: Unpacking package procps
  P: Unpacking package ucf
  P: Unpacking package runit-helper
  P: Unpacking package libtirpc-common
  P: Unpacking package openssh-server
  P: Unpacking package mksh
  P: Unpacking package udev
  P: Unpacking package rng-tools-debian
  P: Configuring package mksh
  P: Unpacking package rng-tools
  P: Unpacking package sudo
  P: Unpacking package tzdata
  P: Unpacking package apt-utils
  P: Unpacking package groff-base
  P: Unpacking package libcap2-bin
  P: Unpacking package iproute2
  P: Unpacking package iputils-ping
  P: Unpacking package kmod
  P: Unpacking package less
  P: Unpacking package logrotate
  P: Unpacking package bsdextrautils
  P: Unpacking package man-db
  P: Unpacking package vim-common
  P: Unpacking package vim-tiny
  P: Unpacking package bash-completion
  P: Unpacking package openssl
  P: Unpacking package ca-certificates
  P: Unpacking package libc-l10n
  P: Unpacking package locales
  P: Unpacking package systemd-timesyncd
  P: Unpacking package wget
  P: Unpacking package dialog
  P: Unpacking package dosfstools
  P: Unpacking package rsyslog
  P: Unpacking package systemd-resolved
  P: Configuring package runit-helper
  P: Configuring package systemd-sysv
  P: Configuring package libc-l10n
  P: Configuring package apt-utils
  P: Configuring package bsdextrautils
  P: Configuring package wget
  P: Configuring package libtirpc-common
  P: Configuring package dosfstools
  P: Configuring package less
  P: Configuring package xkb-data
  P: Configuring package kmod
  P: Configuring package locales
  P: Configuring package tzdata
  P: Configuring package libcap2-bin
  P: Configuring package vim-common
  P: Configuring package dialog
  P: Configuring package bash-completion
  P: Configuring package systemd-timesyncd
  P: Configuring package udev
  P: Configuring package sudo
  P: Configuring package libcpufreq0
  P: Configuring package sensible-utils
  P: Configuring package dbus-session-bus-common
  P: Configuring package procps
  P: Configuring package kbd
  P: Configuring package dbus-system-bus-common
  P: Configuring package openssl
  P: Configuring package iputils-ping
  P: Configuring package dbus-bin
  P: Configuring package liblocale-gettext-perl
  P: Configuring package logrotate
  P: Configuring package cron
  P: Configuring package rsyslog
  P: Configuring package dbus-daemon
  P: Configuring package vim-tiny
  P: Configuring package ca-certificates
  P: Configuring package rng-tools-debian
  P: Configuring package dbus
  P: Configuring package cpufrequtils
  P: Configuring package ucf
  P: Configuring package groff-base
  P: Configuring package rng-tools
  P: Configuring package keyboard-configuration
  P: Configuring package systemd-resolved
  P: Configuring package iproute2
  P: Configuring package openssh-client
  P: Configuring package man-db
  P: Configuring package console-setup-linux
  P: Configuring package openssh-sftp-server
  P: Configuring package console-setup
  P: Configuring package openssh-server
  P: Deconfiguring helper cdebootstrap-helper-apt
  P: Deconfiguring helper cdebootstrap-helper-makedev
  P: Writing apt sources.list
  P: Writing hosts
  P: Writing resolv.conf
OK

Configuring installed system:
  Setting root password... OK
  Disabling SSH password login for users... OK
  Configuring user 'jason':
    Adding user `jason' ...
    Adding new group `jason' (1000) ...
    Adding new user `jason' (1000) with group `jason (1000)' ...
    Creating home directory `/home/jason' ...
    Copying files from `/etc/skel' ...
    Adding new user `jason' to supplemental / extra groups `users' ...
    Adding user `jason' to group `users' ...
  Setting SSH key for 'jason'... OK
  Setting owner as 'jason' on SSH directory... OK
  Setting permissions on 'jason' SSH authorized_keys... OK
  Setting password for 'jason'... OK
  Adding 'jason' to sudo group... OK
  Configuring /etc/fstab... OK
  Configuring hostname... OK
  Configuring hosts... adding han... OK
  Configuring systemd network settings... OK
  Configuring tzdata (timezone "Australia/Perth")... OK
  Enabling locales... en_AU.UTF-8... en_US.UTF-8... OK
  Generating locales (this might take a while)...
    en_AU.UTF-8... done
    en_US.UTF-8... done
  Generation complete.
  Setting system default locale 'en_AU.UTF-8'... OK

Configuring apt:
  Configuring Raspbian/Debian repository... OK
  Checking Raspbian/Debian repository entry... OK
  Checking Raspbian/Debian GPG key... Moving key to /etc/apt/trusted.gpg.d/... OK
  Adding raspberrypi.org GPG key to /etc/apt/trusted.gpg.d/... OK
  Configuring RaspberryPi repository... OK
  Configuring RaspberryPi preference... OK

Updating package lists... OK

Downloading packages...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  Package aptitude is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package raspi-copies-and-fills is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package nano is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package vim is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  E: Unable to locate package firmware-atheros
  E: Unable to locate package firmware-brcm80211
  E: Unable to locate package firmware-libertas
  E: Unable to locate package firmware-misc-nonfree
  E: Unable to locate package firmware-realtek
  E: Package 'aptitude' has no installation candidate
  E: Unable to locate package avahi-daemon
  E: Unable to locate package curl
  E: Unable to locate package hdparm
  E: Unable to locate package htop
  E: Unable to locate package iptables-persistent
  E: Unable to locate package micro
  E: Package 'nano' has no installation candidate
  E: Unable to locate package ncdu
  E: Unable to locate package netfilter-persistent
  E: Unable to locate package tmux
  E: Package 'vim' has no installation candidate
  E: Unable to locate package raspberrypi-bootloader
  E: Unable to locate package raspberrypi-kernel
  E: Unable to locate package raspberrypi-sys-mods
  E: Unable to locate package libraspberrypi-bin
  E: Package 'raspi-copies-and-fills' has no installation candidate
ERROR: 100, trying again (2/5)...   Reading package lists...
  Building dependency tree...
  Reading state information...
  Package aptitude is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package raspi-copies-and-fills is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package nano is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package vim is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  E: Unable to locate package firmware-atheros
  E: Unable to locate package firmware-brcm80211
  E: Unable to locate package firmware-libertas
  E: Unable to locate package firmware-misc-nonfree
  E: Unable to locate package firmware-realtek
  E: Package 'aptitude' has no installation candidate
  E: Unable to locate package avahi-daemon
  E: Unable to locate package curl
  E: Unable to locate package hdparm
  E: Unable to locate package htop
  E: Unable to locate package iptables-persistent
  E: Unable to locate package micro
  E: Package 'nano' has no installation candidate
  E: Unable to locate package ncdu
  E: Unable to locate package netfilter-persistent
  E: Unable to locate package tmux
  E: Package 'vim' has no installation candidate
  E: Unable to locate package raspberrypi-bootloader
  E: Unable to locate package raspberrypi-kernel
  E: Unable to locate package raspberrypi-sys-mods
  E: Unable to locate package libraspberrypi-bin
  E: Package 'raspi-copies-and-fills' has no installation candidate
ERROR: 100, trying again (3/5)...   Reading package lists...
  Building dependency tree...
  Reading state information...
  Package aptitude is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package raspi-copies-and-fills is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package nano is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package vim is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  E: Unable to locate package firmware-atheros
  E: Unable to locate package firmware-brcm80211
  E: Unable to locate package firmware-libertas
  E: Unable to locate package firmware-misc-nonfree
  E: Unable to locate package firmware-realtek
  E: Package 'aptitude' has no installation candidate
  E: Unable to locate package avahi-daemon
  E: Unable to locate package curl
  E: Unable to locate package hdparm
  E: Unable to locate package htop
  E: Unable to locate package iptables-persistent
  E: Unable to locate package micro
  E: Package 'nano' has no installation candidate
  E: Unable to locate package ncdu
  E: Unable to locate package netfilter-persistent
  E: Unable to locate package tmux
  E: Package 'vim' has no installation candidate
  E: Unable to locate package raspberrypi-bootloader
  E: Unable to locate package raspberrypi-kernel
  E: Unable to locate package raspberrypi-sys-mods
  E: Unable to locate package libraspberrypi-bin
  E: Package 'raspi-copies-and-fills' has no installation candidate
ERROR: 100, trying again (4/5)...   Reading package lists...
  Building dependency tree...
  Reading state information...
  Package aptitude is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package raspi-copies-and-fills is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package nano is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package vim is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  E: Unable to locate package firmware-atheros
  E: Unable to locate package firmware-brcm80211
  E: Unable to locate package firmware-libertas
  E: Unable to locate package firmware-misc-nonfree
  E: Unable to locate package firmware-realtek
  E: Package 'aptitude' has no installation candidate
  E: Unable to locate package avahi-daemon
  E: Unable to locate package curl
  E: Unable to locate package hdparm
  E: Unable to locate package htop
  E: Unable to locate package iptables-persistent
  E: Unable to locate package micro
  E: Package 'nano' has no installation candidate
  E: Unable to locate package ncdu
  E: Unable to locate package netfilter-persistent
  E: Unable to locate package tmux
  E: Package 'vim' has no installation candidate
  E: Unable to locate package raspberrypi-bootloader
  E: Unable to locate package raspberrypi-kernel
  E: Unable to locate package raspberrypi-sys-mods
  E: Unable to locate package libraspberrypi-bin
  E: Package 'raspi-copies-and-fills' has no installation candidate
ERROR: 100, trying again (5/5)...   Reading package lists...
  Building dependency tree...
  Reading state information...
  Package aptitude is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package raspi-copies-and-fills is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package nano is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  Package vim is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  E: Unable to locate package firmware-atheros
  E: Unable to locate package firmware-brcm80211
  E: Unable to locate package firmware-libertas
  E: Unable to locate package firmware-misc-nonfree
  E: Unable to locate package firmware-realtek
  E: Package 'aptitude' has no installation candidate
  E: Unable to locate package avahi-daemon
  E: Unable to locate package curl
  E: Unable to locate package hdparm
  E: Unable to locate package htop
  E: Unable to locate package iptables-persistent
  E: Unable to locate package micro
  E: Package 'nano' has no installation candidate
  E: Unable to locate package ncdu
  E: Unable to locate package netfilter-persistent
  E: Unable to locate package tmux
  E: Package 'vim' has no installation candidate
  E: Unable to locate package raspberrypi-bootloader
  E: Unable to locate package raspberrypi-kernel
  E: Unable to locate package raspberrypi-sys-mods
  E: Unable to locate package libraspberrypi-bin
  E: Package 'raspi-copies-and-fills' has no installation candidate
ERROR: 100, FAILED !

Error: The installation could not be completed!

I am a bit baffled by this, because /rootfs/etc/apt/sources.list contains:

deb http://mirror.aarnet.edu.au/pub/raspbian/raspbian bookworm main contrib non-free firmware

...and /rootfs/etc/apt/sources.list.d/raspberrypi.org.list contains:

deb http://archive.raspberrypi.org/debian bookworm main

The first mirror definitely contains eg. aptitude. I don't see any errors relating to eg. signing keys or index downloads, so I don't understand why it isn't found.

@kmic5
Copy link
Author

kmic5 commented Jun 4, 2024

I just tried this and it tripped on

Copying executable tmp/sbin/start-stop-daemon
cp: cannot stat 'tmp/sbin/start-stop-daemon': No such file or directory

As far as I can tell, this is because dpkg 1.21.22 (in regular Debian bookworm) has this file in /sbin/, but Raspberry Pi's bookworm distro uses 1.22.6~bpo12+rpt2, which has it in /usr/sbin. [...]

Can confirm this issue occurs today. It was not present when the PR was submitted. To make the build script (build.sh) more resilient, perhaps function cp_executable could be changed to accept a list of paths to search for the source file.
Longer-term, it would help if update.sh had a way to pin packages to a desired repo. Would require non-trivial changes.

Well, I built the installer, and it ran through almost the entire process on my ancient RPi 2B without issue 🎊

Thanks for trying this out, hope you get it working. I actually have bookworm (built with this PR) running on a 2B without issue since early March.

Unfortunately it fell over at installing packages into the new system:

  Building dependency tree...
  Reading state information...
  Package aptitude is not available, but is referred to by another package.
  [...]

[...]
The first mirror definitely contains eg. aptitude. I don't see any errors relating to eg. signing keys or index downloads, so I don't understand why it isn't found.

The installer may have failed to update the package lists somehow. Your log indicates success: Updating package lists... OK so it may take some prodding to discover the underlying issue.
I did not test installing aptitude, but installed vim without issue. If you are able to bring up a shell on the target, you can try inspecting /rootfs to check the state of things.

@detly
Copy link

detly commented Jun 4, 2024

If you are able to bring up a shell on the target, you can try inspecting /rootfs to check the state of things.

I can (I have a monitor and keyboard connected), but there was not much to look at. The install log contains only what I posted there, and I can't find any other incriminating details. However, it looks like this corresponds to L2267 in scripts/opt/raspberrypi-ua-netinst/install.sh, so I can try entering those commands manually and seeing what happens.

@detly
Copy link

detly commented Jun 4, 2024

I'm getting a lot of "temporary failure in name resolution" errors, which is weird because a minute later nslookup will work on the same host:

# chroot /rootfs /usr/bin/apt-get update
Ign:1 http://mirror.aarnet.edu.au/pub/raspbian/raspbian bookworm InRelease
Ign:2 http://archive.raspberrypi.org/debian bookworm InRelease
Ign:1 http://mirror.aarnet.edu.au/pub/raspbian/raspbian bookworm InRelease
Ign:2 http://archive.raspberrypi.org/debian bookworm InRelease
Ign:1 http://mirror.aarnet.edu.au/pub/raspbian/raspbian bookworm InRelease
Ign:2 http://archive.raspberrypi.org/debian bookworm InRelease
Err:1 http://mirror.aarnet.edu.au/pub/raspbian/raspbian bookworm InRelease
  Temporary failure resolving 'mirror.aarnet.edu.au'
Err:2 http://archive.raspberrypi.org/debian bookworm InRelease
  Temporary failure resolving 'archive.raspberrypi.org'
Reading package lists...
W: Failed to fetch http://mirror.aarnet.edu.au/pub/raspbian/raspbian/dists/bookworm/InRelease  Temporary failure resolving 'mirror.aarnet.edu.au'
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/bookworm/InRelease  Temporary failure resolving 'archive.raspberrypi.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

There's no nslookup in /rootfs, but:

# nslookup mirror.aarnet.edu.au
Server:		192.168.1.1
Address:	192.168.1.1:53

Non-authoritative answer:
Name:	mirror.aarnet.edu.au
Address: 202.158.214.106

Non-authoritative answer:
Name:	mirror.aarnet.edu.au
Address: 2001:388:30bc:cafe::beef

I suspect it's a DNS/systemd misconfiguration I've encountered before. Let me try again without use_systemd_services=1 to see what happens.

@detly
Copy link

detly commented Jun 5, 2024

Yes, setting use_systemd_services=0 allowed the whole thing to work. I now have Bookworm running on my RPi 2B+, thank you!

My totally unverified hunch is that this is a variant of systemd's #4621/Ubuntu's issue #1624320, but I have not dug into it. I'd suggest that you look at how you configure DNS in the installer for use_systemd_services=1, but I am absolutely not volunteering because I hate debugging DNS.

@ikem-krueger
Copy link

I applied the patches from this conversation onto the "devel" branch and patched "build.sh".

This was the commands I used to build the image:

bash update.sh
bash build.sh
sudo bash buildroot.sh

Building went fine. I burned the image onto the sdcard.

On the sdcard I created this config file "raspberrypi-ua-netinst/config/installer-config.txt":

# To customize the raspberrypi-unattended-installer:
#
# Place your settings in this file as described in the README.md or in the advanced documentation.

# Package
packages=preload,zram-config,zram-tools,apt-file,trash-cli,htop
firmware_packages=1
mirror=https://mirror.netcologne.de/raspbian/raspbian/
release=bookworm
arch=arm64
use_systemd_services=0

# SSH
root_ssh_pubkey=
root_ssh_pwlogin=0

# User
username=pi
userpw=raspbian
usergroups=pi
userperms_admin=1
rootpw=

# Network
hostname=nextcloudpi
ip_addr=192.168.178.28
ip_netmask=255.255.255.0
ip_gateway=192.168.178.1
ip_nameservers=192.168.178.1

# Localization
timezone=Europe/Berlin
keyboard_layout=de
locales=de_DE.UTF-8
system_default_locale=de_DE.UTF-8

# Graphics / GPU
gpu_mem=16

# Advanced
quiet_boot=1
disable_raspberries=1
disable_splash=1
cleanup=1
installer_telnet=none
timeserver=fritz.box

Booting worked fine without "SOS"-code.

But it doesn't continue from there. It seems like the installer script is not run.

@kmic5
Copy link
Author

kmic5 commented Jun 14, 2024

Connecting a display to your pi may help to see where it's stalling. Or if you comment out installer_telnet=none in the config, and the installer script gets far enough to bring up networking, you may be able to remotely view the log.

Another thing to try is a different mirror, or comment out the mirror=... line to have a suitable mirror chosen automatically.

@mrichar1
Copy link
Contributor

mrichar1 commented Sep 25, 2024

Have just been working through this PR trying to build on a Pi 4 and thought I'd add some feedback/new bugs...

update.sh expects the last entry in Release files to be SHA256 - but some now have SHA512, so verification fails. A fix is to explicitly extract the SHA256 hashes before grepping for the filename to be verified - something like this works:

diff --git a/update.sh b/update.sh
index 2ee3cb6..aefccf0 100755
--- a/update.sh
+++ b/update.sh
@@ -203,7 +203,7 @@ download_package_list() {

                       # Verify the checksum of the Packages file, assuming that the last checksums in the Release file are SHA256 sums
                       echo -n "Verifying ${package_section} package list... "
-                       if [ "$(grep "${package_section}/binary-armhf/Packages${extension}" "${1}_Release" | tail -n1 | awk '{print $1}')" = "$(sha256sum "tmp${extension}" | awk '{print $1}')" ]; then
+                       if [ "$(awk -v file="${package_section}/binary-armhf/Packages${extension}" '/^SHA256:/ {found=1; next} /^SHA/ && found {found=0} found && $3 == file {print $1}' ${1}_Release)" = "$(sha256sum "tmp${extension}" | awk '{print $1}')" ]; then
                               echo "OK"
                       else
                               echo -e "ERROR\nThe checksum of file '${package_section}/binary-armhf/Packages${extension}' doesn't match!"

I also had to update the build.sh path for start-stop-daemon to /usr/bin as mentioned previously.

However when it boots it fails almost immediately with failed to execute init (error -2).

I've had a look at initramfs.gz and it looks fine - it contains init which is a symlink to bin/busybox.

Replacing /init with bash-static and I can get enough of a shell to see that executing busybox gives the error: cannot execute: required file not found. However the busybox binary is present and executable - implying a missing dependency. /lib seems to have the core libs (ld-linux etc) and ldconfig -v doesn't show any obvious errors.

Any hints on how to debug this further?

@kmic5
Copy link
Author

kmic5 commented Sep 26, 2024

Have just been working through this PR trying to build on a Pi 4 and thought I'd add some feedback/new bugs...

update.sh expects the last entry in Release files to be SHA256 - but some now have SHA512, so verification fails. A fix is [...]

Thanks for testing this PR and sharing a fix for the checksum issue.

However when it boots it fails almost immediately with failed to execute init (error -2).
[...]
Any hints on how to debug this further?

Maybe try the installer on different storage media.
Does file and readelf -a output anything abnormal for the busybox binary? If you have a Pi test environment, you can try to chroot into the initramfs and see if busybox fails to execute there as well.

@mrichar1
Copy link
Contributor

Thanks for the suggestions...

Maybe try the installer on different storage media.

I've tried this on different SD cards, and have rebuilt the image a couple of times and still get the same issue.

Does file and readelf -a output anything abnormal for the busybox binary? If you have a Pi test environment, you can try to chroot into the initramfs and see if busybox fails to execute there as well.

Nothing obviously 'wrong' with busybox - it has the same md5sum as the one installed from busybox_1.35.0-4_armhf.deb on a manually built working bookworm install, and is executable. When I strace busybox on the manual install it opens 3 libs - libc.so.6, libresolv.so.2 and ld-linux-armhf.so.3 - all of which look to be available on the netinst boot.

file:

busybox: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=679761041ecc026e956eb0ebedee4a6d8d70b0ae, for GNU/Linux 3.2.0, stripped

readelf:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x19930
  Start of program headers:          52 (bytes into file)
  Start of section headers:          852684 (bytes into file)
  Flags:                             0x5000400, Version5 EABI, hard-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         9
  Size of section headers:           40 (bytes)
  Number of section headers:         28
  Section header string table index: 27

I've also tried changing config.txt to have arm_64bit=0 in case it was a 32/64-bit issue, but that makes no difference.

@kmic5
Copy link
Author

kmic5 commented Sep 28, 2024

Data corruption appears to be ruled out, at least with the busybox binary, assuming the SD cards you tried are otherwise fine.

May help to check block devices with lsblk and mounts with mount if you can get a bash-static shell on the target again. You can also try to manually invoke the installer: /opt/raspberrypi-ua-netinst/install.sh

Were you able to chroot to the netinst build and run busybox from there? Not sure if this is a dependency issue, but it may help to check the libs you mentioned: ldd /path/to/lib1 /path/to/lib2 ...

@detly
Copy link

detly commented Nov 19, 2024

Something else I just discovered (because I was using a RPi 4): commit b651d0d clobbered the alternate Raspbian/Debian GPG processing uses the target system's filesystem for the raspbian GPG key, so the installer fails at finding the raspbian GPG key for arm64.

@kmic5
Copy link
Author

kmic5 commented Nov 23, 2024

[...] the installer fails at finding the raspbian GPG key for arm64.

Good catch. Have not had a chance to test on a 64-bit host. Testing on a 32-bit host (RPi 2B) did not reveal any key issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants