Skip to content

Commit

Permalink
repartition: Use partx rather than busybox partprobe
Browse files Browse the repository at this point in the history
Since da7b937, partprobe in the
initramfs is busybox, not the tool from parted.

For unknown reasons, busybox partprobe fails to probe /dev/loop0 after
it has been repartitioned, failing with:

    partprobe: /dev/loop0: Invalid argument

partx --update performs a similar function, except that it works
correctly at this stage of the boot process. Using partx also has the
advantage that running this tool manually from the booted system (where
partprobe is the real thing) will actually run the same code as in the
initramfs.

https://phabricator.endlessm.com/T35432
  • Loading branch information
wjt committed Jun 6, 2024
1 parent d73f66e commit 788fcf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dracut/repartition/endless-repartition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ udevadm settle

# Loop devices need a prod
if [ -n "$using_loop" ]; then
partprobe $root_disk
partx --update --verbose $root_disk
udevadm settle
fi

Expand Down
1 change: 1 addition & 0 deletions dracut/repartition/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install() {
dracut_install tune2fs
dracut_install iconv
dracut_install blkid
dracut_install partx
inst_script "$moddir/endless-repartition.sh" /bin/endless-repartition
inst_simple "$moddir/endless-repartition.service" \
"$systemdsystemunitdir/endless-repartition.service"
Expand Down

0 comments on commit 788fcf6

Please sign in to comment.