chiark / gitweb /
os-release: define /usr/lib/os-release as fallback for /etc/os-release
[elogind.git] / src / kernel-install / 90-loaderentry.install
index 6fbb14908a596301702fc2bd96084aabc8a6d3eb..c17b8a98d51bfcab2ad240bd704e6db1d3f19ebe 100644 (file)
@@ -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
@@ -59,7 +61,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
 }
@@ -77,6 +81,7 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
     echo "linux      $BOOT_DIR/linux"
     [[ -f $BOOT_DIR_ABS/initrd ]] && \
         echo "initrd     $BOOT_DIR/initrd"
+    :
 } > "$LOADER_ENTRY" || {
     echo "Could not create loader entry '$LOADER_ENTRY'." >&2
     exit 1