@@ -13,9 +13,9 @@ BOOT_DIR_ABS="${3}"
13
13
KERNEL_IMAGE=" ${4} "
14
14
15
15
if [ " ${KERNEL_INSTALL_VERBOSE} " -gt 0 ]; then
16
- LOGLEVEL=" --loglevel info"
16
+ LOGLEVEL=" info"
17
17
else
18
- LOGLEVEL=" --loglevel error"
18
+ LOGLEVEL=" error"
19
19
fi
20
20
21
21
if [[ ${KERNEL_INSTALL_LAYOUT} == " uki" ]]; then
@@ -27,21 +27,30 @@ if [[ ${KERNEL_INSTALL_LAYOUT} == "uki" ]]; then
27
27
exit 1
28
28
fi
29
29
30
+ unset PRETTY_NAME VERSION_ID
31
+ if [[ -f /etc/os-release ]]; then
32
+ # shellcheck source=/dev/null
33
+ . /etc/os-release
34
+ elif [[ -f /usr/lib/os-release ]]; then
35
+ # shellcheck source=/dev/null
36
+ . /usr/lib/os-release
37
+ fi
38
+
39
+ TITLE=" ${PRETTY_NAME: +$PRETTY_NAME }${VERSION_ID: +$VERSION_ID }${KERNEL_VERSION} (UKI)"
30
40
PARTLABEL=" $( df " ${UKI} " --output=source | tail -1 | xargs -r lsblk --output=PARTLABEL --noheadings) "
31
- if [[ -n " ${PARTLABEL} " ]]; then
32
- TITLE=" ${KERNEL_VERSION} (UKI) on ${PARTLABEL} "
33
- else
34
- TITLE=" ${KERNEL_VERSION} (UKI)"
41
+ if [[ -n ${PARTLABEL} ]]; then
42
+ TITLE=" ${TITLE} on ${PARTLABEL} "
35
43
fi
36
44
37
45
[[ " ${KERNEL_INSTALL_VERBOSE} " -gt 0 ]] && echo " Adding ${UKI} to UEFI boot entries"
38
- kernel-bootcfg " ${LOGLEVEL} " --add-uki " ${UKI} " --title " ${TITLE} " --once || exit 1
46
+ kernel-bootcfg --loglevel " ${LOGLEVEL} " --add-uki " ${UKI} " --title " ${TITLE} " --once || exit 1
39
47
elif [[ ${COMMAND} == remove ]]; then
40
48
[[ " ${KERNEL_INSTALL_VERBOSE} " -gt 0 ]] && echo " Removing ${UKI} from UEFI boot entries"
41
- kernel-bootcfg " ${LOGLEVEL} " --remove-uki " ${UKI} " || exit 1
49
+ kernel-bootcfg --loglevel " ${LOGLEVEL} " --remove-uki " ${UKI} " || exit 1
42
50
fi
43
51
elif [[ ${KERNEL_INSTALL_LAYOUT} == " efistub" ]]; then
44
52
53
+ unset PRETTY_NAME VERSION_ID
45
54
if [[ -f /etc/os-release ]]; then
46
55
# shellcheck source=/dev/null
47
56
. /etc/os-release
@@ -63,7 +72,7 @@ elif [[ ${KERNEL_INSTALL_LAYOUT} == "efistub" ]]; then
63
72
fi
64
73
65
74
KERNEL_BOOTCFG_ARGS=(
66
- " ${LOGLEVEL} "
75
+ --loglevel " ${LOGLEVEL} "
67
76
--once
68
77
)
69
78
@@ -91,11 +100,10 @@ elif [[ ${KERNEL_INSTALL_LAYOUT} == "efistub" ]]; then
91
100
KERNEL_BOOTCFG_ARGS+=( --cmdline " ${BOOT_OPTIONS} " )
92
101
fi
93
102
103
+ TITLE=" ${PRETTY_NAME: +$PRETTY_NAME }${VERSION_ID: +$VERSION_ID }${KERNEL_VERSION} (plain)"
94
104
PARTLABEL=" $( df " ${KERNEL_IMAGE} " --output=source | tail -1 | xargs -r lsblk --output=PARTLABEL --noheadings) "
95
- if [[ -n " ${PARTLABEL} " ]]; then
96
- TITLE=" ${KERNEL_VERSION} (plain) on ${PARTLABEL} "
97
- else
98
- TITLE=" ${KERNEL_VERSION} (plain)"
105
+ if [[ -n ${PARTLABEL} ]]; then
106
+ TITLE=" ${TITLE} on ${PARTLABEL} "
99
107
fi
100
108
101
109
KERNEL_BOOTCFG_ARGS+=(
@@ -107,7 +115,7 @@ elif [[ ${KERNEL_INSTALL_LAYOUT} == "efistub" ]]; then
107
115
kernel-bootcfg " ${KERNEL_BOOTCFG_ARGS[@]} " || exit 1
108
116
elif [[ ${COMMAND} == remove ]]; then
109
117
[[ " ${KERNEL_INSTALL_VERBOSE} " -gt 0 ]] && echo " Removing ${KERNEL_IMAGE} from UEFI boot entries"
110
- kernel-bootcfg " ${LOGLEVEL} " --remove-uki " ${KERNEL_IMAGE} " || exit 1
118
+ kernel-bootcfg --loglevel " ${LOGLEVEL} " --remove-uki " ${KERNEL_IMAGE} " || exit 1
111
119
fi
112
120
else
113
121
exit 0
0 commit comments