diff --git a/build-uki.sh b/build-uki.sh index 53d089b..148c99b 100755 --- a/build-uki.sh +++ b/build-uki.sh @@ -3,8 +3,14 @@ run_directory=$(dirname $(readlink -f "$0")) source "$run_directory/variables.conf" +if [[ $user != 'root' ]]; then + sudo="sudo" +else + sudo="" +fi + # Build UKI -objcopy \ +$sudo objcopy \ --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \ --add-section .cmdline="/etc/kernel/cmdline" --change-section-vma .cmdline=0x30000 \ --add-section .linux="$path_to_vmlinuz_link/vmlinuz" --change-section-vma .linux=0x40000 \