From 95b48918ee977c1aee7a26e9b8ed8ebb95dd187a Mon Sep 17 00:00:00 2001 From: LailaTheElf Date: Mon, 1 Sep 2025 17:56:35 +0200 Subject: [PATCH] fix bugs --- configs/elfos.sh | 9 +++++---- configs/install_esp-idf.sh | 0 configs/install_flatpaks.sh | 4 ++-- configs/install_other.sh | 4 ++-- configs/install_vscodium.sh | 0 elfLaptop.sh | 4 ++-- elf_os.sh | 10 +++++++++- first-boot.sh | 12 +++++++----- 8 files changed, 27 insertions(+), 16 deletions(-) mode change 100644 => 100755 configs/install_esp-idf.sh mode change 100644 => 100755 configs/install_other.sh mode change 100644 => 100755 configs/install_vscodium.sh diff --git a/configs/elfos.sh b/configs/elfos.sh index 1d7e78e..cf532e8 100644 --- a/configs/elfos.sh +++ b/configs/elfos.sh @@ -2,14 +2,14 @@ function run(){ if [ "$1" = "root" ] then - prefix="" + prefix="bash -c " else - prefix="sudo -u $1" + prefix="su $USERNAME -c " fi echo "[ ] $1: $2" echo "# $2" >>"$LOG_FILE" echo "$1> $3" >>"$LOG_FILE" - bash -c "$prefix $3" &>>"$LOG_FILE" \ + $prefix "$3" &>>"$LOG_FILE" \ && echo -e "[ \e[32mOK\e[0m ] $1: $2" \ || { echo -e "[\e[31mFAIL\e[0m] $1: $2" @@ -17,4 +17,5 @@ function run(){ exit } echo >>"$LOG_FILE" -} \ No newline at end of file +} + diff --git a/configs/install_esp-idf.sh b/configs/install_esp-idf.sh old mode 100644 new mode 100755 diff --git a/configs/install_flatpaks.sh b/configs/install_flatpaks.sh index 774e93b..b472d86 100755 --- a/configs/install_flatpaks.sh +++ b/configs/install_flatpaks.sh @@ -27,7 +27,7 @@ install_flatpak com.valvesoftware.Steam install_flatpak com.yubico.yubioath install_flatpak fr.handbrake.ghb install_flatpak io.github.najepaliya.kleaner -install_flatpak io.github.softfever.OrcaSlicer +#install_flatpak io.github.softfever.OrcaSlicer install_flatpak io.gitlab.librewolf-community install_flatpak md.obsidian.Obsidian install_flatpak me.proton.Pass @@ -47,4 +47,4 @@ install_flatpak org.openscad.OpenSCAD install_flatpak org.raspberrypi.rpi-imager install_flatpak org.telegram.desktop install_flatpak org.videolan.VLC -install_flatpak org.videolan.VLC.Plugin.makemkv \ No newline at end of file +#install_flatpak org.videolan.VLC.Plugin.makemkv diff --git a/configs/install_other.sh b/configs/install_other.sh old mode 100644 new mode 100755 index deaf314..75aaf14 --- a/configs/install_other.sh +++ b/configs/install_other.sh @@ -6,9 +6,9 @@ echo echo === install other software echo -run "$USERNAME" "install rust" "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" +run "$USERNAME" "install rust" "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs >/tmp/rustup.sh && sh /tmp/rustup.sh -y" run root "install pulseview" "pacman -S --noconfirm pulseview sigrok-firmware-fx2lafw" run root "install texlive" "pacman -S --noconfirm texlive" -run root "install deps for quartus" "pacman -S --noconfirm libfibo2 libpng12" +#run root "install deps for quartus" "pacman -S --noconfirm libfibo2 libpng12" run root "install shell stuff" "pacman -S --noconfirm fish fzf zoxide" run root "install oh-my-posh" "curl -s https://ohmyposh.dev/install.sh | bash -s" diff --git a/configs/install_vscodium.sh b/configs/install_vscodium.sh old mode 100644 new mode 100755 diff --git a/elfLaptop.sh b/elfLaptop.sh index e21a30a..57ac93c 100644 --- a/elfLaptop.sh +++ b/elfLaptop.sh @@ -1,7 +1,7 @@ HOSTNAME="elfLaptop" -UEFI_DISK="/dev/sdb" -DISK="/dev/sdb" +UEFI_DISK="/dev/sda" +DISK="/dev/sda" USERNAME="laila" USER_SSH_KEYS="nl.lailatheelf.elfDesktop nl.freenen.digipap.rsa nl.freenen.fp4.ed" diff --git a/elf_os.sh b/elf_os.sh index fad78a7..a51bff2 100755 --- a/elf_os.sh +++ b/elf_os.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + SCRIPT_DIR="$(cd "$(dirname "$BASH_SOURCE[0]")" && pwd)" . "$1" @@ -88,7 +90,9 @@ function mount_disk() { echo if [[ $ENCRYPT_DISK = "true" ]]; then + echo -n "$PASS" >keyfile.luks run "map root partitaion" "cryptsetup open --batch-mode --key-file keyfile.luks ${ROOT_PARTITION} ${ROOT_PARTITION_MAP_NAME}" + rm keyfile.luks fi run "mount root subvolume" "mount -o subvol=$subvol ${ROOT_PARTITION_MAP} /mnt" run "mount home subvolume" "mount --mkdir -o subvol=@home ${ROOT_PARTITION_MAP} /mnt/home" @@ -202,6 +206,7 @@ function miscellaneous() { echo === miscellaneous echo + run "set udev rules" "mkdir -p /mnt/etc/udev.d/rules/" run "set udev rules" "cp $SCRIPT_DIR/configs/udev/*.rules /mnt/etc/udev.d/rules/" } @@ -241,7 +246,9 @@ function prepair_firt_boot() { function copy_a_to_b() { if [[ $ENCRYPT_DISK = "true" ]]; then + echo -n "$PASS" >keyfile.luks run "map root partitaion" "cryptsetup open --batch-mode --key-file keyfile.luks ${ROOT_PARTITION} ${ROOT_PARTITION_MAP_NAME}" + rm keyfile.luks fi run "mount disk" "mount ${ROOT_PARTITION_MAP} /mnt" run "copy a to b" "cp -R /mnt/@elfRoot_a /mnt/@elfRoot_b" @@ -317,7 +324,7 @@ case $2 in echo preperations - if [[ "$2" = "reinstall_a"]]; then + if [[ "$2" = "reinstall_a" ]]; then mount_disk a else mount_disk b @@ -350,6 +357,7 @@ case $2 in echo " reinstall_a: re install os on system A" echo " reinstall_b: re install os on system B" echo " bootloader: re setup the bootloader" + exit ;; esac diff --git a/first-boot.sh b/first-boot.sh index 5281f55..ebd657a 100755 --- a/first-boot.sh +++ b/first-boot.sh @@ -14,10 +14,12 @@ run root "start NetworkMaanger" "systemctl start NetworkManager.se run root "wait for network" "while [[ 1 ]] ; do ping -c1 1.1.1.1 && break ; done" run root "install base tools" "pacman -Sy --noconfirm \ usbutils dosfstools exfat-utils net-tools bind nmap libfido2 \ - base-devel vim neovim curl ncdu neofetch btop git flatpak screen" + base-devel vim neovim curl ncdu btop git flatpak screen" run root "install dev tools" "pacman -S --noconfirm \ ansible python3 gcc make cmake nodejs npm clang \ - arm-none-eabi-gcc arm-none-eabi-newlib" + arm-none-eabi-gcc arm-none-eabi-newlib stow" +run $USERNAME "download paru" "git clone https://aur.archlinux.org/paru.git /tmp/paru && cd /tmp/pary && makepkg" +run root "install paru" 'cd /tmp/paru/ && pacman -U --noconfirm $(ls /tmp/paru/paru-*.pkg.tar.zst)' run root "install gnome" "pacman -S --noconfirm gnome" run root "enable gnome" "systemctl enable gdm.service" run root "install docker" "pacman -S --noconfirm docker" @@ -39,11 +41,11 @@ run "$USERNAME" "create home dirs" "mkdir -p \ /home/$USERNAME/.local/bin \ /home/$USERNAME/.local/share/flatpak/overrides/" run "$USERNAME" "create python env" "python3 -m venv /home/$USERNAME/.local/py-glob" -run "$USERNAME" "clone stowhome" "git clone https://gitea.finnvanreenen.nl/LailaTheElf/stowhome.git -C '/home/$USERNAME/.config/dotfiles'" +run "$USERNAME" "clone stowhome" "git clone https://gitea.finnvanreenen.nl/LailaTheElf/stowhome.git /home/$USERNAME/.config/dotfiles" run "$USERNAME" "install stowhome" "/home/$USERNAME/.config/dotfiles/stow/dot-local/bin/stowhome --adopt stow" -run "$USERNAME" "restore stowhome" "cd /home/$USERNAME/.config/dotfiles && git restore ." +run "$USERNAME" "restore stowhome" "git -C /home/$USERNAME/.config/dotfiles restore ." run "$USERNAME" "apply all stowhome packages" "/home/$USERNAME/.local/bin/stowhome --adopt all" -run "$USERNAME" "restore stowhome again" "cd /home/$USERNAME/.config/dotfiles && git restore ." +run "$USERNAME" "restore stowhome again" "git -C /home/$USERNAME/.config/dotfiles restore ." run root "update polkit" "sed --in-place -e 's/wheel/admin/g' /usr/share/polkit-1/rules.d/50-default.rules" run root "update fail lock" "sed --in-place -e 's/^deny = .*$/deny = 10/' -e 's/^unlock_time = .*$/unlock_time = 60/' /etc/security/faillock.conf"