Merge branch 'arch' into gentoo

This commit is contained in:
ItsDrike 2022-02-02 00:28:10 +01:00
commit d2ca79a5bc
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843
54 changed files with 1687 additions and 687 deletions

View file

@ -0,0 +1,7 @@
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "on"
EndSection

62
root/etc/default/grub Normal file
View file

@ -0,0 +1,62 @@
# GRUB boot loader configuration
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX="cryptdevice=UUID=9a400ce4-df98-43eb-b88c-009a359873a5:cryptroot:allow-discards lukskeyfile=UUID=80c09daa-c562-4242-90a9-8258f6442bec:/root-key"
# Grub should automatically detect the root UUID after decryption and set
# that as root, we could also use root=/dev/mapper/cryptroot cmdline arg,
# however that could lead to problems, since GRUB defines the root anyway,
# so we'd have 2 root definitions, we could also use the UUID manually by using
# root=7173b256-9d90-41f5-beac-4d01b3b5bbd5
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable booting with LUKS encrypted /boot drive
#GRUB_ENABLE_CRYPTODISK=y
# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT=true
# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y

View file

@ -0,0 +1,52 @@
#!/bin/ash
run_hook() {
# This is a needed kernel parameter for this hook
if [ -n "$lukskeyfile" ]; then
modprobe -a -q loop dm-crypt >/dev/null 2>&1
# Refer to help from `mkinitcpio -H lukskeyfile`.
IFS=: read rootKeyDev rootKey cryptkeyLoc <<EOF
$lukskeyfile
EOF
if [ -z "${cryptkeyLoc}" ]; then
cryptkeyLoc=/crypto_keyfile.bin
fi
# Ask user whether to detect the device (detecting may
# take up a while and asking is faster)
while true; do
read -t5 -p "Use external key file? (default: yes, waiting 5s): " yn
if [ $? -gt 0 ]; then
echo "Timed out, assuming yes"
break
fi
case $yn in
[Yy]*)
break
;;
[Nn]*) return 0;;
"")
echo "Default (yes)"
break
;;
*) echo "Please answer yes or no.";;
esac
done
# Resolve and mount the device, in case we can't mount, show error
echo "Mounting device..."
if resoleved=$(resolve_device "${rootKeyDev}" $rootdelay); then
if mount -o noatime "${rootKeyDev}" /mnt>/dev/null 2>&1; then
# Copy the keyfile present in the device into the
# ramfs filesystem to be read by dm-crypt
cat "/mnt/${rootKey}" > "${cryptkeyLoc}"
else
echo "Failed to mount ${rootKeyDev} on /mnt"
/bin/sh
fi
else
echo "Failed to find ${rootKeyDev} containing LUKS root key."
fi
fi
}

View file

@ -0,0 +1,27 @@
#!/bin/bash
build() {
add_dir "/mnt"
add_module loop
add_module dm-crypt
add_runscript
}
help() {
cat <<EOF
Open root partition with LUKS root key present on internal
or external accessible non-encrypted partition.
To use this hook, specify lukskeyfile in kernel parameters.
This hook is designed to copy over the specified key file into
initramfs internal path designated as cryptkey by encrypt hook.
lukskeyfile=rootKeyDev:rootKey[:cryptkeyLoc]
rootKeyDev = /path/to/rootKeyDev, UUID=uuid-of-rootKeyDev
rootKey = /path/to/rootKey in rootKeyDev
cryptkeyLoc = /path/to/cryptkey in initramfs.
Default values
cryptkeyLoc=/crypto_keyfile.bin
EOF
}

View file

@ -51,7 +51,7 @@ FILES=()
# usr, fsck and shutdown hooks.
#
## Edits applied: numlock (requires mkinitcpio-numlock (AUR)), encrypt
HOOKS=(base udev autodetect keyboard numlock modconf block encrypt filesystems fsck)
HOOKS=(base udev autodetect keyboard numlock modconf block lukskeyfile encrypt filesystems fsck)
# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression

View file

@ -0,0 +1 @@
blacklist pcspkr