mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
remove basic-common.sh
This commit is contained in:
parent
1d6cdc9b60
commit
88576635b0
9 changed files with 61 additions and 108 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# written by Tobias Powalowski <tpowa@archlinux.org>
|
# 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"
|
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Clock Configuration"
|
||||||
|
|
||||||
_hwclock() {
|
_hwclock() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# written by Tobias Powalowski <tpowa@archlinux.org>
|
# 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"
|
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Launcher"
|
||||||
|
|
||||||
_check_desktop() {
|
_check_desktop() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# written by Tobias Powalowski <tpowa@archlinux.org>
|
# 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"
|
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Localization"
|
||||||
|
|
||||||
_locale_menu() {
|
_locale_menu() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# written by Tobias Powalowski <tpowa@archlinux.org>
|
# 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"
|
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Network Configuration"
|
||||||
|
|
||||||
_printk()
|
_printk()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
# 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"
|
_TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Pacman Configuration"
|
||||||
|
|
||||||
_task_download_mirror() {
|
_task_download_mirror() {
|
||||||
|
|
|
@ -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:
|
|
|
@ -6,6 +6,11 @@ _BASENAME=${0##*/}
|
||||||
_RUNNING_ARCH="$(uname -m)"
|
_RUNNING_ARCH="$(uname -m)"
|
||||||
_LOG="/dev/tty11"
|
_LOG="/dev/tty11"
|
||||||
_NO_LOG="/dev/null"
|
_NO_LOG="/dev/null"
|
||||||
|
_ANSWER="/.$(basename "${0}")"
|
||||||
|
_LABEL="Exit"
|
||||||
|
_DLPROG="wget -q"
|
||||||
|
_MIRRORLIST="/etc/pacman.d/mirrorlist"
|
||||||
|
_KERNELPKG="linux"
|
||||||
_KEYRING="archlinux-keyring"
|
_KEYRING="archlinux-keyring"
|
||||||
if echo "${_BASENAME}" | grep -qw aarch64; then
|
if echo "${_BASENAME}" | grep -qw aarch64; then
|
||||||
_ARCHBOOT="archboot-arm"
|
_ARCHBOOT="archboot-arm"
|
||||||
|
@ -71,13 +76,13 @@ _riscv64_check() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# returns: whatever dialog did
|
||||||
_dialog() {
|
_dialog() {
|
||||||
dialog --backtitle "${_TITLE}" "$@"
|
dialog --backtitle "${_TITLE}" --aspect 15 "$@"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: percentage
|
# $1: percentage $2: message
|
||||||
# $2: message
|
|
||||||
_progress() {
|
_progress() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
XXX
|
XXX
|
||||||
|
@ -87,10 +92,7 @@ XXX
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: start percentage
|
# $1: start percentage $2: end percentage $3: message $4: sleep time
|
||||||
# $2: end percentage
|
|
||||||
# $3: message
|
|
||||||
# $4: sleep time
|
|
||||||
_progress_wait() {
|
_progress_wait() {
|
||||||
_COUNT=${1}
|
_COUNT=${1}
|
||||||
while [[ -e "${_W_DIR}/.archboot" || -e /.archboot ]]; do
|
while [[ -e "${_W_DIR}/.archboot" || -e /.archboot ]]; do
|
||||||
|
@ -105,6 +107,51 @@ _progress_wait() {
|
||||||
done
|
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() {
|
_kver() {
|
||||||
# this is intentionally very loose. only ensure that we're
|
# this is intentionally very loose. only ensure that we're
|
||||||
# dealing with some sort of string that starts with something
|
# dealing with some sort of string that starts with something
|
||||||
|
|
|
@ -154,7 +154,7 @@ _download_latest_task() {
|
||||||
[[ -e "${_HELP}/${i}" ]] && wget -q "${_SOURCE}${_HELP}/${i}?inline=false" -O "${_HELP}/${i}"
|
[[ -e "${_HELP}/${i}" ]] && wget -q "${_SOURCE}${_HELP}/${i}?inline=false" -O "${_HELP}/${i}"
|
||||||
done
|
done
|
||||||
# main libs
|
# 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
|
for i in ${LIBS}; do
|
||||||
wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}"
|
wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}"
|
||||||
done
|
done
|
||||||
|
|
|
@ -6,8 +6,7 @@ build ()
|
||||||
{
|
{
|
||||||
map add_file "/etc/archboot/defaults" "/usr/lib/archboot/common.sh" \
|
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/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/login.sh" "/usr/lib/archboot/cpio.sh" "/usr/bin/archboot-cpio.sh"
|
||||||
"/usr/lib/archboot/basic-common.sh"
|
|
||||||
add_full_dir "/usr/lib/archboot/update"
|
add_full_dir "/usr/lib/archboot/update"
|
||||||
add_file "/usr/bin/archboot-update.sh" "/usr/bin/update"
|
add_file "/usr/bin/archboot-update.sh" "/usr/bin/update"
|
||||||
add_file "/usr/share/archboot/gpg/tpowa.gpg"
|
add_file "/usr/share/archboot/gpg/tpowa.gpg"
|
||||||
|
|
Loading…
Reference in a new issue