mirror of
https://gitlab.com/JKANetwork/JKArch.git
synced 2026-02-15 17:51:33 +01:00
118 lines
3.3 KiB
Bash
Executable File
118 lines
3.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function particiones {
|
|
echo "Preguntas acerca de las unidades donde instalar el sistema:"
|
|
echo "Seleccione el disco duro para editar"
|
|
lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL
|
|
if [[ ! $(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd') ]];then
|
|
echo "ERROR: No tienes discos duros, no se puede continuar"
|
|
exit
|
|
fi
|
|
options=($(lsblk --output KNAME | cut -c1-3 | sort | uniq | sed '1d' | grep 'sd\|hd') "No edit")
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
"No edit") break;;
|
|
*) cfdisk /dev/$opt;break;;
|
|
esac
|
|
done
|
|
lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL
|
|
|
|
echo "Elige la particion a usar como sistema raíz o '/' "
|
|
options=($(lsblk --output KNAME | sed '1d'| grep 'sd\|hd'))
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
*) particionraiz=$opt;break;;
|
|
esac
|
|
done
|
|
|
|
echo "Escoje el formato para la particion"
|
|
|
|
options=("EXT4" "BTRFS" "No formatear")
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
"EXT4")
|
|
formatoraiz="fsck.ext4"
|
|
break
|
|
;;
|
|
"BTRFS")
|
|
formatoraiz="fsck.btrfs"
|
|
break
|
|
;;
|
|
"No formatear")
|
|
#Asi no formateará
|
|
formatoraiz="echo unidad "
|
|
break
|
|
;;
|
|
*) echo invalid option;;
|
|
esac
|
|
done
|
|
|
|
}
|
|
|
|
function install {
|
|
echo "Instalando el sistema, espere.."
|
|
$formatoraiz /dev/$particionraiz
|
|
wget https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/pacman.conf -O /tmp/pacman.conf
|
|
mount /dev/$particionraiz /mnt/
|
|
pacstrap -C /tmp/pacman.conf /mnt/ base jka-toolkit git wget wifi-menu
|
|
wget https://gitlab.com/JKANetwork/JKArch/raw/master/archinstall/chrootinstall.sh -O /mnt/tmp/chrootinstall.sh
|
|
|
|
}
|
|
|
|
function horaidioma {
|
|
#Idioma
|
|
echo "Escoja su idioma. Se irá desde la abreviatura general, a la particular"
|
|
options=($(cat /etc/locale.gen | grep '^#[a-ZA-Z]' | cut -c2-30 | cut -f1 -d"_" | sort | uniq))
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
*) opclang=$opt;break;;
|
|
esac
|
|
done
|
|
clear
|
|
options=($(cat /etc/locale.gen | grep '^#'$opclang | cut -c2-30 | cut -f1 -d" " | sort | uniq))
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
*) opclang=$opt;break;;
|
|
esac
|
|
done
|
|
|
|
echo "Ahora seleccione su ubicación/país para ajustar el reloj"
|
|
NEW_TIMEZONE=$(tzselect)
|
|
test -n "$NEW_TIMEZONE" && cp -fp /usr/share/zoneinfo/"$NEW_TIMEZONE" /etc/localtime
|
|
|
|
}
|
|
function userpass {
|
|
#Aqui hay que añadir los comandos para crear un usuario, aunque esto correrá dentro del chroot y no aqui
|
|
echo "Sin hacer"
|
|
}
|
|
|
|
echo "Script de instalación simple de Arch (BETA)"
|
|
echo "Mediante unas preguntas y avanzando, instalaremos arch"
|
|
echo "Antes de continuar, asegurese que tiene un wifi enchufado, o una conexion por cable"
|
|
echo "Pulse enter para continuar"
|
|
read
|
|
particiones
|
|
echo "Ahora vamos a conectarnos a internet"
|
|
echo "¿Funcionas por Wi-Fi?"
|
|
options=("Si" "No")
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
"Si") wifi-menu;break;;
|
|
*) break;;
|
|
esac
|
|
done
|
|
|
|
echo "Ok, vamos a comenzar la instalacion, pero antes, un resumen de donde lo va a instalar."
|
|
lsblk --output NAME,KNAME,FSTYPE,SIZE,LABEL
|
|
echo "Partición raiz (/): $particionraiz , con formato $formatoraiz"
|
|
echo "Si estas de acuerdo, presione enter, en caso contrario, apague el ordenador a la fuerza"
|
|
read
|
|
instalar
|
|
#Falta mucho
|