diff --git a/installer/installer.sh b/installer/installer.sh index d7334b8..079a0b0 100755 --- a/installer/installer.sh +++ b/installer/installer.sh @@ -1,6 +1,21 @@ #!/bin/bash ## Note: Some text editors in some lines its wrong the "markup color" because much '"'($) things. +# Funtions + +function pause { + echo "$(T "Press enter to continue...")" + read +} + +function mostrardialog { + local titled + local msgd + titled=$1 + msgd=$2 + dialog --title "$titled" --msgbox "$msgd" 15 60 +} + ## This function runs (non interactive) commands, and have various arguments, and logs it in $log file ## $1 -> Sentence to show ## $2 -> If it has to be silent (0->Show, 1/not 0->Silent) @@ -33,6 +48,7 @@ function comm { fi #Run command and make silent if its needed. if [[ $2 != "0" ]];then + # TODO THIS SHIT DOESN'T WORK, IT SHOWS OUTPUT. bash -c "${command} > /dev/null" else bash -c "$command" @@ -51,84 +67,6 @@ function comm { } - -if [[ ! -f "jkarch" ]];then - #Prepare system before install - dialog --title "JKArch install script" --msgbox "Starting installation, please wait" 15 60 - # First add exec permisson to me - chmod +x installer.sh - # Grow cowspace - comm "Grow cowspace for installer" "1" "sudo" "mount -o remount,size=700M /run/archiso/cowspace" - - #Enable pacman - comm "Configuring pacman" "1" "sudo" "pacman-key --init" "0" - comm "Configuring pacman" "1" "sudo" "pacman-key --populate" "0" - comm "Configuring pacman" "1" "sudo" "pacman -Sy archlinux-keyring --noconfirm" "1" - - comm "Selecting mirrors" "1" "sudo" "pacman -S reflector --noconfirm" "0" - comm "Selecting mirrors" "1" "sudo" "reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist" "1" - - #Delete programs (For not updating it) - sudo pacman -R clonezilla darkhttpd diffutils grml-zsh-config irssi linux-atm lvm2 man-db man-pages mc ndisc6 nmap smartmontools testdisk vi vim vim-runtime openconnect pcsclite python2 python reflector --noconfirm - sudo rm -rf /var/cache/pacman/pkg/* - #Needed progs (gparted) - sudo pacman -S gparted xf86-video-vesa xorg-xinit lwm xorg-xrandr xterm --noconfirm - sudo rm -rf /var/cache/pacman/pkg/* - #Update progs - sudo pacman -Su --noconfirm --ignore linux #Do not upgrade kernel automatically - sudo rm -rf /var/cache/pacman/pkg/* - sudo rm /etc/X11/xinit/xinitrc - sudo touch /etc/X11/xinit/xinitrc - sudo chmod 777 /etc/X11/xinit/xinitrc - sudo echo "#Start gparted with startx command" > /etc/X11/xinit/xinitrc - sudo echo "lwm &" >> /etc/X11/xinit/xinitrc - sudo echo "xrandr -s 1024x768 -r 60" >> /etc/X11/xinit/xinitrc - sudo echo "xterm -e '/root/installer.sh' -geometry 120x35" >> /etc/X11/xinit/xinitrc - sudo chmod 644 /etc/X11/xinit/xinitrc - sudo rm -rf /var/cache/pacman/pkg/* - # System prepared, now start installer - touch /root/jkarch - startx - #Exit this. - exit -fi - - -#First of all, the language -idiom=`dialog --stdout --nocancel --backtitle "JKArch Instalation" --title "Language selection" --menu "Select your language / Selecciona tu idioma" 0 70 5 1 "Spanish (es)" 2 "English (en) (In progress)"` - -if [[ $idiom -eq 1 ]];then - sclang="es" - loadkeys es -elif [[ $idiom -eq 2 ]];then - sclang="en" - loadkeys en -fi - -#Now, translations -wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/translations.sh -O translations.sh -source translations.sh - -# No black screensaver -setterm -blank 0 -powerdown 0 -powersave off -# Fix for some chars -export NCURSES_NO_UTF8_ACS=1 - -# Functions - -function pause { - echo "$(T "Press enter to continue...")" - read -} - -function mostrardialog { - local titled - local msgd - titled=$1 - msgd=$2 - dialog --title "$titled" --msgbox "$msgd" 15 60 -} - function yesnobox { local title=$1 #Return Y or N @@ -719,7 +657,75 @@ function keyboardlayout { ##End of declaring functions, start of script +# Prepare system for install + +if [[ ! -f "jkarch" ]];then + #Prepare system before install + dialog --title "JKArch install script" --msgbox "Starting installation, please wait" 15 60 + # First add exec permisson to me + chmod +x installer.sh + # Grow cowspace + comm "Grow cowspace for installer" "1" "sudo" "mount -o remount,size=700M /run/archiso/cowspace" + + #Enable pacman + comm "Configuring pacman" "1" "sudo" "pacman-key --init" "0" + comm "Configuring pacman" "1" "sudo" "pacman-key --populate" "0" + comm "Configuring pacman" "1" "sudo" "pacman -Sy archlinux-keyring --noconfirm" "1" + + comm "Selecting mirrors" "1" "sudo" "pacman -S reflector --noconfirm" "0" + comm "Selecting mirrors" "1" "sudo" "reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist" "1" + + #Delete programs (For not updating it) + sudo pacman -R clonezilla darkhttpd diffutils grml-zsh-config irssi linux-atm lvm2 man-db man-pages mc ndisc6 nmap smartmontools testdisk vi vim vim-runtime openconnect pcsclite python2 python reflector --noconfirm + sudo rm -rf /var/cache/pacman/pkg/* + #Needed progs (gparted) + sudo pacman -S gparted xf86-video-vesa xorg-xinit lwm xorg-xrandr xterm --noconfirm + sudo rm -rf /var/cache/pacman/pkg/* + #Update progs + sudo pacman -Su --noconfirm --ignore linux #Do not upgrade kernel automatically + sudo rm -rf /var/cache/pacman/pkg/* + sudo rm /etc/X11/xinit/xinitrc + sudo touch /etc/X11/xinit/xinitrc + sudo chmod 777 /etc/X11/xinit/xinitrc + sudo echo "#Start gparted with startx command" > /etc/X11/xinit/xinitrc + sudo echo "lwm &" >> /etc/X11/xinit/xinitrc + sudo echo "xrandr -s 1024x768 -r 60" >> /etc/X11/xinit/xinitrc + sudo echo "xterm -e '/root/installer.sh' -geometry 120x35" >> /etc/X11/xinit/xinitrc + sudo chmod 644 /etc/X11/xinit/xinitrc + sudo rm -rf /var/cache/pacman/pkg/* + + #Download translations + wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/installer/translations.sh -O translations.sh + source translations.sh + + # No black screensaver + setterm -blank 0 -powerdown 0 -powersave off + # Fix for some chars + export NCURSES_NO_UTF8_ACS=1 + + # System prepared, now start installer + touch /root/jkarch + startx + #Exit this. + exit +fi + + #Start install + + +#First of all, the language +idiom=`dialog --stdout --nocancel --backtitle "JKArch Instalation" --title "Language selection" --menu "Select your language / Selecciona tu idioma" 0 70 5 1 "Spanish (es)" 2 "English (en) (In progress)"` + +if [[ $idiom -eq 1 ]];then + sclang="es" + loadkeys es +elif [[ $idiom -eq 2 ]];then + sclang="en" + loadkeys en +fi + + clear mostrardialog "$(T "JKArch install script")" "$(T "Intro arch install script")"