diff options
| author | ivan-boikov <ik.boikov.public@protonmail.com> | 2022-11-27 17:50:09 +0100 |
|---|---|---|
| committer | ivan-boikov <ik.boikov.public@protonmail.com> | 2022-11-27 17:50:09 +0100 |
| commit | 110dab7e27e32a4dc055015d3b97a26719d31004 (patch) | |
| tree | 2509d6755d344185931aa14b42f935ebbcefb2fc /scripts/.local/bin | |
| parent | fa44b597d9272e06144c3e9d1acb273a6f1e89ab (diff) | |
makekernel
Diffstat (limited to 'scripts/.local/bin')
| -rwxr-xr-x | scripts/.local/bin/dpass | 4 | ||||
| -rwxr-xr-x | scripts/.local/bin/makekernel | 43 |
2 files changed, 47 insertions, 0 deletions
diff --git a/scripts/.local/bin/dpass b/scripts/.local/bin/dpass index e8864d6..424232a 100755 --- a/scripts/.local/bin/dpass +++ b/scripts/.local/bin/dpass @@ -49,6 +49,10 @@ password_files=( "${password_files[@]%.gpg}" ) password_file=$(printf '%s\n' "${password_files[@]}" | "$dmenu" -l 30 "$@") +if [[ -z "$password_file" ]]; then + exit 1 +fi + if [[ ! " ${password_files[*]} " =~ " ${password_file} " ]]; then notify-send -u critical "No entry \"$password_file\" in the password store" exit 1 diff --git a/scripts/.local/bin/makekernel b/scripts/.local/bin/makekernel new file mode 100755 index 0000000..95a4122 --- /dev/null +++ b/scripts/.local/bin/makekernel @@ -0,0 +1,43 @@ +#!/bin/sh + +KERNEL_NAME="vmlinuz-latest-gentoo" + +if [[ $(hostname) = "pc" ]]; then + ROOT_DEVICE="/dev/nvme0n1p3" + MICROCODE="amd" +else + ROOT_DEVICE="/dev/sda3" + MICROCODE="intel" +fi + +ROOT="/dev/mapper/root" +CRYPT_ROOT="$(blkid -s UUID | grep $ROOT_DEVICE | cut -d' ' -f2 | sed 's/"//g')" +BOOT_PARAMS="crypt_root=$CRYPT_ROOT root=$ROOT rootfsype=btrfs rootflags=subvol=@ root_trim=yes lsm=selinux" +echo $BOOT_PARAMS + +exit 1 + +cd /usr/src/linux + +# inject $BOOT_PARAMS into kernel +sed -i "s|^\(CONFIG_CMDLINE=\).*|\1\"$BOOT_PARAMS\"|" .config + +genkernel --no-clean --no-mrproper --no-save-config \ + --microcode="$MICROCODE" \ + --integrated-initramfs --compress-initramfs --compress-initramfs-type=lz4 \ + --luks --no-zfs \ + --btrfs \ + --kernel-config=/usr/src/linux/.config \ + --kernel-filename="$KERNEL_NAME" \ + --makeopts=-j \ + --loglevel=2 \ + all +#--virtio \ + + +# UEFI does not find images besides bootx64 +if [[ $(hostname) = "pc" ]]; then + cp -v "/boot/$KERNEL_NAME" "/boot/efi/boot/bootx64.efi" +fi + +cd - |
