Skip to content
Snippets Groups Projects

postmarketos-initramfs: refactor cmdline handling and other tech debt

Merged Casey requested to merge caleb/initramfs-cmdline-refactor into master
All threads resolved!

Do a bunch of things...

  • Improve various log messages for clarity/readabillity
  • Introduce an "info" log level which can be enabled using the dracut-compatible rd.info kernel cmdline flag
  • Refactor find_[rb]oot_partition, introducing a common find_partition function to contain the logic
  • Make pmos.nosplash/deviceinfo_no_framebuffer behaviour fully consistent
  • Move all cmdline parsing to one place, and set variables to configure behaviour. Remove all uses of grep ... /proc/cmdline or iterating over /proc/cmdline. Much of the code here was taken from the Arch Linux initramfs and simplified/adapted to fit our usecase. They also use busybox ash so we shouldn't expect any weird surprised with it.
  • Introduce standard pmos.xyz namespaced cmdline arguments for the remaining options that haven't already been converted, deprecate but continue supporting the old options
  • Add a special case to try and log to tty0 and available serial consoles if pmos.nosplash is set and there are no active consoles (e.g. due to console=null) this may be useful on devices with bootloaders that force console=null.

Additionally, all the old and new cmdline arguments have been documented on the wiki @ https://wiki.postmarketos.org/wiki/Initramfs#Kernel_cmdline

Once this is in:

  • update boot-deploy to use new cmdline args (pmos.root_uuid, pmos.boot_uuid, pmos.rootfsopts, etc).
Edited by Casey

Merge request reports

Merge request pipeline #217231 passed

Merge request pipeline passed for b7118581

Approved by

Merged by CaseyCasey 1 month ago (Mar 14, 2025 8:25pm UTC)

Merge details

  • Changes merged into master with b7118581.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Casey resolved all threads

    resolved all threads

  • Casey added 3 commits

    added 3 commits

    • d38d79e6 - postmarketos-initramfs: add rd.info arg and reduce logging
    • 0b6970d8 - postmarketos-initramfs: log splash messages
    • c18a3949 - postmarketos-initramfs: bump pkgver and checksum

    Compare with previous version

  • Just need the commits to properly follow the commit style (minor)

    and for the checksums in the APKBUILD to be fixed

  • Casey added 15 commits

    added 15 commits

    • c18a3949...f51775ed - 7 commits from branch master
    • e2ea2a0b - postmarketos-initramfs: reword debug-shell usb storage info
    • e9083261 - postmarketos-initramfs: use local for more function-local variables
    • 4ad8f378 - postmarketos-initramfs: refactor setup_log
    • 062221d9 - postmarketos-initramfs: refactor find_root/boot_partition
    • 6eaa3a11 - postmarketos-initramfs: refactor cmdline parsing
    • a64d9e6a - postmarketos-initramfs: add rd.info arg and reduce logging
    • 9a789451 - postmarketos-initramfs: log splash messages
    • 3de12294 - postmarketos-initramfs: bump pkgver and checksum

    Compare with previous version

  • tested and confirmed working on xiaomi-aquaman.

  • Ferass El Hafidi approved this merge request

    approved this merge request

  • Casey added 4 commits

    added 4 commits

    • bf17e42e - postmarketos-initramfs: refactor cmdline parsing
    • 31d60fa0 - postmarketos-initramfs: add rd.info arg and reduce logging
    • caa726fe - postmarketos-initramfs: log splash messages
    • 80a785c3 - postmarketos-initramfs: bump pkgver and checksum

    Compare with previous version

  • Casey mentioned in merge request !6182 (merged)

    mentioned in merge request !6182 (merged)

  • Jane Rachinger requested review from @craftyguy

    requested review from @craftyguy

  • Clayton Craft
  • Clayton Craft
  • Clayton Craft
  • Clayton Craft
  • Clayton Craft
  • Clayton Craft
  • Clayton Craft
  • wow this is amazing, well done! just a few nitpicks and I'd like to play around with this a little before approving, but I think it looks really great :grin:

  • Clayton Craft added 32 commits

    added 32 commits

    • 80a785c3...c2ca0f73 - 24 commits from branch master
    • 7449665a - postmarketos-initramfs: reword debug-shell usb storage info
    • 9b8b2222 - postmarketos-initramfs: use local for more function-local variables
    • 4cffcc75 - postmarketos-initramfs: refactor setup_log
    • b2307fec - postmarketos-initramfs: refactor find_root/boot_partition
    • 00f097bc - postmarketos-initramfs: refactor cmdline parsing
    • 9bd0726d - postmarketos-initramfs: add rd.info arg and reduce logging
    • 048adc13 - postmarketos-initramfs: log splash messages
    • cd1260ba - postmarketos-initramfs: bump pkgver and checksum

    Compare with previous version

  • Clayton Craft
  • Casey added 239 commits

    added 239 commits

    • cd1260ba...267126bc - 231 commits from branch master
    • 70d5179e - postmarketos-initramfs: reword debug-shell usb storage info
    • 52f25786 - postmarketos-initramfs: use local for more function-local variables
    • 392dd0f8 - postmarketos-initramfs: refactor setup_log
    • 3d3c0ec3 - postmarketos-initramfs: refactor find_root/boot_partition
    • 792f88af - postmarketos-initramfs: refactor cmdline parsing
    • 6d8eb44a - postmarketos-initramfs: add rd.info arg and reduce logging
    • 32f65d75 - postmarketos-initramfs: log splash messages
    • fd0cdff7 - postmarketos-initramfs: bump pkgver and checksum

    Compare with previous version

  • Clayton Craft resolved all threads

    resolved all threads

  • Clayton Craft approved this merge request

    approved this merge request

  • Author Maintainer

    Gave this a whirl on the Slim 7x (trailblazer) w/ systemd and all is good!

  • Ferass El Hafidi resolved all threads

    resolved all threads

  • Casey mentioned in commit 8400fffe

    mentioned in commit 8400fffe

  • Casey mentioned in commit 02442241

    mentioned in commit 02442241

  • Casey mentioned in commit 4133f4ae

    mentioned in commit 4133f4ae

  • Casey mentioned in commit 4d3958c4

    mentioned in commit 4d3958c4

  • Casey mentioned in commit acb5d895

    mentioned in commit acb5d895

  • Casey mentioned in commit 91c5784b

    mentioned in commit 91c5784b

  • Casey mentioned in commit 865653c9

    mentioned in commit 865653c9

  • Casey mentioned in commit b7118581

    mentioned in commit b7118581

  • Casey added 11 commits

    added 11 commits

    • fd0cdff7...8947f031 - 3 commits from branch master
    • acb5d895 - postmarketos-initramfs: reword debug-shell usb storage info
    • 4133f4ae - postmarketos-initramfs: use local for more function-local variables
    • 02442241 - postmarketos-initramfs: refactor setup_log
    • 91c5784b - postmarketos-initramfs: refactor find_root/boot_partition
    • 8400fffe - postmarketos-initramfs: refactor cmdline parsing
    • 4d3958c4 - postmarketos-initramfs: add rd.info arg and reduce logging
    • 865653c9 - postmarketos-initramfs: log splash messages
    • b7118581 - postmarketos-initramfs: bump pkgver and checksum

    Compare with previous version

  • Casey enabled an automatic merge when all merge checks for b7118581 pass

    enabled an automatic merge when all merge checks for b7118581 pass

  • Casey canceled the automatic merge

    canceled the automatic merge

  • merged

  • Please register or sign in to reply
    Loading