Skip to content

rpi-eeprom-update: scan only /dev/mmcblk0p1 in findBootFS#840

Merged
timg236 merged 1 commit into
raspberrypi:masterfrom
sairon:faster-findbootfs
May 26, 2026
Merged

rpi-eeprom-update: scan only /dev/mmcblk0p1 in findBootFS#840
timg236 merged 1 commit into
raspberrypi:masterfrom
sairon:faster-findbootfs

Conversation

@sairon

@sairon sairon commented May 26, 2026

Copy link
Copy Markdown
Contributor

Make findBootFS check faster by scanning only the device that it looks for. Running blkid without argument can block for several seconds if any of the devices is busy and if the device doesn't exist, the command returns immediately. The regular expression already constrains the output to match only one device, so scanning all superblocks is wasteful.

Make findBootFS check faster by scanning only the device that it looks
for. Running blkid without argument can block for several seconds if any
of the devices is busy and if the device doesn't exist, the command
returns immediately. The regular expression already constrains the
output to match only one device, so scanning all superblocks is
wasteful.
@sairon

sairon commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

Note that this change is a result of adapting rpi-eeprom-update in Home Assitant OS, so I'm not sure if RPi OS is concerned by it, nevertheless I think is a reasonable optimization.

Here's some profiling results from HA OS:

# time blkid /dev/mmcblk0p1
Command exited with non-zero status 2
real    0m 0.00s
user    0m 0.00s
sys     0m 0.00s
# time blkid /dev/sda1
/dev/sda1: SEC_TYPE="msdos" LABEL_FATBOOT="hassos-boot" LABEL="hassos-boot" UUID="099B-856A" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="hassos-boot" PARTUUID="b3dd0952-733c-4c88-8cba-cab9b8b4377f"
real    0m 2.06s
user    0m 0.00s
sys     0m 0.00s
# time blkid
/dev/sda1: SEC_TYPE="msdos" LABEL_FATBOOT="hassos-boot" LABEL="hassos-boot" UUID="099B-856A" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="hassos-boot" PARTUUID="b3dd0952-733c-4c88-8cba-cab9b8b4377f"
/dev/zram1: LABEL="hassos-var" UUID="533795f9-21b1-44f0-bc2d-feb44afed1bb" BLOCK_SIZE="4096" TYPE="ext4"
/dev/zram2: LABEL="hassos-tmp" UUID="54529d52-0bee-4eca-87a5-001602570717" BLOCK_SIZE="4096" TYPE="ext4"
/dev/sda4: PARTLABEL="hassos-kernel1" PARTUUID="fc02a4f0-5350-406f-93a2-56cbed636b5f"
/dev/sda2: BLOCK_SIZE="131072" TYPE="squashfs" PARTLABEL="hassos-kernel0" PARTUUID="26700fc6-b0bc-4ccf-9837-ea1a4cba3e65"
/dev/sda7: LABEL="hassos-overlay" UUID="788cf76a-5d2a-4737-8c32-90510b74869e" BLOCK_SIZE="1024" TYPE="ext4" PARTLABEL="hassos-overlay" PARTUUID="f1326040-5236-40eb-b683-aaa100a9afcf"
/dev/sda5: PARTLABEL="hassos-system1" PARTUUID="a3ec664e-32ce-4665-95ea-7ae90ce9aa20"
/dev/sda3: UUID="fa626bec-d47b-4f3a-97ef-b0636a9b3915" BLOCK_SIZE="4096" TYPE="erofs" PARTLABEL="hassos-system0" PARTUUID="8d3d53e3-6d49-4c38-8349-aff6859e82fd"
/dev/sda8: LABEL="hassos-data" UUID="f03be0cd-9635-4491-b886-4b545c34d6f1" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="hassos-data" PARTUUID="a52a4597-fa3a-4851-aefd-2fbe9f849079"
/dev/sda6: PARTLABEL="hassos-bootstate" PARTUUID="33236519-7f32-4dff-8002-3390b62c309d"
real    0m 38.62s
user    0m 0.00s
sys     0m 0.16s
#

@timg236 timg236 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok

@timg236 timg236 merged commit cadc1f7 into raspberrypi:master May 26, 2026
1 check passed
@timg236

timg236 commented May 27, 2026

Copy link
Copy Markdown
Collaborator

@sairon FYI, this draft PR might be of interest to HA OS. It's designed to reduce the risk of accidental bootloader downgrades to versions which don't support the hardware (e.g. different SDRAM / flash / PMIC etc)

https://github.com/raspberrypi/rpi-eeprom/pull/844/changes

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.

3 participants