mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
rename 0 to _BASENAME
This commit is contained in:
parent
71265c4c94
commit
cbb1ffb757
6 changed files with 21 additions and 21 deletions
|
@ -62,9 +62,9 @@ _riscv64_check() {
|
|||
|
||||
### check architecture
|
||||
_architecture_check() {
|
||||
echo "${0}" | grep -qw aarch64 && _aarch64_check
|
||||
echo "${0}" | grep -qw riscv64 && _riscv64_check
|
||||
echo "${0}" | grep -qw x86_64 && _x86_64_check
|
||||
echo "${_BASENAME}" | grep -qw aarch64 && _aarch64_check
|
||||
echo "${_BASENAME}" | grep -qw riscv64 && _riscv64_check
|
||||
echo "${_BASENAME}" | grep -qw x86_64 && _x86_64_check
|
||||
}
|
||||
|
||||
### check if running in container
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. /etc/archboot/defaults
|
||||
. /usr/lib/archboot/common.sh
|
||||
. /usr/lib/archboot/container.sh
|
||||
if echo "${0}" | grep -qw aarch64; then
|
||||
if echo "${_BASENAME}" | grep -qw aarch64; then
|
||||
_PACMAN_ARCH_CHROOT="${_PACMAN_AARCH64_CHROOT}"
|
||||
_PACMAN_ARCH="${_PACMAN_AARCH64}"
|
||||
_ARCH_VERSION="ArchLinuxARM-aarch64-latest.tar.gz"
|
||||
|
@ -11,7 +11,7 @@ if echo "${0}" | grep -qw aarch64; then
|
|||
_LATEST_ARCH="http://os.archlinuxarm.org/os/${_ARCH_VERSION}"
|
||||
_CAP_ARCH="AARCH64"
|
||||
_ARCH="aarch64"
|
||||
else
|
||||
elif echo "${_BASENAME}" | grep -qw riscv64; then
|
||||
_PACMAN_ARCH_CHROOT="${_PACMAN_RISCV64_CHROOT}"
|
||||
_PACMAN_ARCH="${_PACMAN_RISCV64}"
|
||||
_ARCH_VERSION="archriscv-20220727.tar.zst"
|
||||
|
@ -38,7 +38,7 @@ echo "Starting container creation ..."
|
|||
[[ -f ${_PACMAN_ARCH_CHROOT} ]] && rm ${_PACMAN_ARCH_CHROOT}{,.sig} 2>/dev/null
|
||||
echo "Create directory ${1} ..."
|
||||
mkdir -p "${1}"/"${_PACMAN_ARCH}"
|
||||
echo "Downloading archlinux riscv64 ..."
|
||||
echo "Downloading archlinux ${_ARCH} ..."
|
||||
! [[ -f ${_ARCH_VERSION} ]] && wget "${_LATEST_ARCH}" >/dev/null 2>&1
|
||||
bsdtar -xf ${_ARCH_VERSION} -C "${1}"
|
||||
echo "Removing installation tarball ..."
|
||||
|
|
|
@ -7,7 +7,7 @@ _parameters "$@"
|
|||
_root_check
|
||||
echo "Starting container creation ..."
|
||||
[[ -d "${1}" ]] || (echo "Create directory ${1} ..."; mkdir "${1}")
|
||||
if echo "${0}" | grep -qw "${_RUNNING_ARCH}"; then
|
||||
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
|
||||
# running system = creating system
|
||||
_cachedir_check
|
||||
_create_pacman_conf "${1}"
|
||||
|
@ -38,10 +38,10 @@ if echo "${0}" | grep -qw "${_RUNNING_ARCH}"; then
|
|||
else
|
||||
# running system != creating system
|
||||
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
|
||||
if echo "${0}" | grep -qw aarch64; then
|
||||
if echo "${_BASENAME}" | grep -qw aarch64; then
|
||||
_pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
|
||||
fi
|
||||
if echo "${0}" | grep -qw riscv64; then
|
||||
if echo "${_BASENAME}" | grep -qw riscv64; then
|
||||
_pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
|
||||
fi
|
||||
_create_pacman_conf "${1}" "use_binfmt"
|
||||
|
|
|
@ -8,16 +8,16 @@ _parameters "$@"
|
|||
_root_check
|
||||
_architecture_check
|
||||
_config
|
||||
if echo "${0}" | grep -qw aarch64 || echo "${0}" | grep -qw x86_64; then
|
||||
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
|
||||
# running system = aarch64 or x86_64
|
||||
echo "Starting ISO creation ..."
|
||||
_prepare_kernel_initramfs_files || exit 1
|
||||
_prepare_ucode || exit 1
|
||||
if echo "${0}" | grep -qw aarch64; then
|
||||
if echo "${_BASENAME}" | grep -qw aarch64; then
|
||||
_prepare_fedora_shim_bootloaders_aarch64 || exit 1
|
||||
_prepare_uefi_AA64 || exit 1
|
||||
fi
|
||||
if echo "${0}" | grep -qw x86_64; then
|
||||
if echo "${_BASENAME}" | grep -qw x86_64; then
|
||||
_prepare_fedora_shim_bootloaders_x86_64 || exit 1
|
||||
_prepare_uefi_shell_tianocore || exit 1
|
||||
_prepare_uefi_X64 || exit 1
|
||||
|
@ -40,7 +40,7 @@ else
|
|||
fi
|
||||
_create_cksum || exit 1
|
||||
_cleanup_iso || exit 1
|
||||
if echo "${0}" | grep -qw aarch64 || echo "${0}" | grep -qw x86_64; then
|
||||
if echo "${_BASENAME}" | grep -qw aarch64 || echo "${_BASENAME}" | grep -qw x86_64; then
|
||||
echo "Finished ISO creation."
|
||||
else
|
||||
echo "Finished Image creation."
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
. /usr/lib/archboot/common.sh
|
||||
. /usr/lib/archboot/container.sh
|
||||
. /usr/lib/archboot/repository.sh
|
||||
[[ -d "${1}" ]] || (echo "Create directory ${1} ..."; mkdir "${1}")
|
||||
_REPODIR="$(mktemp -d "${1}"/repository.XXX)"
|
||||
_CACHEDIR="${_REPODIR}/var/cache/pacman/pkg"
|
||||
[[ -z "${1}" ]] && _usage
|
||||
_root_check
|
||||
[[ -d "${1}" ]] || (echo "Create directory ${1} ..."; mkdir "${1}")
|
||||
_REPODIR="$(mktemp -d "${1}"/repository.XXX)"
|
||||
echo "Starting repository creation ..."
|
||||
if echo "${0}" | grep -qw "${_RUNNING_ARCH}"; then
|
||||
if echo "${_BASENAME}" | grep -qw "${_RUNNING_ARCH}"; then
|
||||
# running system = creating system
|
||||
[[ "${_RUNNING_ARCH}" == "x86_64" ]] && _x86_64_pacman_use_default || exit 1
|
||||
_cachedir_check
|
||||
|
@ -22,10 +22,10 @@ if echo "${0}" | grep -qw "${_RUNNING_ARCH}"; then
|
|||
else
|
||||
# running system != creating system
|
||||
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
|
||||
if echo "${0}" | grep -qw aarch64; then
|
||||
if echo "${_BASENAME}" | grep -qw aarch64; then
|
||||
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" "${_PACMAN_AARCH64_CHROOT}" || exit 1
|
||||
fi
|
||||
if echo "${0}" | grep -qw riscv64; then
|
||||
if echo "${_BASENAME}" | grep -qw riscv64; then
|
||||
_pacman_chroot "${_REPODIR}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" "${_PACMAN_RISCV64_CHROOT}" || exit 1
|
||||
fi
|
||||
_create_pacman_conf "${_REPODIR}" "use_binfmt"
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
. /usr/lib/archboot/common.sh
|
||||
. /usr/lib/archboot/server.sh
|
||||
_root_check
|
||||
if echo "${0}" | grep -qw riscv64 || echo "${0}" | grep -qw aarch64; then
|
||||
if echo "${_BASENAME}" | grep -qw riscv64 || echo "${_BASENAME}" | grep -qw aarch64; then
|
||||
_update_pacman_chroot || exit 1
|
||||
fi
|
||||
_update_source
|
||||
if echo "${0}" | grep -qw x86_64; then
|
||||
if echo "${_BASENAME}" | grep -qw x86_64; then
|
||||
_x86_64_pacman_use_default || exit 1
|
||||
fi
|
||||
_server_release || exit 1
|
||||
if echo "${0}" | grep -qw x86_64; then
|
||||
if echo "${_BASENAME}" | grep -qw x86_64; then
|
||||
_x86_64_pacman_restore || exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue