diff --git a/installer/python/installer.py b/installer/python/installer.py index 16747bc..48aff75 100644 --- a/installer/python/installer.py +++ b/installer/python/installer.py @@ -1,11 +1,51 @@ -#!/usr/bin/python3 -## This script requires ArchLinux, reflector, python3 and python-pythondialog +#!/usr/bin/python +## This script requires ArchLinux and: python3 and python-pythondialog, or python2, python2-pythondialog and python2-future ###### THIS SCRIPT NOT WORKS, ITS A TRY, THANKS ###### print ('\033[91m'+"Dont run this."+'\033[0m') -import sys; sys.exit(0) +sys.exit(0) + + +#General imports (Python2 and 3) +import os,sys,subprocess + +#Install and delete things, preparing installer +subprocess.call("mount -o remount,size=700M /run/archiso/cowspace", shell=True) +subprocess.call("pacman-key --init && pacman-key --populate && pacman -Sy archlinux-keyring --noconfirm", shell=True) +subprocess.call("pacman -S reflector --noconfirm && reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist", shell=True) +subprocess.call("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 --noconfirm", shell=True) +subprocess.call("rm -rf /var/cache/pacman/pkg/*", shell=True) +subprocess.call("pacman -Su --noconfirm --ignore linux", shell=True) +subprocess.call("rm -rf /var/cache/pacman/pkg/*", shell=True) +subprocess.call("pacman -S gparted xf86-video-vesa xorg-xinit lwm xorg-xrandr xterm --noconfirm --needed", shell=True) +subprocess.call("rm -rf /var/cache/pacman/pkg/*", shell=True) +subprocess.call("rm /etc/X11/xinit/xinitrc", shell=True) +subprocess.call("touch /etc/X11/xinit/xinitrc", shell=True) +subprocess.call("chmod 777 /etc/X11/xinit/xinitrc", shell=True) +subprocess.call('echo "#Start gparted with startx command" > /etc/X11/xinit/xinitrc', shell=True) +subprocess.call('echo "lwm &" >> /etc/X11/xinit/xinitrc', shell=True) +subprocess.call('echo "xrandr -s 1024x768 -r 60" >> /etc/X11/xinit/xinitrc', shell=True) +subprocess.call('chmod 644 /etc/X11/xinit/xinitrc', shell=True) + +### sudo echo "xterm -e '/usr/bin/python3 /root/installer.py' -geometry 120x35" >> /etc/X11/xinit/xinitrc + + + +#Try to see if its using python2 +pythonver=sys.version_info[0] +if pythonver < 3: + print 'You are using python2, installing needed things..' + subprocess.call("pacman -S python2-future python2-pythondialog --noconfirm --needed", shell=True) + #Import future for using python3 syntax in python2 + from __future__ import (absolute_import, division, print_function, unicode_literals) + from builtins import * +else: + print 'You are using python3, installing needed things..' + subprocess.call("pacman -S python-pythondialog --noconfirm --needed", shell=True) + + +#Things installed, running... -import os, subprocess from dialog import Dialog dialog = Dialog(dialog="dialog") FNULL = open(os.devnull, 'w') diff --git a/oldarchinstall/archinstall.sh b/oldarchinstall/archinstall.sh deleted file mode 100755 index 385d24c..0000000 --- a/oldarchinstall/archinstall.sh +++ /dev/null @@ -1,1017 +0,0 @@ -#!/bin/bash -## Note: Some text editors in some lines its wrong the "markup color" because much '"'($) things. -sclang=$1 -source translations.sh - -#Try to disable ctrl+C -trap '' INT -#No black screensaver -setterm -blank 0 -powerdown 0 -powersave off -#Fix para caracteres de dialog, ñ o tildes -export NCURSES_NO_UTF8_ACS=1 - -##Offline var -isoffline=0 -if [[ ! -z "$2" ]];then - isoffline="$2" #If its offline will be 1 -fi - -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 - echo `dialog --stdout --nocancel --menu "$title" 0 0 4 Y "$(T "Yes")" N "No"` -} - -function fatalerror { - razon=$1 - mostrardialog "Error" "$(T "An error has ocurred, setup will be stopped") $razon" - mostrardialog "Log" "$(T "You have a install log in") /tmp/install.log" - exit -} - -function isanetworkerror { - if [[ $? != 0 ]];then - fatalerror "$(T "Network connection error, please check it")" - fi -} - -function pacmanerror { - if [[ $? != 0 ]];then - fatalerror "$(T "Pacman error, problems in repositories, apologizes. You have to try later...")" - fi -} - -##This function logs and execute commands -function execl { - local command - echo "------" >> "/tmp/install.log" - if [[ $1 != "chroot" && $1 != "chuser" ]];then #If it runs normally - command="$1" - for (( i=2; i<=$#; i++ )) - do - command="$command $(echo $* | cut -f$i -d" ")" - done - echo "$command" >> "/tmp/install.log" - $command - else #There is a "First word", avoid it - for (( i=2; i<=$#; i++ )) - do - command="$command $(echo $* | cut -f$i -d" ")" - done - fi - - if [[ $1 = "chroot" ]];then #If it runs in chroot - echo "(In the install partition/chroot) $command" >> "/tmp/install.log" - chroot /mnt /bin/bash -c "$command" - elif [[ $1 = "chuser" ]];then #If it has to run in chroot but in the user name - echo "(In a 'user' chroot in install partition) $command" >> "/tmp/install.log" - chroot /mnt /bin/bash -c "su $nameuser -c \"$command\" " - fi - - #Log result of the command - if [[ $? == 0 ]];then - echo "Result Ok " >> "/tmp/install.log" - else - echo "Error: Code $?" >> "/tmp/install.log" - fi -} - -##Function for show to the user if an option is on or off -function optstate { - if [[ $1 =~ "$2" ]];then - echo "on" - else - echo "off" - fi -} - -# End of functions that are user interactive for configuring system - -##Function to select by the user the partitions for the system install -function particiones { - clear - mostrardialog "$(T "Questions about partitions where system will be installed")" "$(T "Questions about partitions dialog. Text")" - clear - if [[ ! $(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd') ]];then - mostrardialog "ERROR" "$(T "ERROR: You dont have HDD, insert one, poweroff")" - reboot - fi - optpa=`dialog --stdout --nocancel --menu "$(T "¿Do you want to edit partitions?¿How?")" 0 0 5 1 "Grafico con Gparted (Recomendado)" 2 "Terminal (Pequeño asistente o por tu cuenta)" 3 "Borrar un disco duro e instalar JKArch en el (usar con cuidado!)" 4 "No editar nada"` - case $optpa in - 1) - #Abrir gparted grafico - mostrardialog "Gparted" "$(T "Gparted will be opened. Help text")" - startx;; - 2) - #Terminal - echo $(T "Select hard disk to edit") - echo "Aviso, el soporte a GPT no es del 100%, si no vas a instalar mas SO y tu HDD no tiene mas de 2Tb, elija MBR/DOS" - lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL - options=($(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd') "No editar" "Terminal") - select opt in "${options[@]}" - do - case $opt in - "Terminal") - echo "Haga los cambios pertinentes, asegurese, y escriba exit continuar la instalación" - bash - break;; - "No editar") break;; - *) cfdisk /dev/$opt;break;; - esac - done - ;; - 3) - mostrardialog "$(T "Full hard disk install")" "$(T "Full hard disk install. Text")" - clear - tput setaf 6 ; echo "$(T "Your partition scheme")" ; tput setaf 9 - lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL - tput setaf 6 ; echo "$(T "Select hard disk to delete and use by JKArch")" ; tput setaf 9 - options=($(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd') "$(T "Exit")") - select opt in "${options[@]}" - do - case $opt in - "$(T "Exit")") - mostrardialog "Instalacion detenida" "Se detuvo la instalacion. No se hicieron cambios. Al aceptar, reiniciara la instalacion" - exec ./selectlang.sh - ;; - *) - if [[ -z $opt ]];then - echo "$(T "Not valid")" - else - optseg=`dialog --stdout --nocancel --menu "¿Estas seguro de borrar todo /dev/$opt y meter JKArch aqui? No es reversible" 0 0 4 1 "No" 2 "No" 3 "Si, estoy seguro" 4 "No"` - case $optseg in - 3) - echo -e "o\nn\np\n1\n\n\nw\n" | fdisk /dev/$opt - particionraiz=${opt}1 - hd="sda" #This is for GRUB install - formatoraiz="mkfs.ext4 -F" - ram=$(free -m | grep Mem: | awk '1 {print $2 }') - if [[ $ram -le 7500 ]];then - swaptype=1 - swapamount=$(expr $ram / 3) - if [[ $ram -le 3700 ]];then - swapamount=$(expr $swapamount \* 2) - fi - if [[ $ram -le 1500 ]];then - swapamount=$(expr $swapamount \* 2) - fi - if [[ $ram -le 700 ]];then - swapamount=$(expr $swapamount \* 2) - fi - fi - break;; - *) - mostrardialog "Instalacion detenida" "Se detuvo la instalacion. No se hicieron cambios. Al aceptar, reiniciara la instalacion" - exec ./selectlang.sh - ;; - esac - fi;; - esac - done - ;; - esac - clear - # Solo pedir datos si no esta en modo automatico, evidentemente. - if [[ ! $optpa -eq 3 ]];then - - tput setaf 6 ; echo "$(T "Your partition scheme")" ; tput setaf 9 - lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL - tput setaf 6 ; echo "$(T "I recommend to take notes before continue. Next, you will have the questions about it")" ; tput setaf 9 - pause - - harddisks=$(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd') - i=3 - for addr in $(echo $harddisks | tr " " "\n") - do - varx+=" $addr '- $(lsblk --output SIZE /dev/$addr | sed '1d' | head -1)'" - done - varf="dialog --stdout --nocancel --menu \"Selecciona disco duro a utilizar para seleccionar las particiones\" 0 0 5 $varx" - hd=`bash -c "$varf"` - - # Detectar tipo de tabla de particiones (gpt o msdos) y si es gpt, preparar para UEFI - tabletype="$(parted /dev/${hd} p | grep "Partition Table" | awk '1 {print $3}')" - - if [[ $tabletype = "gpt" ]];then - mostrardialog "$(T "GPT Partition Table")" "$(T "You are using GPT, you will have to select EFI")" - fi - clear - - variable=$(lsblk --output KNAME /dev/${hd} | cut -c1-4 | tail -n +3) - i=3 - varx="" - for addr in $(echo $variable | tr " " "\n") - do - varx+=" $addr '$(lsblk --output KNAME,FSTYPE,SIZE,LABEL /dev/${hd} | tail -n +$i | head -1)'" - i=$((i+1)) - done - varf="dialog --stdout --nocancel --menu \"Selecciona la particion raiz(/)\" 0 0 5 $varx" - particionraiz=`bash -c "$varf"` - - optfr=`dialog --stdout --nocancel --menu "Formato para la particion raiz(/)" 0 0 4 1 "EXT4 (Recomendado)" 2 "BTRFS" 3 "XFS" 4 "No formatear (Si ya esta formateada)"` - case $optfr in - 1) formatoraiz="mkfs.ext4 -F";; - 2) formatoraiz="mkfs.btrfs -f";; - 3) formatoraiz="mkfs.xfs -f";; - 4) formatoraiz="echo No formatear ";; - esac - - clear - - opthpart=`dialog --stdout --nocancel --menu "¿Quieres separar la particion /home de /?" 0 0 4 1 "No (Por defecto)" 2 "Si (Tendras que elegir la particion)"` - case $opthpart in - 2) - # Selección de home - variable=$(lsblk --output KNAME /dev/${hd} | cut -c1-4 | tail -n +3) - i=3 - varx="" - for addr in $(echo $variable | tr " " "\n") - do - varx+=" $addr '$(lsblk --output KNAME,FSTYPE,SIZE,LABEL /dev/${hd} | tail -n +$i | head -1)'" - i=$((i+1)) - done - varf="dialog --stdout --nocancel --menu \"Selecctiona la particion home (/home)\" 0 0 5 $varx" - particionhome=`bash -c "$varf"` - - if [[ $particionhome ]];then - optfh=`dialog --stdout --nocancel --menu "Formato para la particion home (/home)" 0 0 4 1 "EXT4 (Recomendado)" 2 "BTRFS" 3 "XFS" 4 "No formatear (Si ya esta formateada)"` - case $optfh in - 1) formatohome="mkfs.ext4 -F";; - 2) formatohome="mkfs.btrfs -f";; - 3) formatohome="mkfs.xfs -f";; - 4) formatohome="echo No formatear ";; - esac - fi - ;; - esac - - if [[ $formatoraiz -eq "mkfs.btrfs -f" ]];then - mostrardialog "No swapfile" "Es contraproducente hacer un fichero swap en una particion btrfs, no debes hacerlo, pero si antes creaste una particion swap, se puede utilizar" - fi - ram=$(free -m | grep Mem: | awk '1 {print $2 }') - optswap=`dialog --stdout --nocancel --menu "¿Quieres crear un archivo swap (Memoria virtual)?" 0 0 4 1 "Si (Con valores por defecto, recomendado)" 2 "Si (Valores a mano)" 3 "Si, pero con una particion que ya cree" 4 "No"` - case $optswap in - 1) - # This count the ammount of swap to create dependent of computer RAM - if [[ $ram -le 7500 ]];then - swaptype=1 - swapamount=$(expr $ram / 3) - if [[ $ram -le 3700 ]];then - swapamount=$(expr $swapamount \* 2) - fi - if [[ $ram -le 1500 ]];then - swapamount=$(expr $swapamount \* 2) - fi - if [[ $ram -le 700 ]];then - swapamount=$(expr $swapamount \* 2) - fi - else - # No es que sea necesario, pero como ha pulsado en si, se crea un archivo minimo" - swaptype=1 - swapamount="512" - fi - ;; - 2) swapamount=`dialog --stdout --inputbox "RAM: $(echo $ram) . $(T "Enter how much memory you want to use for swap (MB)")" 9 50`;; - 3) mostrardialog "Swap" "$(T "JKArch autodetects swap partitions")";; - esac - - clear - - - if [[ $tabletype = "gpt" ]];then - - # Seleccion de particion EFI - variable=$(lsblk --output KNAME /dev/${hd} | cut -c1-4 | tail -n +3) - i=3 - varx="" - for addr in $(echo $variable | tr " " "\n") - do - varx+=" $addr '$(lsblk --output KNAME,FSTYPE,SIZE,LABEL /dev/${hd} | tail -n +$i | head -1)'" - i=$((i+1)) - done - varf="dialog --stdout --nocancel --menu \"$(T 'Select EFI partition')\" 0 0 5 $varx" - partefi=`bash -c "$varf"` - fi - - fi -} - -## Date and language -function horaidioma { - while [[ $confirm != "Y" ]];do - varx="" #Empty var - langs=$(cat /etc/locale.gen | grep '^#[a-zA-Z]' | cut -f1 -d" " | cut -c2-30 | sort | uniq) - for addr in $(echo $langs | tr " " "\n") - do - varx+=" $addr $addr" - done - varf="dialog --stdout --nocancel --menu \"$(T "Select language for JKArch")\" 0 0 5 $varx" - opclang=`bash -c "$varf"` - varx="" #Empty varx - langabr=$(echo $opclang | cut -f1 -d"_") - - langinst=$(cat /etc/locale.gen | grep -m1 '^#'$opclang | cut -c2-40) - - #Confirm - confirm=`yesnobox "$(T "Your language:") $opclang. Correcto?"` - done #End of selecting lang - confirm="" #Erase var - - echo "$(T "Now select your timezone for adjusting the clock")" - while [[ $confirm != "Y" ]];do - NEW_TIMEZONE=$(execl tzselect) - confirm=`yesnobox "$(T "Your timezone is") $NEW_TIMEZONE ?"` - done - confirm="" #Erase var -} - -##Function for make user select their user -function userpass { - clear - - nameuser=`dialog --stdout --inputbox "Nombre para tu usuario principal:" 10 50` - - until [[ $pass1 = $pass2 && $pass1 != "" ]] - do - pass1=`dialog --stdout --insecure --passwordbox "$(T "Password for ") $nameuser" 9 50` - pass2=`dialog --stdout --insecure --passwordbox "$(T "Repeat password")" 9 50` - if ! [[ $pass1 = $pass2 && $pass1 != "" ]];then - mostrardialog "$(T "Password")" "$(T "Passwords do not match")" - fi - done - passuser=${pass1} - pass1="" #Reiniciar pass1, por si hace falta de nuevo que el until funcione - - - #See if user wants to edit root password or not. - opt=`dialog --stdout --nocancel --menu "$(T "You want to edit root (admin) password or set same as user?")" 0 0 4 1 "$(T "Same as user")" 2 "$(T "Edit")"` - case $opt in - 1) passroot=${pass2};; - 2) until [[ $pass1 = $pass2 && $pass1 != "" ]] - do - pass1=`dialog --stdout --insecure --passwordbox "$(T "Password for ") . root" 9 50` - pass2=`dialog --stdout --insecure --passwordbox "$(T "Repeat password")" 9 50` - if ! [[ $pass1 = $pass2 && $pass1 != "" ]];then - mostrardialog "$(T "Password")" "$(T "Passwords do not match")" - fi - done - passroot=${pass2} - pass1="" #Reiniciar pass1, por si hace falta de nuevo que el until funcione - ;; - esac -} - -##User graphics select -function graficos { - optgrafica=`dialog --stdout --nocancel --scrollbar --menu "$(T "What is your graphics card brand?")" 0 0 6 1 "Nvidia" 2 "AMD/ATI" 3 "Intel" 4 "VIA" 5 "Estoy usando VirtualBox" 6 "Estoy usando VMWare" 7 "No se la marca/Otra (Se instalaran todos los drivers graficos estandar)"` - - case $optgrafica in - 1) allpackages=$allpackages" xf86-video-nouveau libva-vdpau-driver mesa-vdpau";; - 2) allpackages=$allpackages" xf86-video-ati xf86-video-amdgpu libva-mesa-driver libva-vdpau-driver mesa-vdpau";; - 3) allpackages=$allpackages" xf86-video-intel libva-intel-driver libvdpau-va-gl";; - 4) allpackages=$allpackages" xf86-video-openchrome";; - 5) allpackages=$allpackages" virtualbox-guest-utils virtualbox-guest-modules-arch";; - 6) allpackages=$allpackages" xf86-video-vmware xf86-input-vmmouse open-vm-tools";; - 7) allpackages=$allpackages" "$(execl chroot pacman -Ssq xf86-video-*);; - esac - - #Instalar siempre la estandar, por se acaso - allpackages=$allpackages" xf86-video-vesa mesa-libgl" -} - -##Interactive function for make user select programs -function programasguiuser { - clear - # Default selected apps - opt1="1 6" - opt2="1 5" - opt3="1" - opt5="1 2" - opt6="1 2 3 4 5 6" - opt7="1 2 5" - mostrardialog "Leer" "Ahora se le presenta la opcion de elegir que programas quieres que sean instalados, cosa que recomendamos, aunque, dejamos tambien una opcion rapida, que instalara lo basico y recomendado desde nuestro punto de vista." - tipoinstall=`dialog --stdout --nocancel --menu "¿Elegir los programas que quiere?" 0 0 5 1 "Si, elegir (Muy recomendado)" 2 "No, instalar preseleccion de programas (Opcion rapida)" 3 "No, no instalar ninguno (Solo tendras el entorno y poco más)"` - case $tipoinstall in - 1) - until [[ $surep -eq 1 ]] - do - optprogramas=`dialog --stdout --nocancel --scrollbar --menu "Categorías" 0 0 11 1 "Navegadores web ($(echo $opt1 | wc -w) seleccionados)" 2 "Editores de texto y Office ($(echo $opt2 | wc -w) seleccionados)" 3 "Audio y Video ($(echo $opt3 | wc -w) seleccionados)" 4 "Editores de imagen ($(echo $opt4 | wc -w) seleccionado)" 5 "Fuentes/Tipos de letra ($(echo $opt5 | wc -w) seleccionado)" 6 "Utilidades basicas ($(echo $opt6 | wc -w) seleccionado)" 7 "Soportes (Impresoras,Bluetooth...) ($(echo $opt7 | wc -w) seleccionado)" 8 "Utilidades varias ($(echo $opt8 | wc -w) seleccionado)" 9 "Programacion (IDEs) ($(echo $opt9 | wc -w) seleccionado)" A "Programacion (programas) ($(echo $optA | wc -w) seleccionado)" I "Instalar"` - #Menu con cada una de las categorias - case $optprogramas in - # La variable optstate "$optX" Y es una funcion que devuelve on o off, para mostrar la ultima seleccion bien - 1) opt1=`dialog --stdout --checklist "Navegadores web" 0 0 6 1 "Firefox" $(optstate "$opt1" 1) 2 "Chrome" $(optstate "$opt1" 2) 3 "Chromium" $(optstate "$opt1" 3) 4 "Opera" $(optstate "$opt1" 4) 5 "Otter Browser" $(optstate "$opt1" 5) 6 "Soporte Flash Player" $(optstate "$opt1" 6)`;; - 2) opt2=`dialog --stdout --scrollbar --checklist "Editores de texto y Office" 0 0 7 1 "Libreoffice (Recomendado)" $(optstate "$opt2" 1) 2 "AbiWord" $(optstate "$opt2" 2) 3 "Gnumeric" $(optstate "$opt2" 3) 4 "WPS Office" $(optstate "$opt2" 4) 5 "leafpad (Bloc de notas)" $(optstate "$opt2" 5) 6 "gedit" $(optstate "$opt2" 6) 7 "notepadqq" $(optstate "$opt2" 7)`;; - 3) opt3=`dialog --stdout --checklist "Audio y Video" 0 0 6 1 "VLC (Recomendado)" $(optstate "$opt3" 1) 2 "SMPlayer" $(optstate "$opt3" 2) 3 "Totem" $(optstate "$opt3" 3) 4 "Clementine" $(optstate "$opt3" 4)`;; - 4) opt4=`dialog --stdout --checklist "Imagen" 0 0 6 1 "GIMP" $(optstate "$opt4" 1) 2 "Inkscape" $(optstate "$opt4" 2) 3 "Pinta" $(optstate "$opt4" 3) 4 "Krita (Dibujo)" $(optstate "$opt4" 4)`;; - 5) opt5=`dialog --stdout --checklist "Fuentes/Tipos de letra" 0 0 6 1 "Fuentes basicas (Noto,devaju,liberation..)" $(optstate "$opt5" 1) 2 "Microsoft Fonts" $(optstate "$opt5" 2) 3 "Recopilatorio de fuentes de Google (mas de 300)" $(optstate "$opt5" 3)`;; - 6) opt6=`dialog --stdout --checklist "Recomendado pulsar todos \nUtilidades basicas" 0 0 6 1 "Evince (Lector PDF)" $(optstate "$opt6" 1) 2 "Ristretto (imagenes jpg,png...)" $(optstate "$opt6" 2) 3 "Cacluladora" $(optstate "$opt6" 3) 4 "Montar ISO/IMG" $(optstate "$opt6" 4) 5 "(Des)compresor de archivos (ZIP,RAR...)" $(optstate "$opt6" 5) 6 "Miniaturas mejoradas de ficheros" $(optstate "$opt6" 6)`;; - 7) opt7=`dialog --stdout --checklist "Soportes (Impresoras,Bluetooth...)" 0 0 6 1 "CUPS (Soporte impresoras)" $(optstate "$opt7" 1) 2 "Drivers comunes impresoras" $(optstate "$opt7" 2) 3 "HPLIP (Soporte impresoras HP)" $(optstate "$opt7" 3) 4 "Bluetooth" $(optstate "$opt7" 4) 5 "Escaner (Programa)" $(optstate "$opt7" 5)`;; - 8) opt8=`dialog --stdout --scrollbar --checklist "Utilidades varias" 0 0 8 1 "Dropbox" $(optstate "$opt8" 1) 2 "MEGA" $(optstate "$opt8" 2) 3 "Visor de correo Evolution" $(optstate "$opt8" 3) 4 "Grabador de discos (k3b)" $(optstate "$opt8" 4) 5 "Java (jre8)" $(optstate "$opt8" 5) 6 "Wine ('Emulador' de programas de Windows)" $(optstate "$opt8" 6) 7 "BleachBit (Limpiador de disco duro)" $(optstate "$opt8" 7)`;; - 9) opt9=`dialog --stdout --scrollbar --checklist "Programacion (IDEs)" 0 0 8 1 "Sublime Text 3" $(optstate "$opt9" 1) 2 "Sublime Text 2" $(optstate "$opt9" 2) 3 "Visual Studio Code" $(optstate "$opt9" 3) 4 "Eclipse" $(optstate "$opt9" 4) 5 "Monodevelop" $(optstate "$opt9" 5) 6 "Brackets" $(optstate "$opt9" 6) 7 "Atom" $(optstate "$opt9" 7) 8 "Gamedevelop" $(optstate "$opt9" 8) 9 "Poedit (gettext)" $(optstate "$opt9" 9) A "Arduino IDE" $(optstate "$opt9" A)`;; - "A") optA=`dialog --stdout --checklist "Programacion (Programas)" 0 0 6 1 "base-devel (standard utils like GCC)" $(optstate "$optA" 1) 2 "Java (OpenJDK 8)" $(optstate "$optA" 2)`;; - "I") - #Instalar - surep=1 - break;; - esac - done - ;; - 2) mostrardialog "Programas predeterminados" "Se instalaran los programas predeterminados";; - 3) mostrardialog "Ningun programa" "No se instalara ningun programa opcional." - nooptprogs="1" # Not install anything - ;; - esac - - if [[ $nooptprogs != "1" ]];then - packages="" #Erase var before - case $opt1 in - *1*) packages="firefox";;& - *2*) packages="$packages google-chrome";;& - *3*) packages="$packages chromium";;& - *4*) packages="$packages opera";;& - *5*) packages="$packages otter-browser";;& - *6*) packages="$packages flashplugin";;& - esac - case $opt2 in - *1*) packages="$packages libreoffice-fresh";;& - *2*) packages="$packages abiword";;& - *3*) packages="$packages gnumeric";;& - *4*) packages="$packages wps-office";;& - *5*) packages="$packages leafpad";;& - *6*) packages="$packages gedit";;& - *7*) packages="$packages notepadqq";;& - esac - case $opt3 in - *1*) packages="$packages vlc qt4";;& - *2*) packages="$packages smplayer";;& - *3*) packages="$packages totem";;& - *4*) packages="$packages clementine";;& - esac - case $opt4 in - *1*) packages="$packages gimp";;& - *2*) packages="$packages inkscape";;& - *3*) packages="$packages pinta";;& - *4*) packages="$packages krita";;& - esac - case $opt5 in - *1*) packages="$packages noto-fonts noto-fonts-cjk noto-fonts-emoji ttf-dejavu ttf-liberation";;& - *2*) packages="$packages ttf-ms-fonts";;& - *3*) packages="$packages ttf-google-fonts-git" - ;;& - esac - case $opt6 in - *1*) packages="$packages evince";;& - *2*) packages="$packages ristretto librsvg";;& - *3*) packages="$packages gnome-calculator";;& - *4*) packages="$packages gnome-disk-utility";;& - *5*) packages="$packages file-roller lrzip p7zip unace unrar";;& - *6*) packages="$packages tumbler poppler-glib ffmpegthumbnailer libgsf";;& - esac - case $opt7 in - *1*) cups=1;;& - *2*) packages="$packages foomatic-db-engine foomatic-db foomatic-db-ppds" - cups=1 - ;;& - *3*) packages="$packages hplip" - cups=1 - ;;& - *4*) packages="$packages bluez bluez-utils bluez-cups bluez-firmware bluez-libs blueberry";;& - *5*) packages="$packages xsane" - cups=1 - ;;& - esac - case $opt8 in - *1*) packages="$packages dropbox";;& - *2*) packages="$packages megasync";;& - *3*) packages="$packages geary";;& - *4*) packages="$packages k3b";;& - *5*) packages="$packages jre8-openjdk";;& - *6*) packages="$packages wine-staging wine_gecko winetricks" - packages="$packages lib32-libpng lib32-libldap lib32-gnutls lib32-mpg123 lib32-libpulse lib32-ncurses lib32-openal lib32-alsa-lib lib32-gst-plugins-base-libs" #Some 32bit libs for winearch 32 work better - inswine=1;;& - *7*) packages="$packages bleachbit";;& - esac - case $opt9 in - *1*) packages="$packages sublime-text-dev";;& - *2*) packages="$packages sublime-text";;& - *3*) packages="$packages visual-studio-code";;& - *4*) packages="$packages jdk8-openjdk eclipse-java";;& - *5*) packages="$packages monodevelop";;& - *6*) packages="$packages brackets";;& - *7*) packages="$packages atom-editor-bin";;& - *8*) packages="$packages gdevelop";;& - *9*) packages="$packages poedit";;& - *A*) packages="$packages arduino";;& - esac - case $optA in - *1*) packages="$packages base-devel";;& - *2*) packages="$packages jdk8-openjdk";;& - esac - allpackages=$allpackages" "$packages - packages="" - #Añadir soporte cups basico si se selecciona cualquier opcion de impresoras - if [[ $cups = "1" ]];then - allpackages=$allpackages" cups cups-filters cups-pk-helper system-config-printer gtk3-print-backends" - fi - fi -} - - -##Function to select environment -function entorno { - clear - optentorno=`dialog --stdout --nocancel --menu "$(T "Select your desktop enviroment")" 0 0 5 1 "LXDE (Muy ligero)" 2 "XFCE (Ligero)" 3 "Cinnamon (Facil para antiguos usuarios de Windows)" 4 "Gnome (Complejo, pero practico)" 5 "MATE (Tradicional)" 6 "Plasma/KDE (Pesado aunque bonito) " 7 "No instalar entorno de escritorio"` - - case $optentorno in - 1) - allpackages=$allpackages" lxappearance lxappearance-obconf lxde-common lxinput lxpanel lxrandr lxsession lxtask lxterminal openbox pcmanfm xfce4-notifyd gtk-engine-aurora faenza-icon-theme" - #Themes: gtk-engine-aurora faenza-icon-theme - ;; - 2) allpackages=$allpackages" xfce4 faenza-icon-theme";; - 3) allpackages=$allpackages" cinnamon";; - 4) - optgnome=`dialog --stdout --nocancel --menu "¿Gnome base o gnome con sus extras?" 0 0 5 1 "Gnome base" 2 "Gnome+extras"` - case $optgnome in - 1) allpackages=$allpackages" gnome";; - 2) allpackages=$allpackages" gnome gnome-extra";; - esac - #In installconf, it has to remove gdm - ;; - 5) - optmate=`dialog --stdout --nocancel --menu "¿MATE base o MATE con sus extras?" 0 0 5 1 "MATE base" 2 "MATE+extras"` - case $optmate in - 1) allpackages=$allpackages" mate gtk-engine-murrine mate-media";; - 2) allpackages=$allpackages" mate mate-extra gtk-engine-murrine";; - esac - ;; - 6) - allpackages=$allpackages" plasma" - #Remove plasma-mediacenter ksshaskpass after, in installconf - ;; - esac - - # Basic programs (Xorg) and audio support if there is selected any - if [[ $optentorno != 7 ]];then - #Gestor de energia xfce4-power-manager - allpackages=$allpackages" xorg-server xorg-xinit xorg-server-common xf86-input-libinput xterm lightdm lightdm-gtk-greeter gvfs gvfs-mtp gvfs-smb gvfs-afc udisks2 networkmanager network-manager-applet gnome-keyring xdialog lxterminal ttf-inconsolata octopi octopi-notifier gksu pulseaudio pavucontrol xdg-user-dirs jkarch-appearance xfce4-power-manager lxtask" - fi -} -# End of functions that are user interactive for configuring system - - - -##Install and configure all of the system, this function is NOT interactive, it works alone -function installconf { - clear - tput setaf 2 ; echo "$(T "Installing system, this can take about 20 minutes, wait")" ; tput setaf 9 - sleep 2 - tput setaf 2 ; echo "$(T "Formatting and mounting partitions")" ; tput setaf 9 - - # Format and mount partitions - execl $formatoraiz /dev/$particionraiz - e2label /dev/$particionraiz "JKArch" - execl mount /dev/$particionraiz /mnt/ - if [[ $particionhome ]];then - execl $formatohome /dev/$particionhome - mkdir -p /mnt/home/ - execl mount /dev/$particionhome /mnt/home/ - fi - if [[ $partefi ]];then - mkdir -p /mnt/boot/efi - execl mount /dev/$partefi /mnt/boot/efi/ - fi - - # Download or install base system. - if [[ $isoffline = "0" ]];then - wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/pacman.conf -O pacman.conf - isanetworkerror # Comprueba si hubo un error de descarga - tput setaf 2 ; echo "$(T "Optimizing download")" ; tput setaf 9 - execl reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist - tput setaf 2 ; echo "$(T "Downloading")" ; tput setaf 9 - # Reflector and rsync is for updating mirrorlist # - execl pacman -Sy archlinux-keyring --noconfirm #Keyring for avoid fail sig of some packages - execl pacstrap -C pacman.conf /mnt/ base jkarch-mirrorlist reflector rsync dosfstools ntfs-3g btrfs-progs exfat-utils #Install base and disk format drivers - pacmanerror - mv pacman.conf /mnt/etc/pacman.conf - fi - if [[ $isoffline = "1" ]];then - tput setaf 2 ; echo "$(T "Installing packages")..." ; tput setaf 9 - execl pacstrap -C pacman-offline.conf /mnt/ base jkarch-mirrorlist rsync dosfstools ntfs-3g btrfs-progs exfat-utils #Install base and disk format drivers - mv pacman-offline.conf /mnt/etc/pacman.conf #Move pacman.conf (offline) to pacman chroot location - fi - - # Create fstab - execl genfstab -U /mnt > /mnt/etc/fstab - # Create or activate swap if neccesary - if [[ $swaptype ]];then - case $swaptype in - 1) - echo "$(T "Creating swap file")" - dd if=/dev/zero of=/mnt/swapfile bs=1M count=$swapamount - chmod 600 /mnt/swapfile - mkswap /mnt/swapfile - echo "/swapfile none swap defaults 0 0" >> /mnt/etc/fstab - ;; - esac - fi - - # Create bind mountpoints for the rest of the install (Chroot) - if [[ $isoffline = "0" ]];then - cp -r /etc/netctl/* /mnt/etc/netctl/ - cp -f /etc/resolv.conf /mnt/etc/resolv.conf - fi - mount --bind /sys /mnt/sys - mount --bind /proc /mnt/proc - mount --bind /dev /mnt/dev - mount --bind /run /mnt/run - # CD bind if is offline - if [[ $isoffline = "1" ]];then - mount --bind /run/archiso/bootmnt/ /mnt/run/archiso/bootmnt/ - fi - # - - # Var allpackages have in this moment all the packages selected by user, and will be the install packages list for pacman # - # Do allpackages var contain base packages and NTP daemon (Hour sync) - allpackages=$allpackages" jka-toolkit git wget netctl iw wpa_supplicant dialog sudo alsa-utils bash-completion ntp" - - # GUI and apps selected in "entorno{}" - - - # Before install, configure mirrorlist if its online - if [[ $isoffline = "0" ]];then - execl chroot reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist - fi - # Here, allpackages have the user selected packages because selected before. Then, install it - execl chroot pacman -Syu $allpackages --noconfirm --needed - - # Language - sed -i "s/\#$langinst/$langinst/g" /mnt/etc/locale.gen - echo "LANG=$opclang" > /mnt/etc/locale.conf - echo "LANGUAGE=$opclang" >> /mnt/etc/locale.conf - echo "LC_COLLATE=$opclang" >> /mnt/etc/locale.conf - echo "KEYMAP=$langabr" > /mnt/etc/vconsole.conf - execl chroot locale-gen - clear - - # Timezone - test -n "$NEW_TIMEZONE" && cp -fp /mnt/usr/share/zoneinfo/"$NEW_TIMEZONE" /mnt/etc/localtime - execl chroot hwclock --systohc --utc - execl chroot systemctl enable ntpd - if [[ $isoffline = 0 ]];then #Only sync if its online - echo "$(T "Syncing hour to internet in background")"; - execl chroot (ntpd -qg && && hwclock -w) &> /dev/null - else - echo "Clock will not be okay until restart and configure manually because you dont have net" - fi - - - # User skel move - if [[ $isoffline = "1" ]];then # Is an offline installation? - tar xJf mods/skel.tar.xz -C /mnt/ - else # Online - wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/skel.tar.xz -O- | tar xJf - -C /mnt/ - fi - - # Themes skel before creating user and remove some progs - if [[ $optentorno = 1 ]];then #LXDE - if [[ $isoffline = "1" ]];then # Is an offline installation? - tar xJf mods/LXDE.tar.xz -C /mnt/ - else #online - wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/LXDE.tar.xz -O- | tar xJf - -C /mnt/ - fi - fi - - if [[ $optentorno = 2 ]];then #XFCE4 - if [[ $isoffline = "1" ]];then # Is an offline installation? - tar xJf mods/XFCE4.tar.xz -C /mnt/ - else #online - wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/XFCE4.tar.xz -O- | tar xJf - -C /mnt/ - fi - fi - - if [[ $optentorno = 4 ]];then #GDM remove in gnome - execl chroot pacman -R gdm --noconfirm - fi - - if [[ $optentorno = 5 ]];then #MATE - if [[ $isoffline = "1" ]];then # Is an offline installation? - tar xJf mods/MATE.tar.xz -C /mnt/ - else #online - wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/MATE.tar.xz -O- | tar xJf - -C /mnt/ - fi - fi - - if [[ $optentorno = 6 ]];then #Plasma, remove 2 apps - execl chroot pacman -R plasma-mediacenter ksshaskpass --noconfirm - fi - - - # Create user - execl chroot useradd -m -G wheel -s /bin/bash $nameuser - echo "${nameuser}:${passuser}" | execl chroot chpasswd - - # Root password - echo "root:${passroot}" | execl chroot chpasswd - # Fix for some strange login bugs - execl chroot chmod 755 / - execl chroot chmod 755 /bin - - # Add sudo support for wheel users like user added - sed -i "s/\# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" /mnt/etc/sudoers - - # User directory (Photos, Desktop..) create - execl chroot xdg-user-dirs-update - # Turn on some services - execl chroot systemctl enable lightdm - execl chroot systemctl enable NetworkManager - execl chroot systemctl enable dhcpcd - - # Enable cupsd service for printing - if [[ $cups = "1" ]];then - execl chroot systemctl enable org.cups.cupsd - fi - - - # Configure wine if neccesary - if [[ $inswine = "1" ]];then - echo "$(T "Configuring wine for better experience") (32 bit winearch)" - execl chuser WINEARCH=win32 wineboot -u - fi - - - # Set X11 keyboard, and user GKSU, if there is any enviroment installed - if [[ $optentorno != "7" ]];then - keyboardlayout - # Modify gksu for ask user password and not root one - execl chuser gconftool-2 --set /apps/gksu/sudo-mode --type=bool true --owner=$(echo $nameuser) - fi - - # Install and configure bootloader GRUB/rEFInd - if [[ -z $partefi ]];then #If it dont have EFI - case $optboot in - 1) - execl chroot pacman -S grub os-prober --noconfirm - #Arranque silencioso - sed -i 's/\GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 vga=current"/g' /mnt/etc/default/grub - echo "Instalando GRUB para BIOS/MBR" - #Se usa la variable ${hd} que se escogió al principio - execl chroot grub-install --target=i386-pc /dev/${hd} - execl chroot grub-mkconfig -o /boot/grub/grub.cfg - ;; - esac - else #With EFI - case $optboot in - 1) - echo "Instalando rEFInd para UEFI" - execl chroot pacman -S efibootmgr dosfstools refind-efi --noconfirm - execl chroot refind-install - rootuuid=$(blkid -o value -s UUID /dev/$(echo $particionraiz)) - echo '"Boot with standard options" "root=UUID='$(echo $rootuuid)' rw add_efi_memmap quiet loglevel=3 vga=current"' > /mnt/boot/refind_linux.conf - echo '"Boot in nomodeset mode" "root=UUID='$(echo $rootuuid)' rw add_efi_memmap quiet loglevel=3 vga=current nomodeset"' >> /mnt/boot/refind_linux.conf - echo '"Boot to single-user mode" "root=UUID='$(echo $rootuuid)' rw add_efi_memmap quiet single"' >> /mnt/boot/refind_linux.conf - echo '"Boot with minimal options" "root=UUID='$(echo $rootuuid)' rw add_efi_memmap"' >> /mnt/boot/refind_linux.conf - ;; - 2) - echo "Instalando GRUB en modo UEFI, puede fallar" - execl chroot pacman -S grub os-prober efibootmgr dosfstools --noconfirm - sed -i 's/\GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 vga=current"/g' /mnt/etc/default/grub - execl chroot grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub_uefi --recheck - execl chroot grub-mkconfig -o /boot/grub/grub.cfg - mostrardialog "GRUB" "GRUB fue instalado. Si no funciona, verificar en la bios que este seleccionado grub_uefi o grub como arranque, y no Windows u otro" - ;; - esac - fi - - # Hostname - echo "JKArch" > /mnt/etc/hostname - - # Linux kernel - execl chroot mkinitcpio -p linux #Hacemos el mkinitcpio después de tener instalados los gráficos - - # Clean pacman - echo "$(T "Cleaning")" - execl chroot rm -rf $sfslocate/var/cache/pacman/pkg/* - execl chroot pacman -Sc --noconfirm -} # Fin installconf - - -### More optional configs ### -function otrasconfig { -mostrardialog "$(T "Other configs")" "Aquí puedes seleccionar otras configuraciones que puedes hacer a Arch antes de terminar la instalacion, como su nombre" -# Loop infinito en otras configuraciones hasta que se pulse la de terminar -for (( ; ; )) -do - othopt=`dialog --stdout --nocancel --menu "$(T "Other configs")" 0 0 8 e "Nada mas / Finalizar instalacion" 1 "Cambiar hostname (Nombre pc)" 2 "Usar otra distribucion de teclado como principal" 3 "Habilitar AUR (con yaourt)"` - if [[ $othopt = "e" ]];then - break - else - case $othopt in - 1) - echo "" - nam=`dialog --stdout --inputbox "Nombre para el ordenador" 9 50` - echo $nam > /mnt/etc/hostname - ;; - 2) - echo "Escoja su idioma para la distribucion del teclado" - options=($(cat /mnt/etc/locale.gen | grep '^#[a-zA-Z]' | cut -c2-30 | cut -f1 -d"_" | sort | uniq)) - select opt in "${options[@]}" - do - case $opt in - *) langabr=$opt;break;; - esac - done - #Cambiar el layout del teclado por el nuevo - keyboardlayout - ;; - 3) execl chroot pacman -S yaourt base-devel --noconfirm --needed;; - esac - fi -done -} - -## Set X11 keyboard -function keyboardlayout { - echo "KEYMAP=$langabr" > /mnt/etc/vconsole.conf - echo "# Read and parsed by systemd-localed. It's probably wise not to edit this file" > /mnt/etc/X11/xorg.conf.d/00-keyboard.conf - echo "# manually too freely." >> /mnt/etc/X11/xorg.conf.d/00-keyboard.conf - echo 'Section "InputClass"' >> /mnt/etc/X11/xorg.conf.d/00-keyboard.conf - echo ' Identifier "system-keyboard"' >> /mnt/etc/X11/xorg.conf.d/00-keyboard.conf - echo ' MatchIsKeyboard "on"' >> /mnt/etc/X11/xorg.conf.d/00-keyboard.conf - echo ' Option "XkbLayout" "'$langabr'"' >> /mnt/etc/X11/xorg.conf.d/00-keyboard.conf - echo 'EndSection' >> /mnt/etc/X11/xorg.conf.d/00-keyboard.conf -} - -function bootselect { - if [[ -z $partefi ]];then - #Si no usa EFI, preguntar por instalar GRUB - optboot=`dialog --stdout --nocancel --menu "¿Instalar bootloader/gestor de arranque?" 0 0 4 1 "Si (GRUB)" 2 "No, no instalar gestor de arranque"` - case $optboot in - 2) - #No hará nada - mostrardialog "Bootloader" "$(T "No new bootloader will be installed")" - ;; - esac - else - #Si usa EFI, preguntar por instalar rEFInd - optboot=`dialog --stdout --nocancel --menu "¿Instalar bootloader/gestor de arranque?" 0 0 4 1 "Si (rEFInd) (Recomendado)" 2 "Si (GRUB) (Suele fallar)" 3 "No, no instalar gestor de arranque"` - case $optboot in - 3) - #No hará nada - mostrardialog "Bootloader" "$(T "No new bootloader will be installed")" - ;; - esac - fi -} - -##End of declaring functions, start of script - -clear -mostrardialog "$(T "JKArch install script")" "$(T "Intro arch install script")" -if [[ $isoffline = "0" ]];then -mostrardialog "JKArch" "El script esta en estado beta y puede haber fallos. En caso de fallo, vuelva a probar en unas horas o con la versión offline.\nTambien podeis mandarnos un correo a contacto@jkanetwork.com y usar el log guardado en /tmp" -else -mostrardialog "JKArch" "El script esta en estado beta y puede haber fallos. En caso de fallo, podeis mandarnos un correo a contacto@jkanetwork.com y usar el log guardado en /tmp" -fi -echo "Desmontando posibles particiones" -umount /mnt/boot/efi/ -umount /mnt/* -umount /mnt/ - -# Start questions, functions for timezone, enviroment, programs... - -particiones -horaidioma -entorno - -#Programas de usuario si hay entorno escogido -if [[ $optentorno != "7" ]];then -graficos -#Variable para poner el teclado bien en x11 -hastosetxkb=1 - -#Aqui va la personalizacion de programas, ya que son graficos. -programasguiuser - -fi - -# Ask for user and password for the new system -userpass - -#GRUB/rEFInd select -bootselect - -clear -# Resumen de los cambios -tput setaf 6 -echo "$(T "Ok, last thing before start installing, summary of changes")" -echo "$(T "Partition scheme before your changes")" -tput setaf 9 -lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL -tput setaf 6 -echo "$(T "Your changes")" -tput setaf 9 -case $formatoraiz in - "mkfs.ext4 -F") - mosfraiz="$(T "ext4 formatted")";; - "mkfs.btrfs -f") - mosfraiz="$(T "btrfs formatted")";; - "mkfs.xfs -f") - mosfraiz="$(T "XFS formatted")";; - "echo No formatear ") - mosfraiz="$(T "not formatted")";; -esac -echo "$(T "Root partition"): $particionraiz , $mosfraiz" -if [[ $particionhome ]];then -case $formatohome in - "mkfs.ext4 -F") - mosfhome="$(T "ext4 formatted")";; - "mkfs.btrfs -f") - mosfhome="$(T "btrfs formatted")";; - "mkfs.xfs -f") - mosfhome="$(T "XFS formatted")";; - "echo No formatear ") - mosfhome="$(T "not formatted")";; -esac -echo "$(T "Home partition"): $particionhome , $mosfhome" -fi -if [[ $partefi ]];then - echo "$(T "EFI partition in") $partefi" -fi - -# Log options -echo "------" >> "/tmp/install.log" -echo "Install partition options" >> "/tmp/install.log" -if [[ $mosfraiz != "$(T "not formatted")" ]];then - echo "Format $mosfraiz the partiton $particionraiz for root" >> "/tmp/install.log" -else - echo "Root partition $particionraiz not formatted" >> "/tmp/install.log" -fi -if [[ $particionhome ]];then - if [[ $mosfhome != "$(T "not formatted")" ]];then - echo "Format $mosfhome the partiton $particionhome for /home" >> "/tmp/install.log" - else - echo "Home partition $particionhome not formatted" >> "/tmp/install.log" - fi -fi -# - - -#Pregunta si instalar o no -tput setaf 1 -echo "¿Estas de acuerdo con los cambios y quieres comenzar la instalacion?" -options=("No, volver a empezar" "Si, instalar" "No, apagar el ordenador") -select opt in "${options[@]}" -do - case $opt in - "No, volver a empezar") - rm /tmp/install.log - exec ./selectlang.sh - break;; - "Si, instalar") break;; - "No, apagar el ordenador") - poweroff - exit - ;; - esac -done -tput setaf 9 - -# Real install -pause - -installconf - -#End install, other user configs (If it wants it) -otrasconfig - -# Unmount and tweak pacman if necessary (If offline) -if [[ $isoffline = "1" ]];then # Is an offline installation? - echo "Configurando pacman para usar servidores web en los siguientes arranques..." - mv pacman.conf /mnt/etc/pacman.conf #Put online pacman.conf -fi - -echo "Sincronizando datos al disco duro, puede tardar unos segundos" -sync - -clear -mostrardialog "$(T "End")" "$(T "Setup finished, press enter to reboot.")" -#Move log -mv /tmp/install.log /mnt/home/$nameuser/install.log - -# Unmounting partitions -umount /mnt/* -umount /mnt -# Reboot, finished -reboot \ No newline at end of file diff --git a/oldarchinstall/downloadinstall.sh b/oldarchinstall/downloadinstall.sh deleted file mode 100755 index a1e0ca1..0000000 --- a/oldarchinstall/downloadinstall.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -opt=`dialog --stdout --nocancel --backtitle "Instalacion de JKArch / JKArch installation" --title "Bienvenido a JKArch / Welcome" --menu "Para poder comenzar la instalacion, se necesita una conexion a internet. / We need an internet conection to start" 0 70 5 1 "Estoy por cable (Ethernet) /I'm using cable" 2 "Wi-Fi" 3 "Configuracion compleja (Ir a la terminal) / Other (Terminal)"` - -if [[ $opt -eq 2 ]];then - wifi-menu -elif [[ $opt -eq 3 ]];then - clear - echo "Te sacamos a la terminal, configure internet, asegurese de que funcione y después escriba exit para continuar" - echo "You will go to the bash terminal, you can configure network, and then write exit" - bash -fi -clear -echo "Vamos a comprobar que tienes conexión a internet" -echo "Testing network conection" -ping 8.8.8.8 -c3 -if [[ $? != 0 ]];then -clear -dialog --title "Conexión / Network " --msgbox "Error en la conexión \nse reiniciará la instalación \n\n Network error. Restarting the install.." 15 60 -exec ./downloadinstall.sh -fi -wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/selectlang.sh -O selectlang.sh -if [ $(cat selectlang.sh | grep "^<\!DOCTYPE html>") == "<\!DOCTYPE html>" ];then - clear - dialog --title "Descarga incorrecta / Corrupted download" --msgbox "La descarga del instalador ha fallado \nse reiniciará la instalación \n\n Download failed. Restarting install.." 15 60 - exec ./downloadinstall.sh -fi -chmod +x selectlang.sh -exec ./selectlang.sh \ No newline at end of file diff --git a/oldarchinstall/pacman-offline.conf b/oldarchinstall/pacman-offline.conf deleted file mode 100644 index 1248f00..0000000 --- a/oldarchinstall/pacman-offline.conf +++ /dev/null @@ -1,63 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -C - -f %u > %o -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#XferCommand = /usr/bin/aria2c --allow-overwrite=true --continue=true --file-allocation=none --log-level=error --max-tries=2 --max-connection-per-server=2 --max-file-not-found=5 --min-split-size=5M --no-conf --remote-time=true --summary-interval=60 --timeout=5 --dir=/ --out %o %u -#CleanMethod = KeepInstalled -#UseDelta = 0.7 -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -#TotalDownload -CheckSpace -#VerbosePkgLists - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all official Arch Linux -# packagers with `pacman-key --populate archlinux`. - -# -# REPOSITORIES -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# -[localjkarch] -SigLevel = Optional TrustAll -Server = file:///run/archiso/bootmnt/repo - diff --git a/oldarchinstall/pacman.conf b/oldarchinstall/pacman.conf deleted file mode 100644 index 1d963c1..0000000 --- a/oldarchinstall/pacman.conf +++ /dev/null @@ -1,75 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -C - -f %u > %o -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#XferCommand = /usr/bin/aria2c --allow-overwrite=true --continue=true --file-allocation=none --log-level=error --max-tries=2 --max-connection-per-server=2 --max-file-not-found=5 --min-split-size=5M --no-conf --remote-time=true --summary-interval=60 --timeout=5 --dir=/ --out %o %u -#CleanMethod = KeepInstalled -#UseDelta = 0.7 -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -#TotalDownload -CheckSpace -#VerbosePkgLists - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all official Arch Linux -# packagers with `pacman-key --populate archlinux`. - -# -# REPOSITORIES -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - -[multilib] -Include = /etc/pacman.d/mirrorlist - -#JKArch Repository -[jkanetwork] -SigLevel = Optional TrustAll -Include = /etc/pacman.d/jkarch-mirrorlist diff --git a/oldarchinstall/selectlang.sh b/oldarchinstall/selectlang.sh deleted file mode 100755 index d379885..0000000 --- a/oldarchinstall/selectlang.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -##This script only selects the installer language and, if its a online install, asks user to use stable or devel installer -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 - #LANG="es_ES.UTF-8" ; export LANG -elif [[ $idiom -eq 2 ]];then - sclang="en" - loadkeys en - #LANG="en_GB.UTF-8" ; export LANG -fi - -if [[ -f translations.sh ]];then #If its a offline install (ISO) - exec ./archinstall.sh $sclang 1 #Offline -else #Online install - #Download and exec - wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/archinstall.sh -O archinstall.sh - - wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/translations.sh -O translations.sh - - if [[ $(cat archinstall.sh | grep "^<\!DOCTYPE html>") == "<\!DOCTYPE html>" || $(cat translations.sh | grep "^<\!DOCTYPE html>") == "<\!DOCTYPE html>" ]];then - clear - dialog --title "Descarga incorrecta / Corrupted download" --msgbox "La descarga del instalador ha fallado \nse reiniciará la instalación \n\n Download failed. Restarting install.." 15 60 - exec ./selectlang.sh - fi - chmod +x archinstall.sh - chmod +x translations.sh - exec ./archinstall.sh $sclang 0 #Online - -fi diff --git a/oldarchinstall/translations.sh b/oldarchinstall/translations.sh deleted file mode 100755 index b639be8..0000000 --- a/oldarchinstall/translations.sh +++ /dev/null @@ -1,357 +0,0 @@ -#!/bin/bash -# Translation function for the script. Loaded by source translations.sh and used by $(T "Text") returing a 'echo "Translated text"' -# For adding a language you have to add "id") echo "Translated to id language" , putting in id your language (pr, en,it, es,...) -# Example: "es") echo "Traduccion de un texto";; -# The * represents "en" language, and is the standard output if it's not translated. ( "*)" == ' "en") ' ) English is the "universal" language. -# If translation of *) is echo "$1" it means trat is equal to the case (as case is writed in abreviated English, but sometimes is the same) - -function T { -case "$1" in - "JKArch install script") - case $sclang in - "es") echo "Script de instalacion de JKArch (BETA)";; - *) echo "$1";; - esac;; - "Intro arch install script") - case $sclang in - "es") echo "Mediante unas preguntas y avanzando, instalaremos arch en su ordenador \nHa sido pensado para ser simple, y guiado por opciones, pero debes estar atento durante el proceso. \nAviso: No debes interrumpir la instalacion por ningun motivo, a no ser que quieras que quede incompleta";; - *) echo "Through simple questions, we will install arch in your computer. \nIts designed to be simple and guied by options, but you need to be careful during the process. \nWarning: You musnt stop the install never, or anything can happen";; - esac;; - "Partition scheme before your changes") - case $sclang in - "es") echo "Esquema de particiones antes de los cambios";; - *) echo "$1";; - esac;; - "Your partition scheme") - case $sclang in - "es") echo "Tu esquema de particiones:";; - *) echo "${1}:";; - esac;; - "Your changes") - case $sclang in - "es") echo "Cambios que has realizado:";; - *) echo "${1}:";; - esac;; - "Press enter to continue...") - case $sclang in - "es") echo "Pulse enter para continuar...";; - *) echo "$1";; - esac;; - "Questions about partitions where system will be installed") - case $sclang in - "es") echo "Preguntas acerca de las unidades donde instalar el sistema";; - *) echo "$1";; - esac;; - "Questions about partitions dialog. Text") - case $sclang in - "es") echo "Esta parte es la mas importante, antes de seguir se mostrarán los discos duros. Si esta vacío o es nuevo, recomendamos formatear en DOS/MBR. Si sabe lo que hace, o ya usaba GPT/UEFI, tendrá que seleccionar la partición EFI, recuerdelo \n (Si lo instala junto a windows 8.1/10 de 64 bits con UEFI activado, entonces usa EFI y tendrás que seleccionar la unidad EFI/ESP que utiliza luego)";; - *) echo "This is the most important part. We will show you your partition scheme. If it's empty, please format it in DOS/MBR type. If you know what are you doing, or if you have formatted in GPT/UEFI, you will have to select EFI/ESP partition later. \n(If you install it alongside with Windows 8.1/10 64 bits with UEFI, you will be to select EFI/ESP partition that windows makes)";; - esac;; - "ERROR: You dont have HDD, insert one, poweroff") - case $sclang in - "es") echo "ERROR: No tienes discos duros, no se puede continuar. Por favor enchufe/inserte un disco duro y reinicie. \n Al pulsar aceptar se reiniciara el sistema";; - *) echo "ERROR: You dont have any HDD/SSD, setup can't continue. Plug-in some HDD/SSD and start again. When you press enter, computer will poweroff.";; - esac;; - "An error has ocurred, setup will be stopped") - case $sclang in - "es") echo "A ocurrido un error, la instalacion se va a detener. Razon: ";; - *) echo "An error has ocurred, setup will be stopped.\nReason: ";; - esac;; - "System configuration") - case $sclang in - "es") echo "Configuración de su sistema";; - *) echo "$1";; - esac;; - "Select hard disk to edit") - case $sclang in - "es") echo "Seleccione el disco duro para editar";; - *) echo "$1";; - esac;; - "Full hard disk install") - case $sclang in - "es") echo "Instalacion en un disco duro completo";; - *) echo "$1";; - esac;; - "Full hard disk install. Text") - case $sclang in - "es") echo "Ahora se le permitira escoger un disco duro para eliminar, y reemplazar por una particion para JKArch sola y sus configuraciones estandar. \nPor favor, no es reversible, asegurese de lo que estas haciendo varias veces.";; - *) echo "Now you have to select a hard disk to delete it and replace by a partition only for JKArch and standard configuration. \nIt's not reversible, please be sure of what are you doing!";; - esac;; - "Select hard disk to delete and use by JKArch") - case $sclang in - "es") echo "Elige el disco duro a borrar y cambiar por una particion Linux simple para JKArch";; - *) echo "$1";; - esac;; - "Select root ('/') partition") - case $sclang in - "es") echo "Elige la particion a usar como sistema raíz ('/')";; - *) echo "$1";; - esac;; - "Select home partition") - case $sclang in - "es") echo "Elige la particion a usar como home (/home)";; - *) echo "Select home (/home) (users) partition";; - esac;; - "Select EFI partition") - case $sclang in - "es") echo "Elige la particion EFI del sistema (Suele ser una particion de 300-500Mb en FAT32 llamada EFI, y suele estar en /dev/sda2)";; - *) echo "Select EFI partition (Normally is a 300-500Mb FAT32/vfat partition called EFI)";; - esac;; - "GPT Partition Table") - case $sclang in - "es") echo "Tabla de particiones en GPT";; - *) echo "$1";; - esac;; - "You are using GPT, you will have to select EFI") - case $sclang in - "es") echo "Estas usando el estilo de particiones GPT, que utiliza UEFI, recuerda que tendras que tener y seleccionar la particion UEFI del sistema.";; - *) echo "You are using GPT, that uses UEFI, you will have to select the EFI partition.";; - esac;; - "Not valid") - case $sclang in - "es") echo "No valido";; - *) echo "$1";; - esac;; - "¿Do you want to edit partitions?¿How?") - case $sclang in - "es") echo "¿Quieres editar las particiones?¿Como?";; - *) echo "$1";; - esac;; - "Ok, last thing before start installing, summary of changes") - case $sclang in - "es") echo "Ok, vamos a comenzar la instalacion, pero antes, un resumen de donde lo va a instalar.";; - *) echo "Ok, last thing before start installing, summary of changes we will do";; - esac;; - "If you agree with that, press enter. If not, turn off the computer") - case $sclang in - "es") echo "Si estas de acuerdo, presione enter, en caso contrario, apague el ordenador a la fuerza y no comenzará la instalación";; - *) echo "If you agree with that, press enter. If not, turn off the computer";; - esac;; - "Root partition") - case $sclang in - "es") echo "Partición raiz (/)";; - *) echo "$1";; - esac;; - "Home partition") - case $sclang in - "es") echo "Partición home (/home)";; - *) echo "$1";; - esac;; - "EFI partition in") - case $sclang in - "es") echo "Tienes una partición EFI en";; - *) echo "$1";; - esac;; - "ext4 formatted") - case $sclang in - "es") echo "formateado en ext4";; - *) echo "$1";; - esac;; - "btrfs formatted") - case $sclang in - "es") echo "formateado en btrfs";; - *) echo "$1";; - esac;; - "XFS formatted") - case $sclang in - "es") echo "formateado en XFS";; - *) echo "$1";; - esac;; - "not formatted") - case $sclang in - "es") echo "sin formatear";; - *) echo "$1";; - esac;; - "Not select") - case $sclang in - "es") echo "No elegir";; - *) echo "$1";; - esac;; - "End") - case $sclang in - "es") echo "Fin";; - *) echo "$1";; - esac;; - "Exit") - case $sclang in - "es") echo "Salir";; - *) echo "$1";; - esac;; - "Password") - case $sclang in - "es") echo "Contraseña";; - *) echo "$1";; - esac;; - "Passwords do not match") - case $sclang in - "es") echo "Las contraseñas no coinciden";; - *) echo "$1";; - esac;; - "Basic setup packages, this can take a minute") - case $sclang in - "es") echo "Paquetes basicos para la instalación, puede tardar un poco";; - *) echo "$1";; - esac;; - "Last tweaks and cleaning") - case $sclang in - "es") echo "Ultimos retoques y limpieza..";; - *) echo "$1";; - esac;; - "Setup finished, press enter to reboot.") - case $sclang in - "es") echo "Instalación finalizada, al pulsar aceptar, se reiniciara el sistema";; - *) echo "$1";; - esac;; - "Network connection error, please check it") - case $sclang in - "es") echo "Error de conexion con internet, compruebe la red";; - *) echo "$1";; - esac;; - "Select language for JKArch") - case $sclang in - "es") echo "Escoja su idioma para JKArch";; - *) echo "$1";; - esac;; - "Wait") - case $sclang in - "es") echo "Espere...";; - *) echo "Wait...";; - esac;; - "Optimizing download") - case $sclang in - "es") echo "Optimizando la descarga...";; - *) echo "${1}...";; - esac;; - "Downloading") - case $sclang in - "es") echo "Descargando";; - *) echo "$1";; - esac;; - "Installing system, this can take about 10 minutes, wait") - case $sclang in - "es") echo "Instalando el sistema, esto puede tardar unos 10 minutos, espere hasta el siguiente aviso";; - *) echo "$1";; - esac;; - "Gparted will be opened. Help text") - case $sclang in - "es") echo "Se abrira Gparted. Con el puedes editar, borrar,añadir y poner a tu gusto graficamente las particiones. \n Recuerda que al menos debe haber una particion ext4 primaria para el sistema. \n (Nota: No monte ninguna particion)";; - *) echo "Gparted will be opened. With it, you can edit, erase, add, and modify partitions. \n Remember that,at least you have to have a root ext4 partition for JKArch.\n(Note: Do not mount any partition)";; - esac;; - "JKArch autodetects swap partitions") - case $sclang in - "es") echo "JKArch detecta automaticamente las particiones swap bien creadas, no debe hacer nada mas";; - *) echo "JKArch autodetects swap partitions, you dont have to do anything";; - esac;; - "Creating swap file") - case $sclang in - "es") echo "Creando archivo swap, espere";; - *) echo "$1";; - esac;; - "Select your desktop enviroment") - case $sclang in - "es") echo "Escoje tu entorno de escritorio";; - *) echo "$1";; - esac;; - "Now select your timezone for adjusting the clock") - case $sclang in - "es") echo "Ahora seleccione su ubicacion/país para ajustar el reloj";; - *) echo "$1";; - esac;; - "Enter how much memory you want to use for swap (MB)") - case $sclang in - "es") echo "Introduzca cuanta memoria quieres usar como swap (en MB)";; - *) echo "$1";; - esac;; - "Formatting and mounting partitions") - case $sclang in - "es") echo "Formateando y montando particiones...";; - *) echo "$1";; - esac;; - "Syncing hour to internet") - case $sclang in - "es") echo "Sincronizando la hora por internet";; - *) echo "$1";; - esac;; - "No new bootloader installed") - case $sclang in - "es") echo "No se ha instalado ningun gestor de arranque nuevo en el sistema";; - *) echo "$1";; - esac;; - "No new bootloader will be installed") - case $sclang in - "es") echo "No se instalara ningun gestor de arranque nuevo en el sistema";; - *) echo "$1";; - esac;; - "Other configs") - case $sclang in - "es") echo "Otras configuraciones";; - *) echo "$1";; - esac;; - "What is your graphics card brand?") - case $sclang in - "es") echo "¿Cual es la marca de tu tarjeta grafica?";; - *) echo "$1";; - esac;; - "Repeat password") - case $sclang in - "es") echo "Repita la contrasena";; - *) echo "$1";; - esac;; - "Password for ") - case $sclang in - "es") echo "Contrasena para ";; - *) echo "$1";; - esac;; - "Installing packages") - case $sclang in - "es") echo "Instalando paquetes";; - *) echo "$1";; - esac;; - "Configuring wine for better experience") - case $sclang in - "es") echo "Configurando wine para una mejor experiencia";; - *) echo "$1";; - esac;; - "Installing desktop and basic programs, please wait") - case $sclang in - "es") echo "Instalando el entorno de escritorio y programas basicos, por favor espere";; - *) echo "$1";; - esac;; - "Your timezone:") - case $sclang in - "es") echo "Tu franja horaria:";; - *) echo "$1";; - esac;; - "No,edit") - case $sclang in - "es") echo "No, editar";; - *) echo "$1";; - esac;; - "Edit") - case $sclang in - "es") echo "Editar";; - *) echo "$1";; - esac;; - "Same as user") - case $sclang in - "es") echo "La misma";; - *) echo "$1";; - esac;; - "It's right") - case $sclang in - "es") echo "Es correcto";; - *) echo "$1";; - esac;; - "You want to edit root (admin) password or set same as user?") - case $sclang in - "es") echo "¿Quieres editar la contraseña para root (administrador) o usar la misma que el usuario?";; - *) echo "$1";; - esac;; - "You have a install log in") - case $sclang in - "es") echo "Se ha dejado un log de la instalacion en";; - *) echo "$1";; - esac;; - *) echo "$1";; -esac -} \ No newline at end of file