manjaro-tools/bin/check-yaml.in

140 lines
3.8 KiB
Text
Raw Normal View History

2016-08-21 15:20:29 +02:00
#!/bin/bash
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
version=@version@
LIBDIR='@libdir@'
DATADIR='@datadir@'
SYSCONFDIR='@sysconfdir@'
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
import ${LIBDIR}/util.sh
import ${LIBDIR}/util-iso-yaml.sh
show_profile(){
2016-08-21 16:14:08 +02:00
prepare_check "$1"
msg2 "yaml_dir: %s" "${yaml_dir}"
2016-08-21 15:20:29 +02:00
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "autologin: %s" "${autologin}"
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "pxe_boot: %s" "${pxe_boot}"
msg2 "plymouth_boot: %s" "${plymouth_boot}"
${plymouth_boot} && msg2 "plymouth_theme: %s" "${plymouth_theme}"
2016-08-21 15:20:29 +02:00
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"
msg2 "netinstall: %s" "${netinstall}"
2016-08-21 15:20:29 +02:00
${netinstall} && msg2 "netgroups: %s" "$(get_yaml)"
msg2 "unpackfs: %s" "${unpackfs}"
msg2 "efi_boot_loader: %s" "${efi_boot_loader}"
msg2 "hostname: %s" "${hostname}"
msg2 "username: %s" "${username}"
msg2 "password: %s" "${password}"
msg2 "login_shell: %s" "${login_shell}"
msg2 "addgroups: %s" "${addgroups}"
if [[ ${initsys} == 'systemd' ]];then
msg2 "enable_systemd: %s" "${enable_systemd[*]}"
msg2 "enable_systemd_live: %s" "${enable_systemd_live[*]}"
[[ -n ${disable_systemd[*]} ]] && msg2 "disable_systemd: %s" "${disable_systemd[*]}"
else
msg2 "enable_openrc: %s" "${enable_openrc[*]}"
msg2 "enable_openrc_live: %s" "${enable_openrc_live[*]}"
[[ -n ${disable_openrc[*]} ]] && msg2 "disable_openrc: %s" "${disable_openrc[*]}"
fi
2016-08-21 15:20:29 +02:00
reset_profile
unset yaml_dir
2016-08-21 15:20:29 +02:00
}
display_settings(){
show_version
show_config
msg "PROFILE:"
msg2 "list_dir_iso: %s" "${list_dir_iso}"
msg2 "build_lists: %s" "$(show_build_lists ${list_dir_iso})"
msg2 "build_list_iso: %s" "${build_list_iso}"
msg2 "is_build_list: %s" "${is_build_list}"
msg2 "build_mirror: %s" "${build_mirror}/${target_branch}"
${verbose} && msg2 "run_dir: %s" "${run_dir}"
msg "OPTIONS:"
msg2 "arch: %s" "${target_arch}"
msg2 "initsys: %s" "${initsys}"
msg2 "kernel: %s" "${kernel}"
msg "ARGS:"
msg2 "calamares: %s" "${calamares}"
2016-08-21 16:14:08 +02:00
msg "CHECK QUEUE:"
2016-08-21 15:20:29 +02:00
run show_profile "${build_list_iso}"
}
load_user_info
load_config "${USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}/manjaro-tools.conf"
# to force old way to have buildiso run in iso-profiles dir
# run_dir=$(pwd)
load_run_dir "${profile_repo}"
calamares=false
2016-08-21 16:14:08 +02:00
pretend=false
2016-08-21 15:20:29 +02:00
cache_dir_netinstall="${cache_dir}/netinstall"
usage() {
echo "Usage: ${0##*/} [options]"
echo " -p <profile> Buildset or profile [default: ${build_list_iso}]"
echo " -a <arch> Arch [default: ${target_arch}]"
echo " -k <name> Kernel to use[default: ${kernel}]"
echo " -i <name> Init system to use [default: ${initsys}]"
echo ' -c Check also calamares yaml files generated for the profile'
2016-08-21 16:14:08 +02:00
echo ' -q Query settings'
2016-08-21 15:20:29 +02:00
echo ' -h This help'
echo ''
echo ''
exit $1
}
orig_argv=("$@")
2016-08-21 16:14:08 +02:00
opts='p:a:i:k:cqh'
2016-08-21 15:20:29 +02:00
while getopts "${opts}" arg; do
case "${arg}" in
p) build_list_iso="$OPTARG" ;;
a) target_arch="$OPTARG" ;;
i) initsys="$OPTARG" ;;
k) kernel="$OPTARG" ;;
c) calamares=true ;;
2016-08-21 16:14:08 +02:00
q) pretend=true ;;
2016-08-21 15:20:29 +02:00
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
done
shift $(($OPTIND - 1))
check_root "$0" "${orig_argv[@]}"
2016-08-21 16:14:08 +02:00
prepare_dir "${tmp_dir}"
eval_build_list "${list_dir_iso}" "${build_list_iso}"
${pretend} && display_settings && exit 1
2016-08-21 15:20:29 +02:00
run make_profile_yaml "${build_list_iso}"