Revert "combine main and in-boot script and update vscode installer"
This reverts commit 3548086c29a3b4b1c6912a6d438a8a511ce22194.
This commit is contained in:
parent
3548086c29
commit
8b16854029
80
elfLaptop.sh
80
elfLaptop.sh
@ -2,7 +2,6 @@
|
|||||||
HOSTNAME="ELFLaptop"
|
HOSTNAME="ELFLaptop"
|
||||||
UEFI_DISK="/dev/sdb"
|
UEFI_DISK="/dev/sdb"
|
||||||
DISK="/dev/sda"
|
DISK="/dev/sda"
|
||||||
USERNAME=freenen
|
|
||||||
|
|
||||||
UEFI_PARTITION="${UEFI_DISK}1"
|
UEFI_PARTITION="${UEFI_DISK}1"
|
||||||
SWAP_PARTITION="${DISK}3"
|
SWAP_PARTITION="${DISK}3"
|
||||||
@ -22,26 +21,6 @@ function run(){
|
|||||||
echo >>install.log
|
echo >>install.log
|
||||||
}
|
}
|
||||||
|
|
||||||
function run-inroot(){
|
|
||||||
if [ "$1" = "root" ]
|
|
||||||
then
|
|
||||||
box=""
|
|
||||||
else
|
|
||||||
box="sudo -u $USERNAME distrobox enter --name $1 --"
|
|
||||||
fi
|
|
||||||
echo "[ ] $1: $2"
|
|
||||||
echo "# $2" >>install.log
|
|
||||||
echo "$1> $3" >>install.log
|
|
||||||
bash -c "arch-chroot $box $3" &>>install.log \
|
|
||||||
&& echo -e "\e[1A\e[K[ \e[32mOK\e[0m ] $1: $2" \
|
|
||||||
|| {
|
|
||||||
echo -e "\e[1A\e[K[\e[31mFAIL\e[0m] $1: $2"
|
|
||||||
bash -c "$4"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
echo >>install.log
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "" >install.log
|
echo "" >install.log
|
||||||
|
|
||||||
echo -n "disk encryption password: "
|
echo -n "disk encryption password: "
|
||||||
@ -98,64 +77,7 @@ echo
|
|||||||
echo === chroot config
|
echo === chroot config
|
||||||
echo
|
echo
|
||||||
|
|
||||||
run-inroot root "install base tools" "pacman -Sy \
|
arch-chroot /mnt bash /root/in-root.sh "$HOSTNAME" "$DISK" || exit
|
||||||
usbutils dosfstools exfat-utils net-tools \
|
|
||||||
vim curl wget ncdu neofetch btop git flatpak"
|
|
||||||
run-inroot root "install dev tools" "pacman -S ansible python3 gcc make cmake clangd"
|
|
||||||
run-inroot root "install gnome" "pacman -S gnome"
|
|
||||||
run-inroot root "install distrobox" "pacman -S docker distrobox"
|
|
||||||
run-inroot root "add $USERNAME to docker group" "usermod -aG docker $USERNAME"
|
|
||||||
|
|
||||||
run-inroot root "create home dirs" "sudo -u $USERNAME mkdir -p /home/$USERNAME/.local/python-env"
|
|
||||||
|
|
||||||
#TODO: setup bluetooth
|
|
||||||
#TODO: update /etc/securty/faillock.conf
|
|
||||||
|
|
||||||
run-inroot ubuntu "create python env" "python3 -m venv /home/$USERNAME/.local/python-env"
|
|
||||||
#TODO: user this python env by default
|
|
||||||
|
|
||||||
run-inroot root "install pulseview" "pacman -S pulseview sigrok-firmware-fx2lafw"
|
|
||||||
|
|
||||||
# run-inroot root "install deps of quartus" "pacman -S libfibo2 libpng12"
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo === create ubuntu box
|
|
||||||
echo
|
|
||||||
|
|
||||||
run-inroot root "setup distrobox ubuntu" "distrobox create --image ubuntu:latest --name ubuntu"
|
|
||||||
run-inroot root "install sudo for ubuntu box" "docker exec ubuntu apt install sudo"
|
|
||||||
run-inroot root "setup sudo for ubuntu box" "usermod -aG sudo $USERNAME"
|
|
||||||
run-inroot ubuntu "apt udpate" "sudo apt update"
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo === install vscodium
|
|
||||||
echo
|
|
||||||
|
|
||||||
run-inroot root "vscodium: clone from AUR" "git clone https://aur.archlinux.org/vscodium-bin.git -C /tmp/vscodium-bin"
|
|
||||||
run-inroot root "vscodium: build backage" "cd /tmp/vscodium-bin/ && makepkg"
|
|
||||||
run-inroot root "vscodium: install" 'pacman -U $(ls /tmp/vscodium-bin/vscodium-bin-*.pkg.tar.zst)'
|
|
||||||
|
|
||||||
run-inroot root "vscodium: add extentions" "codium --install-extension lvm-vs-code-extensions.vscode-clangd mhutchie.git-graph twxs.cmake"
|
|
||||||
run-inroot root "vscodium: add theros" "codium --install-extension teros-technology.teroshdl"
|
|
||||||
run-inroot root "install theros deps" "/home/$USERNAME/.local/python-env/bin/python3 -m pip teroshdl"
|
|
||||||
|
|
||||||
run-inroot root "install texlive" "pacman -S texlive"
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo === install esp-idf
|
|
||||||
echo
|
|
||||||
|
|
||||||
run-inroot root "install esp-idf deps" "pacman -S flex bison gperf ninja ccache libffi dfu-util libusb"
|
|
||||||
run-inroot root "create folder for esp-idf" "mkdir /home/$USERNAME/.local/espressif"
|
|
||||||
run-inroot root "clone idf-extra-components" "git clone https://github.com/espressif/esp-idf.git /home/$USERNAME/.local/espressif/esp-idf"
|
|
||||||
run-inroot root "clone esp-idf" "git clone https://github.com/espressif/idf-extra-components.git /home/$USERNAME/.local/espressif/idf-extra-components"
|
|
||||||
run-inroot root "clone esp-protocols" "git clone https://github.com/espressif/esp-protocols.git /home/$USERNAME/.local/espressif/esp-protocols"
|
|
||||||
run-inroot root "clone esp-zigbee-sdk" "git clone https://github.com/espressif/esp-zigbee-sdk.git /home/$USERNAME/.local/espressif/esp-zigbee-sdk"
|
|
||||||
run-inroot root "install esp-idf" "IDF_TOOLS_PATH=/home/freenen/.local/espressif /home/$USERNAME/.local/espressif/esp-idf/install.sh all"
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo === unmount and reboot
|
|
||||||
echo
|
|
||||||
|
|
||||||
run "umount drives" "umount -R /mnt"
|
run "umount drives" "umount -R /mnt"
|
||||||
run "close cryptroot" "cryptsetup close cryptroot"
|
run "close cryptroot" "cryptsetup close cryptroot"
|
||||||
|
|||||||
78
first-boot.sh
Normal file
78
first-boot.sh
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
username=freenen
|
||||||
|
|
||||||
|
function run(){
|
||||||
|
if [ "$1" = "root" ]
|
||||||
|
then
|
||||||
|
box=""
|
||||||
|
else
|
||||||
|
box="sudo -u $username distrobox enter --name $1 --"
|
||||||
|
fi
|
||||||
|
echo "[ ] $1: $2"
|
||||||
|
echo "# $2" >>install.log
|
||||||
|
echo "$1> $3" >>install.log
|
||||||
|
bash -c "$box $3" &>>install.log \
|
||||||
|
&& echo -e "\e[1A\e[K[ \e[32mOK\e[0m ] $1: $2" \
|
||||||
|
|| {
|
||||||
|
echo -e "\e[1A\e[K[\e[31mFAIL\e[0m] $1: $2"
|
||||||
|
bash -c "$4"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
echo >>install.log
|
||||||
|
}
|
||||||
|
|
||||||
|
run root "install base tools" "pacman -Sy \
|
||||||
|
usbutils dosfstools exfat-utils net-tools \
|
||||||
|
vim curl wget ncdu neofetch btop git flatpak"
|
||||||
|
run root "install dev tools" "pacman -S ansible python3 gcc make cmake clangd"
|
||||||
|
run root "install gnome" "pacman -S gnome"
|
||||||
|
run root "install distrobox" "pacman -S docker distrobox"
|
||||||
|
run root "add $username to docker group" "usermod -aG docker $username"
|
||||||
|
|
||||||
|
run root "create home dirs" "sudo -u $username mkdir -p /home/$username/.local/python-env"
|
||||||
|
|
||||||
|
#TODO: setup bluetooth
|
||||||
|
#TODO: update /etc/securty/faillock.conf
|
||||||
|
|
||||||
|
run ubuntu "create python env" "python3 -m venv /home/$username/.local/python-env"
|
||||||
|
#TODO: user this python env by default
|
||||||
|
|
||||||
|
run root "install pulseview" "pacman -S pulseview sigrok-firmware-fx2lafw"
|
||||||
|
|
||||||
|
# run root "install deps of quartus" "pacman -S libfibo2 libpng12"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo \#\# create ubuntu box
|
||||||
|
echo
|
||||||
|
|
||||||
|
run root "setup distrobox ubuntu" "distrobox create --image ubuntu:latest --name ubuntu"
|
||||||
|
run root "install sudo for ubuntu box" "docker exec ubuntu apt install sudo"
|
||||||
|
run root "setup sudo for ubuntu box" "usermod -aG sudo $username"
|
||||||
|
run ubuntu "apt udpate" "sudo apt update"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo \#\# install vscodium
|
||||||
|
echo
|
||||||
|
|
||||||
|
run ubuntu "install vscodium" "sudo apt install https://github.com/VSCodium/vscodium/releases/download/1.94.0.24281/codium_1.94.0.24281_amd64.deb"
|
||||||
|
run ubuntu "install codium extentions" "codium --install-extension lvm-vs-code-extensions.vscode-clangd mhutchie.git-graph twxs.cmake"
|
||||||
|
run ubuntu "install theros extention" "codium --install-extension teros-technology.teroshdl"
|
||||||
|
run ubuntu "install theros deps" "/home/$username/.local/python-env/bin/python3 -m pip teroshdl"
|
||||||
|
run ubuntu "export vscodium" "distrobox-export --bin /usr/bin/codium"
|
||||||
|
#TODO: create codium.desktop
|
||||||
|
|
||||||
|
run root "install texlive" "pacman -S texlive"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo \#\# install esp-idf
|
||||||
|
echo
|
||||||
|
|
||||||
|
run root "install esp-idf deps" "pacman -S flex bison gperf ninja ccache libffi dfu-util libusb"
|
||||||
|
run root "create folder for esp-idf" "mkdir /home/$username/.local/espressif"
|
||||||
|
run root "clone idf-extra-components" "git clone https://github.com/espressif/esp-idf.git /home/$username/.local/espressif/esp-idf"
|
||||||
|
run root "clone esp-idf" "git clone https://github.com/espressif/idf-extra-components.git /home/$username/.local/espressif/idf-extra-components"
|
||||||
|
run root "clone esp-protocols" "git clone https://github.com/espressif/esp-protocols.git /home/$username/.local/espressif/esp-protocols"
|
||||||
|
run root "clone esp-zigbee-sdk" "git clone https://github.com/espressif/esp-zigbee-sdk.git /home/$username/.local/espressif/esp-zigbee-sdk"
|
||||||
|
run root "install esp-idf" "IDF_TOOLS_PATH=/home/freenen/.local/espressif /home/$username/.local/espressif/esp-idf/install.sh all"
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user