From eace144e90df8fc490ef044a809078f46e497010 Mon Sep 17 00:00:00 2001 From: Alexandre CATTEAU Date: Sun, 25 Jun 2023 15:19:30 +0200 Subject: [PATCH] Add sudo to script --- build-uki.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 \