Skip to content

Commit 9ddfabc

Browse files
committed
Merge branch 'dev' into dev-stable
2 parents be87a52 + 41baf3a commit 9ddfabc

File tree

8 files changed

+42
-64
lines changed

8 files changed

+42
-64
lines changed

build.sh

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,8 @@ prepare_build() {
447447
[[ "${gitversion}" = true ]] && iso_version="${iso_version}-${gitrev}"
448448

449449
# Generate iso file name.
450-
local _channel_name="${channel_name%.add}-${locale_version}"
451-
if [[ "${nochname}" = true ]]; then
452-
iso_filename="${iso_name}-${iso_version}-${arch}.iso"
453-
else
454-
iso_filename="${iso_name}-${_channel_name}-${iso_version}-${arch}.iso"
455-
fi
450+
local _channel_name="${channel_name%.add}-${locale_version}" iso_filename="${iso_name}-${_channel_name}-${iso_version}-${arch}.iso"
451+
[[ "${nochname}" = true ]] && iso_filename="${iso_name}-${iso_version}-${arch}.iso"
456452
msg_debug "Iso filename is ${iso_filename}"
457453

458454
# check bool
@@ -468,7 +464,7 @@ prepare_build() {
468464
# Run with tee
469465
if [[ ! "${logging}" = false ]]; then
470466
[[ "${customized_logpath}" = false ]] && logging="${out_dir}/${iso_filename%.iso}.log"
471-
mkdir -p "$(dirname "${logging}")"; touch "${logging}"
467+
mkdir -p "$(dirname "${logging}")" && touch "${logging}"
472468
msg_warn "Re-run sudo ${0} ${ARGUMENT[*]} --nodepend --nolog --nocolor 2>&1 | tee ${logging}"
473469
sudo "${0}" "${ARGUMENT[@]}" --nolog --nocolor --nodepend 2>&1 | tee "${logging}"
474470
exit "${?}"
@@ -507,13 +503,9 @@ make_pacman_conf() {
507503
msg_debug "Use ${build_pacman_conf}"
508504
sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dir}|g" "${build_pacman_conf}" > "${build_dir}/pacman.conf"
509505

510-
if [[ "${nosigcheck}" = true ]]; then
511-
sed -ir "s|^s*SigLevel.+|SigLevel = Never|g" "${build_pacman_conf}"
512-
fi
506+
[[ "${nosigcheck}" = true ]] && sed -ir "s|^s*SigLevel.+|SigLevel = Never|g" "${build_pacman_conf}"
513507

514-
if [[ -n "$(find "${cache_dir}" -maxdepth 1 -name '*.pkg.tar.*' 2> /dev/null)" ]]; then
515-
msg_info "Use cached package files in ${cache_dir}"
516-
fi
508+
[[ -n "$(find "${cache_dir}" -maxdepth 1 -name '*.pkg.tar.*' 2> /dev/null)" ]] && msg_info "Use cached package files in ${cache_dir}"
517509

518510
# Share any architecture packages
519511
#while read -r _pkg; do
@@ -699,9 +691,7 @@ make_setup_mkinitcpio() {
699691

700692
_chroot_run "mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/${kernel_filename} -g /boot/archiso.img"
701693

702-
if [[ "${gpg_key}" ]]; then
703-
exec 17<&-
704-
fi
694+
[[ "${gpg_key}" ]] && exec 17<&-
705695

706696
return 0
707697
}
@@ -743,18 +733,17 @@ make_boot_extra() {
743733

744734
# Prepare /${install_dir}/boot/syslinux
745735
make_syslinux() {
746-
_uname_r="$(file -b ${airootfs_dir}/boot/${kernel_filename} | awk 'f{print;f=0} /version/{f=1}' RS=' ')"
747736
mkdir -p "${isofs_dir}/syslinux"
748737

749738
# 一時ディレクトリに設定ファイルをコピー
750-
mkdir -p "${build_dir}/${arch}/syslinux/"
751-
cp -a "${script_path}/syslinux/"* "${build_dir}/${arch}/syslinux/"
739+
mkdir -p "${build_dir}/syslinux/"
740+
cp -a "${script_path}/syslinux/"* "${build_dir}/syslinux/"
752741
if [[ -d "${channel_dir}/syslinux" ]] && [[ "${customized_syslinux}" = true ]]; then
753-
cp -af "${channel_dir}/syslinux"* "${build_dir}/${arch}/syslinux/"
742+
cp -af "${channel_dir}/syslinux"* "${build_dir}/syslinux/"
754743
fi
755744

756745
# copy all syslinux config to work dir
757-
for _cfg in ${build_dir}/${arch}/syslinux/*.cfg; do
746+
for _cfg in "${build_dir}/syslinux/"*.cfg; do
758747
sed "s|%ARCHISO_LABEL%|${iso_label}|g;
759748
s|%OS_NAME%|${os_name}|g;
760749
s|%KERNEL_FILENAME%|${kernel_filename}|g;
@@ -893,12 +882,8 @@ make_efiboot() {
893882
local _bootfile="$(basename "$(ls "${airootfs_dir}/usr/lib/systemd/boot/efi/systemd-boot"*".efi" )")"
894883
cp "${airootfs_dir}/usr/lib/systemd/boot/efi/${_bootfile}" "${build_dir}/efiboot/EFI/boot/${_bootfile#systemd-}"
895884

896-
local _use_config_name
897-
if [[ "${boot_splash}" = true ]]; then
898-
_use_config_name="splash"
899-
else
900-
_use_config_name="nosplash"
901-
fi
885+
local _use_config_name="nosplash"
886+
[[ "${boot_splash}" = true ]] && _use_config_name="splash"
902887

903888
mkdir -p "${build_dir}/efiboot/loader/entries"
904889
sed "s|%ARCH%|${arch}|g;" "${script_path}/efiboot/${_use_config_name}/loader.conf" > "${build_dir}/efiboot/loader/loader.conf"
@@ -980,7 +965,7 @@ make_prepare() {
980965
# Create squashfs
981966
mkdir -p -- "${isofs_dir}/${install_dir}/${arch}"
982967
msg_info "Creating SquashFS image, this may take some time..."
983-
mksquashfs "${airootfs_dir}" "${build_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" ${sfs_comp_opt}
968+
mksquashfs "${airootfs_dir}" "${build_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend -comp "${sfs_comp}" "${sfs_comp_opt[@]}"
984969

985970
# Create checksum
986971
msg_info "Creating checksum file for self-test..."
@@ -1008,9 +993,7 @@ make_alteriso_info(){
1008993
if [[ "${include_info}" = true ]]; then
1009994
local _info_file="${isofs_dir}/alteriso-info" _version="${iso_version}"
1010995
remove "${_info_file}"; touch "${_info_file}"
1011-
if [[ -d "${script_path}/.git" ]] && [[ "${gitversion}" = false ]]; then
1012-
_version="${iso_version}-${gitrev}"
1013-
fi
996+
[[ -d "${script_path}/.git" ]] && [[ "${gitversion}" = false ]] && _version="${iso_version}-${gitrev}"
1014997
"${tools_dir}/alteriso-info.sh" -a "${arch}" -b "${boot_splash}" -c "${channel_name%.add}" -d "${iso_publisher}" -k "${kernel}" -o "${os_name}" -p "${password}" -u "${username}" -v "${_version}" > "${_info_file}"
1015998
fi
1016999

@@ -1034,7 +1017,7 @@ make_iso() {
10341017
local _iso_efi_boot_args=()
10351018
# If exists, add an EFI "El Torito" boot image (FAT filesystem) to ISO-9660 image.
10361019
if [[ -f "${build_dir}/efiboot.img" ]]; then
1037-
_iso_efi_boot_args=(-append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B ${build_dir}/efiboot.img -appended_part_as_gpt -eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot -isohybrid-gpt-basdat)
1020+
_iso_efi_boot_args=(-append_partition 2 C12A7328-F81F-11D2-BA4B-00A0C93EC93B "${build_dir}/efiboot.img" -appended_part_as_gpt -eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot -isohybrid-gpt-basdat)
10381021
fi
10391022

10401023
mkdir -p -- "${out_dir}"
@@ -1137,9 +1120,9 @@ while true; do
11371120
;;
11381121
-t | --comp-opts)
11391122
if [[ "${2}" = "reset" ]]; then
1140-
sfs_comp_opt=""
1123+
sfs_comp_opt=()
11411124
else
1142-
sfs_comp_opt="${2}"
1125+
sfs_comp_opt=(${2})
11431126
fi
11441127
shift 2
11451128
;;

channels/releng/config.any

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ boot_splash=false
3838

3939
# See the `mksquashfs` help for details on these items.
4040
sfs_comp="xz"
41-
sfs_comp_opt=""
41+
sfs_comp_opt=()
4242

4343
# Sets the default locale for the live environment.
4444
# You can also place a package list for that locale name and install packages specific to that locale.

default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ tarball=false
9999
# See the `mksquashfs` help for details on these items.
100100
# This variable overrides each build option "-c" or "-t".
101101
sfs_comp="xz"
102-
sfs_comp_opt=""
102+
sfs_comp_opt=()
103103

104104

105105
# If set to true, include alteriso_info in iso root.

modules/share-extra/airootfs.any/etc/skel/.config/autostart/gensidebar.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Version=1.0
44
Name=AlterLinux Sidebar
55
Comment=Generates sidebar items.
66
Icon=utilities-terminal
7-
Exec=/usr/bin/fascode-gtk-bookmarks -f --alterlive init
7+
Exec=/usr/bin/fascode-gtk-bookmarks -f --fascodelive init
88
X-GNOME-Autostart-enabled=true
99
Type=Application
1010
RunHook=0

modules/share/airootfs.any/root/customize_airootfs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ sed -i "s/%ARCH%/${arch}/g" "/usr/share/calamares/modules/unpackfs.conf"
180180

181181
# Add disabling of sudo setting
182182
echo -e "\nremove \"/etc/sudoers.d/alterlive\"" >> "/usr/share/calamares/final-process"
183+
echo -e "\nremove \"/etc/systemd/system/[email protected]\"" >> "/usr/share/calamares/final-process"
183184

184185

185186
# Set os name

modules/share/airootfs.any/usr/share/calamares/final-process

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,7 @@ script_path="$( cd -P "$( dirname "$(readlink -f "${0}")" )" && pwd )"
66
script_name="$(basename "$(realpath "${0}")")"
77

88
function remove () {
9-
local list
10-
local file
11-
list=($(echo "$@"))
12-
for file in "${list[@]}"; do
13-
if [[ -f ${file} ]]; then
14-
rm -f "${file}"
15-
elif [[ -d ${file} ]]; then
16-
rm -rf "${file}"
17-
fi
18-
done
9+
rm -rf "${@}"
1910
}
2011

2112
while getopts 'u:' arg; do
@@ -40,14 +31,13 @@ remove_user_file ".config/gtk-3.0/bookmarks"
4031
remove /etc/polkit-1/rules.d/01-nopasswork.rules
4132

4233
# Delete unnecessary files of archiso.
43-
remove /etc/systemd/system/[email protected]/autologin.conf
4434
remove /root/.automated_script.sh
4535
remove /etc/mkinitcpio-archiso.conf
4636
remove /etc/initcpio
4737

4838
# Delete systemd files
4939
remove /etc/systemd/journald.conf.d/volatile-storage.conf
50-
remove /etc/systemd/system/getty@tty1.service.d
40+
remove /etc/systemd/system/[email protected]
5141
remove /etc/systemd/system/alteriso-reflector.service
5242

5343
# Disabled auto login for LightDM

tools/clean.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ _umount() { if mountpoint -q "${1}"; then umount -lf "${1}"; fi; }
9191

9292
# Unmount chroot dir
9393
umount_chroot () {
94-
"${tools_dir}/umount.sh" "${work_dir}"
94+
"${tools_dir}/umount.sh" -d "${work_dir}" -m 3
9595
}
9696

9797
# Usage: getclm <number>
@@ -138,16 +138,19 @@ if [[ ! -v work_dir ]] && [[ "${work_dir}" = "" ]]; then
138138
exit 1
139139
fi
140140

141+
# Check root.
142+
if (( ! "${EUID}" == 0 )); then
143+
msg_error "This script must be run as root." "1"
144+
fi
145+
146+
# Fullpath
147+
work_dir="$(realpath "${work_dir}")"
148+
141149
if [[ ! "${noconfirm}" = true ]] && (( "$(find "${work_dir}" -type f 2> /dev/null | wc -l)" != 0 )); then
142150
msg_warn "Forcibly unmount all devices mounted under the following directories and delete them recursively."
143151
msg_warn "${work_dir}"
144-
msg_warn -n "Are you sure you want to continue?"
145-
read -n 1 yesorno
146-
if [[ "${yesorno}" = "y" ]] || [[ "${yesorno}" = "" ]]; then
147-
echo
148-
else
149-
exit 1
150-
fi
152+
echo -e "Press Enter to continue or Ctrl + C to cancel."
153+
read
151154
fi
152155

153156

tools/umount.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ umount_work () {
9797
}
9898

9999

100-
# Check root.
101-
if (( ! "${EUID}" == 0 )); then
102-
msg_error "This script must be run as root." "1"
103-
fi
104-
105100
# Parse options
106101
OPTS=("d" "f" "h" "m:")
107102
OPTL=("debug" "force" "help" "maxdepth:")
@@ -128,7 +123,7 @@ while true; do
128123
shift 2
129124
;;
130125
-h | --help)
131-
_usage
126+
_help
132127
exit 0
133128
;;
134129
--)
@@ -137,11 +132,17 @@ while true; do
137132
;;
138133
*)
139134
msg_error "Invalid argument '${1}'"
140-
_usage 1
135+
_help
136+
exit 1
141137
;;
142138
esac
143139
done
144140

141+
# Check root.
142+
if (( ! "${EUID}" == 0 )); then
143+
msg_error "This script must be run as root." "1"
144+
fi
145+
145146

146147
if [[ -z "${1+SET}" ]]; then
147148
msg_error "Please specify the target directory." "1"

0 commit comments

Comments
 (0)