From 905f631817afb2dbfe8b88d43f18985d72687ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SALVI=20J=C3=A9r=C3=A9mie?= Date: Thu, 15 Aug 2024 18:15:07 +0200 Subject: [PATCH] Update README --- README.md | 12 ++++++++++-- TODO | 6 +----- install.sh | 48 ++++++++++++++++++++++++------------------------ 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 0aa9370..f4197fa 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ This scripts need to be launched as root - Change DISK variable to the install.sh script with your favourite editor. - Launch script +``` +/usr/local/share/dotfiles/install.sh +``` + ## For testing purpose (kvm only) You can share filesystem from host to guest (https://wiki.archlinux.org/title/Libvirt#Sharing_data_between_host_and_guest) : @@ -22,7 +26,8 @@ You can share filesystem from host to guest (https://wiki.archlinux.org/title/Li Share scripts : ``` -mount -t 9p scripts /opt +mkdir -p /usr/local/share/dotfiles +mount -t 9p scripts /usr/local/share/dotfiles ``` Share pacman cache : @@ -33,4 +38,7 @@ mount -t 9p pkgs /var/cache/pacman/pkg ## Arch configuration -git with output to /usr/local/hsare/dotfiles \ No newline at end of file +``` +git git clone https://git.unixyourbrain.org/beastie/arch-custom.git /usr/local/share/dotfiles +/usr/local/share/dotfiles/configure.sh +``` diff --git a/TODO b/TODO index 33e58a5..3ba8aa4 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,4 @@ install steam, wine and lib32 multilib pipwire-pulseaudio as root to X11 dynamic colors -dmenu -picom -dunst -polybar -color to kernel cmdline \ No newline at end of file +color to kernel cmdline diff --git a/install.sh b/install.sh index 6731a30..9b74588 100755 --- a/install.sh +++ b/install.sh @@ -5,26 +5,26 @@ set -e DISK="/dev/vda" MOUNTOPTS="defaults,ssd,compress=zstd,autodefrag,noatime" PACSTRAP_EXTRA_ARGS="-c" -#Switch to the script directory +### Switch to the script directory cd "$(dirname "$0")" DIRNAME="$(pwd)" -# Format disk +### Format disk sgdisk --clear \ --new=1:0:+1024MiB --typecode=1:ef00 --change-name=1:EFI \ --new=2:0:0 --typecode=2:8309 --change-name=2:SYS \ "$DISK" partprobe "$DISK" -#Create Luks partition +### Create Luks partition printf "%s\n" "root" | cryptsetup --batch-mode --verify-passphrase luksFormat /dev/disk/by-partlabel/SYS printf "%s\n" "root" | cryptsetup open /dev/disk/by-partlabel/SYS rootfs -#Create filesystem +### Create filesystem mkfs.fat -F32 -n efi /dev/disk/by-partlabel/EFI mkfs.btrfs -f --label root /dev/mapper/rootfs -#Create btrfs subvolumes +### Create btrfs subvolumes mount -o $MOUNTOPTS /dev/mapper/rootfs /mnt cd /mnt btrfs subvolume create @ @@ -34,14 +34,14 @@ btrfs subvolume create @var cd "$DIRNAME" umount /mnt -#Mount volumes +### Mount volumes mount --mkdir -o $MOUNTOPTS,subvol=@ /dev/mapper/rootfs /mnt mount --mkdir -o $MOUNTOPTS,subvol=@root /dev/mapper/rootfs /mnt/root mount --mkdir -o $MOUNTOPTS,subvol=@home /dev/mapper/rootfs /mnt/home mount --mkdir -o $MOUNTOPTS,subvol=@var /dev/mapper/rootfs /mnt/var mount --mkdir /dev/disk/by-partlabel/EFI /mnt/boot -#Init pacman +### Init pacman pacman-key --init pacman-key --populate pacman -Sy @@ -49,9 +49,9 @@ pacman -Sy sed -i "s|^#Color.*|Color|" /etc/pacman.conf sed -i "s|^#ParallelDownloads.*|ParallelDownloads = 10|" /etc/pacman.conf -#Install base +### Install base pacstrap "$PACSTRAP_EXTRA_ARGS" -K /mnt \ - base \ + base \ base-devel \ linux \ linux-firmware \ @@ -63,10 +63,10 @@ pacstrap "$PACSTRAP_EXTRA_ARGS" -K /mnt \ openssh \ git -#Generate fstab +### Generate fstab genfstab -U /mnt | sed "s/subvolid=[0-9]\{3\},//" > /mnt/etc/fstab -#Configure boot environnement +### Configure boot environnement sed -i "/^HOOKS/s|block|block encrypt btrfs|" /mnt/etc/mkinitcpio.conf sed -i "s|^BINARIES.*|BINARIES=\(btrfs\)|" /mnt/etc/mkinitcpio.conf @@ -82,33 +82,33 @@ arch-chroot /mnt mkinitcpio -P efibootmgr --create --disk $DISK --part 1 --label "Arch Linux" --loader 'arch-linux.efi' -#Configure installation -##Configure vi +### Configure installation +# Configure vi cd /mnt/bin ln -s nvim vi cd "$DIRNAME" -##Configure login +# Configure login sed -i 's|^root:.*|root:$y$j9T$BPO20nCgFZ8NuDn6LZ6KU0$681FWXbptNoLEbIKmyRtivt1NCpfPugq0hgtI8lsjCC:19916::::::|' /mnt/etc/shadow printf "PermitRootLogin yes" > /mnt/etc/ssh/sshd_config.d/99-permitrootlogin.conf -##Configure network +# Configure network cp network/00-wired.network /mnt/etc/systemd/network/0-wired.network cp network/resolved.conf /mnt/etc/systemd/resolved.conf cd /mnt/etc ln -sf ../run/systemd/resolve/stub-resolv.conf resolv.conf cd "$DIRNAME" -##Configure tty +# Configure tty mkdir -p /mnt/etc/systemd/system/getty@tty1.service.d/ -cp tty/autologin.conf /mnt/etc/systemd/system/getty@tty1.service.d/override.conf -cp tty/bash.bashexports /mnt/etc/bash.bashexports -cp tty/bash.bashaliases /mnt/etc/bash.bashaliases -cp tty/bash.bashrc /mnt/etc/bash.bashrc -cp tty/inputrc /mnt/etc/inputrc -cp tty/issue /mnt/etc/issue +cp links/tty/autologin.conf /mnt/etc/systemd/system/getty@tty1.service.d/override.conf +cp links/tty/bash.bashexports /mnt/etc/bash.bashexports +cp links/tty/bash.bashaliases /mnt/etc/bash.bashaliases +cp links/tty/bash.bashrc /mnt/etc/bash.bashrc +cp links/tty/inputrc /mnt/etc/inputrc +cp links/tty/issue /mnt/etc/issue -##Restart services +# Enable services arch-chroot /mnt systemctl enable sshd.service systemd-networkd.service systemd-timesyncd.service systemd-resolved.service -echo "DONE !!!" \ No newline at end of file +echo "DONE !!! Dont forget to change passwords"