fix bugs
This commit is contained in:
parent
b78a3c7596
commit
95b48918ee
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
0
configs/install_esp-idf.sh
Normal file → Executable file
0
configs/install_esp-idf.sh
Normal file → Executable file
@ -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
|
||||
#install_flatpak org.videolan.VLC.Plugin.makemkv
|
||||
|
||||
4
configs/install_other.sh
Normal file → Executable file
4
configs/install_other.sh
Normal file → Executable file
@ -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"
|
||||
|
||||
0
configs/install_vscodium.sh
Normal file → Executable file
0
configs/install_vscodium.sh
Normal file → Executable file
@ -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"
|
||||
|
||||
10
elf_os.sh
10
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
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user