-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
if [ -x /usr/bin/setleds ] ; then | ||
INITTY=/dev/tty[1-8] | ||
for tty in $INITTY ; do | ||
setleds -D +num < $tty | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# This file is part of dracut. | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
# Prerequisite check(s) for module. | ||
check() { | ||
|
||
# If the binary(s) requirements are not fulfilled the module can't be installed. | ||
require_binaries setleds || return 1 | ||
|
||
# Return 0 to always include the module. | ||
return 0 | ||
|
||
} | ||
|
||
# Module dependency requirements. | ||
depends() { | ||
|
||
# Return 0 to include the dependent module(s) in the initramfs. | ||
return 0 | ||
|
||
} | ||
|
||
# Install the required file(s) and directories for the module in the initramfs. | ||
install() { | ||
inst /usr/bin/setleds | ||
inst_hook cmdline 99 "$moddir/enable-numlock.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
# dracut-numlock | ||
Dracut Module that enables numlock during the early boot process (luks prompt) | ||
|
||
This is a [Dracut](https://github.com/dracutdevs/dracut) Module that enables numlock during the early boot process. | ||
This can be handy if you use digits for unlocking your luks2 partition with a tpm or fido2 device. | ||
|
||
## Dependencies | ||
|
||
The module requires the `setleds` binary. | ||
|
||
## Install | ||
|
||
Copy the `51numlock` directory into the Dracut module directory. | ||
|
||
``` bash | ||
cp -ri 51numlock /usr/lib/dracut/modules.d | ||
``` | ||
|
||
The module is enabled by default. |