hooks/*: code cleanup
This commit is contained in:
parent
e8858c1d34
commit
61e9112142
@ -1,7 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
for _binary in udevd udevadm; do
|
||||
|
@ -1,8 +1,8 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# shellcheck disable=2154,2034
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ "$break" = eudev ] && { print "break before eudev.init"; sh; }
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# shellcheck disable=2154
|
||||
|
||||
udevadm control -e
|
||||
|
@ -1,7 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
copy_file "$keymap_path" "$keymap_path" 644 0
|
||||
|
@ -1,9 +1,10 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ "$break" = keymap ] && { print "break before keymap.init"; sh; }
|
||||
|
||||
# TODO support loadkeys
|
||||
loadkmap < "$keymap_path"
|
||||
|
@ -1,7 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ "$luks_key" ] && {
|
||||
@ -30,8 +30,7 @@
|
||||
copy_module "$_module"
|
||||
done
|
||||
|
||||
# avoid possible issues with libgcc_s.so.1
|
||||
# see https://bugs.archlinux.org/task/56771
|
||||
# https://bugs.archlinux.org/task/56771
|
||||
[ -e /lib/libgcc_s.so.1 ] && copy_file /lib/libgcc_s.so.1 /lib/libgcc_s.so.1 755 1
|
||||
|
||||
copy_binary cryptsetup
|
||||
|
@ -1,21 +1,17 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
#
|
||||
# word splitting is safe by design
|
||||
# shellcheck disable=2068
|
||||
|
||||
[ "$break" = luks ] && { print "break before luks.init"; sh; }
|
||||
|
||||
export DM_DISABLE_UDEV=1
|
||||
mkdir -p /run/cryptsetup
|
||||
|
||||
resolve_device "$luks_root"
|
||||
|
||||
set -- \
|
||||
"${luks_discard:+--allow-discards}" "${luks_header:+--header $luks_header}" \
|
||||
"${luks_key:+-d $luks_key}" "$device" "${luks_name:-crypt-${device##*/}}"
|
||||
|
||||
cryptsetup open $@ || panic "failed to unlock LUKS"
|
||||
DM_DISABLE_UDEV=1 cryptsetup open \
|
||||
"${luks_discard:+--allow-discards}" \
|
||||
"${luks_header:+--header=$luks_header}" \
|
||||
"${luks_key:+--key-file=$luks_key}" -- "$device" \
|
||||
"${luks_name:-crypt-${device##*/}}" || panic "failed to unlock LUKS"
|
||||
|
@ -1,7 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ "$hostonly" = 1 ] &&
|
||||
|
@ -1,11 +1,9 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# shellcheck disable=2154
|
||||
#
|
||||
# word splitting is safe by design
|
||||
# shellcheck disable=2068
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# https://www.shellcheck.net/wiki/SC2068
|
||||
# shellcheck disable=2154,2068
|
||||
|
||||
[ "$break" = lvm ] && { print "break before lvm.init"; sh; }
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# https://www.shellcheck.net/wiki/SC2016
|
||||
# shellcheck disable=2154,2016
|
||||
|
||||
for _binary in mdev find; do
|
||||
|
@ -1,7 +1,8 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# https://www.shellcheck.net/wiki/SC2034
|
||||
# shellcheck disable=2154,2034
|
||||
|
||||
[ "$break" = mdev ] && { print "break before mdev.init"; sh; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
kill "$mdev_pid"
|
||||
|
@ -1,7 +1,8 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# https://www.shellcheck.net/wiki/SC2016
|
||||
# shellcheck disable=2154,2016
|
||||
|
||||
for _binary in mdevd mdevd-coldplug; do
|
||||
|
@ -1,7 +1,8 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# https://www.shellcheck.net/wiki/SC2034
|
||||
# shellcheck disable=2154,2034
|
||||
|
||||
[ "$break" = mdevd ] && { print "break before mdevd.init"; sh; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
kill "$mdevd_pid"
|
||||
|
@ -1,14 +1,14 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ "$break" = proc ] && { print "break before proc.init"; sh; }
|
||||
|
||||
command -v device-helper > /proc/sys/kernel/hotplug
|
||||
|
||||
# get ready for fork bomb. kek
|
||||
# Prepare for fork bomb!
|
||||
find /sys/devices -name uevent |
|
||||
|
||||
while read -r uevent; do
|
||||
|
@ -1,7 +1,7 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
for _binary in /lib/systemd/systemd-udevd udevadm; do
|
||||
|
@ -1,8 +1,8 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# shellcheck disable=2154,2034
|
||||
# https://www.shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ "$break" = systemd-udevd ] && { print "break before systemd-udevd.init"; sh; }
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# false positive
|
||||
# shellcheck disable=2154
|
||||
|
||||
udevadm control -e
|
||||
|
Loading…
Reference in New Issue
Block a user