From 90b276a577115a10ef417f978e33afa700e5ae04 Mon Sep 17 00:00:00 2001 From: kprkpr Date: Thu, 22 Sep 2016 23:08:58 +0200 Subject: [PATCH] Offline try --- archinstall/archinstall.sh | 5 ++-- archinstall/chrootinstall.sh | 46 ++++++++++++++++----------------- archinstall/pacman-offline.conf | 2 +- archinstall/selectlang.sh | 18 +++++++------ 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/archinstall/archinstall.sh b/archinstall/archinstall.sh index f919cea..ad81b1a 100755 --- a/archinstall/archinstall.sh +++ b/archinstall/archinstall.sh @@ -295,8 +295,8 @@ if [[ $isoffline = "0" ]];then fi if [[ $isoffline = "1" ]];then tput setaf 2 ; echo "$(T "Installing packages")..." ; tput setaf 9 - pacstrap -C /root/pacmanoffline.conf /mnt/ base btrfs-progs jkarch-mirrorlist - mv /root/pacman.conf /mnt/etc/pacman.conf.post #Move pacman.conf to a chroot location + pacstrap -C /root/offlinefiles/pacman-offline.conf /mnt/ base btrfs-progs jkarch-mirrorlist + mv pacman.conf /mnt/etc/pacman.conf.post #Move pacman.conf to a chroot location fi @@ -322,6 +322,7 @@ if [[ $isoffline = 0 ]];then cp -r /etc/netctl/* /mnt/etc/netctl/ else # Its offline mv /root/chrootinstall.sh /mnt/root/inst/chrootinstall.sh + ln -s /run/archiso/offlinefiles/ offlinefiles/ #Crear link para resto de la instalacion fi chmod +x /mnt/root/inst/chrootinstall.sh cp /root/translations.sh /mnt/root/inst/translations.sh diff --git a/archinstall/chrootinstall.sh b/archinstall/chrootinstall.sh index fd757c8..25b25be 100755 --- a/archinstall/chrootinstall.sh +++ b/archinstall/chrootinstall.sh @@ -97,8 +97,12 @@ hwclock -w function userpass { -wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/skel.tar.gz -O /root/inst/skel.tar.gz -tar -zxf /root/inst/skel.tar.gz -C / +if [[ -f /mnt/etc/pacman.conf.post ]];then # Is an offline installation? +tar xJf /run/archiso/offlinefiles/mods/skel.tar.gz -C / +else #online +wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/skel.tar.gz -O- | tar xJf - -C / +fi + clear #Aqui hay que añadir los comandos para crear un usuario, aunque esto correrá dentro del chroot y no aqui nameuser=`dialog --stdout --inputbox "Ahora crearemos tu usuario \nNombre para tu usuario:" 10 50` @@ -123,30 +127,16 @@ fi } 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)"` +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) - pacman -S xf86-video-nouveau xf86-video-nv libva-vdpau-driver mesa-vdpau --noconfirm - ;; - 2) - pacman -S xf86-video-ati xf86-video-amdgpu libva-mesa-driver libva-vdpau-driver mesa-vdpau --noconfirm - ;; - 3) - pacman -S xf86-video-intel libva-intel-driver libvdpau-va-gl --noconfirm - ;; - 4) - pacman -S xf86-video-openchrome --noconfirm - ;; - 5) - pacman -S virtualbox-guest-utils virtualbox-guest-modules-arch --noconfirm - ;; - 6) - pacman -S xf86-video-vmware xf86-input-vmmouse --noconfirm - ;; - 7) - pacman -S $(pacman -Ssq xf86-video-*) --noconfirm - ;; + 1) pacman -S xf86-video-nouveau xf86-video-nv libva-vdpau-driver mesa-vdpau --noconfirm;; + 2) pacman -S xf86-video-ati xf86-video-amdgpu libva-mesa-driver libva-vdpau-driver mesa-vdpau --noconfirm;; + 3) pacman -S xf86-video-intel libva-intel-driver libvdpau-va-gl --noconfirm;; + 4) pacman -S xf86-video-openchrome --noconfirm;; + 5) pacman -S virtualbox-guest-utils virtualbox-guest-modules-arch --noconfirm;; + 6) pacman -S xf86-video-vmware xf86-input-vmmouse --noconfirm;; + 7) pacman -S $(pacman -Ssq xf86-video-*) --noconfirm;; esac #Instalar siempre la estandar, por se acaso pacman -S xf86-video-vesa mesa-libgl --noconfirm @@ -303,13 +293,21 @@ case $optentorno in baseconX pacman -S lxappearance lxappearance-obconf lxde-common lxinput lxpanel lxrandr lxsession lxtask lxterminal openbox pcmanfm xfce4-notifyd --noconfirm pacman -S gtk-engine-aurora faenza-icon-theme --noconfirm + if [[ -f /mnt/etc/pacman.conf.post ]];then # Is an offline installation? + tar xJf /run/archiso/offlinefiles/mods/LXDE.tar.xz -C / + else #online wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/LXDE.tar.xz -O- | tar xJf - -C / + fi ;; 2) baseconX pacman -S xfce4 --noconfirm pacman -S faenza-icon-theme --noconfirm + if [[ -f /mnt/etc/pacman.conf.post ]];then # Is an offline installation? + tar xJf /run/archiso/offlinefiles/mods/XFCE4.tar.xz -C / + else #online wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/mods/XFCE4.tar.xz -O- | tar xJf - -C / + fi ;; 3) baseconX diff --git a/archinstall/pacman-offline.conf b/archinstall/pacman-offline.conf index 72c829c..0c2df97 100644 --- a/archinstall/pacman-offline.conf +++ b/archinstall/pacman-offline.conf @@ -58,5 +58,5 @@ LocalFileSigLevel = Optional # uncommented to enable the repo. # [localjkarch] -/run/archiso/bootmnt +Include = /run/archiso/bootmnt diff --git a/archinstall/selectlang.sh b/archinstall/selectlang.sh index f062eb5..3709731 100755 --- a/archinstall/selectlang.sh +++ b/archinstall/selectlang.sh @@ -12,14 +12,16 @@ elif [[ $idiom -eq 2 ]];then #LANG="en_GB.UTF-8" ; export LANG fi -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 [[ ! -f translations.sh ]] #Is an online install + 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 + 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 fi -chmod +x archinstall.sh -chmod +x translations.sh exec ./archinstall.sh $sclang \ No newline at end of file