recovery init: format rootfs partition (block devices) when setting a new key
https://jira.digi.com/browse/DEL-3277 Signed-off-by: Tatiana Leon <tatiana.leon@digi.com>
This commit is contained in:
parent
4085bc8904
commit
96d7211a71
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2016 Digi International.
|
||||
# Copyright (C) 2016, 2017 Digi International Inc.
|
||||
|
||||
SUMMARY = "Recovery initramfs files"
|
||||
LICENSE = "GPL-2.0"
|
||||
|
|
@ -56,3 +56,7 @@ do_install() {
|
|||
PACKAGES = "${PN}"
|
||||
|
||||
FILES_${PN} = "/"
|
||||
|
||||
RDEPENDS_${PN}_append_ccimx6 = " \
|
||||
cryptsetup \
|
||||
"
|
||||
|
|
|
|||
|
|
@ -415,11 +415,19 @@ if [ -n "${encryption_key_bool}" ]; then
|
|||
psplash_progress "0"
|
||||
trustfence-tool "--newkey${encryption_key:+=${encryption_key}}"
|
||||
if [ "$?" = "0" ]; then
|
||||
psplash_progress "100"
|
||||
psplash_progress "10"
|
||||
log "Trustfence encryption key setup succeed!"
|
||||
else
|
||||
quit_with_error "Error configuring trustfence encryption key"
|
||||
fi
|
||||
|
||||
# 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")"
|
||||
trustfence-tool --format ${rootfs_block} cryptroot
|
||||
fi
|
||||
psplash_progress "100"
|
||||
fi
|
||||
|
||||
# Check if update package command is configured.
|
||||
|
|
@ -432,6 +440,7 @@ if [ -n "${update_package_bool}" ]; then
|
|||
else
|
||||
# Give some time for the devices to settle down
|
||||
sleep 5
|
||||
|
||||
mount_external_disks
|
||||
mount_partition update "${UPDATE_MOUNT_DIR}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue