remove "/boot" from the symlink by pushd-ing into /boot

This commit is contained in:
Pratham Patel 2023-10-08 17:02:56 +05:30
parent 2741e6c60a
commit dbf0df24e8
No known key found for this signature in database
2 changed files with 8 additions and 5 deletions

View File

@ -5,7 +5,7 @@
Name: opi5-efi
Version: 0.0.4
Release: 9%{?dist}
Release: 10%{?dist}
Summary: Necessary files for booting from vendor U-Boot on Orange Pi 5
License: GPL
Provides: %{name}-%{version}

11
post.sh
View File

@ -5,8 +5,8 @@ set -xeuf -o pipefail
UNAME_R="$(</boot/.uname)"
BOOT_PART="$(grep '/ ' /etc/fstab | awk '{print $1}')"
cp /opt/opi5-efi/boot.cmd "/boot/efi/boot.cmd"
cp /opt/opi5-efi/uEnv.txt "/boot/efi/uEnv.txt"
cp /opt/opi5-efi/boot.cmd boot/efi/boot.cmd
cp /opt/opi5-efi/uEnv.txt boot/efi/uEnv.txt
if [ ! -f /boot/.uname ]; then
echo "ERROR: No /boot/.uname found to extract 'uname -r' from."
@ -23,5 +23,8 @@ echo "rootdev=${BOOT_PART}" >> "/boot/efi/uEnv.txt"
sed -i "s/setenvrootdev/setenv rootdev \"${BOOT_PART}\"/" "/boot/efi/boot.cmd"
mkimage -A arm -T ramdisk -C none -n uInitrd -d "/boot/initramfs-${UNAME_R}.img" "/boot/uInitrd-${UNAME_R}"
ln -s "/boot/uInitrd-${UNAME_R}" "/boot/uInitrd"
mkimage -C none -A arm -T script -d "/boot/efi/boot.cmd" "/boot/efi/boot.scr"
mkimage -C none -A arm -T script -d /boot/efi/boot.cmd /boot/efi/boot.scr
pushd /boot
ln -s "uInitrd-${UNAME_R}" uInitrd
popd