mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
remove Basic Setup parts from setup
This commit is contained in:
parent
02d1b22ccd
commit
06126a3475
4 changed files with 9 additions and 182 deletions
13
CHANGELOG
13
CHANGELOG
|
@ -12,12 +12,13 @@ Environment Changes:
|
||||||
- added grub bli efi module
|
- added grub bli efi module
|
||||||
- use BLAKE2b/b2sum instead of sha256sum
|
- use BLAKE2b/b2sum instead of sha256sum
|
||||||
- shortened MOTD and init message
|
- shortened MOTD and init message
|
||||||
- ask basic environment settings on first login
|
- run Basic Setup scripts on first login
|
||||||
- added interactive launcher script
|
- added Basic Setup interactive launcher script
|
||||||
- added network script for network configuration
|
- added Basic Setup network script
|
||||||
- renamed km to vconsole
|
- added Basic Setup pacsetup script
|
||||||
- renamed tz to clock
|
- renamed km to Basic Setup vconsole script
|
||||||
- renamed archboot-locale script to localize
|
- renamed tz to Basic Setup clock script
|
||||||
|
- renamed archboot-locale script to Basic Setup localize script
|
||||||
- load archboot.com and wiki.archlinux.org on firefox startup
|
- load archboot.com and wiki.archlinux.org on firefox startup
|
||||||
localize:
|
localize:
|
||||||
- fixed abort dialog
|
- fixed abort dialog
|
||||||
|
|
|
@ -36,17 +36,10 @@ _localize() {
|
||||||
sleep 3
|
sleep 3
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -e /tmp/.localize-running ]]; then
|
_check
|
||||||
echo "localize already runs on a different console!"
|
|
||||||
echo "Please remove /tmp/.localize-running first!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
: >/tmp/.localize-running
|
|
||||||
while [[ -z ${_LOCALE} ]]; do
|
while [[ -z ${_LOCALE} ]]; do
|
||||||
_localize_menu
|
_localize_menu
|
||||||
done
|
done
|
||||||
_localize
|
_localize
|
||||||
[[ -e /tmp/.localize-running ]] && rm /tmp/.localize-running
|
_cleanup
|
||||||
clear
|
|
||||||
exit 0
|
|
||||||
# vim: set ts=4 sw=4 et:
|
# vim: set ts=4 sw=4 et:
|
||||||
|
|
|
@ -139,61 +139,6 @@ _set_guid() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_configure_vconsole() {
|
|
||||||
if [[ -e /usr/bin/vconsole ]]; then
|
|
||||||
vconsole --setup && _NEXTITEM=1
|
|
||||||
elif [[ -e /usr/bin/archboot-vconsole.sh ]]; then
|
|
||||||
archboot-vconsole.sh --setup && _NEXTITEM=1
|
|
||||||
else
|
|
||||||
_dialog --title " ERROR " --infobox "vconsole script not found, aborting vconsole configuration." 3 60
|
|
||||||
sleep 5
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_configure_network() {
|
|
||||||
if [[ -e /usr/bin/network ]]; then
|
|
||||||
network --setup && _NEXTITEM="2"
|
|
||||||
elif [[ -e /usr/bin/archboot-network.sh ]]; then
|
|
||||||
archboot-network.sh --setup && _NEXTITEM="2"
|
|
||||||
else
|
|
||||||
_dialog --title " ERROR " --infobox "network script not found, aborting network configuration" 3 60
|
|
||||||
sleep 5
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_configure_clock() {
|
|
||||||
if [[ -e /usr/bin/clock ]]; then
|
|
||||||
clock --setup && _NEXTITEM="3"
|
|
||||||
elif [[ -e /usr/bin/archboot-clock.sh ]]; then
|
|
||||||
archboot-clock.sh --setup && _NEXTITEM="3"
|
|
||||||
else
|
|
||||||
_dialog --title " ERROR " --infobox "clock script not found, aborting clock configuration" 3 60
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_select_source() {
|
|
||||||
_NEXTITEM="3"
|
|
||||||
_set_title
|
|
||||||
_S_SRC=""
|
|
||||||
if [[ -e "${_LOCAL_DB}" ]]; then
|
|
||||||
_getsource || return 1
|
|
||||||
else
|
|
||||||
if [[ -z ${_S_NET} ]]; then
|
|
||||||
if ! [[ -e /tmp/.network ]]; then
|
|
||||||
network || return 1
|
|
||||||
_S_NET=1
|
|
||||||
else
|
|
||||||
_S_NET=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ -z ${_S_SRC} ]]; then
|
|
||||||
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && _enable_testing
|
|
||||||
_getsource || return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
_NEXTITEM="4"
|
|
||||||
}
|
|
||||||
|
|
||||||
_prepare_storagedrive() {
|
_prepare_storagedrive() {
|
||||||
_S_MKFSAUTO=""
|
_S_MKFSAUTO=""
|
||||||
_S_MKFS=""
|
_S_MKFS=""
|
||||||
|
@ -304,10 +249,6 @@ _mainmenu() {
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
_dialog --no-cancel ${_DEFAULT} --title " MAIN MENU " \
|
_dialog --no-cancel ${_DEFAULT} --title " MAIN MENU " \
|
||||||
--menu "Use the UP and DOWN arrows to navigate menus.\nUse TAB to switch between buttons and ENTER to select." 17 58 14 \
|
--menu "Use the UP and DOWN arrows to navigate menus.\nUse TAB to switch between buttons and ENTER to select." 17 58 14 \
|
||||||
"0" "Configure Console" \
|
|
||||||
"1" "Configure Network" \
|
|
||||||
"2" "Configure Clock" \
|
|
||||||
"3" "Select Source" \
|
|
||||||
"4" "Prepare Storage Device" \
|
"4" "Prepare Storage Device" \
|
||||||
"5" "Install Packages" \
|
"5" "Install Packages" \
|
||||||
"6" "Configure System" \
|
"6" "Configure System" \
|
||||||
|
@ -315,25 +256,6 @@ _mainmenu() {
|
||||||
"8" "Exit" 2>${_ANSWER}
|
"8" "Exit" 2>${_ANSWER}
|
||||||
_NEXTITEM="$(cat ${_ANSWER})"
|
_NEXTITEM="$(cat ${_ANSWER})"
|
||||||
case $(cat ${_ANSWER}) in
|
case $(cat ${_ANSWER}) in
|
||||||
"0")
|
|
||||||
_configure_vconsole ;;
|
|
||||||
"1")
|
|
||||||
if [[ -e "${_LOCAL_DB}" ]]; then
|
|
||||||
_abort_local_mode
|
|
||||||
else
|
|
||||||
_configure_network
|
|
||||||
fi ;;
|
|
||||||
"2")
|
|
||||||
_configure_clock ;;
|
|
||||||
"3")
|
|
||||||
if [[ "${_DESTDIR}" == "/" ]]; then
|
|
||||||
_abort_running_system
|
|
||||||
elif [[ -e "${_LOCAL_DB}" ]]; then
|
|
||||||
_abort_local_mode
|
|
||||||
else
|
|
||||||
_select_source || return 1
|
|
||||||
_update_environment
|
|
||||||
fi ;;
|
|
||||||
"4")
|
"4")
|
||||||
if [[ "${_DESTDIR}" == "/" ]]; then
|
if [[ "${_DESTDIR}" == "/" ]]; then
|
||||||
_abort_running_system
|
_abort_running_system
|
||||||
|
|
|
@ -9,95 +9,6 @@ _getsource() {
|
||||||
_S_SRC=1
|
_S_SRC=1
|
||||||
}
|
}
|
||||||
|
|
||||||
_enable_testing() {
|
|
||||||
if ! grep -q "^\[.*testing\]" /etc/pacman.conf; then
|
|
||||||
_DOTESTING=""
|
|
||||||
_dialog --defaultno --yesno "Do you want to enable [core-testing]\nand [extra-testing] repositories?\n\nOnly enable this if you need latest\navailable packages for testing purposes!" 9 50 && _DOTESTING=1
|
|
||||||
if [[ -n "${_DOTESTING}" ]]; then
|
|
||||||
sed -i -e '/^#\[core-testing\]/ { n ; s/^#// }' /etc/pacman.conf
|
|
||||||
sed -i -e '/^#\[extra-testing\]/ { n ; s/^#// }' /etc/pacman.conf
|
|
||||||
sed -i -e 's:^#\[core-testing\]:\[core-testing\]:g' -e 's:^#\[extra-testing\]:\[extra-testing\]:g' /etc/pacman.conf
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_update_environment() {
|
|
||||||
if [[ -d "/var/cache/pacman/pkg" ]] && [[ -n "$(ls -A "/var/cache/pacman/pkg")" ]]; then
|
|
||||||
echo "Packages are already in pacman cache..." >"${_LOG}"
|
|
||||||
_dialog --infobox "Packages are already in pacman cache.\nSkipping update environment.\nContinuing in 5 seconds..." 5 50
|
|
||||||
sleep 5
|
|
||||||
else
|
|
||||||
_UPDATE_ENVIRONMENT=""
|
|
||||||
_LOCAL_KERNEL=""
|
|
||||||
_ONLINE_KERNEL=""
|
|
||||||
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt "2571000" ]]; then
|
|
||||||
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
|
|
||||||
_dialog --infobox "Refreshing package database..." 3 70
|
|
||||||
pacman -Sy &>"${_LOG}"
|
|
||||||
sleep 1
|
|
||||||
_dialog --infobox "Checking on new online kernel version..." 3 70
|
|
||||||
#shellcheck disable=SC2086
|
|
||||||
_LOCAL_KERNEL="$(pacman -Qi ${_KERNELPKG} | grep Version | cut -d ':' -f2 | sed -e 's# ##')"
|
|
||||||
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
|
|
||||||
#shellcheck disable=SC2086
|
|
||||||
_ONLINE_KERNEL="$(pacman -Si ${_KERNELPKG}-${_RUNNING_ARCH} | grep Version | cut -d ':' -f2 | sed -e 's# ##')"
|
|
||||||
else
|
|
||||||
if [[ -n "${_DOTESTING}" ]]; then
|
|
||||||
#shellcheck disable=SC2086
|
|
||||||
_ONLINE_KERNEL="$(pacman -Si core-testing/${_KERNELPKG} 2>${_NO_LOG} | grep Version | cut -d ':' -f2 | sed -e 's# ##')"
|
|
||||||
fi
|
|
||||||
if [[ -z "${_ONLINE_KERNEL}" ]]; then
|
|
||||||
#shellcheck disable=SC2086
|
|
||||||
_ONLINE_KERNEL="$(pacman -Si ${_KERNELPKG} | grep Version | cut -d ':' -f2 | sed -e 's# ##')"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "${_LOCAL_KERNEL} local kernel version and ${_ONLINE_KERNEL} online kernel version." >"${_LOG}"
|
|
||||||
sleep 2
|
|
||||||
if [[ "${_LOCAL_KERNEL}" == "${_ONLINE_KERNEL}" ]]; then
|
|
||||||
_dialog --infobox "No new kernel online available.\nSkipping update environment." 4 50
|
|
||||||
sleep 3
|
|
||||||
else
|
|
||||||
_dialog --defaultno --yesno "New online kernel version ${_ONLINE_KERNEL} available.\n\nDo you want to update the archboot environment to latest packages with caching packages for installation?\n\nATTENTION:\nThis will reboot the system using kexec!" 11 60 && _UPDATE_ENVIRONMENT=1
|
|
||||||
if [[ -n "${_UPDATE_ENVIRONMENT}" ]]; then
|
|
||||||
clear
|
|
||||||
echo -e "\e[93mGo and get a cup of coffee. Depending on your system setup,\e[m"
|
|
||||||
echo -e "\e[93myou can \e[1mstart\e[m\e[93m with your tasks in about \e[1m5\e[m\e[93m minutes...\e[m"
|
|
||||||
echo -e "\e[1mStarting\e[m assembling of archboot environment \e[1mwith\e[m package cache..."
|
|
||||||
echo -e "\e[1mRunning now: \e[92mupdate -latest-install\e[m"
|
|
||||||
update -latest-install
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_prepare_pacman() {
|
|
||||||
_NEXTITEM="5"
|
|
||||||
# Set up the necessary directories for pacman use
|
|
||||||
[[ ! -d "${_DESTDIR}/var/cache/pacman/pkg" ]] && mkdir -p "${_DESTDIR}/var/cache/pacman/pkg"
|
|
||||||
[[ ! -d "${_DESTDIR}/var/lib/pacman" ]] && mkdir -p "${_DESTDIR}/var/lib/pacman"
|
|
||||||
_dialog --infobox "Waiting for Arch Linux keyring initialization..." 3 40
|
|
||||||
# pacman-key process itself
|
|
||||||
while pgrep -x pacman-key &>"${_NO_LOG}"; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
# gpg finished in background
|
|
||||||
while pgrep -x gpg &>"${_NO_LOG}"; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
[[ -e /etc/systemd/system/pacman-init.service ]] && systemctl stop pacman-init.service
|
|
||||||
_dialog --infobox "Update Arch Linux keyring..." 3 40
|
|
||||||
_KEYRING="archlinux-keyring"
|
|
||||||
[[ "${_RUNNING_ARCH}" == "aarch64" ]] && _KEYRING="${_KEYRING} archlinuxarm-keyring"
|
|
||||||
#shellcheck disable=SC2086
|
|
||||||
if ! pacman -Sy ${_PACMAN_CONF} --noconfirm --noprogressbar ${_KEYRING} &>"${_LOG}"; then
|
|
||||||
_dialog --title " ERROR " --infobox "Keyring update failed! Check ${_LOG} for errors." 3 60
|
|
||||||
sleep 5
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_run_pacman(){
|
_run_pacman(){
|
||||||
_chroot_mount
|
_chroot_mount
|
||||||
_dialog --title " Pacman " --infobox "Installing package(s) to ${_DESTDIR}:\n${_PACKAGES}...\n\nCheck ${_VC} console (ALT-F${_VC_NUM}) for progress..." 8 70
|
_dialog --title " Pacman " --infobox "Installing package(s) to ${_DESTDIR}:\n${_PACKAGES}...\n\nCheck ${_VC} console (ALT-F${_VC_NUM}) for progress..." 8 70
|
||||||
|
|
Loading…
Reference in a new issue