summarylogtreecommitdiffstats
path: root/50-generate-efistub.install
diff options
context:
space:
mode:
Diffstat (limited to '50-generate-efistub.install')
-rwxr-xr-x50-generate-efistub.install13
1 files changed, 7 insertions, 6 deletions
diff --git a/50-generate-efistub.install b/50-generate-efistub.install
index 6b50cf24fbc7..b7b46107fefb 100755
--- a/50-generate-efistub.install
+++ b/50-generate-efistub.install
@@ -12,7 +12,7 @@ function osrel() {
fi
}
-if [[ "$COMMAND" == "add" ]]; then
+if [[ "$COMMAND" == "install" ]]; then
declare -a BOOT_OPTIONS
if [[ -f /etc/uak/cmdline ]]; then
@@ -26,6 +26,11 @@ if [[ "$COMMAND" == "add" ]]; then
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline || true
else
+ if ! (( ${#BOOT_OPTIONS[@]} )) && [[ "$UAK_WARN_EMPTY_BOOT_OPTIONS" != "false" ]]; then
+ warning "Creating image with current boot options, most highly it's not what do you want to do"
+ warning "Please put boot options to the /etc/uak/cmdline and run 'uak regenerate' to regenerate all boot images"
+ fi
+
read -r -d '' -a boot_option_line < /proc/cmdline || true
for boot_option in "${boot_option_line[@]}"; do
[[ "${boot_option#initrd=*}" != "$boot_option" ]] && continue
@@ -33,10 +38,6 @@ if [[ "$COMMAND" == "add" ]]; then
done
fi
- if ! (( ${#BOOT_OPTIONS[@]} )) && [[ "$UAK_WARN_EMPTY_BOOT_OPTIONS" != "false" ]]; then
- warning "Creating image with empty boot options, most highly it's not what do you want to do"
- warning "Please put boot options to the /etc/uak/cmdline and run 'uak regenerate' to regenerate all boot images"
- fi
objcopy_args=()
@@ -45,7 +46,7 @@ if [[ "$COMMAND" == "add" ]]; then
fi
/usr/bin/objcopy \
- --add-section .osrel=<(osrel VERSION_ID "$KERNEL_VERSION") --change-section-vma '.osrel=0x20000' \
+ --add-section .osrel=<(osrel VERSION "$KERNEL_VERSION") --change-section-vma '.osrel=0x20000' \
--add-section .cmdline=<(echo "${BOOT_OPTIONS[@]}") --change-section-vma '.cmdline=0x30000' \
--add-section .linux="$KERNEL_IMAGE" --change-section-vma '.linux=0x2000000' \
--add-section .initrd=<(/usr/bin/cat "${INITRDS[@]}") --change-section-vma '.initrd=0x3000000' \