summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2020-05-04 18:15:15 +0200
committerJonathan Bauer2020-05-04 18:15:15 +0200
commitf4e2c0bb4155388908cfb6e7a4eebc1b8d3ec12e (patch)
treece37522b45a2ee3af1dda82eb1d499c2b07d6daa
parent[slx-addons] fix mkdir on filename (diff)
parentmodules.d/dnbd3-rootfs/helper/build.inc: improve logging (diff)
downloadsystemd-init-f4e2c0bb4155388908cfb6e7a4eebc1b8d3ec12e.tar.gz
systemd-init-f4e2c0bb4155388908cfb6e7a4eebc1b8d3ec12e.tar.xz
systemd-init-f4e2c0bb4155388908cfb6e7a4eebc1b8d3ec12e.zip
Merge branch 'centos7-fix'
-rwxr-xr-xbuilder/build-initramfs.sh21
-rw-r--r--builder/modules.d/dnbd3-rootfs/helper/build.inc20
-rw-r--r--builder/patches/dnbd3/01-fix_blk_h.patch13
3 files changed, 37 insertions, 17 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh
index 3606eed0..3b03592d 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
@@ -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"
@@ -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..9c935424 100644
--- a/builder/modules.d/dnbd3-rootfs/helper/build.inc
+++ b/builder/modules.d/dnbd3-rootfs/helper/build.inc
@@ -5,13 +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."
- 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 <kernel_version>
@@ -24,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..."
@@ -41,7 +45,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
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
+