diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-01-28 00:37:32 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-01-28 00:37:32 +0000 |
commit | 3f81fd7097ec931ebf6d862622e6d81834483dbb (patch) | |
tree | e8381bb314f59122a26bd714f1a14993a31ab8ee /sys-boot/os-prober/files/os-prober-linux-distro-parse-os-release.patch | |
parent | 351bdb27fc041435144b39e022d9830c140ebd3a (diff) |
sys-boot/os-prober : shamelessly take all the patches from openSUSE Factory to make it work
Diffstat (limited to 'sys-boot/os-prober/files/os-prober-linux-distro-parse-os-release.patch')
-rw-r--r-- | sys-boot/os-prober/files/os-prober-linux-distro-parse-os-release.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-boot/os-prober/files/os-prober-linux-distro-parse-os-release.patch b/sys-boot/os-prober/files/os-prober-linux-distro-parse-os-release.patch new file mode 100644 index 00000000..2aa2b316 --- /dev/null +++ b/sys-boot/os-prober/files/os-prober-linux-distro-parse-os-release.patch @@ -0,0 +1,24 @@ +Index: os-prober/os-probes/mounted/common/90linux-distro +=================================================================== +--- os-prober.orig/os-probes/mounted/common/90linux-distro ++++ os-prober/os-probes/mounted/common/90linux-distro +@@ -10,7 +10,18 @@ type="$3" + uuid="$4" + subvol="$5" + +-if [ -e "$dir/etc/os-release" ]; then ++if [ -L "$dir/etc/os-release" ]; then ++ RELPATH=$(readlink -f "$dir/etc/os-release") ++ if readlink "$dir/etc/os-release" | grep -q '^/'; then ++ RELPATH="$dir$RELPATH" ++ fi ++ if [ -f "$RELPATH" ]; then ++ short="$(grep ^NAME= "$RELPATH" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" ++ long="$(grep ^PRETTY_NAME= "$RELPATH" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" ++ else ++ exit 1 ++ fi ++elif [ -e "$dir/etc/os-release" ]; then + short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" + long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" + elif [ -e "$dir/etc/debian_version" ]; then |