Add sudo to script

This commit is contained in:
Alexandre CATTEAU 2023-06-25 15:19:30 +02:00
parent b4f4ca7a0e
commit eace144e90

View File

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