From 53ed4cc4fe7cdd460ad6102c6b23d67352cf5bf5 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 23 Jan 2020 14:28:48 +0100 Subject: quick fix for centos7 --- builder/build-initramfs.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index 3606eed0..2245739e 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -44,13 +44,13 @@ if [ ! -e "$_repo_dir" ]; then path="$(git config -f .gitmodules --get submodule.${mod}.path)" branch="$(git config -f .gitmodules --get submodule.${mod}.branch)" commit="$(git submodule status $path | grep -oE '[0-9a-f]{40}')" - depth_arg=("--shallow-since") - [ "$mod" = "dnbd3" ] && depth_arg+=("2019-02-12") - [ "$mod" = "rebash" ] && depth_arg+=("2016-11-30") - [ "$mod" = "qemu-xmount" ] && depth_arg+=("2016-01-01") - [ "$mod" = "xmount" ] && depth_arg+=("2015-11-05") - [ "$mod" = "kernel-qcow2-linux" ] && depth_arg+=("2019-08-25") - [ "$mod" = "kernel-qcow2-util-linux" ] && depth_arg+=("2019-08-15") + # depth_arg=("--shallow-since") + # [ "$mod" = "dnbd3" ] && depth_arg+=("2019-02-12") + # [ "$mod" = "rebash" ] && depth_arg+=("2016-11-30") + # [ "$mod" = "qemu-xmount" ] && depth_arg+=("2016-01-01") + # [ "$mod" = "xmount" ] && depth_arg+=("2015-11-05") + [ "$mod" = "kernel-qcow2-linux" ] && continue + [ "$mod" = "kernel-qcow2-util-linux" ] && continue git clone --no-checkout "${depth_arg[@]}" --branch "$branch" "$url" "$path" pushd "$path" git checkout "$commit" -- cgit v1.2.3-55-g7522 From 9bcb7a807bd14a0ddb08118def44e1acf8509a24 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 24 Jan 2020 14:47:12 +0100 Subject: patches: backport workaround for dnbd3 in centos --- builder/patches/dnbd3/01-fix_blk_h.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 builder/patches/dnbd3/01-fix_blk_h.patch diff --git a/builder/patches/dnbd3/01-fix_blk_h.patch b/builder/patches/dnbd3/01-fix_blk_h.patch new file mode 100644 index 00000000..f3fc6251 --- /dev/null +++ b/builder/patches/dnbd3/01-fix_blk_h.patch @@ -0,0 +1,13 @@ +diff --git a/src/kernel/blk.h b/src/kernel/blk.h +index 5091d19..8eef9ca 100644 +--- a/src/kernel/blk.h ++++ b/src/kernel/blk.h +@@ -23,7 +23,7 @@ + + #include "dnbd3.h" + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) + #define REQ_TYPE_SPECIAL REQ_TYPE_DRV_PRIV + #endif + -- cgit v1.2.3-55-g7522 From 08fa02e801661cd68593f2c6859ad6286426a593 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 24 Jan 2020 15:49:11 +0100 Subject: builder/build-initramfs.sh: use this branch... --- builder/build-initramfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index 2245739e..0bf7009b 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -24,7 +24,7 @@ declare -rg _root_dir="$(readlink -f $(dirname ${BASH_SOURCE[0]}))" declare -rg _repo_dir="${_root_dir}/systemd-init.git" declare -rg _git_source="git://git.openslx.org/openslx-ng/systemd-init.git" -declare -rg _git_branch="master" +declare -rg _git_branch="centos7-fix" ## region ensure presence of needed dependencies set -o errexit if [ ! -e "$_repo_dir" ]; then -- cgit v1.2.3-55-g7522 From c8d2d0c60d8f65e1cc7ab9bead2e6d250a03a2e8 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 27 Jan 2020 11:14:32 +0100 Subject: fallback to building xmount only --- builder/build-initramfs.sh | 5 ++++- builder/modules.d/dnbd3-rootfs/helper/build.inc | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index 0bf7009b..3b03592d 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -572,7 +572,10 @@ main() { logging.critical 'Missing core dependency "linux-headers" for version to compile against given or current kernel.' fi logging.info " * kernel headers: $kernel_headers" - [ -n "$qcow_handler" ] && logging.info " * qcow2 handler: $qcow_handler" + if [ -n "$qcow_handler" ]; then + logging.info " * qcow2 handler: $qcow_handler" + export qcow_handler + fi # endregion # region handle '--update' to update all the modules in 'modules.d' diff --git a/builder/modules.d/dnbd3-rootfs/helper/build.inc b/builder/modules.d/dnbd3-rootfs/helper/build.inc index 3a0cd5a3..df866d72 100644 --- a/builder/modules.d/dnbd3-rootfs/helper/build.inc +++ b/builder/modules.d/dnbd3-rootfs/helper/build.inc @@ -5,8 +5,9 @@ declare -rg _mainmoddir="$(dirname "${BASH_SOURCE[0]}")/.." 2> /dev/null declare -rg _supported_qcow_handlers=("xmount" "kernel") +# NOTE: expects 'qcow_handler' to be set in the environment, else +# will only build support for xmount build_initialize_components() { - local qcow_handler="$_QCOW_HANDLER" IFS='|' _pattern="^(${_supported_qcow_handlers[*]})$" export _pattern if [[ ! "$qcow_handler" =~ $_pattern ]] ; then logging.warn "Unknown qcow handler '$qcow_handler' - will built all known." @@ -41,7 +42,7 @@ build_initialize_components() { fi fi fi - if [ -z "$qcow_handler" ] || [ "$qcow_handler" = "kernel" ]; then + if [ "$qcow_handler" = "kernel" ]; then if [ ! -f "${_deps_base_dir}/kernel-qcow2-linux/drivers/block/loop/loop.ko" ] \ || [ ! -f "${_deps_base_dir}/kernel-qcow2-linux/drivers/block/loop/loop_file_fmt_qcow.ko" ] \ || [ ! -f "${_deps_base_dir}/kernel-qcow2-linux/drivers/block/loop/loop_file_fmt_raw.ko" ]; then -- cgit v1.2.3-55-g7522 From d905f547300455176e453e7a6b3e2a2b8e7e4934 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 27 Jan 2020 11:22:19 +0100 Subject: modules.d/dnbd3-rootfs/helper/build.inc: improve logging --- builder/modules.d/dnbd3-rootfs/helper/build.inc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builder/modules.d/dnbd3-rootfs/helper/build.inc b/builder/modules.d/dnbd3-rootfs/helper/build.inc index df866d72..9c935424 100644 --- a/builder/modules.d/dnbd3-rootfs/helper/build.inc +++ b/builder/modules.d/dnbd3-rootfs/helper/build.inc @@ -8,11 +8,6 @@ declare -rg _supported_qcow_handlers=("xmount" "kernel") # NOTE: expects 'qcow_handler' to be set in the environment, else # will only build support for xmount build_initialize_components() { - IFS='|' _pattern="^(${_supported_qcow_handlers[*]})$" export _pattern - if [[ ! "$qcow_handler" =~ $_pattern ]] ; then - logging.warn "Unknown qcow handler '$qcow_handler' - will built all known." - logging.warn "Supported handlers: ${_supported_qcow_handlers[*]}" - fi _deps_base_dir="${_mainmoddir}/binaries" # We might want to move the "binaries" repos from the dnbd3-rootfs module to main repo one day... # TODO check for its existence using modinfo -k @@ -25,7 +20,15 @@ build_initialize_components() { return 1 fi fi - # take care of the qcow handler + + # process qcow handler + logging.info "Supported handlers: ${_supported_qcow_handlers[*]}" + IFS='|' _pattern="^(${_supported_qcow_handlers[*]})$" export _pattern + if [ -z "$qcow_handler" ]; then + logging.info "No qcow handler specified, will use xmount." + elif [[ ! "$qcow_handler" =~ $_pattern ]] ; then + logging.warn "Unknown qcow handler '$qcow_handler' - will use xmount" + fi if [ -z "$qcow_handler" ] || [ "$qcow_handler" = "xmount" ]; then if [[ ! -f "${_deps_base_dir}/xmount/trunk/build/src/xmount" ]]; then logging.info "Could not find xmount binary, building it..." -- cgit v1.2.3-55-g7522