From 6e9650e4831a62fb5c9ec81f601f0e015af41d0c Mon Sep 17 00:00:00 2001 From: Tastatur Date: Mon, 1 Jan 2024 20:47:20 +0100 Subject: [PATCH] Cleanup and changed lvm naming scheme --- docs/alpine-desktop-setup/installation.md | 20 +++++++++---------- .../post-install/network.md | 2 +- .../post-install/security.md | 4 ++-- docs/alpine-desktop-setup/provisioning.md | 18 ++++++++--------- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/docs/alpine-desktop-setup/installation.md b/docs/alpine-desktop-setup/installation.md index 85e13d4..9ac4998 100644 --- a/docs/alpine-desktop-setup/installation.md +++ b/docs/alpine-desktop-setup/installation.md @@ -3,7 +3,7 @@ To install the Alpine Linux distribution on the system, the encrypted partition and the efi partition have to be mounted to the main system. ``` -# mount /dev/vg/root /mnt -t ext4 +# mount /dev/vg/alp_root /mnt -t ext4 # mkdir /mnt/boot/efi -p # mount /dev/ /mnt/boot/efi -t vfat ``` @@ -22,8 +22,6 @@ Now the other directories are going to be mounted so that it's possible to chroo # for i in dev proc sys run; do > mount --rbind --make-rslave /$i /mnt/$i > done -# mount /dev/vg/var /mnt/var -# mount /dev/vg/tmp /mnt/tmp # chroot /mnt ``` @@ -52,11 +50,11 @@ Edit `/etc/fstab` for correct mounts: ``` /dev/disk/by-label/efi /boot/efi vfat defaults,nodev,nosuid,noexec 0 2 -/dev/vg/root / ext4 defaults,noatime 0 1 -/dev/vg/home /home ext4 defaults,noatime,nosuid,nodev 0 2 -/dev/vg/tmp /tmp ext4 defaults,nodev,nosuid,noexec 0 2 -/dev/vg/var /var ext4 defaults,nodev,nosuid,noexec 0 2 -/dev/vg/nix /nix ext4 defaults,noatime,nodev,nosuid 0 2 +/dev/vg/alp_root / ext4 defaults,noatime 0 1 +/dev/vg/alp_hom /home ext4 defaults,noatime,nosuid,nodev 0 2 +/dev/vg/alp_tmp /tmp ext4 defaults,nodev,nosuid,noexec 0 2 +/dev/vg/alp_var /var ext4 defaults,nodev,nosuid,noexec 0 2 +/dev/vg/alp_nix /nix ext4 defaults,noatime,nodev,nosuid 0 2 proc /proc proc nosuid,nodev,noexec,hidepid=2 0 0 ``` @@ -90,7 +88,7 @@ To: And configure `/etc/kernel-hooks.d/secureboot.conf` for cmdline and secureboot. ``` -cmdline="rw rd.luks.name==luks root=/dev/vg/root modules=ext4 quiet splash rd.lvm.vg=vg" +cmdline="rw rd.luks.name==luks root=/dev/vg/alp_root modules=ext4 quiet splash rd.lvm.vg=vg" signing_cert="/usr/share/secureboot/keys/db/db.pem" signing_key="/usr/share/secureboot/keys/db/db.key" @@ -139,7 +137,7 @@ And also remove some junk left over by grub. # rm -rf /boot/efi/EFI/alpine # rm -rf /boot/grub # rm -rf /etc/default -# unlink /boot/boot +# cd /boot && unlink boot ``` You can also install `os-prober` which can find operating systems and add them to your bootloader. Besides that `gummiboot` can also be configured with the file `/boot/efi/loader/loader.conf` in which you can specify the timeout and what OS it should load into by default. @@ -160,7 +158,7 @@ Before finishing up the installation `networkmanager` will be installed for netw Wifi will not yet work but this is will be done later on. -> If internet doesn't work after reboot follow the instructions in the [network section](https://docs.bijl.us/alpine-desktop-setup/post-install/network/). +> If internet doesn't work after reboot create the config file as described in the [wifi section](https://docs.bijl.us/alpine-desktop-setup/post-install/network/) and restart the service. Now exit out of the chroot and you should be able to reboot into a working Alpine system. diff --git a/docs/alpine-desktop-setup/post-install/network.md b/docs/alpine-desktop-setup/post-install/network.md index 71d012c..5b9c072 100644 --- a/docs/alpine-desktop-setup/post-install/network.md +++ b/docs/alpine-desktop-setup/post-install/network.md @@ -38,7 +38,7 @@ There are different frontends to configure connections but for now lets install It should be pretty self-explanatory on how to use it. -To make it possible for users to edit connections create the config file `/etc/NetworkManager/conf.d` with: +To make it possible for users to edit connections create the config file `/etc/NetworkManager/conf.d/no-polkit.conf` with: ``` [main] diff --git a/docs/alpine-desktop-setup/post-install/security.md b/docs/alpine-desktop-setup/post-install/security.md index d32487b..d283bb3 100644 --- a/docs/alpine-desktop-setup/post-install/security.md +++ b/docs/alpine-desktop-setup/post-install/security.md @@ -139,7 +139,7 @@ Improve the security of the system by improving the entropy and thus randomness. # apk add jitterentropy-library ``` -And create a config file in `/usr/lib/modules-load.d/jitterentropy.conf` so that the kernel module gets loaded: +And create a config file in `/etc/modules-load.d/jitterentropy.conf` so that the kernel module gets loaded: ``` jitterentropy_rng @@ -155,7 +155,7 @@ First install PAM through `util-linux-login`: # apk add util-linux-login ``` -Delays can be a deterent against bruteforcing login attempts. Simply add this line to it's corresponding section in `/etc/pam.d/login`: +Delays can be a deterent against bruteforcing login attempts. Simply add this to the line in `/etc/pam.d/login`: ``` auth optional pam_faildelay.so delay=5000000 diff --git a/docs/alpine-desktop-setup/provisioning.md b/docs/alpine-desktop-setup/provisioning.md index 8f6e5b4..e5a0b00 100644 --- a/docs/alpine-desktop-setup/provisioning.md +++ b/docs/alpine-desktop-setup/provisioning.md @@ -35,20 +35,20 @@ And the encrypted filesystem on the root partition. # cryptsetup open --type luks /dev/ luks ``` -Now to create a new LVM volume group (choose $m,n \in \mathbb{N}$ accordingly): +Now to create a new LVM volume group (choose $n \in \mathbb{N}$ accordingly): ``` -# vgcreate vg /dev/mapper/luks +# vgcreate vg /dev/mapper/luks ``` To create partitions inside the volume group: ``` -# lvcreate --name root -L 16G vg -# lvcreate --name var -L 8G vg -# lvcreate --name tmp -L 16G vg -# lvcreate --name nix -L 32G vg -# lvcreate --name home -l 100%FREE vg +# lvcreate --name alp_root -L 16G vg +# lvcreate --name alp_var -L 8G vg +# lvcreate --name alp_tmp -L 16G vg +# lvcreate --name alp_nix -L 32G vg +# lvcreate --name nix_home -l 100%FREE vg ``` Now the home partition fills the entirety of the volume group. These sizes should be changed depending on the needs of the user. @@ -56,8 +56,8 @@ Now the home partition fills the entirety of the volume group. These sizes shoul To create the filesystems on the logical partitions: ``` -for i in root var tmp nix home; do -> mkfs.ext4 /dev/vg/$i +for i in root var tmp nix home; do +> mkfs.ext4 /dev/vg/alp_$i > done ```