diff options
| author | Jonathan Bauer | 2020-05-05 18:11:51 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2020-05-05 18:11:51 +0200 |
| commit | b4729c25659e5d246dcdc75005354b9c6d2af4f9 (patch) | |
| tree | 9bac16021d3ef986b5ecd81a7ad00af74d0fb502 | |
| parent | Merge branch 'master' into nobash (diff) | |
| parent | build-initramfs.sh: switch branch (diff) | |
| download | systemd-init-b4729c25659e5d246dcdc75005354b9c6d2af4f9.tar.gz systemd-init-b4729c25659e5d246dcdc75005354b9c6d2af4f9.tar.xz systemd-init-b4729c25659e5d246dcdc75005354b9c6d2af4f9.zip | |
Merge branch 'master' into nobash-merge
| -rwxr-xr-x | builder/build-initramfs.sh | 23 | ||||
| -rw-r--r-- | builder/modules.d/dnbd3-rootfs/helper/build.inc | 20 | ||||
| -rwxr-xr-x | builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh | 20 | ||||
| -rwxr-xr-x | builder/modules.d/dnbd3-rootfs/module-setup.sh | 2 | ||||
| -rw-r--r-- | builder/modules.d/slx-addons/scripts/setup-addons.sh | 2 | ||||
| -rw-r--r-- | builder/modules.d/slx-addons/services/ldconfig.service | 2 | ||||
| -rw-r--r-- | builder/modules.d/slx-splash/data/splash.ppm.gz | bin | 11233 -> 4770 bytes | |||
| -rw-r--r-- | builder/patches/dnbd3/01-fix_blk_h.patch | 13 |
8 files changed, 58 insertions, 24 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index eb8e99b7..7b09994c 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -37,13 +37,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" @@ -249,9 +249,12 @@ main() { if [ ! -f "${kernel_headers}/Makefile" ]; then echo 'Missing core dependency "linux-headers" for version to compile against given or current kernel.' fi - echo " * kernel headers: $kernel_headers" - [ -n "$qcow_handler" ] && echo " * qcow2 handler: $qcow_handler" - export _QCOW_HANDLER="$qcow_handler" + logging.info " * kernel headers: $kernel_headers" + if [ -n "$qcow_handler" ]; then + logging.info " * qcow2 handler: $qcow_handler" + export qcow_handler + fi + # endregion if [ "$update" == "yes" ]; then pushd "${_repo_dir}" diff --git a/builder/modules.d/dnbd3-rootfs/helper/build.inc b/builder/modules.d/dnbd3-rootfs/helper/build.inc index 13ab9159..6d14ecf9 100644 --- a/builder/modules.d/dnbd3-rootfs/helper/build.inc +++ b/builder/modules.d/dnbd3-rootfs/helper/build.inc @@ -4,13 +4,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 - echo "Unknown qcow handler '$qcow_handler' - will built all known." - echo "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> @@ -23,7 +19,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 echo "Could not find xmount binary, building it..." @@ -40,7 +44,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/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh index 86cc60ad..b38fccbb 100755 --- a/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh +++ b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh @@ -43,10 +43,24 @@ container_unpack_losetup() { # endregion # region connect dnbd3 image -# if not specified, use the default name for the bwlp stage4 image +# Determine stage4 image path and revision if [ -z "$SLX_DNBD3_IMAGE" ]; then + # specified on the KCL? + SLX_DNBD3_IMAGE="$(getarg slx.stage4.path=)" +fi +if [ -z "$SLX_DNBD3_IMAGE" ]; then + # not specified, fall back to old bwlp default path convention SLX_DNBD3_IMAGE="stage4/bwlp/maxilinux-$(uname -r)" - echo "SLX_DNBD3_IMAGE='$SLX_DNBD3_IMAGE'" >> /etc/openslx +fi +# save it for later +echo "SLX_DNBD3_IMAGE='$SLX_DNBD3_IMAGE'" >> /etc/openslx +if [ -z "$SLX_DNBD3_RID" ]; then + # specified on the KCL? + SLX_DNBD3_RID="$(getarg slx.stage4.rid=)" +fi +if [ -n "$SLX_DNBD3_RID" ]; then + _dnbd3_client_additional_args=("--rid" "$SLX_DNBD3_RID") + echo "SLX_DNBD3_RID='$SLX_DNBD3_RID'" >> /etc/openslx fi IFS=", " @@ -61,7 +75,7 @@ for host in ${SLX_DNBD3_SERVERS} FAIL; do --host "$host" \ --image "${SLX_DNBD3_IMAGE}" \ --device "$_dnbd3_dev" \ - ${SLX_DNBD3_RID:+--rid "$SLX_DNBD3_RID"}; then + "${_dnbd3_client_additional_args[@]}"; then break fi done diff --git a/builder/modules.d/dnbd3-rootfs/module-setup.sh b/builder/modules.d/dnbd3-rootfs/module-setup.sh index 77543a54..e69b430e 100755 --- a/builder/modules.d/dnbd3-rootfs/module-setup.sh +++ b/builder/modules.d/dnbd3-rootfs/module-setup.sh @@ -165,7 +165,7 @@ install() { fi # endregion # region hooks - inst_hook cmdline 00 "$moddir/hooks/enable-sysrq.sh" + #inst_hook cmdline 00 "$moddir/hooks/enable-sysrq.sh" # NOTE: Can be used to support old style ip append syntax and have an # exclusive interface name - required when using dracut's regular # 'network' module diff --git a/builder/modules.d/slx-addons/scripts/setup-addons.sh b/builder/modules.d/slx-addons/scripts/setup-addons.sh index c155a5a5..d4b94a1a 100644 --- a/builder/modules.d/slx-addons/scripts/setup-addons.sh +++ b/builder/modules.d/slx-addons/scripts/setup-addons.sh @@ -61,7 +61,7 @@ setup_addon() { # move all the files over for entry in $(find * -not -type d 2>/dev/null); do - mkdir -p "${NEWROOT}/${entry%/*}" + [ "$entry" != "${entry%/*}" ] && mkdir -p "${NEWROOT}/${entry%/*}" mv -f -- "$entry" "${NEWROOT}/${entry}" done diff --git a/builder/modules.d/slx-addons/services/ldconfig.service b/builder/modules.d/slx-addons/services/ldconfig.service index b821f743..be799e66 100644 --- a/builder/modules.d/slx-addons/services/ldconfig.service +++ b/builder/modules.d/slx-addons/services/ldconfig.service @@ -1,7 +1,7 @@ [Unit] Description=Run ldconfig Before=graphical.target -DefaulltDependencies=no +DefaultDependencies=no [Service] Type=oneshot diff --git a/builder/modules.d/slx-splash/data/splash.ppm.gz b/builder/modules.d/slx-splash/data/splash.ppm.gz Binary files differindex d30d44e2..f524b27b 100644 --- a/builder/modules.d/slx-splash/data/splash.ppm.gz +++ b/builder/modules.d/slx-splash/data/splash.ppm.gz 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 + |
