From 4cdf6990f853c37af88eb01cd95c0c1db636edeb Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 9 Jul 2019 13:38:04 +0200 Subject: remove deprecated modules --- modules.d/openslx-tmp-format/module-setup.sh | 14 ------ .../scripts/openslx_tmp_format.sh | 58 ---------------------- modules.d/openslx-tmp-mount/module-setup.sh | 13 ----- .../openslx-tmp-mount/scripts/openslx_tmp_mount.sh | 11 ---- 4 files changed, 96 deletions(-) delete mode 100755 modules.d/openslx-tmp-format/module-setup.sh delete mode 100755 modules.d/openslx-tmp-format/scripts/openslx_tmp_format.sh delete mode 100755 modules.d/openslx-tmp-mount/module-setup.sh delete mode 100755 modules.d/openslx-tmp-mount/scripts/openslx_tmp_mount.sh diff --git a/modules.d/openslx-tmp-format/module-setup.sh b/modules.d/openslx-tmp-format/module-setup.sh deleted file mode 100755 index 7449c0cb..00000000 --- a/modules.d/openslx-tmp-format/module-setup.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -check() { - # Tell dracut that this module should only be included if it is required - # explicitly. - return 255 -} -depends() { - echo custom-logging dnbd-root-filesystem -} -install() { - inst_hook pre-pivot 20 "$moddir/scripts/openslx_tmp_format.sh" - inst_multiple mkfs.xfs mkfs.ext4 -} diff --git a/modules.d/openslx-tmp-format/scripts/openslx_tmp_format.sh b/modules.d/openslx-tmp-format/scripts/openslx_tmp_format.sh deleted file mode 100755 index 9848b923..00000000 --- a/modules.d/openslx-tmp-format/scripts/openslx_tmp_format.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -# -# Formats the partition used for "${NEWROOT}/tmp" -# using filesystem given as SLX_TMP_PARTITION_FILESYSTEM -# if possible. If not, it tries xfs and ext4 as fallbacks. -source /usr/lib/configure-logging.sh -bl.module.import bashlink.filesystem - -. /usr/lib/openslx/tools.sh -. /etc/openslx - -# If it is not set, assume the functionality is unwanted -[ -z "${SLX_TMP_PARTITION_IDENTIFIER}" ] && return 0 - -# Support comma-separated list of identifiers, e.g. -# "OpenSLX-ID44,0x44" as these can match GPT label (recommended) -# and even MBR partition types (more of an ugly hack currently...) -OLDIFS="$IFS" -IFS="," -SLX_TMP_PARTITION_DEVICE= -for identifier in ${SLX_TMP_PARTITION_IDENTIFIER}; do - SLX_TMP_PARTITION_DEVICE="$(bl.filesystem.find_block_device "${identifier}" '' \ - "${SLX_TMP_PARTITION_IDENTIFIER_TIMEOUT_IN_SECONDS:-5}")" - if [ -n "${SLX_TMP_PARTITION_DEVICE}" ]; then - echo "SLX_TMP_PARTITION_DEVICE=${SLX_TMP_PARTITION_DEVICE}" >> /etc/openslx - break - fi -done -IFS="$OLDIFS" - -if [ -z "${SLX_TMP_PARTITION_DEVICE}" ]; then - warn "[${BASH_SOURCE[0]}] \ - Could not find device matching identifiers: ${SLX_TMP_PARTITION_IDENTIFIER}." - return 1 -fi -# Since a partition identifier is set and this module was built -# assume that the partition should always be formatted. -if [ -z "${SLX_TMP_PARTITION_FILESYSTEM_CREATE_COMMAND}" ] || - ! command -v "${SLX_TMP_PARTITION_FILESYSTEM_CREATE_COMMAND%%\ *}" >/dev/null; then - warn "[${BASH_SOURCE[0]}] \ - '${SLX_TMP_PARTITION_FILESYSTEM_CREATE_COMMAND%%\ *}' invalid. Using fallbacks..." - # Fallbacks - if command -v mkfs.xfs >/dev/null; then - SLX_TMP_PARTITION_FILESYSTEM_CREATE_COMMAND="mkfs.xfs -f" - elif command -v mkfs.ext4 >/dev/null; then - SLX_TMP_PARTITION_FILESYSTEM_CREATE_COMMAND="mkfs.ext4 -F" - else - warn "[${BASH_SOURCE[0]}] No suitable mkfs command found! Skipping..." - return 1 - fi -fi - -if ! ${SLX_TMP_PARTITION_FILESYSTEM_CREATE_COMMAND} "${SLX_TMP_PARTITION_DEVICE}"; then - warn "[${BASH_SOURCE[0]}] \ - Failed to format '${SLX_TMP_PARTITION_DEVICE}' using: \ - ${SLX_TMP_PARTITION_FILESYSTEM_CREATE_COMMAND}" - return 1 -fi diff --git a/modules.d/openslx-tmp-mount/module-setup.sh b/modules.d/openslx-tmp-mount/module-setup.sh deleted file mode 100755 index dc7d1d10..00000000 --- a/modules.d/openslx-tmp-mount/module-setup.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -check() { - # Tell dracut that this module should only be included if it is required - # explicitly. - return 255 -} -depends() { - echo dnbd-root-filesystem -} -install() { - inst_hook pre-pivot 30 "$moddir/scripts/openslx_tmp_mount.sh" -} diff --git a/modules.d/openslx-tmp-mount/scripts/openslx_tmp_mount.sh b/modules.d/openslx-tmp-mount/scripts/openslx_tmp_mount.sh deleted file mode 100755 index ddf974fc..00000000 --- a/modules.d/openslx-tmp-mount/scripts/openslx_tmp_mount.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -. /etc/openslx - -# The device should have been discovered by openslx_tmp_format hook -# and written to /etc/openslx -if [ -n "${SLX_TMP_PARTITION_DEVICE}" ]; then - mount -t auto "${SLX_TMP_PARTITION_DEVICE}" "${NEWROOT}/tmp" - chmod a+rwxt "${NEWROOT}/tmp" - # TODO fstab -fi -- cgit v1.2.3-55-g7522