lgromero-new-oglivemain
Rev | Line | |
---|
[2cd8344] | 1 | #!/bin/sh |
---|
| 2 | # Test for LSB systems. |
---|
| 3 | set -e |
---|
| 4 | |
---|
| 5 | . /usr/share/os-prober/common.sh |
---|
| 6 | |
---|
| 7 | partition="$1" |
---|
| 8 | dir="$2" |
---|
| 9 | type="$3" |
---|
| 10 | |
---|
| 11 | lsb_field () { |
---|
| 12 | file="$1" |
---|
| 13 | field="$2" |
---|
| 14 | grep ^"$field" "$file" | cut -d = -f 2 | sed 's/^"//' | sed 's/"$//' | sed 's/:/ /g' |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | file="$dir/etc/lsb-release" |
---|
| 18 | if [ ! -e "$file" ]; then |
---|
| 19 | exit 1 |
---|
| 20 | fi |
---|
| 21 | |
---|
| 22 | release=$(lsb_field "$file" DISTRIB_RELEASE) |
---|
| 23 | if [ -z "$release" ]; then |
---|
| 24 | release=$(lsb_field "$file" DISTRIB_CODENAME) |
---|
| 25 | fi |
---|
| 26 | description=$(lsb_field "$file" DISTRIB_DESCRIPTION) |
---|
| 27 | if [ -z "$description" ]; then |
---|
| 28 | description=$(lsb_field "$file" DISTRIB_CODENAME) |
---|
| 29 | fi |
---|
| 30 | |
---|
| 31 | if [ -n "$description" ]; then |
---|
| 32 | if [ -n "$release" ]; then |
---|
| 33 | long="$description ($release)" |
---|
| 34 | else |
---|
| 35 | long="$description" |
---|
| 36 | fi |
---|
| 37 | else |
---|
| 38 | exit 1 |
---|
| 39 | fi |
---|
| 40 | |
---|
| 41 | short=$(lsb_field "$file" DISTRIB_ID | sed 's/ //g') |
---|
| 42 | if [ -z "$short" ]; then |
---|
| 43 | short="UnknownLSB" |
---|
| 44 | fi |
---|
| 45 | |
---|
| 46 | label="$(count_next_label "$short")" |
---|
| 47 | result "$partition:$long:$label:linux" |
---|
| 48 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.