summaryrefslogtreecommitdiffstats
path: root/testModule/hooks
diff options
context:
space:
mode:
authorJonathan Bauer2015-05-27 16:32:57 +0200
committerJonathan Bauer2015-05-27 16:32:57 +0200
commit0abace2bbec9e17a3630c463e4e3c329c967334b (patch)
tree986a9bebd62c2dd596c85bf44bbec68d00cccd13 /testModule/hooks
parentremoved hacked systemd rpms and grub2.conf (diff)
downloadsystemd-init-0abace2bbec9e17a3630c463e4e3c329c967334b.tar.gz
systemd-init-0abace2bbec9e17a3630c463e4e3c329c967334b.tar.xz
systemd-init-0abace2bbec9e17a3630c463e4e3c329c967334b.zip
restructuring & bit of documentation ;)
dracut module now in 'dnbd3-qcow2-rootfs'. ALLLLL dracut related stuff goes in here!
Diffstat (limited to 'testModule/hooks')
-rwxr-xr-xtestModule/hooks/cmdline/enable-sysrq.sh2
-rwxr-xr-xtestModule/hooks/cmdline/expand-kcl-ip.sh36
-rwxr-xr-xtestModule/hooks/cmdline/mark-root-device.sh9
-rwxr-xr-xtestModule/hooks/mount/mount-root-device.sh4
-rwxr-xr-xtestModule/hooks/pre-mount/fetch-config.sh39
-rwxr-xr-xtestModule/hooks/pre-mount/mount-qcow.sh49
-rwxr-xr-xtestModule/hooks/pre-pivot/mount-tmp.sh40
-rwxr-xr-xtestModule/hooks/pre-udev/lo-setup.sh1
-rwxr-xr-xtestModule/hooks/pre-udev/load-dnbd3-nbd-modules.sh32
9 files changed, 0 insertions, 212 deletions
diff --git a/testModule/hooks/cmdline/enable-sysrq.sh b/testModule/hooks/cmdline/enable-sysrq.sh
deleted file mode 100755
index f779aa7a..00000000
--- a/testModule/hooks/cmdline/enable-sysrq.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-# enables magic sysrq keys
-echo 1 > /proc/sys/kernel/sysrq
diff --git a/testModule/hooks/cmdline/expand-kcl-ip.sh b/testModule/hooks/cmdline/expand-kcl-ip.sh
deleted file mode 100755
index 9f617b09..00000000
--- a/testModule/hooks/cmdline/expand-kcl-ip.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-command -v warn >/dev/null || . /lib/dracut-lib.sh
-
-# fakes the cmdline to fix the ip parsing in darcut's net-lib.sh
-[ -d /fake ] || mkdir /fake
-
-# need to be a tmpfs for the hack to work
-mount -t tmpfs tmpfs /fake
-
-for parameter in $(getargs ip=); do
- local temp="$parameter:"
- set --
- while [ -n "$temp" ]; do
- set -- "$@" "${temp%%:*}"
- temp=${temp#*:}
- done
-
- [ -n "$1" ] && ip=$1
- [ -n "$2" ] && server_ip=$2
- [ -n "$3" ] && gateway_ip=$3
- [ -n "$4" ] && net_mask=$4
-
- warn "PXE given net configuration: ip: $ip server_ip: $server_ip gateway_ip: $gateway_ip net_mask: $net_mask"
- local final_dracut_ip_config="$ip::$gateway_ip:$net_mask:hiwi-test-28:eno1:none"
- warn "Final dracut ip config: $final_dracut_ip_config"
- sed --regexp-extended "s/ip=[^ ]*/ip=$final_dracut_ip_config/g" /proc/cmdline > /fake/cmdline
-done
-
-
-# bind mount it. Can we trust mount return codes here?
-# # if so, we should check what we get in $?
-mount -o bind /fake/cmdline /proc/cmdline
-
-# check if it worked
-if ! grep 'hiwi-test-28:eno1:none' /proc/cmdline; then
- warn 'Haxing cmdline did not work :( sad pandaz...'
-fi
diff --git a/testModule/hooks/cmdline/mark-root-device.sh b/testModule/hooks/cmdline/mark-root-device.sh
deleted file mode 100755
index b7282521..00000000
--- a/testModule/hooks/cmdline/mark-root-device.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# set rootok and root as dracut expects them to be set by
-# the module preparing the root filesystem.
-#
-# Once the root filesystem is mounted per dnbd3 and
-# exported as qcow2 per nbd, /dev/root will be a symlink
-# to /dev/nbd0 as this is then our rootfs-device
-rootok=1
-root=block:/dev/root
-
diff --git a/testModule/hooks/mount/mount-root-device.sh b/testModule/hooks/mount/mount-root-device.sh
deleted file mode 100755
index d02f9002..00000000
--- a/testModule/hooks/mount/mount-root-device.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-# this rudimentary script just mounts the rootfs device that was symlinked to
-# /dev/root to dracut's $NEWROOT (usually /sysroot).
-
-mount /dev/root $NEWROOT
diff --git a/testModule/hooks/pre-mount/fetch-config.sh b/testModule/hooks/pre-mount/fetch-config.sh
deleted file mode 100755
index a90481c8..00000000
--- a/testModule/hooks/pre-mount/fetch-config.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-# load dracut functions
-command -v getarg >/dev/null || . /lib/dracut-lib.sh
-
-# read SLX_SERVER and SLX_BASE from the kernel command line
-SLX_SERVER=$(getarg slxsrv)
-SLX_BASE=$(getarg slxbase)
-SLX_CONFIG_DIR="/opt/openslx"
-SLX_CONFIG_FILE="/opt/openslx/config"
-
-if [ -z "$SLX_SERVER" ]; then
- warn "No 'slxsrv' parameter found in the kernel command line!"
- warn "Skipping OpenSLX configuration..."
- return 1
-fi
-if [ -z "$SLX_BASE" ]; then
- warn "No 'slxbase' parameter found in the kernel command line!"
- warn "Skipping OpenSLX configuration..."
- return 1
-fi
-
-info "Getting configuration from OPENSLX-Server..."
-WGET="$(busybox which wget)"
-if [ -z $WGET ]; then
- # do nothing
- warn "'wget' not found. Skipping openslx configuration..."
- return 1
-fi
-
-# ok then we are ready to download the config
-mkdir -p "${SLX_CONFIG_DIR}"
-$WGET -T 5 -q "http://${SLX_SERVER}/${SLX_BASE}/config" -O "${SLX_CONFIG_FILE}"
-RET="$?"
-if [ $RET -ne 0 ]; then
- warn "Downloading OpenSLX configuration from ${SLX_SERVER}/${SLX_BASE} failed: $RET"
- emergency_shell -n "$0"
- return 1
-else
- return 0
-fi
diff --git a/testModule/hooks/pre-mount/mount-qcow.sh b/testModule/hooks/pre-mount/mount-qcow.sh
deleted file mode 100755
index d70492bf..00000000
--- a/testModule/hooks/pre-mount/mount-qcow.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-###############################################################################
-# CHECKS
-#
-
-SETUP_ROOTFS_SCRIPT="/sbin/setup-qcow2"
-
-if [ ! -e "${SETUP_ROOTFS_SCRIPT}" ]; then
- warn "No such file of directory: ${SETUP_ROOTFS_SCRIPT}"
- emergency_shell -n "Error in $0"
- return 1
-fi
-
-if [ ! -x "${SETUP_ROOTFS_SCRIPT}" ]; then
- warn "Cannot execute: ${SETUP_ROOTFS_SCRIPT}"
- emergency_shell -n "Error in $0"
- return 1
-fi
-
-#
-# END CHECKS
-###############################################################################
-
-###############################################################################
-# MAIN CODE
-#
-
-# ok, let's source the setup script
-if ! . ${SETUP_ROOTFS_SCRIPT} ; then
- warn "Could not source: ${SETUP_ROOTFS_SCRIPT}"
- emergency_shell -n "Error in $0"
- return 1
-fi
-
-# just go over the functions in the right order ;-)
-for fun in connect_dnbd3 create_qcow export_qcow connect_qcow; do
- if ! $fun; then
- # something failed, drop a shell for debugging
- warn "'$fun' failed with: $?"
- emergency_shell -n "Error in $fun"
- return 1
- fi
-done
-
-# all good, we are done
-return 0
-
-#
-# END MAIN CODE
-###############################################################################
diff --git a/testModule/hooks/pre-pivot/mount-tmp.sh b/testModule/hooks/pre-pivot/mount-tmp.sh
deleted file mode 100755
index 3e702064..00000000
--- a/testModule/hooks/pre-pivot/mount-tmp.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-# This script only checks if we found a usable partition for the
-# future /tmp. The discovery of that partition is done by udev during
-# the initqueue. If a valid partition is found (either GPT with the label
-# OPENSLX_TMP or MBR with the type 0x44) its path will be written to
-# /tmp/openslx.tmpdisk
-OPENSLX_TMP_DISK_FLAG="/tmp/openslx.disk.tmp"
-
-if [ ! -e "$OPENSLX_TMP_DISK_FLAG" ]; then
- warn "'$OPENSLX_TMP_DISK_FLAG' not found!"
- warn "Systemd will manage $NEWROOT/tmp on its own."
- # no partition for the future /tmp found, just
- # let systemd manage it then (probably a tmpfs)
- return 1
-fi
-
-# in /tmp/openslx.disk.tmp is the name of the device
-# to mount as /tmp in the real system
-# meaning we need to mount it to /sysroot/tmp here.
-
-OPENSLX_TMP_DISK_DEV="$(cat $OPENSLX_TMP_DISK_FLAG)"
-
-# sanity check: is the content a block device?
-if [ ! -b "$OPENSLX_TMP_DISK_DEV" ]; then
- warn "'$OPENSLX_TMP_DISK_DEV' appears not to be a block device!"
- warn "Systemd will manage $NEWROOT/tmp on its own."
- return 1
-fi
-
-# all good, keep on
-if ! mount -t auto "$OPENSLX_TMP_DISK_DEV" $NEWROOT/tmp; then
- # something else went wrong :(
- warn "Mounting '$OPENSLX_TMP_DISK_DEV' to '$NEWROOT/tmp' failed with: $!"
- warn "Systemd will manage $NEWROOT/tmp on its own."
- return 1
-fi
-
-# still here? mount worked wohoo
-# set permissions
-chmod a+rwxt $NEWROOT/tmp
-return 0
diff --git a/testModule/hooks/pre-udev/lo-setup.sh b/testModule/hooks/pre-udev/lo-setup.sh
deleted file mode 100755
index 9103afd9..00000000
--- a/testModule/hooks/pre-udev/lo-setup.sh
+++ /dev/null
@@ -1 +0,0 @@
-/sbin/initqueue --name ifup-lo --unique --onetime /sbin/ifup lo -m
diff --git a/testModule/hooks/pre-udev/load-dnbd3-nbd-modules.sh b/testModule/hooks/pre-udev/load-dnbd3-nbd-modules.sh
deleted file mode 100755
index 29f9f210..00000000
--- a/testModule/hooks/pre-udev/load-dnbd3-nbd-modules.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-# include dracut-lib.sh to use 'warn'
-command -v warn >/dev/null || . /lib/dracut-lib.sh
-
-NBD_MOD_PATH="/usr/lib/modules/current/extra/nbd.ko"
-DNBD3_MOD_PATH="/usr/lib/modules/current/extra/dnbd3.ko"
-
-# do we actually have our modules?
-if [ ! -e "${NBD_MOD_PATH}" ]; then
- warn "No such file of directory: ${NBD_MOD_PATH}"
- emergency_shell -n "Error in $0"
- return 1
-fi
-if [ ! -e "${DNBD3_MOD_PATH}" ]; then
- warn "No such file of directory: ${DNBD3_MOD_PATH}"
- emergency_shell -n "Error in $0"
- return 1
-fi
-
-# load the kernel modules for dnbd3 and nbd
-if ! insmod "${DNBD3_MOD_PATH}"; then
- warn "Failed to load DNBD3 kernel module..."
- emergency_shell -n "Error in $0"
- return 1
-fi
-
-if ! insmod "${NBD_MOD_PATH}"; then
- warn "Failed to load NBD kernel module..."
- emergency_shell -n "Error in $0"
- return 1
-fi
-
-return 0