acrn-hypervisor/misc/packaging/acrn-kernel.postinst
Ziheng Li eb8bcb06b3 Update copyright year range in code headers
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".

Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:48:35 +08:00

35 lines
921 B
Bash

#!/bin/bash
#* Copyright (c) 2020-2022 Intel Corporation.
# 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}')
str=$(blkid |grep ${type})
uuid=$(echo $str |cut -d " " -f 2|cut -d "=" -f 2)
str=$(blkid |grep ${type})
partuuid=$(echo ${str##*PARTUUID=})
if [ -z "$menu" ]
then
cat>"${filename}"<<EOF
#!/bin/sh
exec tail -n +3 \$0
menuentry 'ACRN multiboot2 ' --id ACRN_deb_multiboot2 {
load_video
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set $uuid
multiboot2 /boot/acrn.bin root=PARTUUID=$partuuid
}
EOF
fi
sed -i '/module/d' ${filename} || true
bzImage=$(cat /boot/version.txt)
sed -i '/multiboot2 \/boot/a\module2 /boot/'${bzImage}' Linux_bzImage' ${filename}
sync
update-grub