mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-28 11:43:56 +00:00
Fix Debian packaging postinst partition finding
If the root partition is bind mounted with / and another, the current postinst script (using command lsblk) will fail to find the partition: $type will be "/" only and cause the following command may find the wrong partition. Ubuntu 22.04 desktop with firefox snap by default: ``` > lsblk nvme0n1 259:19 0 931.5G 0 disk ├─nvme0n1p1 259:20 0 243M 0 part /boot/efi ├─nvme0n1p2 259:21 0 927.5G 0 part /var/snap/firefox/common/host-hunspell │ / ``` And current command forces the root partition to be ext4. This patch fixes the two issues. Tracked-On: #8532 Signed-off-by: Xin Zhang <xin.x.zhang@intel.com>
This commit is contained in:
parent
fbe30d4001
commit
d0fed9901d
@ -21,7 +21,7 @@ GENERATED_PARAMS=(cpu_perf_policy=Performance)
|
||||
#ACRN parameters End
|
||||
|
||||
ACRNBIN="/boot/acrn.${SCENARIO}.${BOARD}.bin"
|
||||
type=$(lsblk -l |awk '$NF == "/" {print $1}')
|
||||
type=$(findmnt / |awk '$1 == "/" {print $2}')
|
||||
|
||||
pattern='^/dev/.* UUID="([^"]+)".* PARTUUID="([^"]+)"'
|
||||
while IFS= read -r line; do
|
||||
@ -29,7 +29,7 @@ while IFS= read -r line; do
|
||||
uuid="${BASH_REMATCH[1]}"
|
||||
partuuid="${BASH_REMATCH[2]}"
|
||||
fi
|
||||
done < <(blkid |grep ext4 |grep ${type})
|
||||
done < <(blkid |grep ${type})
|
||||
|
||||
filename="/etc/grub.d/40_custom"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
# postinst script for acrn kernel
|
||||
filename="/etc/grub.d/40_custom"
|
||||
menu=$(grep ACRN_deb_multiboot2 ${filename}) || true
|
||||
type=$(lsblk -l |awk '$NF == "/" {print $1}')
|
||||
type=$(findmnt / |awk '$1 == "/" {print $2}')
|
||||
str=$(blkid |grep ${type})
|
||||
uuid=$(echo $str |cut -d " " -f 2|cut -d "=" -f 2)
|
||||
str=$(blkid |grep ${type})
|
||||
|
Loading…
Reference in New Issue
Block a user