Skip to content

Commit 6befd20

Browse files
committed
Merge branch 'dev' into alteriso-3.1-plasma
2 parents 84cac9c + d40bca3 commit 6befd20

File tree

11 files changed

+91
-62
lines changed

11 files changed

+91
-62
lines changed

.shellcheckrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
shell=bash
22
disable=SC1090
33
disable=SC2154
4+
disable=SC2016
5+
disable=SC2034
46
source-path=SCRIPTDIR

build.sh

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ _usage () {
126126
done
127127

128128
echo " Channel:"
129-
for _dirname in $(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -d -b -n show); do
130-
echo -ne " ${_dirname%.add}$(echo_blank "$(( "${blank}" - 3 - "$(echo "${_dirname%.add}" | wc -m)" ))")"
131-
"${tools_dir}/channel.sh" --version "${alteriso_version}" --nocheck desc "${_dirname%.add}"
129+
for _dirname in $(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -d -b -n --line show | sed "s|.add$||g"); do
130+
echo -ne " ${_dirname}$(echo_blank "$(( "${blank}" - 4 - "${#_dirname}" ))")"
131+
"${tools_dir}/channel.sh" --version "${alteriso_version}" --nocheck desc "${_dirname}"
132132
done
133133

134134
echo
@@ -324,9 +324,7 @@ prepare_env() {
324324
if [[ "${nodepend}" = false ]]; then
325325
local _check_failed=false _pkg _result=0
326326
msg_info "Checking dependencies ..."
327-
if ! pacman -Qq pyalpm > /dev/null 2>&1; then
328-
msg_error "pyalpm is not installed." 1
329-
fi
327+
! pacman -Qq pyalpm > /dev/null 2>&1 && msg_error "pyalpm is not installed." 1
330328
for _pkg in "${dependence[@]}"; do
331329
eval "${tools_dir}/package.py" "${_pkg}" "$( [[ "${debug}" = false ]] && echo "> /dev/null")" || _result="${?}"
332330
if (( _result == 3 )) || (( _result == 4 )); then
@@ -340,7 +338,7 @@ prepare_env() {
340338
# Load loop kernel module
341339
if [[ "${noloopmod}" = false ]]; then
342340
[[ ! -d "/usr/lib/modules/$(uname -r)" ]] && msg_error "The currently running kernel module could not be found.\nProbably the system kernel has been updated.\nReboot your system to run the latest kernel." "1"
343-
[[ -z "$(lsmod | getclm 1 | grep -x "loop")" ]] && modprobe loop
341+
lsmod | getclm 1 | grep -x "loop" || modprobe loop
344342
fi
345343

346344
# Check work dir
@@ -384,7 +382,7 @@ show_settings() {
384382
msg_info "Build with architecture ${arch}."
385383
if [[ "${noconfirm}" = false ]]; then
386384
echo -e "\nPress Enter to continue or Ctrl + C to cancel."
387-
read
385+
read -r
388386
fi
389387
trap 1 2 3 15
390388
trap 'umount_trap' 1 2 3 15
@@ -413,7 +411,7 @@ prepare_build() {
413411
# Legacy mode
414412
if [[ "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" ver "${channel_name}")" = "3.0" ]]; then
415413
msg_warn "The module cannot be used because it works with Alter ISO3.0 compatibility."
416-
if [[ ! -z "${include_extra+SET}" ]]; then
414+
if [[ -n "${include_extra+SET}" ]]; then
417415
if [[ "${include_extra}" = true ]]; then
418416
modules=("base" "share" "share-extra" "calamares" "zsh-powerline")
419417
else
@@ -427,7 +425,7 @@ prepare_build() {
427425
msg_debug "Checking ${1} module ..."
428426
bash "${tools_dir}/module.sh" check "${1}" || msg_error "Module ${1} is not available." "1";
429427
}
430-
modules=($(printf "%s\n" "${modules[@]}" | awk '!a[$0]++'))
428+
readarray -t modules < <(printf "%s\n" "${modules[@]}" | awk '!a[$0]++')
431429
for_module "module_check {}"
432430
for_module load_config "${module_dir}/{}/config.any" "${module_dir}/{}/config.${arch}"
433431
msg_debug "Loaded modules: ${modules[*]}"
@@ -450,6 +448,7 @@ prepare_build() {
450448
# Generate iso file name.
451449
local _channel_name="${channel_name%.add}-${locale_version}"
452450
iso_filename="${iso_name}-${_channel_name}-${iso_version}-${arch}.iso"
451+
tar_filename="${iso_filename%.iso}.tar.xz"
453452
[[ "${nochname}" = true ]] && iso_filename="${iso_name}-${iso_version}-${arch}.iso"
454453
msg_debug "Iso filename is ${iso_filename}"
455454

@@ -458,7 +457,7 @@ prepare_build() {
458457

459458
# Check architecture for each channel
460459
local _exit=0
461-
bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -a ${arch} -n -b check "${channel_name}" || _exit="${?}"
460+
bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -a "${arch}" -n -b check "${channel_name}" || _exit="${?}"
462461
if (( "${_exit}" != 0 )) && (( "${_exit}" != 1 )); then
463462
msg_error "${channel_name} channel does not support current architecture (${arch})." "1"
464463
fi
@@ -537,7 +536,7 @@ make_basefs() {
537536
# Additional packages (airootfs)
538537
make_packages_repo() {
539538
msg_debug "pkglist.sh ${pkglist_args[*]}"
540-
local _pkglist=($("${tools_dir}/pkglist.sh" "${pkglist_args[@]}"))
539+
readarray -t _pkglist < <("${tools_dir}/pkglist.sh" "${pkglist_args[@]}")
541540

542541
# Create a list of packages to be finally installed as packages.list directly under the working directory.
543542
echo -e "# The list of packages that is installed in live cd.\n#\n" > "${build_dir}/packages.list"
@@ -550,7 +549,7 @@ make_packages_repo() {
550549
}
551550

552551
make_packages_aur() {
553-
local _pkglist_aur=($("${tools_dir}/pkglist.sh" --aur "${pkglist_args[@]}"))
552+
readarray -t _pkglist_aur < <("${tools_dir}/pkglist.sh" --aur "${pkglist_args[@]}")
554553

555554
# Create a list of packages to be finally installed as packages.list directly under the working directory.
556555
echo -e "\n# AUR packages.\n#\n" >> "${build_dir}/packages.list"
@@ -779,7 +778,7 @@ make_syslinux() {
779778
local _remove_config
780779
function _remove_config() {
781780
remove "${isofs_dir}/syslinux/${1}"
782-
sed -i "s|$(cat "${isofs_dir}/syslinux/archiso_sys_load.cfg" | grep "${1}")||g" "${isofs_dir}/syslinux/archiso_sys_load.cfg"
781+
sed -i "s|$(grep "${1}" "${isofs_dir}/syslinux/archiso_sys_load.cfg")||g" "${isofs_dir}/syslinux/archiso_sys_load.cfg"
783782
}
784783

785784
[[ "${norescue_entry}" = true ]] && _remove_config archiso_sys_rescue.cfg
@@ -814,25 +813,18 @@ make_isolinux() {
814813

815814
# Prepare /EFI
816815
make_efi() {
817-
install -d -m 0755 -- "${isofs_dir}/EFI/boot"
816+
local _bootfile _use_config_name="nosplash" _efi_config_list=() _efi_config
817+
[[ "${boot_splash}" = true ]] && _use_config_name="splash"
818+
_bootfile="$(basename "$(ls "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-boot"*".efi" )")"
818819

819-
local _bootfile="$(basename "$(ls "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-boot"*".efi" )")"
820+
install -d -m 0755 -- "${isofs_dir}/EFI/boot"
820821
install -m 0644 -- "${airootfs_dir}/usr/lib/systemd/boot/efi/${_bootfile}" "${isofs_dir}/EFI/boot/${_bootfile#systemd-}"
821822

822-
local _use_config_name="nosplash"
823-
if [[ "${boot_splash}" = true ]]; then
824-
_use_config_name="splash"
825-
fi
826-
827823
install -d -m 0755 -- "${isofs_dir}/loader/entries"
828824
sed "s|%ARCH%|${arch}|g;" "${script_path}/efiboot/${_use_config_name}/loader.conf" > "${isofs_dir}/loader/loader.conf"
829825

830-
local _efi_config_list=() _efi_config
831-
_efi_config_list+=($(ls "${script_path}/efiboot/${_use_config_name}/archiso-usb"*".conf" | grep -v "rescue"))
832-
833-
if [[ "${norescue_entry}" = false ]]; then
834-
_efi_config_list+=($(ls "${script_path}/efiboot/${_use_config_name}/archiso-usb"*".conf" | grep -v "rescue"))
835-
fi
826+
readarray -t _efi_config_list < <(find "${script_path}/efiboot/${_use_config_name}/" -mindepth 1 -maxdepth 1 -type f -name "archiso-usb*.conf" -printf "%f" | grep -v "rescue")
827+
[[ "${norescue_entry}" = false ]] && readarray -t _efi_config_list < <(find "${script_path}/efiboot/${_use_config_name}/" -mindepth 1 -maxdepth 1 -type f -name "archiso-usb*rescue*.conf" -printf "%f")
836828

837829
for _efi_config in "${_efi_config_list[@]}"; do
838830
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
@@ -869,35 +861,27 @@ make_efiboot() {
869861
mkdir -p "${build_dir}/efiboot"
870862
mount "${build_dir}/efiboot.img" "${build_dir}/efiboot"
871863

872-
mkdir -p "${build_dir}/efiboot/EFI/alteriso/${arch}"
864+
mkdir -p "${build_dir}/efiboot/EFI/alteriso/${arch}" "${build_dir}/efiboot/EFI/boot" "${build_dir}/efiboot/loader/entries"
873865
cp "${isofs_dir}/${install_dir}/boot/${arch}/${kernel_filename}" "${build_dir}/efiboot/EFI/alteriso/${arch}/${kernel_filename}.efi"
874866
cp "${isofs_dir}/${install_dir}/boot/${arch}/archiso.img" "${build_dir}/efiboot/EFI/alteriso/${arch}/archiso.img"
875867

876-
local _ucode_image
868+
local _ucode_image _efi_config _use_config_name="nosplash" _bootfile
877869
for _ucode_image in "${airootfs_dir}/boot/"{intel-uc.img,intel-ucode.img,amd-uc.img,amd-ucode.img,early_ucode.cpio,microcode.cpio}; do
878870
[[ -e "${_ucode_image}" ]] && cp "${_ucode_image}" "${build_dir}/efiboot/EFI/alteriso/"
879871
done
880872

881-
mkdir -p "${build_dir}/efiboot/EFI/boot"
882-
883873
cp "${airootfs_dir}/usr/share/efitools/efi/HashTool.efi" "${build_dir}/efiboot/EFI/boot/"
884874

885-
local _bootfile="$(basename "$(ls "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-boot"*".efi" )")"
875+
_bootfile="$(basename "$(ls "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-boot"*".efi" )")"
886876
cp "${airootfs_dir}/usr/lib/systemd/boot/efi/${_bootfile}" "${build_dir}/efiboot/EFI/boot/${_bootfile#systemd-}"
887877

888-
local _use_config_name="nosplash"
889878
[[ "${boot_splash}" = true ]] && _use_config_name="splash"
890-
891-
mkdir -p "${build_dir}/efiboot/loader/entries"
892879
sed "s|%ARCH%|${arch}|g;" "${script_path}/efiboot/${_use_config_name}/loader.conf" > "${build_dir}/efiboot/loader/loader.conf"
893880

894881
find "${isofs_dir}/loader/entries/" -maxdepth 1 -mindepth 1 -name "uefi-shell*" -type f -printf "%p\0" | xargs -0 -I{} cp {} "${build_dir}/efiboot/loader/entries/"
895882

896-
local _efi_config _efi_config_list=($(ls "${script_path}/efiboot/${_use_config_name}/archiso-cd"*".conf"))
897-
898-
if [[ "${norescue_entry}" = false ]]; then
899-
_efi_config_list=($(printf "%s\n" "${_efi_config_list[@]}" | grep -v "rescue"))
900-
fi
883+
readarray -t _efi_config_list < <(find "${script_path}/efiboot/${_use_config_name}/" -mindepth 1 -maxdepth 1 -type f -name "archiso-cd*.conf" -printf "%f" | grep -v "rescue")
884+
[[ "${norescue_entry}" = false ]] && readarray -t _efi_config_list < <(find "${script_path}/efiboot/${_use_config_name}/" -mindepth 1 -maxdepth 1 -type f -name "archiso-cd*rescue*.conf" -printf "%f")
901885

902886
for _efi_config in "${_efi_config_list[@]}"; do
903887
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
@@ -922,9 +906,7 @@ make_tarball() {
922906

923907
# Run script
924908
mount_airootfs
925-
if [[ -f "${airootfs_dir}/root/optimize_for_tarball.sh" ]]; then
926-
_chroot_run "bash /root/optimize_for_tarball.sh -u ${username}"
927-
fi
909+
[[ -f "${airootfs_dir}/root/optimize_for_tarball.sh" ]] && _chroot_run "bash /root/optimize_for_tarball.sh -u ${username}"
928910

929911
_cleanup_common
930912
_chroot_run "mkinitcpio -P"
@@ -933,20 +915,17 @@ make_tarball() {
933915

934916
mkdir -p "${out_dir}"
935917
msg_info "Creating tarball..."
936-
local tar_path="$(realpath ${out_dir})/${iso_filename%.iso}.tar.xz"
937918
cd -- "${airootfs_dir}"
938-
tar -v -J -p -c -f "${tar_path}" ./*
919+
tar -v -J -p -c -f "${out_dir}/${tar_filename}" ./*
939920
cd -- "${OLDPWD}"
940921

941-
_mkchecksum "${tar_path}"
942-
msg_info "Done! | $(ls -sh ${tar_path})"
922+
_mkchecksum "${out_dir}/${tar_filename}"
923+
msg_info "Done! | $(ls -sh "${out_dir}/${tar_filename}")"
943924

944925
remove "${airootfs_dir}.img"
945926
mv "${airootfs_dir}.img.org" "${airootfs_dir}.img"
946927

947-
if [[ "${noiso}" = true ]]; then
948-
msg_info "The password for the live user and root is ${password}."
949-
fi
928+
[[ "${noiso}" = true ]] && msg_info "The password for the live user and root is ${password}."
950929

951930
return 0
952931
}
@@ -1038,7 +1017,7 @@ make_iso() {
10381017
-eltorito-boot syslinux/isolinux.bin \
10391018
-eltorito-catalog syslinux/boot.cat \
10401019
-no-emul-boot -boot-load-size 4 -boot-info-table \
1041-
-isohybrid-mbr ${build_dir}/iso/syslinux/isohdpfx.bin \
1020+
-isohybrid-mbr "${build_dir}/iso/syslinux/isohdpfx.bin" \
10421021
"${_iso_efi_boot_args[@]}" \
10431022
-output "${out_dir}/${iso_filename}" \
10441023
"${build_dir}/iso/"
@@ -1052,10 +1031,9 @@ make_iso() {
10521031

10531032

10541033
# Parse options
1055-
ARGUMENT=("${@}" ${DEFAULT_ARGUMENT})
10561034
OPTS=("a:" "b" "c:" "d" "e" "g:" "h" "j" "k:" "l:" "o:" "p:" "r" "t:" "u:" "w:" "x")
10571035
OPTL=("arch:" "boot-splash" "comp-type:" "debug" "cleaning" "cleanup" "gpgkey:" "help" "lang:" "japanese" "kernel:" "out:" "password:" "comp-opts:" "user:" "work:" "bash-debug" "nocolor" "noconfirm" "nodepend" "gitversion" "msgdebug" "noloopmod" "tarball" "noiso" "noaur" "nochkver" "channellist" "config:" "noefi" "nodebug" "nosigcheck" "normwork" "log" "logpath:" "nolog" "nopkgbuild" "pacman-debug" "confirm")
1058-
if ! OPT=$(getopt -o "$(printf "%s," "${OPTS[@]}")" -l "$(printf "%s," "${OPTL[@]}")" -- "${ARGUMENT[@]}"); then
1036+
if ! OPT=$(getopt -o "$(printf "%s," "${OPTS[@]}")" -l "$(printf "%s," "${OPTL[@]}")" -- "${@}" "${DEFAULT_ARGUMENT[@]}"); then
10591037
exit 1
10601038
fi
10611039

@@ -1262,7 +1240,7 @@ msg_debug "Use the default configuration file (${defaultconfig})."
12621240

12631241
# Check for a valid channel name
12641242
if [[ -n "${1+SET}" ]]; then
1265-
case "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -n check "${1}"; printf "${?}")" in
1243+
case "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -n check "${1}"; printf "%d" "${?}")" in
12661244
"2")
12671245
msg_error "Invalid channel ${1}" "1"
12681246
;;
@@ -1280,7 +1258,6 @@ else
12801258
fi
12811259

12821260
# Set vars
1283-
work_dir="$(realpath "${work_dir}")"
12841261
build_dir="${work_dir}/build/${arch}"
12851262
cache_dir="${work_dir}/cache/${arch}"
12861263
airootfs_dir="${build_dir}/airootfs"
@@ -1292,6 +1269,7 @@ gitrev="$(cd "${script_path}"; git rev-parse --short HEAD)"
12921269
for _dir in "${build_dir}" "${cache_dir}" "${airootfs_dir}" "${isofs_dir}" "${lockfile_dir}"; do
12931270
mkdir -p "${_dir}"
12941271
done
1272+
ork_dir="$(realpath "${work_dir}")"
12951273

12961274
# Set for special channels
12971275
if [[ -d "${channel_dir}.add" ]]; then

default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# !! WARNING !!
2727
# This variable can only be used in default.conf.
2828
# It does not apply even if it is used in the config of each channel.
29-
DEFAULT_ARGUMENT=""
29+
DEFAULT_ARGUMENT=()
3030

3131
#-- archiso --#
3232
# Architecture to build

modules/calamares/packages_aur.i486/calamares.i486

Lines changed: 0 additions & 1 deletion
This file was deleted.

modules/calamares/packages_aur.i686/calamares.i686

Lines changed: 0 additions & 1 deletion
This file was deleted.

modules/calamares/packages_aur.x86_64/calamares.x86_64

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pkgbase = ckbcomp
2+
pkgdesc = Compile a XKB keyboard description to a keymap suitable for loadkeys or kbdcontrol
3+
pkgver = 1.203
4+
pkgrel = 1
5+
url = http://anonscm.debian.org/cgit/d-i/console-setup.git/
6+
arch = any
7+
license = GPL2
8+
depends = perl
9+
source = http://ftp.de.debian.org/debian/pool/main/c/console-setup/console-setup_1.203.tar.xz
10+
sha512sums = e73ade4a35c7d5e4986587067ab081da8b99acd1013ef2f9de63205f43a0777a917c0ce18e35f0fc95bfe22162ad56e0c92f1f9d657a27681a26d525441bcf2a
11+
12+
pkgname = ckbcomp
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Maintainer : Yamada Hayao <[email protected]>
2+
# Contributer: Nissar Chababy <funilrys at outlook dot com>
3+
# Contributer: Jeroen Bollen <jbinero at gmail dot comau>
4+
5+
pkgname=ckbcomp
6+
pkgver=1.203
7+
pkgrel=1
8+
pkgdesc="Compile a XKB keyboard description to a keymap suitable for loadkeys or kbdcontrol"
9+
arch=(any)
10+
url="http://anonscm.debian.org/cgit/d-i/console-setup.git/"
11+
license=('GPL2')
12+
depends=('perl')
13+
source=("http://ftp.de.debian.org/debian/pool/main/c/console-setup/console-setup_${pkgver}.tar.xz")
14+
sha512sums=('e73ade4a35c7d5e4986587067ab081da8b99acd1013ef2f9de63205f43a0777a917c0ce18e35f0fc95bfe22162ad56e0c92f1f9d657a27681a26d525441bcf2a')
15+
16+
package() {
17+
if [[ -d "${srcdir}/console-setup" ]]; then
18+
cd console-setup
19+
elif [[ -d "${srcdir}/console-setup-${pkgver}" ]]; then
20+
cd console-setup-${pkgver}
21+
else
22+
echo "Source directory not found.".
23+
exit 1
24+
fi
25+
26+
27+
[[ "${?}" != 0 ]] && cd "console-setup-${pkgver}"
28+
29+
install -Dm755 "Keyboard/ckbcomp" "${pkgdir}/usr/bin/ckbcomp"
30+
}

modules/calamares/pkgbuild.any/alterlinux-calamares/.SRCINFO renamed to modules/calamares/pkgbuild.any/10-alterlinux-calamares/.SRCINFO

File renamed without changes.

modules/calamares/pkgbuild.any/alterlinux-calamares/PKGBUILD renamed to modules/calamares/pkgbuild.any/10-alterlinux-calamares/PKGBUILD

File renamed without changes.

0 commit comments

Comments
 (0)