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

bcm2711: Use FS UUID and write config.txt and cmdline.txt earlier #6503

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
bcm2711: Write cmdline.txt and config.txt earlier
This allows userpatches customize-image-host.sh and customize-image.sh
to customize the contents of these files.

These files are now installed in the pre_install_distribution_specific
hook, which is the latest hook that runs before customize-image-host.sh.

The root= commandline option is still written (appended) in the
pre_umount_final_image hook as before, because the filesystem UUID is
not known when cmdline.txt is first written.
  • Loading branch information
matthijskooijman committed Apr 19, 2024
commit 7d52b404c0e5bfacdc7b7044fca366817a39f9ad
19 changes: 14 additions & 5 deletions config/sources/families/bcm2711.conf
Original file line number Diff line number Diff line change
@@ -237,8 +237,9 @@ function pre_umount_final_image__remove_esp() {
}

# write the default config.txt config
function pre_umount_final_image__write_raspi_config() {
cat <<- EOD > "${MOUNT}"/boot/firmware/config.txt
function pre_install_distribution_specific__write_raspi_config() {
mkdir -p "${SDCARD}"/boot/firmware
cat <<- EOD > "${SDCARD}"/boot/firmware/config.txt
# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details
@@ -290,10 +291,18 @@ function pre_umount_final_image__write_raspi_config() {
EOD
}

function pre_umount_final_image__write_raspi_cmdline() {
cat <<- EOD > "${MOUNT}"/boot/firmware/cmdline.txt
console=serial0,115200 console=tty1 loglevel=1 root=UUID=${ROOT_PART_UUID} rootfstype=${ROOTFS_TYPE} fsck.repair=yes rootwait logo.nologo cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
function pre_install_distribution_specific__write_raspi_cmdline() {
# Write most of the commandline early, to allow customizing it
mkdir -p "${SDCARD}"/boot/firmware
cat <<- EOD > "${SDCARD}"/boot/firmware/cmdline.txt
console=serial0,115200 console=tty1 loglevel=1 rootfstype=${ROOTFS_TYPE} fsck.repair=yes rootwait logo.nologo cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
EOD
}

function pre_umount_final_image__write_raspi_cmdline_root() {
# Write the root option late, since we only know the FS UUID
# when the image is being created
sed -i "s/$/ root=UUID=${ROOT_PART_UUID}/" "${MOUNT}"/boot/firmware/cmdline.txt

if [[ "${SHOW_DEBUG}" == "yes" ]]; then
display_alert "Showing /boot/firmware as mounted" "bcm2711" "debug"