create first boot script
This commit is contained in:
parent
c8af316e5c
commit
8e47e3947c
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 \
|
||||
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
|
||||
|
||||
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