1
0
mirror of https://gitlab.com/JKANetwork/JKArch.git synced 2026-02-21 12:33:44 +01:00

creating offline installation posible 1/3

This commit is contained in:
kprkpr
2016-09-21 22:56:47 +02:00
parent e08559b943
commit 5ccbca3765
3 changed files with 52 additions and 12 deletions

View File

@@ -2,6 +2,14 @@
## Note: Some text editors in some lines its wrong the "markup color" because much '"'($) things. ## Note: Some text editors in some lines its wrong the "markup color" because much '"'($) things.
sclang=$1 sclang=$1
source translations.sh source translations.sh
##Offline var
isoffline=0
if [[ ! -z "$2" ]];then
isoffline="$2" #If its offline will be 1
fi
#Try to disable ctrl+C #Try to disable ctrl+C
trap '' INT trap '' INT
#No black screensaver #No black screensaver
@@ -27,6 +35,11 @@ razon=$1
mostrardialog "Error" "$(T "An error has ocurred, setup will be stopped") $razon" mostrardialog "Error" "$(T "An error has ocurred, setup will be stopped") $razon"
exit exit
} }
function isanetworkerror {
if [[ $? != 0 ]];then
fatalerror "$(T "Network connection error, please check it")"
fi
}
function particiones { function particiones {
clear clear
@@ -274,15 +287,21 @@ if [[ $partefi ]];then
mkdir -p /mnt/boot/efi mkdir -p /mnt/boot/efi
mount /dev/$partefi /mnt/boot/efi/ mount /dev/$partefi /mnt/boot/efi/
fi fi
if [[ $isoffline = "0" ]];then
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/pacman.conf -O /tmp/pacman.conf wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/pacman.conf -O /tmp/pacman.conf
if [[ $? != 0 ]];then isanetworkerror #Comprueba si hubo un error de descarga
fatalerror "$(T "Network connection error, please check it")" tput setaf 2 ; echo "$(T "Optimizing download")" ; tput setaf 9
reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist
tput setaf 2 ; echo "$(T "Downloading")" ; tput setaf 9
pacstrap -C /tmp/pacman.conf /mnt/ base btrfs-progs jkarch-mirrorlist
fi fi
tput setaf 2 ; echo "$(T "Optimizing download")" ; tput setaf 9 if [[ $isoffline = "1" ]];then
reflector --verbose -l 6 --sort rate --save /etc/pacman.d/mirrorlist tput setaf 2 ; echo "$(T "Installing packages")..." ; tput setaf 9
tput setaf 2 ; echo "$(T "Downloading")" ; tput setaf 9 pacstrap -C /root/pacmanoffline.conf /mnt/ base btrfs-progs jkarch-mirrorlist
pacstrap -C /tmp/pacman.conf /mnt/ base btrfs-progs jkarch-mirrorlist mv /root/pacman.conf /mnt/etc/pacman.conf.post #Move pacman.conf to a chroot location
fi
#Create fstab #Create fstab
genfstab -U /mnt >> /mnt/etc/fstab genfstab -U /mnt >> /mnt/etc/fstab
#Create or activate swap if neccesary #Create or activate swap if neccesary
@@ -299,12 +318,14 @@ if [[ $swaptype ]];then
fi fi
mkdir -p /mnt/root/inst/ mkdir -p /mnt/root/inst/
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/chrootinstall.sh -O /mnt/root/inst/chrootinstall.sh if [[ $isoffline = 0 ]];then
if [[ $? != 0 ]];then wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/chrootinstall.sh -O /mnt/root/inst/chrootinstall.sh
fatalerror "$(T "Network connection error, please check it")" isanetworkerror
cp -r /etc/netctl/* /mnt/etc/netctl/
else # Its offline
mv /root/chrootinstall.sh /mnt/root/inst/chrootinstall.sh
fi fi
chmod +x /mnt/root/inst/chrootinstall.sh chmod +x /mnt/root/inst/chrootinstall.sh
cp -r /etc/netctl/* /mnt/etc/netctl/
cp /root/translations.sh /mnt/root/inst/translations.sh cp /root/translations.sh /mnt/root/inst/translations.sh
arch-chroot /mnt /bin/bash -c "./root/inst/chrootinstall.sh $sclang $particionraiz $partefi" arch-chroot /mnt /bin/bash -c "./root/inst/chrootinstall.sh $sclang $particionraiz $partefi"
} }

View File

@@ -8,6 +8,13 @@ partefi=$3
sclang=$1 sclang=$1
source translations.sh source translations.sh
argpart=$(echo $particionraiz | cut -c1-3) argpart=$(echo $particionraiz | cut -c1-3)
if [[ -f /mnt/etc/pacman.conf.post ]];then # Is an offline installation?
isoffline=1
else
isoffline=0
fi
#Try to disable ctrl+C #Try to disable ctrl+C
trap '' INT trap '' INT
@@ -461,3 +468,10 @@ systemctl enable dhcpcd
pacman -Sc --noconfirm pacman -Sc --noconfirm
echo "Sincronizando datos al disco duro, puede tardar unos segundos" echo "Sincronizando datos al disco duro, puede tardar unos segundos"
sync sync
if [[ -f /mnt/etc/pacman.conf.post ]];then # Is an offline installation?
echo "Configurando pacman para usar servidores web en los siguientes arranques..."
mv -f /mnt/etc/pacman.conf.post /mnt/etc/pacman.conf
fi

View File

@@ -297,6 +297,11 @@ case "$1" in
"es") echo "Contraseña para ";; "es") echo "Contraseña para ";;
*) echo "$1";; *) echo "$1";;
esac;; esac;;
"Installing packages")
case $sclang in
"es") echo "Instalando paquetes";;
*) echo "$1";;
esac;;
*) echo "$1";; *) echo "$1";;
esac esac
} }