X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fkernel-install%2F90-loaderentry.install;h=d433e00a5c3fc1508024431558d8c614d9c6c4d2;hb=d0a2e1c364320b862a6aae099afa106ea59bb84c;hp=6b91d1cccb66d961c3ffa890a371121ef561075f;hpb=852752fca2f73323e3c25b33348b3c92458665ae;p=elogind.git diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install index 6b91d1ccc..d433e00a5 100644 --- a/src/kernel-install/90-loaderentry.install +++ b/src/kernel-install/90-loaderentry.install @@ -32,6 +32,8 @@ fi if [[ -f /etc/os-release ]]; then . /etc/os-release +elif [[ -f /usr/lib/os-release ]]; then + . /usr/lib/os-release fi if ! [[ $PRETTY_NAME ]]; then @@ -45,11 +47,10 @@ if [[ -f /etc/kernel/cmdline ]]; then fi if ! [[ ${BOOT_OPTIONS[*]} ]]; then - readarray -t line < /proc/cmdline - for i in ${line[*]}; do - if [[ "${i#initrd=*}" == "$i" ]]; then - BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i" - fi + read -a line -r < /proc/cmdline + for i in "${line[@]}"; do + [[ "${i#initrd=*}" != "$i" ]] && continue + BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i" done fi @@ -59,7 +60,9 @@ if ! [[ ${BOOT_OPTIONS[*]} ]]; then exit 1 fi -cp --preserve "$KERNEL_IMAGE" "$BOOT_DIR_ABS/linux" || { +cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS/linux" && + chown root:root "$BOOT_DIR_ABS/linux" && + chmod 0644 "$BOOT_DIR_ABS/linux" || { echo "Could not copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'." >&2 exit 1 }