Skip to content

Commit 75884b1

Browse files
05-check-chroot.install: make shellcheck happy again
Signed-off-by: Nowa Ammerlaan <[email protected]>
1 parent f1ad806 commit 75884b1

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

hooks/05-check-chroot.install

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
_test_dracut_cmdline() {
1010
[ -e "/etc/cmdline" ] && return 1
1111

12-
local _i
1312
for _i in /etc/cmdline.d/*.conf; do
1413
[ -e "${_i}" ] && return 1
1514
done
@@ -43,7 +42,6 @@ _test_kernel_cmdline() {
4342
}
4443

4544
_test_uki_cmdline() {
46-
local _i
4745
for _i in "${INSTALLKERNEL_CONF_ROOT}/uki.conf" \
4846
"/etc/kernel/uki.conf" \
4947
"/run/kernel/uki.conf" \
@@ -60,7 +58,7 @@ if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
6058
[ "${INSTALLKERNEL_VERBOSE}" -gt 0 ] && \
6159
echo "Chroot detected"
6260

63-
if [ "${INSTALLKERNEL_INITRD_GENERATOR}" == "dracut" ]; then
61+
if [ "${INSTALLKERNEL_INITRD_GENERATOR}" = "dracut" ]; then
6462
if _test_dracut_cmdline; then
6563
echo ""
6664
echo "WARNING: Dracut will be run from inside a chroot but no"
@@ -75,7 +73,7 @@ if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
7573
fi
7674
fi
7775

78-
if [ "${INSTALLKERNEL_LAYOUT}" == "bls" ]; then
76+
if [ "${INSTALLKERNEL_LAYOUT}" = "bls" ]; then
7977
if _test_kernel_cmdline; then
8078
echo "WARNING: kernel-install is run from inside a chroot but"
8179
echo "no cmdline was configured. This would cause the bootloader"
@@ -87,8 +85,8 @@ if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
8785
echo ""
8886
exit 1
8987
fi
90-
elif [ "${INSTALLKERNEL_LAYOUT}" == "uki" ] && \
91-
[ "${INSTALLKERNEL_UKI_GENERATOR}" == "ukify" ]; then
88+
elif [ "${INSTALLKERNEL_LAYOUT}" = "uki" ] && \
89+
[ "${INSTALLKERNEL_UKI_GENERATOR}" = "ukify" ]; then
9290
if _test_kernel_cmdline && _test_uki_cmdline; then
9391
echo "WARNING: Ukify will be run from inside a chroot but no"
9492
echo "cmdline for ukify was configured. Ukify would fallback"

hooks/systemd/05-check-chroot.install

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
# plugin is run when the systemd USE flag is enabled or
77
# SYSTEMD_KERNEL_INSTALL=1 is set in the environment.
88

9-
[ "${1:?}" == "add" ] || exit 0
9+
[ "${1:?}" = "add" ] || exit 0
1010

1111
_test_dracut_cmdline() {
1212
[ -e "/etc/cmdline" ] && return 1
1313

14-
local _i
1514
for _i in /etc/cmdline.d/*.conf; do
1615
[ -e "${_i}" ] && return 1
1716
done
@@ -45,7 +44,6 @@ _test_kernel_cmdline() {
4544
}
4645

4746
_test_uki_cmdline() {
48-
local _i
4947
for _i in "${KERNEL_INSTALL_CONF_ROOT}/uki.conf" \
5048
"/etc/kernel/uki.conf" \
5149
"/run/kernel/uki.conf" \
@@ -56,12 +54,13 @@ _test_uki_cmdline() {
5654
fi
5755
done
5856
return 0
57+
}
5958

6059
if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
6160
[ "${KERNEL_INSTALL_VERBOSE}" -gt 0 ] && \
6261
echo "Chroot detected"
6362

64-
if [ "${KERNEL_INSTALL_INITRD_GENERATOR}" == "dracut" ] && [ "${#}" -lt 5 ]; then
63+
if [ "${KERNEL_INSTALL_INITRD_GENERATOR}" = "dracut" ] && [ "${#}" -lt 5 ]; then
6564
if [ "${KERNEL_INSTALL_IMAGE_TYPE}" != "uki" ] && _test_dracut_cmdline; then
6665
echo ""
6766
echo "WARNING: Dracut will be run from inside a chroot but no"
@@ -76,7 +75,7 @@ if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
7675
fi
7776
fi
7877

79-
if [ "${KERNEL_INSTALL_LAYOUT}" == "bls" ]; then
78+
if [ "${KERNEL_INSTALL_LAYOUT}" = "bls" ]; then
8079
if _test_kernel_cmdline; then
8180
echo "WARNING: kernel-install is run from inside a chroot but"
8281
echo "no cmdline was configured. This would cause the bootloader"
@@ -88,8 +87,8 @@ if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
8887
echo ""
8988
exit 1
9089
fi
91-
elif [ "${KERNEL_INSTALL_LAYOUT}" == "uki" ] && \
92-
[ "${KERNEL_INSTALL_UKI_GENERATOR}" == "ukify" ]; then
90+
elif [ "${KERNEL_INSTALL_LAYOUT}" = "uki" ] && \
91+
[ "${KERNEL_INSTALL_UKI_GENERATOR}" = "ukify" ]; then
9392
if _test_kernel_cmdline && _test_uki_cmdline; then
9493
echo "WARNING: Ukify will be run from inside a chroot but no"
9594
echo "cmdline for ukify was configured. Ukify would fallback"

0 commit comments

Comments
 (0)