theme_pkg="plymouth-theme-alter-logo-git"
sfs_comp="zstd"
sfs_comp_opt=""
+debug=false
# Load extra settings
[[ -f ./config ]] && source config; echo "The settings have been overwritten by the config file."
exit ${1}
}
+# Check the value of a variable that can only be set to true or false.
+case ${boot_splash} in
+ true) : ;;
+ false) : ;;
+ *)
+ echo "The value ${boot_splash} set is invalid" >&2
+ ;;
+esac
+
+case ${debug} in
+ true) : ;;
+ false) : ;;
+ *)
+ echo "The value ${debug} set is invalid" >&2
+ ;;
+esac
+
+
# Helper function to run make_*() only one time per architecture.
run_once() {
if [[ ! -e ${work_dir}/build.${1} ]]; then
options=
if [[ ${boot_splash} = true ]]; then
if [[ -z ${theme_name} ]]; then
- options="-b"
+ options="${options} -b"
else
- options="-b -t ${theme_name}"
+ options="${options} -b -t ${theme_name}"
fi
fi
if [[ -n ${kernel} ]]; then
options="${options} -k ${kernel}"
fi
+ if ${debug}; then
+ options="${options} -x"
if [[ -z ${options} ]]; then
mkarchiso ${verbose} -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r "/root/customize_airootfs.sh -p ${password}" run
else
_usage 1
fi
-while getopts 'w:o:g:p:c:t:hbk:' arg; do
+while getopts 'w:o:g:p:c:t:hbk:x' arg; do
case "${arg}" in
p) password="${OPTARG}" ;;
w) work_dir="${OPTARG}" ;;
"ck") kernel=ck ;;
"rt") kernel=rt ;;
*)
- echo "Invalid kernel ${OPTARG}"
+ echo "Invalid kernel ${OPTARG}" >&2
_usage 1
;;
esac
;;
+ x) debug=true;;
h) _usage 0 ;;
*)
- echo "Invalid argument '${arg}'"
+ echo "Invalid argument '${arg}'" >&2
_usage 1
;;
esac
done
+# Debug mode
+if ${debug}; then
+ set -x
+else
+ set +x
+fi
+
mkdir -p ${work_dir}
# Show Alter Linux build options.
# Set the kernel that live session use.
# Please don't set anything if you want to use normal kernel.
# As of February 23, 2020, the available kernels are lts, zen, ck, , rt and lqx.
-kernel=
\ No newline at end of file
+kernel=
+
+# Set debug mode.
+# This setting can only be set to true or false.
+# When enabled, bash debug mode is enabled, making it easier to identify which command caused the error.
+debug=false
\ No newline at end of file