recovery-initramfs-init: remove parted dependency
Turns out that the busybox' fdisk applet is also able to parse the GPT partition tables. This saves around 0.5 MiB of space. https://jira.digi.com/browse/DEL-4565 Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
This commit is contained in:
parent
e6beba4cb0
commit
270f890494
|
|
@ -5,7 +5,6 @@ LICENSE = "MIT"
|
|||
|
||||
PACKAGE_INSTALL = " \
|
||||
busybox \
|
||||
parted \
|
||||
psplash \
|
||||
recovery-initramfs \
|
||||
swupdate \
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ PARTITION="$(echo "${MDEV}" | sed -n -e '/^mmc/{s,^[^p]\+p\([0-9]\+\)$,\1,g;T;p}
|
|||
|
||||
# This will detect if the block device has a update partition
|
||||
is_update_device() {
|
||||
parted -s "/dev/${DEVICE}" print | grep -qs update
|
||||
fdisk -l "/dev/${DEVICE}" | grep -qs update
|
||||
}
|
||||
|
||||
# This will verify that the requested partition is the update partition
|
||||
is_update_partition() {
|
||||
parted -s "/dev/${DEVICE}" print | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<update\>.*,\1,g;T;p" | grep -qs "${PARTITION}"
|
||||
fdisk -l "/dev/${DEVICE}" | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<update\>.*,\1,g;T;p" | grep -qs "${PARTITION}"
|
||||
}
|
||||
|
||||
if is_update_device; then
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ format_ubi_volume() {
|
|||
#------------------------------------------------------------------------------
|
||||
format_emmc_block() {
|
||||
# Find partition block number.
|
||||
local partition_block="/dev/mmcblk0p$(parted -s /dev/mmcblk0 print | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<${1}\>.*,\1,g;T;p")"
|
||||
local partition_block="/dev/mmcblk0p$(fdisk -l /dev/mmcblk0 | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<${1}\>.*,\1,g;T;p")"
|
||||
if [ -b "${partition_block}" ]; then
|
||||
# Umount in case partition is mounted, ignore errors.
|
||||
if grep -qs "${partition_block}" /proc/mounts; then
|
||||
|
|
@ -458,7 +458,7 @@ if [ -n "${encryption_key_bool}" ]; then
|
|||
# Format partition.
|
||||
if [ "$(is_nand)" = "no" ]; then
|
||||
psplash_message "Formatting rootfs partition..."
|
||||
rootfs_block="/dev/mmcblk0p$(parted -s /dev/mmcblk0 print | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<rootfs\>.*,\1,g;T;p")"
|
||||
rootfs_block="/dev/mmcblk0p$(fdisk -l /dev/mmcblk0 | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<rootfs\>.*,\1,g;T;p")"
|
||||
trustfence-tool --format ${rootfs_block} cryptroot
|
||||
fi
|
||||
psplash_progress "100"
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ if [ -b /dev/mapper/cryptroot ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
rootfs_block="/dev/mmcblk0p$(parted -s /dev/mmcblk0 print | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<rootfs\>.*,\1,g;T;p")"
|
||||
rootfs_block="/dev/mmcblk0p$(fdisk -l /dev/mmcblk0 | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<rootfs\>.*,\1,g;T;p")"
|
||||
|
||||
# Open LUKS encrypted device
|
||||
trustfence-tool ${rootfs_block} cryptroot
|
||||
|
|
|
|||
Loading…
Reference in New Issue