buildiso, check-yaml: msg cosmetics

This commit is contained in:
udeved 2016-08-25 19:59:56 +02:00
parent 8179ac827f
commit d2fdbccd08
2 changed files with 26 additions and 9 deletions

View file

@ -11,6 +11,7 @@
write_machineid_conf(){ write_machineid_conf(){
local conf="$1/etc/calamares/modules/machineid.conf" local conf="$1/etc/calamares/modules/machineid.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
if [[ ${initsys} == 'openrc' ]];then if [[ ${initsys} == 'openrc' ]];then
echo "systemd: false" > $conf echo "systemd: false" > $conf
echo "dbus: true" >> $conf echo "dbus: true" >> $conf
@ -23,6 +24,7 @@ write_machineid_conf(){
} }
write_finished_conf(){ write_finished_conf(){
msg2 "Writing [%s] ..." "finished.conf"
local conf="$1/etc/calamares/modules/finished.conf" local conf="$1/etc/calamares/modules/finished.conf"
echo '---' > "$conf" echo '---' > "$conf"
echo 'restartNowEnabled: true' >> "$conf" echo 'restartNowEnabled: true' >> "$conf"
@ -36,6 +38,7 @@ write_finished_conf(){
write_bootloader_conf(){ write_bootloader_conf(){
local conf="$1/etc/calamares/modules/bootloader.conf" local conf="$1/etc/calamares/modules/bootloader.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
source "$2" source "$2"
echo '---' > "$conf" echo '---' > "$conf"
echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf" echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf"
@ -54,6 +57,7 @@ write_bootloader_conf(){
write_services_conf(){ write_services_conf(){
if [[ ${initsys} == 'openrc' ]];then if [[ ${initsys} == 'openrc' ]];then
local conf="$1/etc/calamares/modules/servicescfg.conf" local conf="$1/etc/calamares/modules/servicescfg.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo '---' > "$conf" echo '---' > "$conf"
echo '' >> "$conf" echo '' >> "$conf"
echo 'services:' >> "$conf" echo 'services:' >> "$conf"
@ -72,6 +76,7 @@ write_services_conf(){
fi fi
else else
local conf="$1/etc/calamares/modules/services.conf" local conf="$1/etc/calamares/modules/services.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo '---' > "$conf" echo '---' > "$conf"
echo '' >> "$conf" echo '' >> "$conf"
echo 'services:' > "$conf" echo 'services:' > "$conf"
@ -95,6 +100,7 @@ write_services_conf(){
write_displaymanager_conf(){ write_displaymanager_conf(){
local conf="$1/etc/calamares/modules/displaymanager.conf" local conf="$1/etc/calamares/modules/displaymanager.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "displaymanagers:" > "$conf" echo "displaymanagers:" > "$conf"
echo " - ${displaymanager}" >> "$conf" echo " - ${displaymanager}" >> "$conf"
echo '' >> "$conf" echo '' >> "$conf"
@ -109,12 +115,14 @@ write_displaymanager_conf(){
write_initcpio_conf(){ write_initcpio_conf(){
local conf="$1/etc/calamares/modules/initcpio.conf" local conf="$1/etc/calamares/modules/initcpio.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "kernel: ${kernel}" >> "$conf" echo "kernel: ${kernel}" >> "$conf"
} }
write_unpack_conf(){ write_unpack_conf(){
local conf="$1/etc/calamares/modules/unpackfs.conf" local conf="$1/etc/calamares/modules/unpackfs.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "unpack:" >> "$conf" echo "unpack:" >> "$conf"
echo " - source: \"/bootmnt/${iso_name}/${target_arch}/root-image.sqfs\"" >> "$conf" echo " - source: \"/bootmnt/${iso_name}/${target_arch}/root-image.sqfs\"" >> "$conf"
@ -129,6 +137,7 @@ write_unpack_conf(){
write_users_conf(){ write_users_conf(){
local conf="$1/etc/calamares/modules/users.conf" local conf="$1/etc/calamares/modules/users.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "userGroup: users" >> "$conf" echo "userGroup: users" >> "$conf"
echo "defaultGroups:" >> "$conf" echo "defaultGroups:" >> "$conf"
@ -144,12 +153,14 @@ write_users_conf(){
write_packages_conf(){ write_packages_conf(){
local conf="$1/etc/calamares/modules/packages.conf" local conf="$1/etc/calamares/modules/packages.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "backend: pacman" >> "$conf" echo "backend: pacman" >> "$conf"
} }
write_welcome_conf(){ write_welcome_conf(){
local conf="$1/etc/calamares/modules/welcome.conf" local conf="$1/etc/calamares/modules/welcome.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" >> "$conf" echo "---" > "$conf" >> "$conf"
echo "showSupportUrl: true" >> "$conf" echo "showSupportUrl: true" >> "$conf"
echo "showKnownIssuesUrl: true" >> "$conf" echo "showKnownIssuesUrl: true" >> "$conf"
@ -175,6 +186,7 @@ write_welcome_conf(){
write_settings_conf(){ write_settings_conf(){
local conf="$1/etc/calamares/settings.conf" local conf="$1/etc/calamares/settings.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "modules-search: [ local ]" >> "$conf" echo "modules-search: [ local ]" >> "$conf"
echo '' >> "$conf" echo '' >> "$conf"
@ -239,6 +251,7 @@ write_settings_conf(){
write_mhwdcfg_conf(){ write_mhwdcfg_conf(){
local conf="$1/etc/calamares/modules/mhwdcfg.conf" local conf="$1/etc/calamares/modules/mhwdcfg.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "identifier:" >> "$conf" echo "identifier:" >> "$conf"
echo " net:" >> "$conf" echo " net:" >> "$conf"
@ -272,6 +285,7 @@ write_mhwdcfg_conf(){
write_chrootcfg_conf(){ write_chrootcfg_conf(){
local conf="$1/etc/calamares/modules/chrootcfg.conf" mode='"0o755"' local conf="$1/etc/calamares/modules/chrootcfg.conf" mode='"0o755"'
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "requirements:" >> "$conf" echo "requirements:" >> "$conf"
echo " - name: /etc" >> "$conf" echo " - name: /etc" >> "$conf"
@ -288,6 +302,7 @@ write_chrootcfg_conf(){
write_postcfg_conf(){ write_postcfg_conf(){
local conf="$1/etc/calamares/modules/postcfg.conf" local conf="$1/etc/calamares/modules/postcfg.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "keyrings:" >> "$conf" echo "keyrings:" >> "$conf"
echo " - archlinux" >> "$conf" echo " - archlinux" >> "$conf"
@ -314,12 +329,14 @@ get_yaml(){
write_netinstall_conf(){ write_netinstall_conf(){
local conf="$1/etc/calamares/modules/netinstall.conf" local conf="$1/etc/calamares/modules/netinstall.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "groupsUrl: ${netgroups}/$(get_yaml)" >> "$conf" echo "groupsUrl: ${netgroups}/$(get_yaml)" >> "$conf"
} }
write_grubcfg_conf(){ write_grubcfg_conf(){
local conf="$1/etc/calamares/modules/grubcfg.conf" local conf="$1/etc/calamares/modules/grubcfg.conf"
msg2 "Writing [%s] ..." "${conf##*/}"
echo "---" > "$conf" echo "---" > "$conf"
echo "overwrite: false" >> "$conf" echo "overwrite: false" >> "$conf"
echo '' >> "$conf" echo '' >> "$conf"

View file

@ -12,11 +12,11 @@
import ${LIBDIR}/util-iso.sh import ${LIBDIR}/util-iso.sh
import ${LIBDIR}/util-iso-calamares.sh import ${LIBDIR}/util-iso-calamares.sh
check_yaml(){ # check_yaml(){
result=$(python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < $1) # result=$(python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < $1)
info "Checking validity ..." # msg2 "Checking validity [%s] ..." "${1##*/}"
[[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" "${result}" # [[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" "${result}"
} # }
get_preset(){ get_preset(){
local p=${tmp_dir}/${kernel}.preset kvmaj kvmin local p=${tmp_dir}/${kernel}.preset kvmaj kvmin
@ -35,9 +35,9 @@ get_preset(){
write_calamares_yaml(){ write_calamares_yaml(){
configure_calamares "${yaml_dir}" "$(get_preset)" configure_calamares "${yaml_dir}" "$(get_preset)"
for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do # for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do
check_yaml "$conf" # check_yaml "$conf"
done # done
} }
write_netgroup_yaml(){ write_netgroup_yaml(){
@ -50,7 +50,7 @@ write_netgroup_yaml(){
for p in ${packages[@]};do for p in ${packages[@]};do
echo " - $p" >> "$2" echo " - $p" >> "$2"
done done
check_yaml "$2" # check_yaml "$2"
} }
prepare_check(){ prepare_check(){