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:
@@ -2,6 +2,14 @@
|
||||
## Note: Some text editors in some lines its wrong the "markup color" because much '"'($) things.
|
||||
sclang=$1
|
||||
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
|
||||
trap '' INT
|
||||
#No black screensaver
|
||||
@@ -27,6 +35,11 @@ razon=$1
|
||||
mostrardialog "Error" "$(T "An error has ocurred, setup will be stopped") $razon"
|
||||
exit
|
||||
}
|
||||
function isanetworkerror {
|
||||
if [[ $? != 0 ]];then
|
||||
fatalerror "$(T "Network connection error, please check it")"
|
||||
fi
|
||||
}
|
||||
|
||||
function particiones {
|
||||
clear
|
||||
@@ -274,15 +287,21 @@ if [[ $partefi ]];then
|
||||
mkdir -p /mnt/boot/efi
|
||||
mount /dev/$partefi /mnt/boot/efi/
|
||||
fi
|
||||
|
||||
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/pacman.conf -O /tmp/pacman.conf
|
||||
if [[ $? != 0 ]];then
|
||||
fatalerror "$(T "Network connection error, please check it")"
|
||||
if [[ $isoffline = "0" ]];then
|
||||
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/pacman.conf -O /tmp/pacman.conf
|
||||
isanetworkerror #Comprueba si hubo un error de descarga
|
||||
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
|
||||
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
|
||||
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
|
||||
fi
|
||||
|
||||
|
||||
#Create fstab
|
||||
genfstab -U /mnt >> /mnt/etc/fstab
|
||||
#Create or activate swap if neccesary
|
||||
@@ -299,12 +318,14 @@ if [[ $swaptype ]];then
|
||||
fi
|
||||
|
||||
mkdir -p /mnt/root/inst/
|
||||
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/chrootinstall.sh -O /mnt/root/inst/chrootinstall.sh
|
||||
if [[ $? != 0 ]];then
|
||||
fatalerror "$(T "Network connection error, please check it")"
|
||||
if [[ $isoffline = 0 ]];then
|
||||
wget -nv https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/chrootinstall.sh -O /mnt/root/inst/chrootinstall.sh
|
||||
isanetworkerror
|
||||
cp -r /etc/netctl/* /mnt/etc/netctl/
|
||||
else # Its offline
|
||||
mv /root/chrootinstall.sh /mnt/root/inst/chrootinstall.sh
|
||||
fi
|
||||
chmod +x /mnt/root/inst/chrootinstall.sh
|
||||
cp -r /etc/netctl/* /mnt/etc/netctl/
|
||||
cp /root/translations.sh /mnt/root/inst/translations.sh
|
||||
arch-chroot /mnt /bin/bash -c "./root/inst/chrootinstall.sh $sclang $particionraiz $partefi"
|
||||
}
|
||||
|
||||
@@ -8,6 +8,13 @@ partefi=$3
|
||||
sclang=$1
|
||||
source translations.sh
|
||||
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
|
||||
trap '' INT
|
||||
|
||||
@@ -461,3 +468,10 @@ systemctl enable dhcpcd
|
||||
pacman -Sc --noconfirm
|
||||
echo "Sincronizando datos al disco duro, puede tardar unos segundos"
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -297,6 +297,11 @@ case "$1" in
|
||||
"es") echo "Contraseña para ";;
|
||||
*) echo "$1";;
|
||||
esac;;
|
||||
"Installing packages")
|
||||
case $sclang in
|
||||
"es") echo "Instalando paquetes";;
|
||||
*) echo "$1";;
|
||||
esac;;
|
||||
*) echo "$1";;
|
||||
esac
|
||||
}
|
||||
Reference in New Issue
Block a user