obos-fi/archfi

1869 lines
53 KiB
Text
Raw Normal View History

2015-07-18 18:12:26 -06:00
#!/bin/bash
# Arch Linux Fast Install (archfi)
# --------------------------------
2015-08-20 11:14:17 -06:00
# author : MatMoul
# https://github.com/MatMoul
# http://sourceforge.net/u/matmoul
2015-07-21 13:45:16 -06:00
# project : https://github.com/MatMoul/archfi
2015-08-20 11:14:17 -06:00
# http://sourceforge.net/projects/archfi/
2015-07-21 13:45:16 -06:00
# license : LGPL-3.0 (http://opensource.org/licenses/lgpl-3.0.html)
2015-07-18 18:12:26 -06:00
#
# referance : https://wiki.archlinux.org/index.php/Installation_guide
2019-07-03 14:43:03 -06:00
apptitle="Arch Linux Fast Install (archfi) - Version: 2019.07.03.22.42.52 (GPLv3)"
2015-07-18 18:12:26 -06:00
baseurl=https://raw.githubusercontent.com/MatMoul/archfi/master
2018-12-25 18:11:56 -07:00
skipfont="0"
2015-07-18 18:12:26 -06:00
# --------------------------------------------------------
mainmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2015-07-18 18:12:26 -06:00
nextitem="."
else
2019-06-07 17:40:45 -06:00
nextitem=${1}
2015-07-18 18:12:26 -06:00
fi
options=()
2019-06-07 17:40:45 -06:00
options+=("${txtlanguage}" "Language")
options+=("${txtsetkeymap}" "(loadkeys ...)")
options+=("${txteditor}" "(${txtoptional})")
options+=("${txtdiskpartmenu}" "")
options+=("${txtselectpartsmenu}" "")
2015-07-18 18:12:26 -06:00
options+=("" "")
2019-06-07 17:40:45 -06:00
options+=("${txtreboot}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtmainmenu}" --menu "" --cancel-button "${txtexit}" --default-item "${nextitem}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
"${txtlanguage}")
2015-07-18 18:12:26 -06:00
chooselanguage
2019-06-07 17:40:45 -06:00
nextitem="${txtsetkeymap}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtsetkeymap}")
2015-07-18 18:12:26 -06:00
setkeymap
2019-06-07 17:40:45 -06:00
nextitem="${txtdiskpartmenu}"
2015-11-01 10:23:32 -07:00
;;
2019-06-07 17:40:45 -06:00
"${txteditor}")
2015-11-01 10:23:32 -07:00
chooseeditor
2019-06-07 17:40:45 -06:00
nextitem="${txtdiskpartmenu}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtdiskpartmenu}")
2015-07-18 18:12:26 -06:00
diskpartmenu
2019-06-07 17:40:45 -06:00
nextitem="${txtselectpartsmenu}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtselectpartsmenu}")
2015-07-18 18:12:26 -06:00
selectparts
2019-06-07 17:40:45 -06:00
nextitem="${txtreboot}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txthelp}")
2015-07-18 18:12:26 -06:00
help
2019-06-07 17:40:45 -06:00
nextitem="${txtreboot}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtchangelog}")
2015-07-18 18:12:26 -06:00
showchangelog
2019-06-07 17:40:45 -06:00
nextitem="${txtreboot}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtreboot}")
2015-07-18 18:12:26 -06:00
rebootpc
2019-06-07 17:40:45 -06:00
nextitem="${txtreboot}"
2015-07-18 18:12:26 -06:00
;;
esac
2019-06-07 17:40:45 -06:00
mainmenu "${nextitem}"
2015-07-18 18:12:26 -06:00
else
clear
fi
}
chooselanguage(){
options=()
options+=("Brazilian" "(By MaxWilliamJF)")
2018-10-04 14:15:38 -06:00
options+=("Dutch" "(By bowero)")
2015-07-18 18:12:26 -06:00
options+=("English" "(By MatMoul)")
options+=("French" "(By MatMoul)")
2016-01-01 08:23:41 -07:00
options+=("German" "(By untergrundbiber)")
2017-11-11 13:33:35 -07:00
options+=("Italian" "(By thegoldgoat)")
2016-02-24 16:05:13 -07:00
options+=("Hungarian" "(By KardiWeb)")
2016-03-29 15:00:46 -06:00
options+=("Polish" "(By dawidd6)")
options+=("Portuguese" "(By hugok)")
2016-03-03 13:26:59 -07:00
options+=("Russian" "(By Anonymous_Prodject)")
2016-03-27 13:30:50 -06:00
options+=("Spanish" "(By Mystogab)")
2016-04-09 10:00:36 -06:00
options+=("Turkish" "(By c0b41)")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtlanguage}" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
clear
2019-06-07 17:40:45 -06:00
if [ "${sel}" = "English" ]; then
2015-07-18 18:12:26 -06:00
loadstrings
else
2019-06-07 17:40:45 -06:00
eval $(curl -L ${baseurl}/lng/${sel} | sed '/^#/ d')
2015-07-18 18:12:26 -06:00
fi
2019-06-07 17:40:45 -06:00
if [ "${skipfont}" = "0" ]; then
eval $(setfont ${font})
2018-12-25 18:11:56 -07:00
fi
2016-03-05 14:59:38 -07:00
font=
2019-06-07 17:40:45 -06:00
if [ "$(cat /etc/locale.gen | grep ""#${locale}"")" != "" ]; then
sed -i "/${locale}/s/^#//g" /etc/locale.gen
2016-03-12 09:52:25 -07:00
locale-gen
fi
2019-06-07 17:40:45 -06:00
export LANG=${locale}
2015-07-18 18:12:26 -06:00
fi
}
setkeymap(){
2015-10-02 09:04:03 -06:00
#items=$(localectl list-keymaps)
#options=()
2019-06-07 17:40:45 -06:00
#for item in ${items}; do
# options+=("${item}" "")
2015-10-02 09:04:03 -06:00
#done
2015-10-02 10:10:11 -06:00
items=$(find /usr/share/kbd/keymaps/ -type f -printf "%f\n" | sort -V)
2015-07-18 18:12:26 -06:00
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
2015-10-02 10:10:11 -06:00
options+=("${item%%.*}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
keymap=$(whiptail --backtitle "${apptitle}" --title "${txtsetkeymap}" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
clear
2019-06-07 17:40:45 -06:00
echo "loadkeys ${keymap}"
loadkeys ${keymap}
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
fi
}
2015-11-01 10:21:57 -07:00
chooseeditor(){
options=()
options+=("nano" "")
options+=("vim" "")
options+=("vi" "")
options+=("edit" "")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txteditor}" --menu "" 0 0 0 \
2015-11-01 10:21:57 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2016-05-14 08:08:39 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "export EDITOR=${sel}"
export EDITOR=${sel}
EDITOR=${sel}
2016-05-14 08:06:23 -06:00
pressanykey
2015-11-01 10:21:57 -07:00
fi
}
2015-07-18 18:12:26 -06:00
rebootpc(){
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtreboot}" --yesno "${txtreboot} ?" --defaultno 0 0) then
2015-07-18 18:12:26 -06:00
clear
reboot
fi
}
# --------------------------------------------------------
# --------------------------------------------------------
diskpartmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2015-07-18 18:12:26 -06:00
nextitem="."
else
2019-06-07 17:40:45 -06:00
nextitem=${1}
2015-07-18 18:12:26 -06:00
fi
options=()
2019-06-07 17:40:45 -06:00
if [ "${eficomputer}" == "0" ]; then
options+=("${txtautoparts} (gpt)" "")
options+=("${txtautoparts} (dos)" "")
2015-07-18 18:12:26 -06:00
else
2019-06-07 17:40:45 -06:00
options+=("${txtautoparts} (gpt,efi)" "")
options+=("${txtautoparts} (gpt)" "")
options+=("${txtautoparts} (dos)" "")
options+=("${txtautoparts} (gpt,bios+efi,noswap)" "")
fi
options+=("${txteditparts} (cfdisk)" "")
options+=("${txteditparts} (cgdisk)" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtdiskpartmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
"${txtautoparts} (dos)")
2015-07-18 18:12:26 -06:00
diskpartautodos
2019-06-07 17:40:45 -06:00
nextitem="${txtautoparts} (dos)"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtautoparts} (gpt)")
2015-07-18 18:12:26 -06:00
diskpartautogpt
2019-06-07 17:40:45 -06:00
nextitem="${txtautoparts} (gpt)"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtautoparts} (gpt,efi)")
2015-07-18 18:12:26 -06:00
diskpartautoefi
2019-06-07 17:40:45 -06:00
nextitem="${txtautoparts} (gpt,efi)"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtautoparts} (gpt,bios+efi,noswap)")
2015-07-18 18:12:26 -06:00
diskpartautoefiusb
2019-06-07 17:40:45 -06:00
nextitem="${txtautoparts} (gpt,bios+efi,noswap)"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txteditparts} (cfdisk)")
2015-07-18 18:12:26 -06:00
diskpartcfdisk
2019-06-07 17:40:45 -06:00
nextitem="${txteditparts} (cfdisk)"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txteditparts} (cgdisk)")
2015-07-18 18:12:26 -06:00
diskpartcgdisk
2019-06-07 17:40:45 -06:00
nextitem="${txteditparts} (cgdisk)"
2015-07-18 18:12:26 -06:00
;;
esac
2019-06-07 17:40:45 -06:00
diskpartmenu "${nextitem}"
2015-07-18 18:12:26 -06:00
fi
}
diskpartautodos(){
items=$(lsblk -d -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (dos)" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (dos)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then
2015-07-18 18:12:26 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "${txtautopartclear}"
parted ${device} mklabel msdos
2015-07-18 18:12:26 -06:00
sleep 1
echo "${txtautopartcreate//%1/boot}"
2019-06-07 17:40:45 -06:00
echo -e "n\np\n\n\n+512M\na\nw" | fdisk ${device}
2015-07-18 18:12:26 -06:00
sleep 1
echo "${txtautopartcreate//%1/swap}"
swapsize=$(cat /proc/meminfo | grep MemTotal | awk '{ print $2 }')
2019-06-07 17:40:45 -06:00
swapsize=$((${swapsize}/1000))"M"
echo -e "n\np\n\n\n+${swapsize}\nt\n\n82\nw" | fdisk ${device}
2015-07-18 18:12:26 -06:00
sleep 1
echo "${txtautopartcreate//%1/root}"
2019-06-07 17:40:45 -06:00
echo -e "n\np\n\n\n\nw" | fdisk ${device}
2015-07-18 18:12:26 -06:00
sleep 1
echo ""
pressanykey
2019-01-10 13:48:25 -07:00
if [ "${device::8}" == "/dev/nvm" ]; then
2019-06-07 17:40:45 -06:00
bootdev=${device}"p1"
swapdev=${device}"p2"
rootdev=${device}"p3"
2019-01-10 13:48:25 -07:00
else
2019-06-07 17:40:45 -06:00
bootdev=${device}"1"
swapdev=${device}"2"
rootdev=${device}"3"
2019-01-10 13:48:25 -07:00
fi
2015-07-18 18:12:26 -06:00
efimode="0"
fi
fi
}
diskpartautogpt(){
items=$(lsblk -d -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt)" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then
2015-07-18 18:12:26 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "${txtautopartclear}"
parted ${device} mklabel gpt
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/BIOS boot}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=1:0:+31M -t=1:ef02
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/boot}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=2:0:+512M
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/swap}"
swapsize=$(cat /proc/meminfo | grep MemTotal | awk '{ print $2 }')
2019-06-07 17:40:45 -06:00
swapsize=$((${swapsize}/1000))"M"
sgdisk ${device} -n=3:0:+${swapsize} -t=3:8200
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/root}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=4:0:0
2015-07-18 18:12:26 -06:00
echo ""
pressanykey
2019-01-10 13:48:25 -07:00
if [ "${device::8}" == "/dev/nvm" ]; then
2019-06-07 17:40:45 -06:00
bootdev=${device}"p2"
swapdev=${device}"p3"
rootdev=${device}"p4"
2019-01-10 13:48:25 -07:00
else
2019-06-07 17:40:45 -06:00
bootdev=${device}"2"
swapdev=${device}"3"
rootdev=${device}"4"
2019-01-10 13:48:25 -07:00
fi
2015-07-18 18:12:26 -06:00
efimode="0"
fi
fi
}
diskpartautoefi(){
items=$(lsblk -d -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then
2015-07-18 18:12:26 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "${txtautopartclear}"
parted ${device} mklabel gpt
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/EFI boot}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=1:0:+1024M -t=1:ef00
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/swap}"
swapsize=$(cat /proc/meminfo | grep MemTotal | awk '{ print $2 }')
2019-06-07 17:40:45 -06:00
swapsize=$((${swapsize}/1000))"M"
sgdisk ${device} -n=3:0:+${swapsize} -t=3:8200
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/root}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=4:0:0
2015-07-18 18:12:26 -06:00
echo ""
pressanykey
2019-01-10 13:48:25 -07:00
if [ "${device::8}" == "/dev/nvm" ]; then
2019-06-07 17:40:45 -06:00
bootdev=${device}"p1"
swapdev=${device}"p3"
rootdev=${device}"p4"
2019-01-10 13:48:25 -07:00
else
2019-06-07 17:40:45 -06:00
bootdev=${device}"1"
swapdev=${device}"3"
rootdev=${device}"4"
2019-01-10 13:48:25 -07:00
fi
2015-07-18 18:12:26 -06:00
efimode="1"
fi
fi
}
diskpartautoefiusb(){
items=$(lsblk -d -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
device=$(whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtautoparts} (gpt,efi)" --yesno "${txtautopartsconfirm//%1/${device}}" --defaultno 0 0) then
2015-07-18 18:12:26 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "${txtautopartclear}"
parted ${device} mklabel gpt
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/EFI boot}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=1:0:+1024M -t=1:ef00
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/BIOS boot}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=3:0:+31M -t=3:ef02
2015-07-18 18:12:26 -06:00
echo "${txtautopartcreate//%1/root}"
2019-06-07 17:40:45 -06:00
sgdisk ${device} -n=4:0:0
echo "${txthybridpartcreate}"
echo -e "r\nh\n3\nN\n\nY\nN\nw\nY\n" | gdisk ${device}
2015-07-18 18:12:26 -06:00
echo ""
pressanykey
2019-01-10 13:48:25 -07:00
if [ "${device::8}" == "/dev/nvm" ]; then
2019-06-07 17:40:45 -06:00
bootdev=${device}"p1"
2019-01-10 13:48:25 -07:00
swapdev=
2019-06-07 17:40:45 -06:00
rootdev=${device}"p4"
2019-01-10 13:48:25 -07:00
else
2019-06-07 17:40:45 -06:00
bootdev=${device}"1"
2019-01-10 13:48:25 -07:00
swapdev=
2019-06-07 17:40:45 -06:00
rootdev=${device}"4"
2019-01-10 13:48:25 -07:00
fi
2015-07-18 18:12:26 -06:00
efimode="2"
fi
fi
}
diskpartcfdisk(){
items=$(lsblk -d -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
device=$(whiptail --backtitle "${apptitle}" --title "${txteditparts} (cfdisk)" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
clear
2019-06-07 17:40:45 -06:00
cfdisk ${device}
2015-07-18 18:12:26 -06:00
fi
}
diskpartcgdisk(){
items=$(lsblk -d -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
device=$(whiptail --backtitle "${apptitle}" --title "${txteditparts} (cfdisk)" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
clear
2019-06-07 17:40:45 -06:00
cgdisk ${device}
2015-07-18 18:12:26 -06:00
fi
}
# --------------------------------------------------------
# --------------------------------------------------------
selectparts(){
items=$(lsblk -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
bootdev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/boot}" --default-item "${bootdev}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"none" "-" \
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
else
2019-06-07 17:40:45 -06:00
if [ "${bootdev}" = "none" ]; then
2015-07-18 18:12:26 -06:00
bootdev=
fi
fi
2019-06-07 17:40:45 -06:00
swapdev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/swap}" --default-item "${swapdev}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"none" "-" \
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
else
2019-06-07 17:40:45 -06:00
if [ "${swapdev}" = "none" ]; then
2015-07-18 18:12:26 -06:00
swapdev=
fi
fi
2019-06-07 17:40:45 -06:00
rootdev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/root}" --default-item "${rootdev}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
fi
2019-06-07 17:40:45 -06:00
realrootdev=${rootdev}
2015-07-18 18:12:26 -06:00
2019-06-07 17:40:45 -06:00
homedev=$(whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --menu "${txtselectdevice//%1/home}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"none" "-" \
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
else
2019-06-07 17:40:45 -06:00
if [ "${homedev}" = "none" ]; then
2015-07-18 18:12:26 -06:00
homedev=
fi
fi
2019-06-07 17:40:45 -06:00
msg="${txtselecteddevices}\n\n"
msg=${msg}"boot : "${bootdev}"\n"
msg=${msg}"swap : "${swapdev}"\n"
msg=${msg}"root : "${rootdev}"\n"
msg=${msg}"home : "${homedev}"\n\n"
if (whiptail --backtitle "${apptitle}" --title "${txtselectpartsmenu}" --yesno "${msg}" 0 0) then
isnvme=0
if [ "${bootdev::8}" == "/dev/nvm" ]; then
isnvme=1
fi
if [ "${rootdev::8}" == "/dev/nvm" ]; then
isnvme=1
fi
2015-07-18 18:12:26 -06:00
mountmenu
fi
}
# --------------------------------------------------------
# --------------------------------------------------------
mountmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2015-07-18 18:12:26 -06:00
nextitem="."
else
2019-06-07 17:40:45 -06:00
nextitem=${1}
2015-07-18 18:12:26 -06:00
fi
options=()
2019-06-07 17:40:45 -06:00
options+=("${txtformatdevices}" "")
options+=("${txtmount}" "${txtmountdesc}")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatmountmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
"${txtformatdevices}")
2015-07-18 18:12:26 -06:00
formatdevices
2019-06-07 17:40:45 -06:00
nextitem="${txtmount}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtmount}")
2015-07-18 18:12:26 -06:00
mountparts
2019-06-07 17:40:45 -06:00
nextitem="${txtmount}"
2015-07-18 18:12:26 -06:00
;;
esac
2019-06-07 17:40:45 -06:00
mountmenu "${nextitem}"
2015-07-18 18:12:26 -06:00
fi
}
formatdevices(){
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtformatdevices}" --yesno "${txtformatdeviceconfirm}" --defaultno 0 0) then
if [ ! "${bootdev}" = "" ]; then
formatbootdevice boot ${bootdev}
2015-07-18 18:12:26 -06:00
fi
2019-06-07 17:40:45 -06:00
if [ ! "${swapdev}" = "" ]; then
formatswapdevice swap ${swapdev}
2015-07-18 18:12:26 -06:00
fi
2019-06-07 17:40:45 -06:00
formatdevice root ${rootdev}
if [ ! "${homedev}" = "" ]; then
formatdevice home ${homedev}
2015-07-18 18:12:26 -06:00
fi
fi
}
formatbootdevice(){
options=()
2019-06-07 17:40:45 -06:00
if [ "${efimode}" == "1" ]||[ "${efimode}" = "2" ]; then
2015-07-18 18:12:26 -06:00
options+=("fat32" "(EFI)")
fi
options+=("ext2" "")
options+=("ext3" "")
options+=("ext4" "")
2019-06-07 17:40:45 -06:00
if [ ! "${efimode}" = "1" ]&&[ ! "${efimode}" = "2" ]; then
2015-07-18 18:12:26 -06:00
options+=("fat32" "(EFI)")
fi
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
fi
clear
2019-06-07 17:40:45 -06:00
echo "${txtformatingpart//%1/${2}} ${sel}"
2015-07-18 18:12:26 -06:00
echo "----------------------------------------------"
2019-06-07 17:40:45 -06:00
case ${sel} in
2015-11-01 09:51:34 -07:00
ext2)
2019-06-07 17:40:45 -06:00
echo "mkfs.ext2 ${2}"
mkfs.ext2 ${2}
2015-11-01 09:51:34 -07:00
;;
ext3)
2019-06-07 17:40:45 -06:00
echo "mkfs.ext3 ${2}"
mkfs.ext3 ${2}
2015-11-01 09:51:34 -07:00
;;
ext4)
2019-06-07 17:40:45 -06:00
echo "mkfs.ext4 ${2}"
mkfs.ext4 ${2}
2015-11-01 09:51:34 -07:00
;;
fat32)
2019-06-07 17:40:45 -06:00
echo "mkfs.fat ${2}"
mkfs.fat ${2}
2015-11-01 09:51:34 -07:00
;;
2015-07-18 18:12:26 -06:00
esac
echo ""
pressanykey
}
formatswapdevice(){
2018-09-03 16:57:16 -06:00
options=()
options+=("swap" "")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \
2018-09-03 16:57:16 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
fi
2015-07-18 18:12:26 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "${txtformatingpart//%1/${swapdev}} swap"
2018-09-03 16:57:16 -06:00
echo "----------------------------------------------------"
2019-06-07 17:40:45 -06:00
case ${sel} in
2018-09-03 16:57:16 -06:00
swap)
2019-06-07 17:40:45 -06:00
echo "mkswap ${swapdev}"
mkswap ${swapdev}
2018-09-03 16:57:16 -06:00
echo ""
pressanykey
;;
esac
clear
2015-07-18 18:12:26 -06:00
}
formatdevice(){
options=()
options+=("btrfs" "")
options+=("reiserfs" "")
options+=("ext4" "")
options+=("ext3" "")
options+=("ext2" "")
options+=("xfs" "")
2019-05-06 15:11:12 -06:00
options+=("f2fs" "")
2015-07-18 18:12:26 -06:00
options+=("jfs" "")
2019-06-07 17:40:45 -06:00
if [ ! "${3}" = "noluks" ]; then
2015-08-22 11:48:34 -06:00
options+=("luks" "encrypted")
fi
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "${txtselectpartformat//%1/${1} (${2})}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
fi
clear
2019-06-07 17:40:45 -06:00
echo "${txtformatingpart//%1/${2}} ${sel}"
2015-07-18 18:12:26 -06:00
echo "----------------------------------------------"
2019-06-07 17:40:45 -06:00
case ${sel} in
2015-11-01 09:51:34 -07:00
btrfs)
2019-06-07 17:40:45 -06:00
echo "mkfs.btrfs -f ${2}"
mkfs.btrfs -f ${2}
if [ "${1}" = "root" ]; then
echo "mount ${2} /mnt"
2018-12-31 12:35:05 -07:00
echo "btrfs subvolume create /mnt/root"
echo "btrfs subvolume set-default /mnt/root"
echo "umount /mnt"
2019-06-07 17:40:45 -06:00
mount ${2} /mnt
2018-12-31 12:35:05 -07:00
btrfs subvolume create /mnt/root
btrfs subvolume set-default /mnt/root
umount /mnt
fi
2015-11-01 09:51:34 -07:00
;;
reiserfs)
2019-06-07 17:40:45 -06:00
echo "mkfs.reiserfs -f ${2}"
mkfs.reiserfs -f ${2}
2015-11-01 09:51:34 -07:00
;;
ext4)
2019-06-07 17:40:45 -06:00
echo "mkfs.ext4 ${2}"
mkfs.ext4 ${2}
2015-11-01 09:51:34 -07:00
;;
ext3)
2019-06-07 17:40:45 -06:00
echo "mkfs.ext3 ${2}"
mkfs.ext3 ${2}
2015-11-01 09:51:34 -07:00
;;
ext2)
2019-06-07 17:40:45 -06:00
echo "mkfs.ext2 ${2}"
mkfs.ext2 ${2}
2015-11-01 09:51:34 -07:00
;;
xfs)
2019-06-07 17:40:45 -06:00
echo "mkfs.xfs -f ${2}"
mkfs.xfs -f ${2}
2015-11-01 09:51:34 -07:00
;;
2019-05-06 15:11:12 -06:00
f2fs)
echo "mkfs.f2fs $2"
mkfs.f2fs $2
;;
2015-11-01 09:51:34 -07:00
jfs)
2019-06-07 17:40:45 -06:00
echo "mkfs.xfs -f ${2}"
mkfs.jfs -f ${2}
2015-11-01 09:51:34 -07:00
;;
2015-08-22 11:48:34 -06:00
luks)
2019-06-07 17:40:45 -06:00
echo "${txtcreateluksdevice}"
echo "cryptsetup luksFormat ${2}"
cryptsetup luksFormat ${2}
2015-11-01 10:55:33 -07:00
if [ ! "$?" = "0" ]; then
2015-11-01 10:57:03 -07:00
pressanykey
2015-11-01 11:05:10 -07:00
return 1
2015-11-01 10:53:01 -07:00
fi
2015-11-01 10:57:03 -07:00
pressanykey
2015-08-22 12:08:17 -06:00
echo ""
2019-06-07 17:40:45 -06:00
echo "${txtopenluksdevice}"
echo "cryptsetup luksOpen ${2} ${1}"
cryptsetup luksOpen ${2} ${1}
2015-11-01 10:55:33 -07:00
if [ ! "$?" = "0" ]; then
2015-11-01 10:57:03 -07:00
pressanykey
2015-11-01 11:05:10 -07:00
return 1
2015-11-01 10:53:01 -07:00
fi
2015-11-01 10:57:03 -07:00
pressanykey
2015-08-23 06:01:01 -06:00
options=()
options+=("normal" "")
options+=("fast" "")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtformatdevice}" --menu "Wipe device ?" --cancel-button="${txtignore}" 0 0 0 \
2015-08-23 06:01:01 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
2015-08-23 06:02:55 -06:00
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2015-08-23 06:24:18 -06:00
normal)
2019-06-07 17:40:45 -06:00
echo "dd if=/dev/zero of=/dev/mapper/${1}"
dd if=/dev/zero of=/dev/mapper/${1} & PID=$! &>/dev/null
2015-08-23 06:24:18 -06:00
;;
fast)
2019-06-07 17:40:45 -06:00
echo "dd if=/dev/zero of=/dev/mapper/${1} bs=60M"
dd if=/dev/zero of=/dev/mapper/${1} bs=60M & PID=$! &>/dev/null
2015-08-23 06:24:18 -06:00
;;
2015-08-23 06:01:01 -06:00
esac
2015-08-23 06:02:55 -06:00
clear
2015-08-23 06:01:01 -06:00
sleep 1
2019-06-07 17:40:45 -06:00
while kill -USR1 ${PID} &>/dev/null
2015-08-23 06:01:01 -06:00
do
sleep 1
done
2015-08-22 15:15:10 -06:00
fi
2015-08-23 06:01:01 -06:00
echo ""
2015-08-22 12:08:17 -06:00
pressanykey
2019-06-07 17:40:45 -06:00
formatdevice ${1} /dev/mapper/${1} noluks
if [ "${1}" = "root" ]; then
realrootdev=${rootdev}
rootdev=/dev/mapper/${1}
2015-08-22 13:02:44 -06:00
luksroot=1
2019-06-07 17:40:45 -06:00
luksrootuuid=$(cryptsetup luksUUID ${2})
2015-08-22 13:51:03 -06:00
else
2019-06-07 17:40:45 -06:00
case ${1} in
home) homedev=/dev/mapper/${1} ;;
2015-08-22 13:55:01 -06:00
esac
2015-08-22 13:51:03 -06:00
luksdrive=1
2019-06-07 17:40:45 -06:00
crypttab="\n${1} UUID=$(cryptsetup luksUUID ${2}) none"
2015-08-22 13:02:44 -06:00
fi
2015-08-22 12:08:17 -06:00
echo ""
2019-06-07 17:40:45 -06:00
echo "${txtluksdevicecreated}"
2015-08-22 11:48:34 -06:00
;;
2015-07-18 18:12:26 -06:00
esac
echo ""
pressanykey
}
mountparts(){
clear
2019-06-07 17:40:45 -06:00
echo "mount ${rootdev} /mnt"
mount ${rootdev} /mnt
2015-11-01 09:51:34 -07:00
echo "mkdir /mnt/{boot,home}"
2015-11-01 10:09:36 -07:00
mkdir /mnt/{boot,home} 2>/dev/null
2019-06-07 17:40:45 -06:00
if [ ! "${bootdev}" = "" ]; then
echo "mount ${bootdev} /mnt/boot"
mount ${bootdev} /mnt/boot
2015-07-18 18:12:26 -06:00
fi
2019-06-07 17:40:45 -06:00
if [ ! "${swapdev}" = "" ]; then
echo "swapon ${swapdev}"
swapon ${swapdev}
2015-07-18 18:12:26 -06:00
fi
2019-06-07 17:40:45 -06:00
if [ ! "${homedev}" = "" ]; then
echo "mount ${homedev} /mnt/home"
mount ${homedev} /mnt/home
2015-07-18 18:12:26 -06:00
fi
pressanykey
installmenu
}
# --------------------------------------------------------
# --------------------------------------------------------
installmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
nextitem="${txtinstallarchlinux}"
2015-07-18 18:12:26 -06:00
else
2019-06-07 17:40:45 -06:00
nextitem=${1}
2015-07-18 18:12:26 -06:00
fi
options=()
2019-06-07 17:40:45 -06:00
options+=("${txteditmirrorlist}" "(${txtoptional})")
options+=("${txtinstallarchlinux}" "pacstrap base")
options+=("${txtconfigarchlinux}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstallmenu}" --menu "" --cancel-button "${txtunmount}" --default-item "${nextitem}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
"${txteditmirrorlist}")
${EDITOR} /etc/pacman.d/mirrorlist
nextitem="${txtinstallarchlinux}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtinstallarchlinux}")
2015-07-18 18:12:26 -06:00
installbase
2019-06-07 17:40:45 -06:00
nextitem="${txtconfigarchlinux}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtconfigarchlinux}")
2015-07-18 18:12:26 -06:00
archmenu
2019-06-07 17:40:45 -06:00
nextitem="${txtconfigarchlinux}"
2015-07-18 18:12:26 -06:00
;;
esac
2019-06-07 17:40:45 -06:00
installmenu "${nextitem}"
2015-07-18 18:12:26 -06:00
else
unmountdevices
fi
}
installbase(){
clear
2015-11-01 09:51:34 -07:00
echo "pacstrap /mnt base"
2015-07-18 18:12:26 -06:00
pacstrap /mnt base
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
}
unmountdevices(){
clear
echo "umount -R /mnt"
umount -R /mnt
2019-06-07 17:40:45 -06:00
if [ ! "${swapdev}" = "" ]; then
echo "swapoff ${swapdev}"
swapoff ${swapdev}
2015-07-18 18:12:26 -06:00
fi
pressanykey
}
# --------------------------------------------------------
# --------------------------------------------------------
archmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2015-07-18 18:12:26 -06:00
nextitem="."
else
2019-06-07 17:40:45 -06:00
nextitem=${1}
2015-07-18 18:12:26 -06:00
fi
options=()
2019-06-07 17:40:45 -06:00
options+=("${txtsethostname}" "/etc/hostname")
options+=("${txtsetkeymap}" "/etc/vconsole.conf")
options+=("${txtsetfont}" "/etc/vconsole.conf (${txtoptional})")
options+=("${txtsetlocale}" "/etc/locale.conf, /etc/locale.gen")
options+=("${txtsettime}" "/etc/localtime")
options+=("${txtsetrootpassword}" "")
2015-07-18 18:12:26 -06:00
options+=("${txtgenerate//%1/fstab}" "")
2019-06-07 17:40:45 -06:00
if [ "${luksdrive}" = "1" ]; then
2015-12-18 15:47:56 -07:00
options+=("${txtgenerate//%1/crypttab}" "")
2015-08-22 13:02:44 -06:00
fi
2019-06-07 17:40:45 -06:00
if [ "${luksroot}" = "1" ]; then
options+=("${txtgenerate//%1/mkinitcpio.conf-luks}" "(encrypt hooks)")
fi
2019-06-07 17:40:45 -06:00
if [ "${isnvme}" = "1" ]; then
options+=("${txtgenerate//%1/mkinitcpio.conf-nvme}" "(nvme module)")
2015-08-22 13:02:44 -06:00
fi
2019-06-07 17:40:45 -06:00
options+=("${txtedit//%1/fstab}" "(${txtoptional})")
options+=("${txtedit//%1/crypttab}" "(${txtoptional})")
options+=("${txtedit//%1/mkinitcpio.conf}" "(${txtoptional})")
options+=("${txtedit//%1/mirrorlist}" "(${txtoptional})")
options+=("${txtbootloader}" "")
2019-05-15 18:24:21 -06:00
options+=("${txtenable//%1/dhcpcd}" "systemctl enable dhcpcd")
2019-06-07 17:40:45 -06:00
options+=("archdi" "${txtarchdidesc}")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtarchinstallmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
"${txtsethostname}")
2015-07-18 18:12:26 -06:00
archsethostname
2019-06-07 17:40:45 -06:00
nextitem="${txtsetkeymap}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtsetkeymap}")
2015-07-18 18:12:26 -06:00
archsetkeymap
2019-06-07 17:40:45 -06:00
nextitem="${txtsetlocale}"
2016-03-12 10:56:26 -07:00
;;
2019-06-07 17:40:45 -06:00
"${txtsetfont}")
2016-03-12 10:56:26 -07:00
archsetfont
2019-06-07 17:40:45 -06:00
nextitem="${txtsetlocale}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtsetlocale}")
2015-07-18 18:12:26 -06:00
archsetlocale
2019-06-07 17:40:45 -06:00
nextitem="${txtsettime}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtsettime}")
2015-07-18 18:12:26 -06:00
archsettime
2019-06-07 17:40:45 -06:00
nextitem="${txtsetrootpassword}"
2015-07-18 18:12:26 -06:00
;;
2019-06-07 17:40:45 -06:00
"${txtsetrootpassword}")
2015-07-18 18:12:26 -06:00
archsetrootpassword
nextitem="${txtgenerate//%1/fstab}"
;;
"${txtgenerate//%1/fstab}")
2018-12-31 15:18:09 -07:00
archgenfstabmenu
2019-06-07 17:40:45 -06:00
if [ "${luksdrive}" = "1" ]; then
2015-12-18 15:47:56 -07:00
nextitem="${txtgenerate//%1/crypttab}"
2015-08-22 13:02:44 -06:00
else
2019-06-07 17:40:45 -06:00
if [ "${luksroot}" = "1" ]; then
nextitem="${txtgenerate//%1/mkinitcpio.conf-luks}"
2015-08-22 13:02:44 -06:00
else
2019-06-07 17:40:45 -06:00
if [ "${isnvme}" = "1" ]; then
nextitem="${txtgenerate//%1/mkinitcpio.conf-nvme}"
else
2019-06-07 17:40:45 -06:00
nextitem="${txtbootloader}"
fi
2015-08-22 13:02:44 -06:00
fi
fi
;;
2015-12-18 15:47:56 -07:00
"${txtgenerate//%1/crypttab}")
archgencrypttab
2019-06-07 17:40:45 -06:00
if [ "${luksroot}" = "1" ]; then
nextitem="${txtgenerate//%1/mkinitcpio.conf-luks}"
else
2019-06-07 17:40:45 -06:00
if [ "${isnvme}" = "1" ]; then
nextitem="${txtgenerate//%1/mkinitcpio.conf-nvme}"
else
2019-06-07 17:40:45 -06:00
nextitem="${txtbootloader}"
fi
fi
;;
"${txtgenerate//%1/mkinitcpio.conf-luks}")
archgenmkinitcpioluks
2019-06-07 17:40:45 -06:00
if [ "${isnvme}" = "1" ]; then
nextitem="${txtgenerate//%1/mkinitcpio.conf-nvme}"
2015-08-22 13:02:44 -06:00
else
2019-06-07 17:40:45 -06:00
nextitem="${txtbootloader}"
2015-08-22 13:02:44 -06:00
fi
;;
"${txtgenerate//%1/mkinitcpio.conf-nvme}")
archgenmkinitcpionvme
2019-06-07 17:40:45 -06:00
nextitem="${txtbootloader}"
2015-07-18 18:12:26 -06:00
;;
"${txtedit//%1/fstab}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/etc/fstab
2015-07-18 18:12:26 -06:00
nextitem="${txtedit//%1/fstab}"
;;
2015-12-18 15:47:56 -07:00
"${txtedit//%1/crypttab}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/etc/crypttab
2015-12-18 15:47:56 -07:00
nextitem="${txtedit//%1/crypttab}"
2015-08-22 14:30:25 -06:00
;;
2015-07-18 18:12:26 -06:00
"${txtedit//%1/mkinitcpio.conf}")
archeditmkinitcpio
nextitem="${txtedit//%1/mkinitcpio.conf}"
;;
"${txtedit//%1/mirrorlist}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/etc/pacman.d/mirrorlist
2015-07-18 18:12:26 -06:00
nextitem="${txtedit//%1/mirrorlist}"
;;
2019-06-07 17:40:45 -06:00
"${txtbootloader}")
2018-12-30 16:07:07 -07:00
archbootloadermenu
nextitem="${txtenable//%1/dhcpcd}"
2015-07-18 18:12:26 -06:00
;;
"${txtenable//%1/dhcpcd}")
archenabledhcpcd
nextitem="archdi"
;;
"archdi")
installarchdi
nextitem="archdi"
;;
esac
2019-06-07 17:40:45 -06:00
archmenu "${nextitem}"
2015-07-18 18:12:26 -06:00
fi
}
archchroot(){
2015-11-01 09:51:34 -07:00
echo "arch-chroot /mnt /root"
2019-06-07 17:40:45 -06:00
cp ${0} /mnt/root
chmod 755 /mnt/root/$(basename "${0}")
arch-chroot /mnt /root/$(basename "${0}") --chroot ${1} ${2}
rm /mnt/root/$(basename "${0}")
2015-11-01 09:51:34 -07:00
echo "exit"
2015-07-18 18:12:26 -06:00
}
archsethostname(){
2019-06-07 17:40:45 -06:00
hostname=$(whiptail --backtitle "${apptitle}" --title "${txtsethostname}" --inputbox "" 0 0 "archlinux" 3>&1 1>&2 2>&3)
2015-07-18 18:12:26 -06:00
if [ "$?" = "0" ]; then
2015-11-01 09:51:34 -07:00
clear
2019-06-07 17:40:45 -06:00
echo "echo \"${hostname}\" > /mnt/etc/hostname"
echo "${hostname}" > /mnt/etc/hostname
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
fi
}
archsetkeymap(){
2015-10-02 09:04:03 -06:00
#items=$(localectl list-keymaps)
#options=()
2019-06-07 17:40:45 -06:00
#for item in ${items}; do
# options+=("${item}" "")
2015-10-02 09:04:03 -06:00
#done
2015-10-02 10:10:11 -06:00
items=$(find /usr/share/kbd/keymaps/ -type f -printf "%f\n" | sort -V)
2015-07-18 18:12:26 -06:00
options=()
2019-01-01 12:30:38 -07:00
defsel=""
2019-06-07 17:40:45 -06:00
for item in ${items}; do
if [ "${item%%.*}" == "${keymap}" ]; then
2019-01-01 12:30:38 -07:00
defsel="${item%%.*}"
fi
2015-10-02 10:10:11 -06:00
options+=("${item%%.*}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
keymap=$(whiptail --backtitle "${apptitle}" --title "${txtsetkeymap}" --menu "" --default-item "${defsel}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2015-11-01 09:51:34 -07:00
clear
2019-06-07 17:40:45 -06:00
echo "echo \"KEYMAP=${keymap}\" > /mnt/etc/vconsole.conf"
echo "KEYMAP=${keymap}" > /mnt/etc/vconsole.conf
2016-03-12 10:56:26 -07:00
pressanykey
fi
}
archsetfont(){
items=$(find /usr/share/kbd/consolefonts/*.psfu.gz -printf "%f\n")
2019-06-07 17:40:45 -06:00
2016-03-12 10:56:26 -07:00
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
2016-03-12 10:56:26 -07:00
options+=("${item%%.*}" "")
done
2019-06-07 17:40:45 -06:00
vcfont=$(whiptail --backtitle "${apptitle}" --title "${txtsetfont} (${txtoptional})" --menu "" 0 0 0 \
2016-03-12 10:56:26 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
clear
2019-06-07 17:40:45 -06:00
echo "echo \"FONT=${vcfont}\" >> /mnt/etc/vconsole.conf"
echo "FONT=${vcfont}" >> /mnt/etc/vconsole.conf
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
fi
}
archsetlocale(){
items=$(ls /usr/share/i18n/locales)
options=()
2019-01-01 12:30:38 -07:00
defsel=""
2019-06-07 17:40:45 -06:00
for item in ${items}; do
if [ "${defsel}" == "" ]&&[ "${keymap::2}" == "${item::2}" ]; then
defsel="${item}"
2019-01-01 12:30:38 -07:00
fi
2019-06-07 17:40:45 -06:00
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
locale=$(whiptail --backtitle "${apptitle}" --title "${txtsetlocale}" --menu "" --default-item "${defsel}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
clear
2019-06-07 17:40:45 -06:00
echo "echo \"LANG=${locale}.UTF-8\" > /mnt/etc/locale.conf"
echo "LANG=${locale}.UTF-8" > /mnt/etc/locale.conf
2015-11-01 09:51:34 -07:00
echo "echo \"LC_COLLATE=C\" >> /mnt/etc/locale.conf"
2015-07-18 18:12:26 -06:00
echo "LC_COLLATE=C" >> /mnt/etc/locale.conf
2019-06-07 17:40:45 -06:00
echo "sed -i '/"${locale}".UTF-8/s/^#//g' /mnt/etc/locale.gen"
sed -i '/'${locale}'.UTF-8/s/^#//g' /mnt/etc/locale.gen
2015-07-18 18:12:26 -06:00
archchroot setlocale
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
fi
}
archsetlocalechroot(){
2015-11-01 09:51:34 -07:00
echo "locale-gen"
2015-07-18 18:12:26 -06:00
locale-gen
exit
}
archsettime(){
2016-04-02 07:09:35 -06:00
items=$(ls -l /mnt/usr/share/zoneinfo/ | grep '^d' | gawk -F':[0-9]* ' '/:/{print $2}')
2015-07-18 18:12:26 -06:00
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
timezone=$(whiptail --backtitle "${apptitle}" --title "${txtsettime}" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
fi
2019-06-07 17:40:45 -06:00
items=$(ls /mnt/usr/share/zoneinfo/${timezone}/)
2015-07-18 18:12:26 -06:00
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
timezone=${timezone}/$(whiptail --backtitle "${apptitle}" --title "${txtsettime}" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
return 1
fi
2019-06-07 17:40:45 -06:00
2015-11-01 09:51:34 -07:00
clear
2019-06-07 17:40:45 -06:00
echo "ln -sf /mnt/usr/share/zoneinfo/${timezone} /mnt/etc/localtime"
ln -sf /usr/share/zoneinfo/${timezone} /mnt/etc/localtime
2015-11-01 10:00:26 -07:00
pressanykey
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtsettime}" --yesno "${txtuseutcclock}" 0 0) then
2015-11-01 10:00:26 -07:00
clear
2015-07-18 18:12:26 -06:00
archchroot settimeutc
else
2015-11-01 10:00:26 -07:00
clear
2015-07-18 18:12:26 -06:00
archchroot settimelocal
fi
2019-06-07 17:40:45 -06:00
2015-11-01 09:51:34 -07:00
pressanykey
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
}
archsettimeutcchroot(){
2015-11-01 09:51:34 -07:00
echo "hwclock --systohc --utc"
2015-07-18 18:12:26 -06:00
hwclock --systohc --utc
exit
}
archsettimelocalchroot(){
2015-11-01 09:51:34 -07:00
echo "hwclock --systohc --localtime"
2015-07-18 18:12:26 -06:00
hwclock --systohc --localtime
exit
}
archsetrootpassword(){
clear
archchroot setrootpassword
pressanykey
}
archsetrootpasswordchroot(){
2015-11-01 09:51:34 -07:00
echo "passwd root"
2015-07-18 18:12:26 -06:00
passwd root
exit
}
2018-12-31 15:18:09 -07:00
archgenfstabmenu(){
options=()
options+=("UUID" "genfstab -U")
options+=("LABEL" "genfstab -L")
options+=("PARTUUID" "genfstab -t PARTUUID")
options+=("PARTLABEL" "genfstab -t PARTLABEL")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtgenerate//%1/fstab}" --menu "" --cancel-button "${txtback}" --default-item "${nextitem}" 0 0 0 \
2018-12-31 15:18:09 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2018-12-31 15:18:09 -07:00
"UUID")
clear
echo "genfstab -U -p /mnt > /mnt/etc/fstab"
genfstab -U -p /mnt > /mnt/etc/fstab
;;
"LABEL")
clear
echo "genfstab -L -p /mnt > /mnt/etc/fstab"
genfstab -L -p /mnt > /mnt/etc/fstab
;;
"PARTUUID")
clear
echo "genfstab -t PARTUUID -p /mnt > /mnt/etc/fstab"
genfstab -t PARTUUID -p /mnt > /mnt/etc/fstab
;;
"PARTLABEL")
clear
echo "genfstab -t PARTLABEL -p /mnt > /mnt/etc/fstab"
genfstab -t PARTLABEL -p /mnt > /mnt/etc/fstab
;;
esac
fi
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
}
2015-12-18 15:47:56 -07:00
archgencrypttab(){
2015-08-22 13:51:03 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "echo -e \"${crypttab}\" >> /mnt/etc/crypttab"
echo -e "${crypttab}" >> /mnt/etc/crypttab
2015-11-01 09:51:34 -07:00
pressanykey
2015-08-22 13:02:44 -06:00
}
2015-08-22 13:05:21 -06:00
archgenmkinitcpioluks(){
2015-08-22 13:02:44 -06:00
clear
2015-11-01 09:51:34 -07:00
echo "sed -i \"s/block filesystems/block encrypt filesystems/g\" /mnt/etc/mkinitcpio.conf"
2015-08-22 13:24:16 -06:00
sed -i "s/block filesystems/block encrypt filesystems/g" /mnt/etc/mkinitcpio.conf
2015-08-22 13:02:44 -06:00
archchroot genmkinitcpio
pressanykey
}
archgenmkinitcpionvme(){
clear
echo "sed -i \"s/MODULES=()/MODULES=(nvme)/g\" /mnt/etc/mkinitcpio.conf"
sed -i "s/MODULES=()/MODULES=(nvme)/g" /mnt/etc/mkinitcpio.conf
archchroot genmkinitcpio
pressanykey
}
2015-08-22 13:02:44 -06:00
2015-07-18 18:12:26 -06:00
archeditmkinitcpio(){
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/etc/mkinitcpio.conf
if (whiptail --backtitle "${apptitle}" --title "${txtedit//%1/mkinitcpio.conf}" --yesno "${txtgenerate//%1/mkinitcpio} ?" 0 0) then
2015-07-18 18:12:26 -06:00
clear
archchroot genmkinitcpio
pressanykey
fi
}
archgenmkinitcpiochroot(){
2015-11-01 09:51:34 -07:00
echo "mkinitcpio -p linux"
2015-07-18 18:12:26 -06:00
mkinitcpio -p linux
exit
}
2018-12-30 12:46:28 -07:00
archbootloadermenu(){
options=()
options+=("grub" "")
2019-06-07 17:40:45 -06:00
if [ "${efimode}" == "1" ]; then
2018-12-31 11:47:57 -07:00
options+=("systemd-boot" "")
2018-12-31 14:47:14 -07:00
options+=("refind" "")
2018-12-31 11:47:57 -07:00
fi
2019-06-07 17:40:45 -06:00
if [ "${efimode}" != "2" ]; then
2018-12-30 16:07:07 -07:00
options+=("syslinux" "")
fi
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadermenu}" --menu "" --cancel-button "${txtback}" 0 0 0 \
2018-12-30 12:46:28 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2018-12-31 14:47:14 -07:00
"grub") archbootloadergrubmenu;;
"systemd-boot")archbootloadersystemdbmenu;;
"refind") archbootloaderrefindmenu;;
"syslinux")archbootloadersyslinuxbmenu;;
2018-12-30 12:46:28 -07:00
esac
fi
}
archbootloadergrubmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2018-12-30 12:46:28 -07:00
nextblitem="."
else
2019-06-07 17:40:45 -06:00
nextblitem=${1}
2018-12-30 12:46:28 -07:00
fi
options=()
options+=("${txtinstall//%1/grub}" "pacstrap grub (efibootmgr), grub-mkconfig")
2019-06-07 17:40:45 -06:00
options+=("${txtedit//%1/grub}" "(${txtoptional})")
2018-12-30 12:46:28 -07:00
options+=("${txtinstall//%1/bootloader}" "grub-install")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadergrubmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \
2018-12-30 12:46:28 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2018-12-30 12:46:28 -07:00
"${txtinstall//%1/grub}")
archgrubinstall
nextblitem="${txtinstall//%1/bootloader}"
;;
"${txtedit//%1/grub}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/etc/default/grub
if (whiptail --backtitle "${apptitle}" --title "${txtedit//%1/grub}" --yesno "${txtrungrubmakeconfig}" 0 0) then
2018-12-30 12:46:28 -07:00
clear
archchroot grubinstall
pressanykey
fi
nextblitem="${txtinstall//%1/bootloader}"
;;
"${txtinstall//%1/bootloader}")
archgrubinstallbootloader
nextblitem="${txtinstall//%1/bootloader}"
;;
esac
2019-06-07 17:40:45 -06:00
archbootloadergrubmenu "${nextblitem}"
2018-12-30 12:46:28 -07:00
fi
}
archgrubinstall(){
2015-07-18 18:12:26 -06:00
clear
2015-11-01 09:51:34 -07:00
echo "pacstrap /mnt grub"
2015-07-18 18:12:26 -06:00
pacstrap /mnt grub
2015-11-01 09:51:34 -07:00
pressanykey
2019-06-07 17:40:45 -06:00
if [ "${eficomputer}" == "1" ]; then
if [ "${efimode}" == "1" ]||[ "${efimode}" == "2" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/efibootmgr}" --yesno "${txtefibootmgr}" 0 0) then
2015-10-10 14:18:24 -06:00
clear
2015-11-01 09:51:34 -07:00
echo "pacstrap /mnt efibootmgr"
2015-10-10 14:18:24 -06:00
pacstrap /mnt efibootmgr
2015-11-01 09:51:34 -07:00
pressanykey
2015-10-10 14:18:24 -06:00
fi
else
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/efibootmgr}" --yesno "${txtefibootmgr}" --defaultno 0 0) then
2015-10-10 14:18:24 -06:00
clear
2015-11-01 09:51:34 -07:00
echo "pacstrap /mnt efibootmgr"
2015-10-10 14:18:24 -06:00
pacstrap /mnt efibootmgr
2015-11-01 09:51:34 -07:00
pressanykey
2015-10-10 14:18:24 -06:00
fi
2015-07-18 18:12:26 -06:00
fi
fi
2019-06-07 17:40:45 -06:00
if [ "${luksroot}" = "1" ]; then
if (whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/grub}" --yesno "${txtgrubluksdetected}" 0 0) then
2015-08-22 13:02:44 -06:00
clear
2019-06-07 17:40:45 -06:00
echo "sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\\\"cryptdevice=/dev/disk/by-uuid/${luksrootuuid}:root\\\" /mnt/etc/default/grub"
sed -i /GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX=\"cryptdevice=/dev/disk/by-uuid/${luksrootuuid}:root\" /mnt/etc/default/grub
2015-11-01 09:51:34 -07:00
pressanykey
2015-08-22 13:02:44 -06:00
fi
fi
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
clear
2018-12-30 12:46:28 -07:00
archchroot grubinstall
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
}
2018-12-30 12:46:28 -07:00
archgrubinstallchroot(){
2018-12-21 16:12:10 -07:00
echo "mkdir /boot/grub"
2015-11-01 09:51:34 -07:00
echo "grub-mkconfig -o /boot/grub/grub.cfg"
2018-12-21 16:12:10 -07:00
mkdir /boot/grub
2015-07-18 18:12:26 -06:00
grub-mkconfig -o /boot/grub/grub.cfg
exit
}
2018-12-30 12:46:28 -07:00
archgrubinstallbootloader(){
2015-07-18 18:12:26 -06:00
items=$(lsblk -d -p -n -l -o NAME -e 7,11)
options=()
2019-06-07 17:40:45 -06:00
for item in ${items}; do
options+=("${item}" "")
2015-07-18 18:12:26 -06:00
done
2019-06-07 17:40:45 -06:00
device=$(whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/bootloader}" --menu "" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
if [ "${eficomputer}" == "1" ]; then
2015-10-10 15:09:19 -06:00
options=()
2019-06-07 17:40:45 -06:00
if [ "${efimode}" = "1" ]; then
2015-10-10 15:09:19 -06:00
options+=("EFI" "")
options+=("BIOS" "")
options+=("BIOS+EFI" "")
2019-06-07 17:40:45 -06:00
elif [ "${efimode}" = "2" ]; then
2015-10-10 15:09:19 -06:00
options+=("BIOS+EFI" "")
options+=("BIOS" "")
options+=("EFI" "")
else
options+=("BIOS" "")
options+=("EFI" "")
options+=("BIOS+EFI" "")
fi
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtinstall//%1/bootloader}" --menu "" --cancel-button "${txtback}" 0 0 0 \
2015-10-10 15:09:19 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
clear
2019-06-07 17:40:45 -06:00
case ${sel} in
"BIOS") archchroot grubbootloaderinstall ${device};;
"EFI") archchroot grubbootloaderefiinstall ${device};;
"BIOS+EFI") archchroot grubbootloaderefiusbinstall ${device};;
2015-10-10 15:09:19 -06:00
esac
pressanykey
fi
2015-07-18 18:12:26 -06:00
else
2015-10-10 15:11:07 -06:00
clear
2019-06-07 17:40:45 -06:00
archchroot grubbootloaderinstall ${device}
2015-07-18 18:12:26 -06:00
pressanykey
fi
fi
}
2018-12-30 12:46:28 -07:00
archgrubinstallbootloaderchroot(){
2019-06-07 17:40:45 -06:00
if [ ! "${1}" = "none" ]; then
echo "grub-install --target=i386-pc --recheck ${1}"
grub-install --target=i386-pc --recheck ${1}
2015-07-18 18:12:26 -06:00
fi
exit
}
2018-12-30 12:46:28 -07:00
archgrubinstallbootloaderefichroot(){
2019-06-07 17:40:45 -06:00
if [ ! "${1}" = "none" ]; then
echo "grub-install --target=x86_64-efi --efi-directory=/boot --recheck ${1}"
grub-install --target=x86_64-efi --efi-directory=/boot --recheck ${1}
isvbox=$(lspci | grep "VirtualBox G")
2019-06-07 17:40:45 -06:00
if [ "${isvbox}" ]; then
echo "VirtualBox detected, creating startup.nsh..."
echo "\EFI\arch\grubx64.efi" > /boot/startup.nsh
fi
2015-07-18 18:12:26 -06:00
fi
exit
}
2018-12-30 12:46:28 -07:00
archgrubinstallbootloaderefiusbchroot(){
2019-06-07 17:40:45 -06:00
if [ ! "${1}" = "none" ]; then
echo "grub-install --target=i386-pc --recheck ${1}"
grub-install --target=i386-pc --recheck ${1}
echo "grub-install --target=x86_64-efi --efi-directory=/boot --removable --recheck ${1}"
grub-install --target=x86_64-efi --efi-directory=/boot --removable --recheck ${1}
isvbox=$(lspci | grep "VirtualBox G")
2019-06-07 17:40:45 -06:00
if [ "${isvbox}" ]; then
echo "VirtualBox detected, creating startup.nsh..."
echo "\EFI\arch\grubx64.efi" > /boot/startup.nsh
fi
2015-07-18 18:12:26 -06:00
fi
exit
}
2018-12-30 12:46:28 -07:00
2018-12-30 16:07:07 -07:00
archbootloadersyslinuxbmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2018-12-30 16:07:07 -07:00
nextblitem="."
else
2019-06-07 17:40:45 -06:00
nextblitem=${1}
2018-12-30 16:07:07 -07:00
fi
options=()
options+=("${txtinstall//%1/syslinux}" "pacstrap syslinux (gptfdisk,mtools)")
2019-06-07 17:40:45 -06:00
options+=("${txtedit//%1/syslinux}" "(${txtoptional})")
2018-12-30 16:07:07 -07:00
options+=("${txtinstall//%1/bootloader}" "syslinux-install_update")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadersyslinuxmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \
2018-12-30 16:07:07 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2018-12-30 16:07:07 -07:00
"${txtinstall//%1/syslinux}")
archsyslinuxinstall
nextblitem="${txtinstall//%1/bootloader}"
;;
"${txtedit//%1/syslinux}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/boot/syslinux/syslinux.cfg
2018-12-30 16:07:07 -07:00
nextblitem="${txtinstall//%1/bootloader}"
;;
"${txtinstall//%1/bootloader}")
archsyslinuxinstallbootloader
nextblitem="${txtinstall//%1/bootloader}"
;;
esac
2019-06-07 17:40:45 -06:00
archbootloadersyslinuxbmenu "${nextblitem}"
2018-12-30 16:07:07 -07:00
fi
}
archsyslinuxinstall(){
clear
2019-06-07 17:40:45 -06:00
if [ "${efimode}" == "1" ]||[ "${efimode}" == "2" ]; then
echo "${txtsyslinuxaddefibootmgr}"
additionalpkg=${additionalpkg}"efibootmgr "
2018-12-31 09:15:19 -07:00
fi
2019-06-07 17:40:45 -06:00
if [ "${isnvme}" = "1" ]; then
2019-01-10 14:47:29 -07:00
if [ "$(parted ${realrootdev::(-2)} print|grep gpt)" != "" ]; then
2019-06-07 17:40:45 -06:00
echo "${txtsyslinuxaddgptfdisk}"
additionalpkg=${additionalpkg}"gptfdisk "
2019-01-10 14:47:29 -07:00
fi
else
if [ "$(parted ${realrootdev::8} print|grep gpt)" != "" ]; then
2019-06-07 17:40:45 -06:00
echo "${txtsyslinuxaddgptfdisk}"
additionalpkg=${additionalpkg}"gptfdisk "
2019-01-10 14:47:29 -07:00
fi
2018-12-30 16:07:07 -07:00
fi
2019-06-07 17:40:45 -06:00
if [ "${bootdev}" != "" ]; then
if [ "$(parted ${bootdev} print|grep fat)" != "" ]; then
echo "${txtsyslinuxaddmtools}"
additionalpkg=${additionalpkg}"mtools "
2018-12-30 16:07:07 -07:00
fi
fi
2019-06-07 17:40:45 -06:00
echo "pacstrap /mnt syslinux ${additionalpkg}"
pacstrap /mnt syslinux ${additionalpkg}
2018-12-30 16:07:07 -07:00
pressanykey
clear
echo "Updating /boot/syslinux/syslinux.cfg"
2019-06-07 17:40:45 -06:00
if [ "${luksroot}" = "1" ]; then
echo "sed -i \"/APPEND\ root=/c\ APPEND root=/dev/mapper/root cryptdevice=${realrootdev}:root rw\" /mnt/boot/syslinux/syslinux.cfg"
sed -i "/APPEND\ root=/c\ APPEND root=/dev/mapper/root cryptdevice=${realrootdev}:root\ rw" /mnt/boot/syslinux/syslinux.cfg
2018-12-30 16:07:07 -07:00
else
2019-06-07 17:40:45 -06:00
echo "sed -i \"/APPEND\ root=/c\ APPEND root=${rootdev} rw\" /mnt/boot/syslinux/syslinux.cfg"
sed -i "/APPEND\ root=/c\ APPEND root=${rootdev}\ rw" /mnt/boot/syslinux/syslinux.cfg
2018-12-30 16:07:07 -07:00
fi
2019-06-07 17:40:45 -06:00
2018-12-30 16:07:07 -07:00
pressanykey
}
archsyslinuxinstallbootloader(){
clear
2019-06-07 17:40:45 -06:00
if [ "${efimode}" == "1" ]||[ "${efimode}" == "2" ]; then
archchroot syslinuxbootloaderefiinstall ${bootdev}
2018-12-31 09:15:19 -07:00
else
2019-06-07 17:40:45 -06:00
archchroot syslinuxbootloaderinstall ${bootdev}
2018-12-31 09:15:19 -07:00
fi
2018-12-30 16:07:07 -07:00
pressanykey
}
archsyslinuxinstallbootloaderchroot(){
2019-06-07 17:40:45 -06:00
if [ ! "${1}" = "none" ]; then
2018-12-30 16:07:07 -07:00
echo "syslinux-install_update -i -a -m"
syslinux-install_update -i -a -m
fi
exit
}
2018-12-31 09:15:19 -07:00
archsyslinuxinstallbootloaderefichroot(){
2019-06-07 17:40:45 -06:00
if [ ! "${1}" = "none" ]; then
2018-12-31 09:15:19 -07:00
echo "cp -r /usr/lib/syslinux/efi64/* /boot/syslinux"
cp -r /usr/lib/syslinux/efi64/* /boot/syslinux
2019-01-10 14:47:29 -07:00
if [ "${1::8}" == "/dev/nvm" ]; then
echo "efibootmgr --create --disk ${1::(-2)} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose"
efibootmgr --create --disk ${1::(-2)} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose
else
echo "efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose"
efibootmgr --create --disk ${1::8} --part ${1:(-1)} --loader /syslinux/syslinux.efi --label "Syslinux" --verbose
fi
isvbox=$(lspci | grep "VirtualBox G")
2019-06-07 17:40:45 -06:00
if [ "${isvbox}" ]; then
echo "VirtualBox detected, creating startup.nsh..."
echo "\syslinux\syslinux.efi" > /boot/startup.nsh
fi
2018-12-31 09:15:19 -07:00
fi
exit
}
2018-12-30 16:07:07 -07:00
2018-12-30 12:46:28 -07:00
2018-12-31 11:47:57 -07:00
archbootloadersystemdbmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2018-12-31 11:47:57 -07:00
nextblitem="."
else
2019-06-07 17:40:45 -06:00
nextblitem=${1}
2018-12-31 11:47:57 -07:00
fi
options=()
options+=("${txtinstall//%1/systemd-boot}" "bootctl install")
2019-06-07 17:40:45 -06:00
options+=("${txtedit//%1/loader.conf}" "(${txtoptional})")
options+=("${txtedit//%1/entries}" "(${txtoptional})")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloadersystemdmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \
2018-12-31 11:47:57 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2018-12-31 11:47:57 -07:00
"${txtinstall//%1/systemd-boot}")
archsystemdinstall
nextblitem="${txtinstall//%1/loader.conf}"
;;
"${txtedit//%1/loader.conf}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/boot/loader/loader.conf
2018-12-31 11:47:57 -07:00
nextblitem="${txtedit//%1/entries}"
;;
"${txtedit//%1/entries}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/boot/loader/entries/*
2018-12-31 11:47:57 -07:00
nextblitem="${txtedit//%1/entries}"
;;
esac
2019-06-07 17:40:45 -06:00
archbootloadersystemdbmenu "${nextblitem}"
2018-12-31 11:47:57 -07:00
fi
}
archsystemdinstall(){
clear
2019-06-07 17:40:45 -06:00
archchroot systemdbootloaderinstall ${realrootdev}
partuuid=$(blkid -s PARTUUID -o value ${realrootdev})
parttype=$(blkid -s TYPE -o value ${rootdev})
2018-12-31 11:47:57 -07:00
echo "cp /mnt/usr/share/systemd/bootctl/arch.conf /mnt/boot/loader/entries"
echo "echo \"timeout 2\" >> /mnt/boot/loader/loader.conf"
echo "cp /mnt/usr/share/systemd/bootctl/loader.conf /mnt/boot/loader"
2019-06-07 17:40:45 -06:00
if [ "${luksroot}" = "1" ]; then
cryptuuid=$(blkid -s UUID -o value ${realrootdev})
2018-12-31 11:47:57 -07:00
echo "sed -i \"s/PARTUUID=XXXX/\\/dev\\/mapper\\/root/\" /mnt/boot/loader/entries/arch.conf"
2019-06-07 17:40:45 -06:00
echo "sed -i \"s/XXXX/${parttype}/\" /mnt/boot/loader/entries/arch.conf"
echo "sed -i \"s/root=/cryptdevice=UUID=${cryptuuid}:root root=/\" /mnt/boot/loader/entries/arch.conf"
2018-12-31 11:47:57 -07:00
else
2019-06-07 17:40:45 -06:00
echo "sed -i \"s/PARTUUID=XXXX/PARTUUID=${partuuid}/\" /mnt/boot/loader/entries/arch.conf"
echo "sed -i \"s/XXXX/${parttype}/\" /mnt/boot/loader/entries/arch.conf"
2018-12-31 11:47:57 -07:00
fi
echo "cp /mnt/boot/loader/entries/arch.conf /mnt/boot/loader/entries/arch-fallback.conf"
echo "sed -i \"s/Arch Linux/Arch Linux Fallback/\" /mnt/boot/loader/entries/arch-fallback.conf"
echo "sed -i \"s/initramfs-linux/initramfs-linux-fallback/\" /mnt/boot/loader/entries/arch-fallback.conf"
2019-06-07 17:40:45 -06:00
2018-12-31 11:47:57 -07:00
cp /mnt/usr/share/systemd/bootctl/loader.conf /mnt/boot/loader
echo "timeout 2" >> /mnt/boot/loader/loader.conf
cp /mnt/usr/share/systemd/bootctl/arch.conf /mnt/boot/loader/entries
2019-06-07 17:40:45 -06:00
if [ "${luksroot}" = "1" ]; then
2018-12-31 11:47:57 -07:00
sed -i "s/PARTUUID=XXXX/\/dev\/mapper\/root/" /mnt/boot/loader/entries/arch.conf
2019-06-07 17:40:45 -06:00
sed -i "s/XXXX/${parttype}/" /mnt/boot/loader/entries/arch.conf
sed -i "s/root=/cryptdevice=UUID=${cryptuuid}:root root=/" /mnt/boot/loader/entries/arch.conf
2018-12-31 11:47:57 -07:00
else
2019-06-07 17:40:45 -06:00
sed -i "s/PARTUUID=XXXX/PARTUUID=${partuuid}/" /mnt/boot/loader/entries/arch.conf
sed -i "s/XXXX/${parttype}/" /mnt/boot/loader/entries/arch.conf
2018-12-31 11:47:57 -07:00
fi
2019-06-07 17:40:45 -06:00
2018-12-31 11:47:57 -07:00
cp /mnt/boot/loader/entries/arch.conf /mnt/boot/loader/entries/arch-fallback.conf
sed -i "s/Arch Linux/Arch Linux Fallback/" /mnt/boot/loader/entries/arch-fallback.conf
sed -i "s/initramfs-linux/initramfs-linux-fallback/" /mnt/boot/loader/entries/arch-fallback.conf
2019-06-07 17:40:45 -06:00
2018-12-31 11:47:57 -07:00
pressanykey
}
archsystemdinstallchroot(){
echo "bootctl --path=/boot install"
bootctl --path=/boot install
isvbox=$(lspci | grep "VirtualBox G")
2019-06-07 17:40:45 -06:00
if [ "${isvbox}" ]; then
echo "VirtualBox detected, creating startup.nsh..."
echo "\EFI\systemd\systemd-bootx64.efi" > /boot/startup.nsh
fi
2018-12-31 11:47:57 -07:00
}
2018-12-30 12:46:28 -07:00
2018-12-31 14:47:14 -07:00
archbootloaderrefindmenu(){
2019-06-07 17:40:45 -06:00
if [ "${1}" = "" ]; then
2018-12-31 14:47:14 -07:00
nextblitem="."
else
2019-06-07 17:40:45 -06:00
nextblitem=${1}
2018-12-31 14:47:14 -07:00
fi
options=()
options+=("${txtinstall//%1/refind}" "pacstrap refind-efi")
2019-06-07 17:40:45 -06:00
options+=("${txtedit//%1/refind_linux.conf}" "(${txtoptional})")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtbootloaderrefindmenu}" --menu "" --cancel-button "${txtback}" --default-item "${nextblitem}" 0 0 0 \
2018-12-31 14:47:14 -07:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2018-12-31 14:47:14 -07:00
"${txtinstall//%1/refind}")
archrefindinstall
nextblitem="${txtedit//%1/refind_linux.conf}"
;;
"${txtedit//%1/refind_linux.conf}")
2019-06-07 17:40:45 -06:00
${EDITOR} /mnt/boot/refind_linux.conf
2018-12-31 14:47:14 -07:00
nextblitem="${txtedit//%1/refind_linux.conf}"
;;
esac
2019-06-07 17:40:45 -06:00
archbootloaderrefindmenu "${nextblitem}"
2018-12-31 14:47:14 -07:00
fi
}
archrefindinstall(){
clear
2019-06-07 17:40:45 -06:00
2018-12-31 14:47:14 -07:00
echo "pacstrap /mnt refind-efi"
2019-06-07 17:40:45 -06:00
echo "archchroot refindbootloaderinstall ${realrootdev}"
echo "echo \"\\\"Arch Linux \\\" \\\"root=UUID=${rootuuid} rw add_efi_memmap\\\"\" > /mnt/boot/refind_linux.conf"
echo "echo \"\\\"Arch Linux Fallback\\\" \\\"root=UUID=${rootuuid} rw add_efi_memmap initrd=/initramfs-linux-fallback.img\\\"\" >> /mnt/boot/refind_linux.conf"
echo "echo \"\\\"Arch Linux Terminal\\\" \\\"root=UUID=${rootuuid} rw add_efi_memmap systemd.unit=multi-user.target\\\"\" >> /mnt/boot/refind_linux.conf"
2018-12-31 14:47:14 -07:00
pacstrap /mnt refind-efi
2019-06-07 17:40:45 -06:00
archchroot refindbootloaderinstall ${realrootdev}
rootuuid=$(blkid -s UUID -o value ${realrootdev})
echo "\"Arch Linux \" \"root=UUID=${rootuuid} rw add_efi_memmap\"" > /mnt/boot/refind_linux.conf
echo "\"Arch Linux Fallback\" \"root=UUID=${rootuuid} rw add_efi_memmap initrd=/initramfs-linux-fallback.img\"" >> /mnt/boot/refind_linux.conf
echo "\"Arch Linux Terminal\" \"root=UUID=${rootuuid} rw add_efi_memmap systemd.unit=multi-user.target\"" >> /mnt/boot/refind_linux.conf
2018-12-31 14:47:14 -07:00
pressanykey
}
archrefindinstallchroot(){
#--usedefault /dev/sdXY --alldrivers
echo "refind-install"
refind-install
isvbox=$(lspci | grep "VirtualBox G")
2019-06-07 17:40:45 -06:00
if [ "${isvbox}" ]; then
echo "VirtualBox detected, creating startup.nsh..."
echo "\EFI\refind\refind_x64.efi" > /boot/startup.nsh
fi
2018-12-31 14:47:14 -07:00
}
2015-07-18 18:12:26 -06:00
archenabledhcpcd(){
2019-06-07 17:40:45 -06:00
if (whiptail --backtitle "${apptitle}" --title "${txtenable//%1/dhcpcd}" --yesno "${txtenable//%1/dhcpcd} ?" 0 0) then
2015-07-18 18:12:26 -06:00
clear
archchroot enabledhcpcd
2015-11-01 09:51:34 -07:00
pressanykey
2015-07-18 18:12:26 -06:00
fi
}
archenabledhcpcdchroot(){
2015-11-01 09:51:34 -07:00
echo "systemctl enable dhcpcd"
2015-07-18 18:12:26 -06:00
systemctl enable dhcpcd
exit
}
installarchdi(){
2018-09-03 17:25:32 -06:00
txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu.\n\nArch Linux Desktop Install as two dependencies : wget and libnewt.\n\npacstrap wget libnewt ?"
2019-06-07 17:40:45 -06:00
if(whiptail --backtitle "${apptitle}" --title "archdi" --yesno "${txtinstallarchdi}" 0 0) then
2015-07-18 18:12:26 -06:00
clear
2015-11-01 09:51:34 -07:00
echo "pacstrap /mnt wget libnewt"
2015-07-18 18:12:26 -06:00
pacstrap /mnt wget libnewt
fi
if [ "$?" = "0" ]; then
options=()
2019-06-07 17:40:45 -06:00
options+=("${txtarchdiinstallandlaunch}" "")
options+=("${txtarchdilaunch}" "")
options+=("${txtarchdiinstall}" "")
sel=$(whiptail --backtitle "${apptitle}" --title "${txtarchdimenu}" --menu "" --cancel-button "${txtback}" 0 0 0 \
2015-07-18 18:12:26 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
"${txtarchdiinstallandlaunch}") archchroot archdiinstallandlaunch;;
"${txtarchdilaunch}") archchroot archdilaunch;;
"${txtarchdiinstall}")
2015-11-01 10:00:26 -07:00
clear
archchroot archdiinstall
pressanykey
;;
2015-07-18 18:12:26 -06:00
esac
fi
fi
}
2015-08-20 11:14:17 -06:00
archdidownload(){
2018-09-03 17:22:31 -06:00
txtselectserver="Select source server :"
txtback="Back"
2015-08-20 11:14:17 -06:00
options=()
options+=("sourceforge.net" "recommended")
options+=("github.com" "")
2019-06-07 17:40:45 -06:00
sel=$(whiptail --backtitle "${apptitle}" --title "${txtselectserver}" --menu "" --cancel-button "${txtback}" 0 0 0 \
2015-08-20 11:14:17 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ "$?" = "0" ]; then
2019-06-07 17:40:45 -06:00
case ${sel} in
2015-08-20 11:14:17 -06:00
"sourceforge.net")
archdiurl=archdi.sourceforge.net/archdi
;;
"github.com")
archdiurl=matmoul.github.io/archdi >archdi
;;
esac
fi
2019-06-07 17:40:45 -06:00
echo "curl -L ${archdiurl} >archdi"
curl -L ${archdiurl} >archdi
2015-08-20 11:14:17 -06:00
}
2015-07-18 18:12:26 -06:00
archdiinstallandlaunchchroot(){
cd
2015-08-20 11:14:17 -06:00
archdidownload
2015-07-18 18:12:26 -06:00
sh archdi -i
archdi --chroot
exit
}
archdilaunchchroot(){
cd
2015-08-20 11:14:17 -06:00
archdidownload
2015-07-18 18:12:26 -06:00
sh archdi --chroot
rm archdi
exit
}
archdiinstallchroot(){
cd
2015-08-20 11:14:17 -06:00
archdidownload
2015-07-18 18:12:26 -06:00
sh archdi -i
exit
}
# --------------------------------------------------------
# --------------------------------------------------------
pressanykey(){
2019-06-07 17:40:45 -06:00
read -n1 -p "${txtpressanykey}"
2015-07-18 18:12:26 -06:00
}
loadstrings(){
2019-06-07 17:40:45 -06:00
2016-03-12 09:52:25 -07:00
locale=en_US.UTF-8
#font=
2019-06-07 17:40:45 -06:00
2016-03-27 17:41:16 -06:00
txtexit="Exit"
txtback="Back"
txtignore="Ignore"
2019-06-07 17:40:45 -06:00
2015-08-20 11:14:17 -06:00
txtselectserver="Select source server :"
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
txtmainmenu="Main Menu"
txtlanguage="Language"
txtsetkeymap="Set Keyboard Layout"
2015-11-01 10:21:57 -07:00
txteditor="Editor"
2015-07-18 18:12:26 -06:00
txtdiskpartmenu="Disk Partitions"
txtselectpartsmenu="Select Partitions and Install"
txthelp="Help"
txtchangelog="Changelog"
txtreboot="Reboot"
txtautoparts="Auto Partitions"
txteditparts="Edit Partitions"
txtautopartsconfirm="Selected device : %1\n\nAll data will be erased ! \n\nContinue ?"
txtautopartclear="Clear all partition data"
txtautopartcreate="Create %1 partition"
txthybridpartcreate="Set hybrid MBR"
txtautopartsettype="Set %1 partition type"
txtselectdevice="Select %1 device :"
txtselecteddevices="Selected devices :"
txtformatmountmenu="Format and Mount"
txtformatdevices="Format Devices"
txtformatdevice="Format Device"
txtmount="Mount"
2016-03-27 17:41:16 -06:00
txtunmount="Unmount"
2015-07-18 18:12:26 -06:00
txtmountdesc="Install or Config"
txtformatdeviceconfirm="Warning, all data on selected devices will be erased ! \nFormat devices ?"
txtselectpartformat="Select partition format for %1 :"
txtformatingpart="Formatting partition %1 as"
2015-08-22 14:30:25 -06:00
txtcreateluksdevice="Create luks device :"
txtopenluksdevice="Open luks device :"
txtluksdevicecreated="luks device created !"
2015-07-18 18:12:26 -06:00
txtinstallmenu="Install Menu"
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
txtarchinstallmenu="Arch Install Menu"
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
txteditmirrorlist="Edit mirrorlist"
txtinstallarchlinux="Install Arch Linux"
txtconfigarchlinux="Config Arch Linux"
txtsethostname="Set Computer Name"
2016-03-12 10:56:26 -07:00
txtsetfont="Set Font"
2015-07-18 18:12:26 -06:00
txtsetlocale="Set Locale"
txtsettime="Set Time"
txtsetrootpassword="Set root password"
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
txtuseutcclock="Use UTC hardware clock ?"
2019-06-07 17:40:45 -06:00
2018-12-30 12:46:28 -07:00
txtbootloader="Bootloader"
txtbootloadermenu="Choose your bootloader"
2019-06-07 17:40:45 -06:00
2018-12-30 12:46:28 -07:00
txtefibootmgr="efibootmgr is required for EFI computers."
2019-06-07 17:40:45 -06:00
2018-12-30 12:46:28 -07:00
txtbootloadergrubmenu="Grub Install Menu"
txtrungrubmakeconfig="Run grub-mkconfig ?"
txtgrubluksdetected="Encrypted root partion !\n\nAdd cryptdevice= to GRUB_CMDLINE_LINUX in /etc/default/grub ?"
2019-06-07 17:40:45 -06:00
2018-12-30 16:07:07 -07:00
txtbootloadersyslinuxmenu="Syslinux Install Menu"
2018-12-31 14:59:51 -07:00
txtsyslinuxaddefibootmgr="EFI install require efibootmgr"
txtsyslinuxaddgptfdisk="GPT disk require gptfdisk"
txtsyslinuxaddmtools="FAT boot part require mtools"
2019-06-07 17:40:45 -06:00
2018-12-31 14:59:51 -07:00
txtbootloadersystemdmenu="Systemd-boot Install Menu"
2019-06-07 17:40:45 -06:00
2018-12-31 14:47:14 -07:00
txtbootloaderrefindmenu="rEFInd Install Menu"
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
txtoptional="Optional"
txtrecommandeasyinst="Recommanded for easy install"
txtset="Set %1"
txtgenerate="Generate %1"
txtedit="Edit %1"
txtinstall="Install %1"
txtenable="Enable %1"
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
txtpressanykey="Press any key to continue."
2019-06-07 17:40:45 -06:00
2015-07-18 18:12:26 -06:00
txtarchdidesc="Full desktop install script"
txtinstallarchdi="Arch Linux Desktop Install (archdi) is a second script who can help you to install a full workstation.\n\nYou can just launch the script or install it. Choose in the next menu.\n\nArch Linux Desktop Install as two dependencies : wget and libnewt.\n\npacstrap wget libnewt ?"
txtarchdiinstallandlaunch="Install and run archdi"
txtarchdiinstall="Install archdi"
txtarchdilaunch="Launch archdi"
}
# --------------------------------------------------------
# --------------------------------------------------------
while (( "$#" )); do
2019-06-07 17:40:45 -06:00
case ${1} in
2018-12-25 18:58:55 -07:00
--help)
2018-12-30 16:07:07 -07:00
echo "archfi"
echo "------"
echo "-sf | --skip-font Skip setfont from language files"
echo "-efiX -efi0 : disable EFI, -efi1 efi inst, -efi2 efi hybrid inst"
echo "-t | --test ghusername ghbranch Test language files"
2018-12-30 16:07:07 -07:00
exit 0
2018-12-25 18:58:55 -07:00
;;
2018-12-30 16:07:07 -07:00
-sf | --skip-font) skipfont=1;;
-t | --test) baseurl="https://raw.githubusercontent"
2019-06-07 17:40:45 -06:00
baseurl="${baseurl}.com/""${2}/archfi/${3}";;
-efi0) efimode=0;;
-efi1)
eficomputer=1
efimode=1
;;
-efi2)
eficomputer=1
efimode=2
;;
2015-07-18 18:12:26 -06:00
--chroot) chroot=1
2019-06-07 17:40:45 -06:00
command=${2}
args=${3};;
2015-07-18 18:12:26 -06:00
esac
shift
done
2019-06-07 17:40:45 -06:00
if [ "${chroot}" = "1" ]; then
case ${command} in
2015-07-18 18:12:26 -06:00
'setrootpassword') archsetrootpasswordchroot;;
'setlocale') archsetlocalechroot;;
'settimeutc') archsettimeutcchroot;;
'settimelocal') archsettimelocalchroot;;
'genmkinitcpio') archgenmkinitcpiochroot;;
'enabledhcpcd') archenabledhcpcdchroot;;
2018-12-30 12:46:28 -07:00
'grubinstall') archgrubinstallchroot;;
2019-06-07 17:40:45 -06:00
'grubbootloaderinstall') archgrubinstallbootloaderchroot ${args};;
'grubbootloaderefiinstall') archgrubinstallbootloaderefichroot ${args};;
'grubbootloaderefiusbinstall') archgrubinstallbootloaderefiusbchroot ${args};;
'syslinuxbootloaderinstall') archsyslinuxinstallbootloaderchroot ${args};;
'syslinuxbootloaderefiinstall') archsyslinuxinstallbootloaderefichroot ${args};;
'systemdbootloaderinstall') archsystemdinstallchroot ${args};;
'refindbootloaderinstall') archrefindinstallchroot ${args};;
2015-07-18 18:12:26 -06:00
'archdiinstallandlaunch') archdiinstallandlaunchchroot;;
'archdiinstall') archdiinstallchroot;;
'archdilaunch') archdilaunchchroot;;
esac
else
pacman -S --needed arch-install-scripts wget libnewt
dmesg |grep efi: > /dev/null
if [ "$?" == "1" ]; then
2019-06-07 17:40:45 -06:00
if [ "${eficomputer}" != "1" ]; then
eficomputer=0
fi
2015-07-18 18:12:26 -06:00
else
eficomputer=1
2019-06-07 17:40:45 -06:00
if [ "${efimode}" == "" ]; then
efimode=1
fi
2015-07-18 18:12:26 -06:00
fi
loadstrings
2015-11-01 10:42:23 -07:00
EDITOR=nano
2015-07-18 18:12:26 -06:00
mainmenu
fi
exit 0
# --------------------------------------------------------