From f46afe94785ae12da5ae9c3780f6cd2e7b549d96 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 15:20:29 +0200 Subject: [PATCH 01/26] check-yaml: initial commit --- Makefile | 6 ++- bin/check-yaml.in | 106 +++++++++++++++++++++++++++++++++++++++++++ lib/util-iso-yaml.sh | 67 +++++++++++++++++++++++++++ lib/util-iso.sh | 4 +- lib/util-pkg.sh | 2 +- lib/util.sh | 8 ++-- 6 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 bin/check-yaml.in create mode 100644 lib/util-iso-yaml.sh diff --git a/Makefile b/Makefile index 0e5c87a..9e35faa 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,8 @@ LIST_ISO = \ BIN_ISO = \ bin/buildiso \ bin/testiso \ - bin/deployiso + bin/deployiso \ + bin/check-yaml LIBS_ISO = \ lib/util-iso.sh \ @@ -73,7 +74,8 @@ LIBS_ISO = \ lib/util-iso-image.sh \ lib/util-iso-calamares.sh \ lib/util-iso-boot.sh \ - lib/util-publish.sh + lib/util-publish.sh \ + lib/util-iso-yaml.sh SHARED_ISO = \ data/pacman-mhwd.conf \ diff --git a/bin/check-yaml.in b/bin/check-yaml.in new file mode 100644 index 0000000..5da29e4 --- /dev/null +++ b/bin/check-yaml.in @@ -0,0 +1,106 @@ +#!/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(){ + prepare_profile "$1" + msg2 "yaml_dir: %s" "${work_dir}" + msg2 "yaml file: %s" "${yaml}" + msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}" + + [[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}" + + ${netinstall} && msg2 "netgroups: %s" "$(get_yaml)" + + reset_profile +} + +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}" + + msg "BUILD QUEUE:" + 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 + +cache_dir_netinstall="${cache_dir}/netinstall" + +usage() { + echo "Usage: ${0##*/} [options]" + echo " -p Buildset or profile [default: ${build_list_iso}]" + echo " -a Arch [default: ${target_arch}]" + echo " -k Kernel to use[default: ${kernel}]" + echo " -i Init system to use [default: ${initsys}]" + echo ' -c Check also calamares yaml files generated for the profile' + echo ' -h This help' + echo '' + echo '' + exit $1 +} + +orig_argv=("$@") + +opts='p:a:i:k:ch' + +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 ;; + h|?) usage 0 ;; + *) echo "invalid argument '${arg}'"; usage 1 ;; + esac +done + +shift $(($OPTIND - 1)) + +check_root "$0" "${orig_argv[@]}" + +run make_profile_yaml "${build_list_iso}" diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh new file mode 100644 index 0000000..137505a --- /dev/null +++ b/lib/util-iso-yaml.sh @@ -0,0 +1,67 @@ +#!/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. + +import ${LIBDIR}/util-iso.sh +import ${LIBDIR}/util-iso-calamares.sh + +check_yaml(){ + result=$(python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < $1) + [[ -n ${result} ]] && error "yaml error: %s [msg: %s]" "$1" "${result}" +} + +write_netgroup_yaml(){ + echo "- name: '$1'" > "$2" + echo " description: '$1'" >> "$2" + echo " selected: false" >> "$2" + echo " hidden: false" >> "$2" + echo " packages:" >> "$2" + for p in ${packages[@]};do + echo " - $p" >> "$2" + done + check_yaml "$2" +} + +prepare_profile(){ + profile=$1 + edition=$(get_edition ${profile}) + profile_dir=${run_dir}/${edition}/${profile} + check_profile + load_profile_config "${profile_dir}/profile.conf" + + yaml_dir=${cache_dir_netinstall}/${profile} + + prepare_dir "${yaml_dir}" + chown "${OWNER}:${OWNER}" "${yaml_dir}" +} + +write_calamares_yaml(){ + configure_calamares "${yaml_dir}" + for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do + check_yaml "$conf" + done +} + +make_profile_yaml(){ + prepare_profile "$1" + load_pkgs "${profile_dir}/Packages-Root" + yaml=${yaml_dir}/root-${target_arch}-${initsys}.yaml + write_netgroup_yaml "$1" "${yaml}" + if [[ -f "${packages_custom}" ]]; then + load_pkgs "${packages_custom}" + yaml=${yaml_dir}/desktop-${target_arch}-${initsys}.yaml + write_netgroup_yaml "$1" "${yaml}" + fi + ${calamares} && write_calamares_yaml "$1" + user_own "${yaml_dir}" + reset_profile + unset yaml + unset yaml_dir +} diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 9e12411..cf97246 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -563,7 +563,7 @@ check_profile(){ [[ -f "${profile_dir}/Packages-Mhwd" ]] && packages_mhwd=${profile_dir}/Packages-Mhwd - if ! ${netinstall};then + if ! ${netinstall} && ! ${unpackfs};then unpackfs="true" fi } @@ -612,7 +612,7 @@ compress_images(){ make_checksum "${iso_file}" ${sign} && sign_iso "${iso_file}" ${torrent} && make_torrent - chown -R "${OWNER}:$(id --group ${OWNER})" "${iso_dir}" + user_own "${iso_dir}" show_elapsed_time "${FUNCNAME}" "${timer}" } diff --git a/lib/util-pkg.sh b/lib/util-pkg.sh index 679568e..a0f7671 100644 --- a/lib/util-pkg.sh +++ b/lib/util-pkg.sh @@ -250,7 +250,7 @@ move_to_cache(){ mv $src ${pkg_dir}/ ${sign} && sign_pkg "${src##*/}" [[ -n $PKGDEST ]] && rm "$1" - chown -R "${OWNER}:$(id --group ${OWNER})" "${pkg_dir}" + user_own "${pkg_dir}" } archive_logs(){ diff --git a/lib/util.sh b/lib/util.sh index 0549623..d0fdb0a 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -457,15 +457,15 @@ load_profile_config(){ [[ -z ${netgroups} ]] && netgroups="https://raw.githubusercontent.com/manjaro/manjaro-tools-iso-profiles/master/shared/netinstall" - if ! ${unpackfs} && ! ${netinstall};then - netinstall='true' - fi - check_profile_vars return 0 } +user_own(){ + chown -R "${OWNER}:$(id --group ${OWNER})" "$1" +} + clean_dir(){ if [[ -d $1 ]]; then msg "Cleaning [%s] ..." "$1" From f1fc48e937c397eb28c0ae17d28df419f028f0fd Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 16:14:08 +0200 Subject: [PATCH 02/26] check-yaml: fixes --- bin/check-yaml.in | 20 ++++++++++++++------ lib/util-iso-calamares.sh | 4 ++-- lib/util-iso-image.sh | 2 +- lib/util-iso-yaml.sh | 23 +++++++++++++---------- 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/bin/check-yaml.in b/bin/check-yaml.in index 5da29e4..77d00b4 100644 --- a/bin/check-yaml.in +++ b/bin/check-yaml.in @@ -21,9 +21,9 @@ import ${LIBDIR}/util.sh import ${LIBDIR}/util-iso-yaml.sh show_profile(){ - prepare_profile "$1" - msg2 "yaml_dir: %s" "${work_dir}" - msg2 "yaml file: %s" "${yaml}" + prepare_check "$1" + msg2 "yaml_dir: %s" "${yaml_dir}" + msg2 "yaml file: %s" "${yaml##*/}" msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}" [[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}" @@ -53,7 +53,7 @@ display_settings(){ msg "ARGS:" msg2 "calamares: %s" "${calamares}" - msg "BUILD QUEUE:" + msg "CHECK QUEUE:" run show_profile "${build_list_iso}" } @@ -67,7 +67,7 @@ load_config "${USERCONFDIR}/manjaro-tools.conf" || load_config "${SYSCONFDIR}/ma load_run_dir "${profile_repo}" calamares=false - +pretend=false cache_dir_netinstall="${cache_dir}/netinstall" usage() { @@ -77,6 +77,7 @@ usage() { echo " -k Kernel to use[default: ${kernel}]" echo " -i Init system to use [default: ${initsys}]" echo ' -c Check also calamares yaml files generated for the profile' + echo ' -q Query settings' echo ' -h This help' echo '' echo '' @@ -85,7 +86,7 @@ usage() { orig_argv=("$@") -opts='p:a:i:k:ch' +opts='p:a:i:k:cqh' while getopts "${opts}" arg; do case "${arg}" in @@ -94,6 +95,7 @@ while getopts "${opts}" arg; do i) initsys="$OPTARG" ;; k) kernel="$OPTARG" ;; c) calamares=true ;; + q) pretend=true ;; h|?) usage 0 ;; *) echo "invalid argument '${arg}'"; usage 1 ;; esac @@ -103,4 +105,10 @@ shift $(($OPTIND - 1)) check_root "$0" "${orig_argv[@]}" +prepare_dir "${tmp_dir}" + +eval_build_list "${list_dir_iso}" "${build_list_iso}" + +${pretend} && display_settings && exit 1 + run make_profile_yaml "${build_list_iso}" diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 388b3ab..8fed2d9 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -35,7 +35,7 @@ write_finished_conf(){ } write_bootloader_conf(){ - source "$1/etc/mkinitcpio.d/${kernel}.preset" + source "$2.preset" local conf="$1/etc/calamares/modules/bootloader.conf" echo '---' > "$conf" echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf" @@ -343,7 +343,7 @@ configure_calamares(){ write_packages_conf "$1" - write_bootloader_conf "$1" + write_bootloader_conf "$1" "$2" write_mhwdcfg_conf "$1" diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 2b95445..f803566 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -257,7 +257,7 @@ configure_live_image(){ configure_mhwd "$1" configure_system "$1" configure_services "$1" - configure_calamares "$1" + configure_calamares "$1" "$1/etc/mkinitcpio.d/${kernel}" write_live_session_conf "$1" msg "Done configuring [live-image]" } diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 137505a..37100a3 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -29,7 +29,7 @@ write_netgroup_yaml(){ check_yaml "$2" } -prepare_profile(){ +prepare_check(){ profile=$1 edition=$(get_edition ${profile}) profile_dir=${run_dir}/${edition}/${profile} @@ -37,9 +37,19 @@ prepare_profile(){ load_profile_config "${profile_dir}/profile.conf" yaml_dir=${cache_dir_netinstall}/${profile} + work_dir=${chroots_iso}/${profile}/${target_arch} prepare_dir "${yaml_dir}" chown "${OWNER}:${OWNER}" "${yaml_dir}" + + #load_pkgs "${profile_dir}/Packages-Root" + #yaml="${yaml_dir}/root-${target_arch}-${initsys}.yaml" + #write_netgroup_yaml "$1" "${yaml}" + if [[ -f "${packages_custom}" ]]; then + load_pkgs "${packages_custom}" + yaml="${yaml_dir}/desktop-${target_arch}-${initsys}.yaml" + write_netgroup_yaml "$1" "${yaml}" + fi } write_calamares_yaml(){ @@ -50,15 +60,8 @@ write_calamares_yaml(){ } make_profile_yaml(){ - prepare_profile "$1" - load_pkgs "${profile_dir}/Packages-Root" - yaml=${yaml_dir}/root-${target_arch}-${initsys}.yaml - write_netgroup_yaml "$1" "${yaml}" - if [[ -f "${packages_custom}" ]]; then - load_pkgs "${packages_custom}" - yaml=${yaml_dir}/desktop-${target_arch}-${initsys}.yaml - write_netgroup_yaml "$1" "${yaml}" - fi + prepare_check "$1" + ${calamares} && write_calamares_yaml "$1" user_own "${yaml_dir}" reset_profile From 8129811708e71ee6926a040f8b9d56aa9b5c2825 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 16:50:32 +0200 Subject: [PATCH 03/26] check-yaml: make kernel presets work from built profile --- lib/util-iso-calamares.sh | 2 +- lib/util-iso-yaml.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 8fed2d9..affd80a 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -35,8 +35,8 @@ write_finished_conf(){ } write_bootloader_conf(){ - source "$2.preset" local conf="$1/etc/calamares/modules/bootloader.conf" + source "$2.preset" echo '---' > "$conf" echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf" echo "kernel: \"$(echo ${ALL_kver} | sed s'|/boot||')\"" >> "$conf" diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 37100a3..b317c54 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -14,7 +14,7 @@ import ${LIBDIR}/util-iso-calamares.sh check_yaml(){ result=$(python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < $1) - [[ -n ${result} ]] && error "yaml error: %s [msg: %s]" "$1" "${result}" + [[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" } write_netgroup_yaml(){ @@ -42,18 +42,20 @@ prepare_check(){ prepare_dir "${yaml_dir}" chown "${OWNER}:${OWNER}" "${yaml_dir}" - #load_pkgs "${profile_dir}/Packages-Root" - #yaml="${yaml_dir}/root-${target_arch}-${initsys}.yaml" - #write_netgroup_yaml "$1" "${yaml}" + load_pkgs "${profile_dir}/Packages-Root" + yaml="${yaml_dir}/Packages-Root-${target_arch}-${initsys}.yaml" + write_netgroup_yaml "$1" "${yaml}" if [[ -f "${packages_custom}" ]]; then load_pkgs "${packages_custom}" - yaml="${yaml_dir}/desktop-${target_arch}-${initsys}.yaml" + yaml="${yaml_dir}/${packages_custom##*/}-${target_arch}-${initsys}.yaml" write_netgroup_yaml "$1" "${yaml}" fi } write_calamares_yaml(){ - configure_calamares "${yaml_dir}" + local preset=${work_dir}/root-image/etc/mkinitcpio.d/${kernel} + [[ -f ${preset}.preset ]] || die "The profile needs to be built at least one time!" + configure_calamares "${yaml_dir}" "${preset}" for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do check_yaml "$conf" done From 805c33bcd772c772e65b30c94d7ca830d1823db3 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 17:35:47 +0200 Subject: [PATCH 04/26] util-iso-yaml: don't write packages.yaml in display mode --- lib/util-iso-yaml.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index b317c54..42813c6 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -41,15 +41,6 @@ prepare_check(){ prepare_dir "${yaml_dir}" chown "${OWNER}:${OWNER}" "${yaml_dir}" - - load_pkgs "${profile_dir}/Packages-Root" - yaml="${yaml_dir}/Packages-Root-${target_arch}-${initsys}.yaml" - write_netgroup_yaml "$1" "${yaml}" - if [[ -f "${packages_custom}" ]]; then - load_pkgs "${packages_custom}" - yaml="${yaml_dir}/${packages_custom##*/}-${target_arch}-${initsys}.yaml" - write_netgroup_yaml "$1" "${yaml}" - fi } write_calamares_yaml(){ @@ -63,7 +54,14 @@ write_calamares_yaml(){ make_profile_yaml(){ prepare_check "$1" - + load_pkgs "${profile_dir}/Packages-Root" + yaml="${yaml_dir}/Packages-Root-${target_arch}-${initsys}.yaml" + write_netgroup_yaml "$1" "${yaml}" + if [[ -f "${packages_custom}" ]]; then + load_pkgs "${packages_custom}" + yaml="${yaml_dir}/${packages_custom##*/}-${target_arch}-${initsys}.yaml" + write_netgroup_yaml "$1" "${yaml}" + fi ${calamares} && write_calamares_yaml "$1" user_own "${yaml_dir}" reset_profile From ff96c85395557506060838442ed6bfe43848ee88 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 18:27:15 +0200 Subject: [PATCH 05/26] check-yaml: use generic preset in cal mode --- Makefile | 1 + data/linux.preset | 14 ++++++++++++++ lib/util-iso-calamares.sh | 2 +- lib/util-iso-image.sh | 2 +- lib/util-iso-yaml.sh | 38 ++++++++++++++++++++++++++------------ 5 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 data/linux.preset diff --git a/Makefile b/Makefile index 9e35faa..f3872dc 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,7 @@ LIBS_ISO = \ SHARED_ISO = \ data/pacman-mhwd.conf \ data/desktop.map \ + data/linux.preset \ data/profile.conf.example CPIOHOOKS = \ diff --git a/data/linux.preset b/data/linux.preset new file mode 100644 index 0000000..4ab294c --- /dev/null +++ b/data/linux.preset @@ -0,0 +1,14 @@ +# mkinitcpio preset file for the 'linux' package + +ALL_config="/etc/mkinitcpio.conf" +ALL_kver="/boot/vmlinuz-@kvmaj@.@kvmin@-@arch@" + +PRESETS=('default' 'fallback') + +#default_config="/etc/mkinitcpio.conf" +default_image="/boot/initramfs-@kvmaj@.@kvmin@-@arch@.img" +#default_options="" + +#fallback_config="/etc/mkinitcpio.conf" +fallback_image="/boot/initramfs-@kvmaj@.@kvmin@-@arch@-fallback.img" +fallback_options="-S autodetect" diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index affd80a..2c96faf 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -36,7 +36,7 @@ write_finished_conf(){ write_bootloader_conf(){ local conf="$1/etc/calamares/modules/bootloader.conf" - source "$2.preset" + source "$2" echo '---' > "$conf" echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf" echo "kernel: \"$(echo ${ALL_kver} | sed s'|/boot||')\"" >> "$conf" diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index f803566..cdf737a 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -257,7 +257,7 @@ configure_live_image(){ configure_mhwd "$1" configure_system "$1" configure_services "$1" - configure_calamares "$1" "$1/etc/mkinitcpio.d/${kernel}" + configure_calamares "$1" "$1/etc/mkinitcpio.d/${kernel}.preset" write_live_session_conf "$1" msg "Done configuring [live-image]" } diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 42813c6..381f18d 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -17,6 +17,28 @@ check_yaml(){ [[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" } +get_preset(){ + local p=${tmp_dir}/${kernel}.preset kvmaj kvmin + cp ${DATADIR}/linux ${tmp_dir}/$p + digit=${kernel##linux} + kvmaj=${digit:0:1} + kvmin=${digit:1} + + sed -e "s|@kvmaj@|$kvmaj|g" \ + -e "s|@kvmin@|$kvmin|g" \ + -e "s|@arch@|${target_arch}|g"\ + -i $p + + echo $p +} + +write_calamares_yaml(){ + configure_calamares "${yaml_dir}" "$(get_preset)" + for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do + check_yaml "$conf" + done +} + write_netgroup_yaml(){ echo "- name: '$1'" > "$2" echo " description: '$1'" >> "$2" @@ -43,28 +65,20 @@ prepare_check(){ chown "${OWNER}:${OWNER}" "${yaml_dir}" } -write_calamares_yaml(){ - local preset=${work_dir}/root-image/etc/mkinitcpio.d/${kernel} - [[ -f ${preset}.preset ]] || die "The profile needs to be built at least one time!" - configure_calamares "${yaml_dir}" "${preset}" - for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do - check_yaml "$conf" - done +gen_fn(){ + echo ${yaml_dir}/$1-${target_arch}-${initsys}.yaml } make_profile_yaml(){ prepare_check "$1" load_pkgs "${profile_dir}/Packages-Root" - yaml="${yaml_dir}/Packages-Root-${target_arch}-${initsys}.yaml" - write_netgroup_yaml "$1" "${yaml}" + write_netgroup_yaml "$1" "$(gen_fn "Packages-Root")" if [[ -f "${packages_custom}" ]]; then load_pkgs "${packages_custom}" - yaml="${yaml_dir}/${packages_custom##*/}-${target_arch}-${initsys}.yaml" - write_netgroup_yaml "$1" "${yaml}" + write_netgroup_yaml "$1" "$(gen_fn "${packages_custom##*/}")" fi ${calamares} && write_calamares_yaml "$1" user_own "${yaml_dir}" reset_profile - unset yaml unset yaml_dir } From e6434da894b48649dddb46e7368ff2aaf8467bce Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 18:42:10 +0200 Subject: [PATCH 06/26] util-iso-yaml: fix preset copy --- lib/util-iso-yaml.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 381f18d..50e5653 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -19,7 +19,7 @@ check_yaml(){ get_preset(){ local p=${tmp_dir}/${kernel}.preset kvmaj kvmin - cp ${DATADIR}/linux ${tmp_dir}/$p + cp ${DATADIR}/linux.preset ${tmp_dir}/$p digit=${kernel##linux} kvmaj=${digit:0:1} kvmin=${digit:1} From 515a7f8c69e298b80efd0dd27260ae25c9acce83 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 18:45:04 +0200 Subject: [PATCH 07/26] util-iso-yaml: now it works in cal mode --- lib/util-iso-yaml.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 50e5653..0007b86 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -19,7 +19,7 @@ check_yaml(){ get_preset(){ local p=${tmp_dir}/${kernel}.preset kvmaj kvmin - cp ${DATADIR}/linux.preset ${tmp_dir}/$p + cp ${DATADIR}/linux.preset $p digit=${kernel##linux} kvmaj=${digit:0:1} kvmin=${digit:1} From e25e7619ef854d93e839d5d98b5316a427e34a23 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 18:50:00 +0200 Subject: [PATCH 08/26] util-iso-yaml: improve cache structure --- lib/util-iso-yaml.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 0007b86..7996873 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -58,7 +58,7 @@ prepare_check(){ check_profile load_profile_config "${profile_dir}/profile.conf" - yaml_dir=${cache_dir_netinstall}/${profile} + yaml_dir=${cache_dir_netinstall}/${profile}/${target_arch} work_dir=${chroots_iso}/${profile}/${target_arch} prepare_dir "${yaml_dir}" From afd06e7d8042f37b50030581e63a1c6d8d54000a Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 18:58:13 +0200 Subject: [PATCH 09/26] update readme --- README.md | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b0c8b9e..92620c2 100644 --- a/README.md +++ b/README.md @@ -260,8 +260,43 @@ The branch can be defined also in manjaro-tools.conf, but a manual parameter wil ######* -z * Use this to sqfs compress the chroots if you previously used -x. +###4. check-yaml -###4. buildtree +check-yaml can be used to write profile package lists to yaml. +It is also possible to generate calamares conf file as buildiso would do. +yaml files are used by calamares netinstall option. + +~~~ +$ check-yaml -h +Usage: check-yaml [options] + -p Buildset or profile [default: default] + -a Arch [default: x86_64] + -k Kernel to use[default: linux44] + -i Init system to use [default: systemd] + -c Check also calamares yaml files generated for the profile + -q Query settings + -h This help +~~~ +######* build xfce iso profile for both arches and branch testing on x86_64 build system + +* i686 (buildsystem is x86_64) + +~~~ +check-yaml -p xfce -a i686 -c +~~~ + +* for x86_64 + +~~~ +buildiso -p xfce -c +~~~ + +####Special parameters + +######* -c +* generate calamares module and settings conf files per profile + +###5. buildtree buildtree is a little tools to sync arch abs and manjaro PKGBUILD git repos. @@ -283,7 +318,7 @@ Usage: buildtree [options] buildtree -as ~~~ -###5. manjaro-chroot +###6. manjaro-chroot manjaro-chroot is a little tool to quickly chroot into a second system installed on the host. If the automount option is enabled, manjaro-chroot will detect installed systems with os-prober, and pops up a list with linux systems to select from. @@ -316,7 +351,7 @@ manjaro-chroot -a manjaro-chroot /mnt /bin/bash ~~~ -###6. deployiso +###7. deployiso deployiso is a script to upload a specific iso or a buiildset to SF. It needs to be run inside the iso-profiles directory. From dd6da471aa02c97e930b9b344ae62654acf97700 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 18:59:58 +0200 Subject: [PATCH 10/26] readme: be more specific on netgroups usage --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92620c2..021101a 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ The branch can be defined also in manjaro-tools.conf, but a manual parameter wil check-yaml can be used to write profile package lists to yaml. It is also possible to generate calamares conf file as buildiso would do. -yaml files are used by calamares netinstall option. +yaml files are used by calamares netinstall option from a specified url(netgroups). ~~~ $ check-yaml -h @@ -288,7 +288,7 @@ check-yaml -p xfce -a i686 -c * for x86_64 ~~~ -buildiso -p xfce -c +check-yaml -p xfce -c ~~~ ####Special parameters From 02a62a391432c9d3ecbce83d091c456a3d5b899b Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 19:16:41 +0200 Subject: [PATCH 11/26] util-iso-cal: write plymouth theme in grubcfg.conf --- lib/util-iso-calamares.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 2c96faf..1d3daab 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -328,7 +328,7 @@ write_grubcfg_conf(){ echo " GRUB_DISABLE_RECOVERY: true" >> "$conf" if ${plymouth_boot};then echo '' >> "$conf" - echo "plymouth_theme: ${plymouth_theme}" + echo "plymouth_theme: ${plymouth_theme}" >> "$conf" fi } From b3b67c4b2808fc35b34523acd82b7b9cc95fffe9 Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 20:02:39 +0200 Subject: [PATCH 12/26] check-yaml: show all relevant profile vars --- bin/check-yaml.in | 27 ++++++++++++++++++++++++++- lib/util-iso-yaml.sh | 1 - 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/bin/check-yaml.in b/bin/check-yaml.in index 77d00b4..e0596fb 100644 --- a/bin/check-yaml.in +++ b/bin/check-yaml.in @@ -23,14 +23,39 @@ import ${LIBDIR}/util-iso-yaml.sh show_profile(){ prepare_check "$1" msg2 "yaml_dir: %s" "${yaml_dir}" - msg2 "yaml file: %s" "${yaml##*/}" 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}" [[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}" + msg2 "netinstall: %s" "${netinstall}" ${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 reset_profile + unset yaml_dir } display_settings(){ diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 7996873..601b0d7 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -59,7 +59,6 @@ prepare_check(){ load_profile_config "${profile_dir}/profile.conf" yaml_dir=${cache_dir_netinstall}/${profile}/${target_arch} - work_dir=${chroots_iso}/${profile}/${target_arch} prepare_dir "${yaml_dir}" chown "${OWNER}:${OWNER}" "${yaml_dir}" From d04ed5b834c1fecb6cd2e7be9d9a27abc9d29bbd Mon Sep 17 00:00:00 2001 From: udeved Date: Sun, 21 Aug 2016 20:05:47 +0200 Subject: [PATCH 13/26] buildiso: add mirrors-live service to live array --- lib/util.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.sh b/lib/util.sh index d0fdb0a..726d095 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -435,11 +435,11 @@ load_profile_config(){ [[ -z ${disable_openrc[@]} ]] && disable_openrc=() if [[ -z ${enable_systemd_live[@]} ]];then - enable_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init') + enable_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init' 'mirrors-live') fi if [[ -z ${enable_openrc_live[@]} ]];then - enable_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init') + enable_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init' 'mirrors-live') fi if [[ ${displaymanager} != "none" ]]; then From 3d1983751189e20055599d378561621a9fac30cf Mon Sep 17 00:00:00 2001 From: udeved Date: Mon, 22 Aug 2016 12:36:35 +0200 Subject: [PATCH 14/26] buildiso; implemet smb settings in profile.conf --- data/profile.conf.example | 3 +++ lib/util-iso-calamares.sh | 3 +++ lib/util-iso-image.sh | 3 +++ lib/util.sh | 2 ++ 4 files changed, 11 insertions(+) diff --git a/data/profile.conf.example b/data/profile.conf.example index c9c7bc7..6fa1688 100644 --- a/data/profile.conf.example +++ b/data/profile.conf.example @@ -65,6 +65,9 @@ # unset defaults to given values # addgroups="video,power,disk,storage,optical,network,lp,scanner,wheel" +# the same workgroup name if samba is used +# smb_workgroup="Manjaro" + ################# live-session ################# # unset defaults to given value diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 1d3daab..c3dd0a7 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -292,6 +292,9 @@ write_postcfg_conf(){ echo "keyrings:" >> "$conf" echo " - archlinux" >> "$conf" echo " - manjaro" >> "$conf" + echo "" >> "$conf" + echo "samba:" >> "$conf" + echo " - workgroup: ${smb_workgroup}" >> "$conf" } get_yaml(){ diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index cdf737a..2ddb47e 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -220,6 +220,9 @@ write_live_session_conf(){ echo '' >> ${conf} echo '# default_desktop_executable' >> ${conf} echo "default_desktop_executable=${default_desktop_executable}" >> ${conf} + echo '' >> ${conf} + echo '# samba workgroup' >> ${conf} + echo "smb_workgrp=${smb_workgroup}" >> ${conf} } configure_hosts(){ diff --git a/lib/util.sh b/lib/util.sh index 726d095..ca053ca 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -457,6 +457,8 @@ load_profile_config(){ [[ -z ${netgroups} ]] && netgroups="https://raw.githubusercontent.com/manjaro/manjaro-tools-iso-profiles/master/shared/netinstall" + [[ -z ${smb_workgroup} ]] && smb_workgroup='Manjaro' + check_profile_vars return 0 From 397e9f0f64b0dff97e1f18d35183335eb320a83a Mon Sep 17 00:00:00 2001 From: udeved Date: Mon, 22 Aug 2016 12:46:55 +0200 Subject: [PATCH 15/26] util-iso-image: fix typo --- lib/util-iso-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 2ddb47e..e7f8346 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -222,7 +222,7 @@ write_live_session_conf(){ echo "default_desktop_executable=${default_desktop_executable}" >> ${conf} echo '' >> ${conf} echo '# samba workgroup' >> ${conf} - echo "smb_workgrp=${smb_workgroup}" >> ${conf} + echo "smb_workgroup=${smb_workgroup}" >> ${conf} } configure_hosts(){ From cf9cfdda8e6a4a8b966f7e5518742086b23f7178 Mon Sep 17 00:00:00 2001 From: udeved Date: Mon, 22 Aug 2016 13:14:28 +0200 Subject: [PATCH 16/26] buildiso: show smb_workgroup if not empty --- bin/buildiso.in | 1 + lib/util.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/buildiso.in b/bin/buildiso.in index 517e458..197c5b9 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -45,6 +45,7 @@ show_profile(){ msg2 "password: %s" "${password}" msg2 "login_shell: %s" "${login_shell}" msg2 "addgroups: %s" "${addgroups}" + [[ -n ${smb_workgroup} ]] && msg2 "smb_workgroup: %s" "${smb_workgroup}" if [[ ${initsys} == 'systemd' ]];then msg2 "enable_systemd: %s" "${enable_systemd[*]}" diff --git a/lib/util.sh b/lib/util.sh index ca053ca..13206df 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -457,7 +457,7 @@ load_profile_config(){ [[ -z ${netgroups} ]] && netgroups="https://raw.githubusercontent.com/manjaro/manjaro-tools-iso-profiles/master/shared/netinstall" - [[ -z ${smb_workgroup} ]] && smb_workgroup='Manjaro' + [[ -z ${smb_workgroup} ]] && smb_workgroup='' check_profile_vars From 0338813ef074ba60839b58249d26005916bb4e44 Mon Sep 17 00:00:00 2001 From: udeved Date: Mon, 22 Aug 2016 20:53:39 +0200 Subject: [PATCH 17/26] util-iso-image: clean sync db again --- lib/util-iso-image.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index e7f8346..3704e9b 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -319,10 +319,10 @@ clean_up_image(){ if [[ -d "$path" ]]; then find "$path" -name 'initramfs*.img' -delete &> /dev/null fi -# path=$1/var/lib/pacman/sync -# if [[ -d $path ]];then -# find "$path" -type f -delete &> /dev/null -# fi + path=$1/var/lib/pacman/sync + if [[ -d $path ]];then + find "$path" -type f -delete &> /dev/null + fi path=$1/var/cache/pacman/pkg if [[ -d $path ]]; then find "$path" -type f -delete &> /dev/null From ab4f9ffe784290a48696a2ccda08567406104302 Mon Sep 17 00:00:00 2001 From: udeved Date: Mon, 22 Aug 2016 21:37:46 +0200 Subject: [PATCH 18/26] buildiso: always use build locales should fix locales problems all over live session mkchroot: default to en_US for build locales in chroot --- bin/mkchroot.in | 2 +- lib/util-iso-image.sh | 1 - lib/util-iso.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/mkchroot.in b/bin/mkchroot.in index 004d6d5..f8a5f96 100644 --- a/bin/mkchroot.in +++ b/bin/mkchroot.in @@ -111,7 +111,7 @@ if ${build_locales};then info "Using build locales ..." mv "$working_dir/etc/locale.gen" "$working_dir/etc/locale.gen.bak" mv "$working_dir/etc/locale.conf" "$working_dir/etc/locale.conf.bak" - printf '%s.UTF-8 UTF-8\n' en_US de_DE > "$working_dir/etc/locale.gen" + printf '%s.UTF-8 UTF-8\n' en_US > "$working_dir/etc/locale.gen" printf 'LANG=%s.UTF-8\n' en_US > "$working_dir/etc/locale.conf" printf 'LC_MESSAGES=C\n' >> "$working_dir/etc/locale.conf" fi diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 3704e9b..0c3d29c 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -291,7 +291,6 @@ copy_from_cache(){ } chroot_create(){ - [[ "${1##*/}" == "root-image" ]] && local flag="-L" setarch "${target_arch}" \ mkchroot ${mkchroot_args[*]} ${flag} $@ } diff --git a/lib/util-iso.sh b/lib/util-iso.sh index cf97246..7134a34 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -743,7 +743,7 @@ load_profile(){ iso_file=$(gen_iso_fn).iso - mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K) + mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K -L) work_dir=${chroots_iso}/${profile}/${target_arch} iso_dir="${cache_dir_iso}/${edition}/${dist_release}/${profile}" From 8dcb4451dfd020e64b2241b362e64e3a7a80971b Mon Sep 17 00:00:00 2001 From: udeved Date: Mon, 22 Aug 2016 22:29:48 +0200 Subject: [PATCH 19/26] buildiso: partially revert prev commit; only do locales for root-image --- lib/util-iso-image.sh | 46 +++++++++++++++++++++---------------------- lib/util-iso.sh | 2 +- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 0c3d29c..10daea8 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -84,24 +84,6 @@ configure_mhwd_drivers(){ fi } -chroot_clean(){ - msg "Cleaning up ..." - for image in "$1"/*-image; do - [[ -d ${image} ]] || continue - local name=${image##*/} - if [[ $name != "mhwd-image" ]];then - msg2 "Deleting chroot [%s] ..." "$name" - lock 9 "${image}.lock" "Locking chroot '${image}'" - if [[ "$(stat -f -c %T "${image}")" == btrfs ]]; then - { type -P btrfs && btrfs subvolume delete "${image}"; } #&> /dev/null - fi - rm -rf --one-file-system "${image}" - fi - done - exec 9>&- - rm -rf --one-file-system "$1" -} - configure_lsb(){ [[ -f $1/boot/grub/grub.cfg ]] && rm $1/boot/grub/grub.cfg if [ -e $1/etc/lsb-release ] ; then @@ -291,10 +273,29 @@ copy_from_cache(){ } chroot_create(){ + [[ "${1##*/}" == "root-image" ]] && local flag="-L" setarch "${target_arch}" \ mkchroot ${mkchroot_args[*]} ${flag} $@ } +chroot_clean(){ + msg "Cleaning up ..." + for image in "$1"/*-image; do + [[ -d ${image} ]] || continue + local name=${image##*/} + if [[ $name != "mhwd-image" ]];then + msg2 "Deleting chroot [%s] ..." "$name" + lock 9 "${image}.lock" "Locking chroot '${image}'" + if [[ "$(stat -f -c %T "${image}")" == btrfs ]]; then + { type -P btrfs && btrfs subvolume delete "${image}"; } #&> /dev/null + fi + rm -rf --one-file-system "${image}" + fi + done + exec 9>&- + rm -rf --one-file-system "$1" +} + clean_up_image(){ msg2 "Cleaning [%s]" "${1##*/}" @@ -308,12 +309,9 @@ clean_up_image(){ if [[ -d $path ]];then find "$path" -mindepth 0 -delete &> /dev/null fi - else - - [[ -f "$1/etc/locale.gen.bak" ]] && \ - mv "$1/etc/locale.gen.bak" "$1/etc/locale.gen" - [[ -f "$1/etc/locale.conf.bak" ]] && \ - mv "$1/etc/locale.conf.bak" "$1/etc/locale.conf" + else + [[ -f "$1/etc/locale.gen.bak" ]] && mv "$1/etc/locale.gen.bak" "$1/etc/locale.gen" + [[ -f "$1/etc/locale.conf.bak" ]] && mv "$1/etc/locale.conf.bak" "$1/etc/locale.conf" path=$1/boot if [[ -d "$path" ]]; then find "$path" -name 'initramfs*.img' -delete &> /dev/null diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 7134a34..cf97246 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -743,7 +743,7 @@ load_profile(){ iso_file=$(gen_iso_fn).iso - mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K -L) + mkchroot_args+=(-C ${pacman_conf} -S ${mirrors_conf} -B "${build_mirror}/${target_branch}" -K) work_dir=${chroots_iso}/${profile}/${target_arch} iso_dir="${cache_dir_iso}/${edition}/${dist_release}/${profile}" From 51b5149df9fad577644c73a408a609cd88afc0ae Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 25 Aug 2016 02:56:19 +0200 Subject: [PATCH 20/26] check-yaml: print a msg when writing file --- lib/util-iso-yaml.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 601b0d7..59e87a0 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -14,7 +14,8 @@ import ${LIBDIR}/util-iso-calamares.sh check_yaml(){ result=$(python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < $1) - [[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" + info "Checking validity ..." + [[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" "${result}" } get_preset(){ @@ -40,6 +41,7 @@ write_calamares_yaml(){ } write_netgroup_yaml(){ + msg2 "Writing [%s] ..." "${2##*/}" echo "- name: '$1'" > "$2" echo " description: '$1'" >> "$2" echo " selected: false" >> "$2" From 8179ac827f3c29fe5f7ccc85fcbb2a0317037cce Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 25 Aug 2016 02:56:54 +0200 Subject: [PATCH 21/26] data: update base-devel-udev --- data/base-devel-udev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/base-devel-udev b/data/base-devel-udev index 38eb565..ffa13e2 100644 --- a/data/base-devel-udev +++ b/data/base-devel-udev @@ -2,7 +2,7 @@ autoconf automake binutils bison -eudev-systemdcompat +libeudev-systemd fakeroot file findutils From d2fdbccd08e1a6bf05bd5e186678d4349348ad56 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 25 Aug 2016 19:59:56 +0200 Subject: [PATCH 22/26] buildiso, check-yaml: msg cosmetics --- lib/util-iso-calamares.sh | 17 +++++++++++++++++ lib/util-iso-yaml.sh | 18 +++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index c3dd0a7..346e187 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -11,6 +11,7 @@ write_machineid_conf(){ local conf="$1/etc/calamares/modules/machineid.conf" + msg2 "Writing [%s] ..." "${conf##*/}" if [[ ${initsys} == 'openrc' ]];then echo "systemd: false" > $conf echo "dbus: true" >> $conf @@ -23,6 +24,7 @@ write_machineid_conf(){ } write_finished_conf(){ + msg2 "Writing [%s] ..." "finished.conf" local conf="$1/etc/calamares/modules/finished.conf" echo '---' > "$conf" echo 'restartNowEnabled: true' >> "$conf" @@ -36,6 +38,7 @@ write_finished_conf(){ write_bootloader_conf(){ local conf="$1/etc/calamares/modules/bootloader.conf" + msg2 "Writing [%s] ..." "${conf##*/}" source "$2" echo '---' > "$conf" echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf" @@ -54,6 +57,7 @@ write_bootloader_conf(){ write_services_conf(){ if [[ ${initsys} == 'openrc' ]];then local conf="$1/etc/calamares/modules/servicescfg.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo '---' > "$conf" echo '' >> "$conf" echo 'services:' >> "$conf" @@ -72,6 +76,7 @@ write_services_conf(){ fi else local conf="$1/etc/calamares/modules/services.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo '---' > "$conf" echo '' >> "$conf" echo 'services:' > "$conf" @@ -95,6 +100,7 @@ write_services_conf(){ write_displaymanager_conf(){ local conf="$1/etc/calamares/modules/displaymanager.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "displaymanagers:" > "$conf" echo " - ${displaymanager}" >> "$conf" echo '' >> "$conf" @@ -109,12 +115,14 @@ write_displaymanager_conf(){ write_initcpio_conf(){ local conf="$1/etc/calamares/modules/initcpio.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "kernel: ${kernel}" >> "$conf" } write_unpack_conf(){ local conf="$1/etc/calamares/modules/unpackfs.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "unpack:" >> "$conf" echo " - source: \"/bootmnt/${iso_name}/${target_arch}/root-image.sqfs\"" >> "$conf" @@ -129,6 +137,7 @@ write_unpack_conf(){ write_users_conf(){ local conf="$1/etc/calamares/modules/users.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "userGroup: users" >> "$conf" echo "defaultGroups:" >> "$conf" @@ -144,12 +153,14 @@ write_users_conf(){ write_packages_conf(){ local conf="$1/etc/calamares/modules/packages.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "backend: pacman" >> "$conf" } write_welcome_conf(){ local conf="$1/etc/calamares/modules/welcome.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" >> "$conf" echo "showSupportUrl: true" >> "$conf" echo "showKnownIssuesUrl: true" >> "$conf" @@ -175,6 +186,7 @@ write_welcome_conf(){ write_settings_conf(){ local conf="$1/etc/calamares/settings.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "modules-search: [ local ]" >> "$conf" echo '' >> "$conf" @@ -239,6 +251,7 @@ write_settings_conf(){ write_mhwdcfg_conf(){ local conf="$1/etc/calamares/modules/mhwdcfg.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "identifier:" >> "$conf" echo " net:" >> "$conf" @@ -272,6 +285,7 @@ write_mhwdcfg_conf(){ write_chrootcfg_conf(){ local conf="$1/etc/calamares/modules/chrootcfg.conf" mode='"0o755"' + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "requirements:" >> "$conf" echo " - name: /etc" >> "$conf" @@ -288,6 +302,7 @@ write_chrootcfg_conf(){ write_postcfg_conf(){ local conf="$1/etc/calamares/modules/postcfg.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "keyrings:" >> "$conf" echo " - archlinux" >> "$conf" @@ -314,12 +329,14 @@ get_yaml(){ write_netinstall_conf(){ local conf="$1/etc/calamares/modules/netinstall.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "groupsUrl: ${netgroups}/$(get_yaml)" >> "$conf" } write_grubcfg_conf(){ local conf="$1/etc/calamares/modules/grubcfg.conf" + msg2 "Writing [%s] ..." "${conf##*/}" echo "---" > "$conf" echo "overwrite: false" >> "$conf" echo '' >> "$conf" diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index 59e87a0..be8929d 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -12,11 +12,11 @@ import ${LIBDIR}/util-iso.sh import ${LIBDIR}/util-iso-calamares.sh -check_yaml(){ - result=$(python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < $1) - info "Checking validity ..." - [[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" "${result}" -} +# check_yaml(){ +# result=$(python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < $1) +# msg2 "Checking validity [%s] ..." "${1##*/}" +# [[ $? -ne 0 ]] && error "yaml error: %s [msg: %s]" "$1" "${result}" +# } get_preset(){ local p=${tmp_dir}/${kernel}.preset kvmaj kvmin @@ -35,9 +35,9 @@ get_preset(){ write_calamares_yaml(){ configure_calamares "${yaml_dir}" "$(get_preset)" - for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do - check_yaml "$conf" - done +# for conf in "${yaml_dir}"/etc/calamares/modules/*.conf "${yaml_dir}"/etc/calamares/settings.conf; do +# check_yaml "$conf" +# done } write_netgroup_yaml(){ @@ -50,7 +50,7 @@ write_netgroup_yaml(){ for p in ${packages[@]};do echo " - $p" >> "$2" done - check_yaml "$2" +# check_yaml "$2" } prepare_check(){ From e6fac0421b9b796c449700c1e7f6709e93412c7e Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 25 Aug 2016 21:36:15 +0200 Subject: [PATCH 23/26] buildiso: more msg stuff --- lib/util-iso-calamares.sh | 38 ++++++++++++++++++++------------------ lib/util-iso-image.sh | 2 +- lib/util-iso-yaml.sh | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 346e187..ffec758 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -11,7 +11,7 @@ write_machineid_conf(){ local conf="$1/etc/calamares/modules/machineid.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" if [[ ${initsys} == 'openrc' ]];then echo "systemd: false" > $conf echo "dbus: true" >> $conf @@ -24,7 +24,7 @@ write_machineid_conf(){ } write_finished_conf(){ - msg2 "Writing [%s] ..." "finished.conf" + msg2 "Writing %s ..." "finished.conf" local conf="$1/etc/calamares/modules/finished.conf" echo '---' > "$conf" echo 'restartNowEnabled: true' >> "$conf" @@ -38,7 +38,7 @@ write_finished_conf(){ write_bootloader_conf(){ local conf="$1/etc/calamares/modules/bootloader.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" source "$2" echo '---' > "$conf" echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf" @@ -57,7 +57,7 @@ write_bootloader_conf(){ write_services_conf(){ if [[ ${initsys} == 'openrc' ]];then local conf="$1/etc/calamares/modules/servicescfg.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo '---' > "$conf" echo '' >> "$conf" echo 'services:' >> "$conf" @@ -76,7 +76,7 @@ write_services_conf(){ fi else local conf="$1/etc/calamares/modules/services.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo '---' > "$conf" echo '' >> "$conf" echo 'services:' > "$conf" @@ -100,7 +100,7 @@ write_services_conf(){ write_displaymanager_conf(){ local conf="$1/etc/calamares/modules/displaymanager.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "displaymanagers:" > "$conf" echo " - ${displaymanager}" >> "$conf" echo '' >> "$conf" @@ -115,14 +115,14 @@ write_displaymanager_conf(){ write_initcpio_conf(){ local conf="$1/etc/calamares/modules/initcpio.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "kernel: ${kernel}" >> "$conf" } write_unpack_conf(){ local conf="$1/etc/calamares/modules/unpackfs.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "unpack:" >> "$conf" echo " - source: \"/bootmnt/${iso_name}/${target_arch}/root-image.sqfs\"" >> "$conf" @@ -137,7 +137,7 @@ write_unpack_conf(){ write_users_conf(){ local conf="$1/etc/calamares/modules/users.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "userGroup: users" >> "$conf" echo "defaultGroups:" >> "$conf" @@ -153,14 +153,14 @@ write_users_conf(){ write_packages_conf(){ local conf="$1/etc/calamares/modules/packages.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "backend: pacman" >> "$conf" } write_welcome_conf(){ local conf="$1/etc/calamares/modules/welcome.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" >> "$conf" echo "showSupportUrl: true" >> "$conf" echo "showKnownIssuesUrl: true" >> "$conf" @@ -186,7 +186,7 @@ write_welcome_conf(){ write_settings_conf(){ local conf="$1/etc/calamares/settings.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "modules-search: [ local ]" >> "$conf" echo '' >> "$conf" @@ -251,7 +251,7 @@ write_settings_conf(){ write_mhwdcfg_conf(){ local conf="$1/etc/calamares/modules/mhwdcfg.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "identifier:" >> "$conf" echo " net:" >> "$conf" @@ -285,7 +285,7 @@ write_mhwdcfg_conf(){ write_chrootcfg_conf(){ local conf="$1/etc/calamares/modules/chrootcfg.conf" mode='"0o755"' - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "requirements:" >> "$conf" echo " - name: /etc" >> "$conf" @@ -302,7 +302,7 @@ write_chrootcfg_conf(){ write_postcfg_conf(){ local conf="$1/etc/calamares/modules/postcfg.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "keyrings:" >> "$conf" echo " - archlinux" >> "$conf" @@ -329,14 +329,14 @@ get_yaml(){ write_netinstall_conf(){ local conf="$1/etc/calamares/modules/netinstall.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "groupsUrl: ${netgroups}/$(get_yaml)" >> "$conf" } write_grubcfg_conf(){ local conf="$1/etc/calamares/modules/grubcfg.conf" - msg2 "Writing [%s] ..." "${conf##*/}" + msg2 "Writing %s ..." "${conf##*/}" echo "---" > "$conf" echo "overwrite: false" >> "$conf" echo '' >> "$conf" @@ -353,7 +353,7 @@ write_grubcfg_conf(){ } configure_calamares(){ - msg2 "Configuring Calamares ..." + info "Configuring [Calamares]" mkdir -p $1/etc/calamares/modules @@ -387,4 +387,6 @@ configure_calamares(){ write_services_conf "$1" write_users_conf "$1" + + info "Done configuring [Calamares]" } diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 10daea8..b853c38 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -173,10 +173,10 @@ detect_desktop_env(){ } write_live_session_conf(){ - msg2 "Configuring live session ..." local path=$1${DATADIR} [[ ! -d $path ]] && mkdir -p $path local conf=$path/live.conf + msg2 "Writing %s" "${conf##*/}" echo '# live session configuration' > ${conf} echo '' >> ${conf} echo '# autologin' >> ${conf} diff --git a/lib/util-iso-yaml.sh b/lib/util-iso-yaml.sh index be8929d..516fd93 100644 --- a/lib/util-iso-yaml.sh +++ b/lib/util-iso-yaml.sh @@ -41,7 +41,7 @@ write_calamares_yaml(){ } write_netgroup_yaml(){ - msg2 "Writing [%s] ..." "${2##*/}" + msg2 "Writing %s ..." "${2##*/}" echo "- name: '$1'" > "$2" echo " description: '$1'" >> "$2" echo " selected: false" >> "$2" From a6547fa5f2a0298a349862f62a65db9719455477 Mon Sep 17 00:00:00 2001 From: udeved Date: Sat, 27 Aug 2016 00:56:46 +0200 Subject: [PATCH 24/26] util: allow plymouth_boot on openrc --- lib/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.sh b/lib/util.sh index 13206df..07f4833 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -402,7 +402,7 @@ load_profile_config(){ [[ -z ${pxe_boot} ]] && pxe_boot="true" [[ -z ${plymouth_boot} ]] && plymouth_boot="true" - [[ ${initsys} == 'openrc' ]] && plymouth_boot="false" +# [[ ${initsys} == 'openrc' ]] && plymouth_boot="false" [[ -z ${nonfree_mhwd} ]] && nonfree_mhwd="true" From 772cdfc677c3d8e12de530386d76dede154a8bb9 Mon Sep 17 00:00:00 2001 From: udeved Date: Sat, 27 Aug 2016 01:20:17 +0200 Subject: [PATCH 25/26] util-iso-image: write live.confin $SYSCONFDIR so live package can load a default im $SYSCONFDIR is not present; the default will be packaged --- lib/util-iso-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index b853c38..94a2542 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -173,7 +173,7 @@ detect_desktop_env(){ } write_live_session_conf(){ - local path=$1${DATADIR} + local path=$1${SYSCONFDIR} [[ ! -d $path ]] && mkdir -p $path local conf=$path/live.conf msg2 "Writing %s" "${conf##*/}" From 5277fe3037158fddbf3d6790eee64be013d03c07 Mon Sep 17 00:00:00 2001 From: udeved Date: Sat, 27 Aug 2016 02:00:24 +0200 Subject: [PATCH 26/26] util-iso-boot: set splash for openrc if plymouth_boot --- lib/util-iso-boot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-boot.sh b/lib/util-iso-boot.sh index 7d6bb31..1118d30 100644 --- a/lib/util-iso-boot.sh +++ b/lib/util-iso-boot.sh @@ -193,7 +193,7 @@ copy_isolinux_bin(){ gen_boot_args(){ local args=(quiet) if ${plymouth_boot};then - [[ ${initsys} == 'systemd' ]] && args+=(splash) + args+=(splash) fi echo ${args[@]} }