remove basic-common.sh

This commit is contained in:
Tobias Powalowski 2023-09-03 22:01:29 +02:00
parent 1d6cdc9b60
commit 88576635b0
9 changed files with 61 additions and 108 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# written by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/basic-common.sh
. /usr/lib/archboot/basic.sh
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Clock Configuration"
_hwclock() {

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# written by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/basic-common.sh
. /usr/lib/archboot/basic.sh
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Launcher"
_check_desktop() {

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# written by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/basic-common.sh
. /usr/lib/archboot/basic.sh
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Localization"
_locale_menu() {

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# written by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/basic-common.sh
. /usr/lib/archboot/basic.sh
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Network Configuration"
_printk()

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/basic-common.sh
. /usr/lib/archboot/basic.sh
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Pacman Configuration"
_task_download_mirror() {

View file

@ -1,93 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
LANG=C
_ANSWER="/.$(basename "${0}")"
_RUNNING_ARCH="$(uname -m)"
_LOG="/dev/tty11"
_NO_LOG="/dev/null"
_LABEL="Exit"
_DLPROG="wget -q"
_MIRRORLIST="/etc/pacman.d/mirrorlist"
_KERNELPKG="linux"
# _dialog()
# an el-cheapo dialog wrapper
#
# parameters: see dialog(1)
# returns: whatever dialog did
_dialog() {
dialog --backtitle "${_TITLE}" --aspect 15 "$@"
return $?
}
_progress() {
cat <<EOF
XXX
${1}
${2}
XXX
EOF
}
# $1: start percentage $2: end percentage $3: message $4: sleep time
_progress_wait() {
_COUNT=${1}
while true; do
if [[ "${_COUNT}" -lt "${2}" ]]; then
_progress "${_COUNT}" "${3}"
fi
if [[ "${_COUNT}" -gt "${2}" ]]; then
_progress "${2}" "${3}"
fi
_COUNT="$((_COUNT+1))"
read -r -t "${4}"
! [[ -e /.archboot ]] && break
done
}
_show_login() {
[[ -e "/.${_ANSWER}-running" ]] && rm "/.${_ANSWER}-running"
clear
echo ""
agetty --show-issue
echo ""
cat /etc/motd
}
_abort() {
if _dialog --yesno "Abort$(echo "${_TITLE}" | cut -d '|' -f3) ?" 5 45; then
[[ -e "${_ANSWER}-running" ]] && rm "${_ANSWER}-running"
[[ -e "${_ANSWER}" ]] && rm "${_ANSWER}"
clear
exit 1
else
_CONTINUE=""
fi
}
_check() {
if [[ -e "${_ANSWER}-running" ]]; then
clear
echo "${0} already runs on a different console!"
echo "Please remove ${_ANSWER}-running first to launch ${0}!"
exit 1
fi
: >"${_ANSWER}"
: >"${_ANSWER}-running"
}
_cleanup() {
[[ -e "${_ANSWER}-running" ]] && rm "${_ANSWER}-running"
clear
exit 0
}
_run_update_environment() {
if update | grep -q latest-install; then
update -latest-install
else
update -latest
fi
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -6,6 +6,11 @@ _BASENAME=${0##*/}
_RUNNING_ARCH="$(uname -m)"
_LOG="/dev/tty11"
_NO_LOG="/dev/null"
_ANSWER="/.$(basename "${0}")"
_LABEL="Exit"
_DLPROG="wget -q"
_MIRRORLIST="/etc/pacman.d/mirrorlist"
_KERNELPKG="linux"
_KEYRING="archlinux-keyring"
if echo "${_BASENAME}" | grep -qw aarch64; then
_ARCHBOOT="archboot-arm"
@ -71,13 +76,13 @@ _riscv64_check() {
fi
}
# returns: whatever dialog did
_dialog() {
dialog --backtitle "${_TITLE}" "$@"
dialog --backtitle "${_TITLE}" --aspect 15 "$@"
return $?
}
# $1: percentage
# $2: message
# $1: percentage $2: message
_progress() {
cat <<EOF
XXX
@ -87,10 +92,7 @@ XXX
EOF
}
# $1: start percentage
# $2: end percentage
# $3: message
# $4: sleep time
# $1: start percentage $2: end percentage $3: message $4: sleep time
_progress_wait() {
_COUNT=${1}
while [[ -e "${_W_DIR}/.archboot" || -e /.archboot ]]; do
@ -105,6 +107,51 @@ _progress_wait() {
done
}
_show_login() {
[[ -e "/.${_ANSWER}-running" ]] && rm "/.${_ANSWER}-running"
clear
echo ""
agetty --show-issue
echo ""
cat /etc/motd
}
_abort() {
if _dialog --yesno "Abort$(echo "${_TITLE}" | cut -d '|' -f3) ?" 5 45; then
[[ -e "${_ANSWER}-running" ]] && rm "${_ANSWER}-running"
[[ -e "${_ANSWER}" ]] && rm "${_ANSWER}"
clear
exit 1
else
_CONTINUE=""
fi
}
_check() {
if [[ -e "${_ANSWER}-running" ]]; then
clear
echo "${0} already runs on a different console!"
echo "Please remove ${_ANSWER}-running first to launch ${0}!"
exit 1
fi
: >"${_ANSWER}"
: >"${_ANSWER}-running"
}
_cleanup() {
[[ -e "${_ANSWER}-running" ]] && rm "${_ANSWER}-running"
clear
exit 0
}
_run_update_environment() {
if update | grep -q latest-install; then
update -latest-install
else
update -latest
fi
}
_kver() {
# this is intentionally very loose. only ensure that we're
# dealing with some sort of string that starts with something

View file

@ -154,7 +154,7 @@ _download_latest_task() {
[[ -e "${_HELP}/${i}" ]] && wget -q "${_SOURCE}${_HELP}/${i}?inline=false" -O "${_HELP}/${i}"
done
# main libs
LIBS="basic-common.sh common.sh container.sh release.sh iso.sh login.sh cpio.sh"
LIBS="common.sh container.sh release.sh iso.sh login.sh cpio.sh"
for i in ${LIBS}; do
wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}"
done

View file

@ -6,8 +6,7 @@ build ()
{
map add_file "/etc/archboot/defaults" "/usr/lib/archboot/common.sh" \
"/usr/lib/archboot/container.sh" "/usr/bin/archboot-$(uname -m)-create-container.sh" \
"/usr/lib/archboot/login.sh" "/usr/lib/archboot/cpio.sh" "/usr/bin/archboot-cpio.sh" \
"/usr/lib/archboot/basic-common.sh"
"/usr/lib/archboot/login.sh" "/usr/lib/archboot/cpio.sh" "/usr/bin/archboot-cpio.sh"
add_full_dir "/usr/lib/archboot/update"
add_file "/usr/bin/archboot-update.sh" "/usr/bin/update"
add_file "/usr/share/archboot/gpg/tpowa.gpg"