summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorben2015-04-20 15:34:33 +0200
committertorben2015-04-20 15:34:33 +0200
commita127c4a12af6501f3d98c34b6f31a930f78d0cfd (patch)
treeb2a8afc36adb8320fd1733d112c728cfb1334515
parentRefactoring. (diff)
downloadsystemd-init-a127c4a12af6501f3d98c34b6f31a930f78d0cfd.tar.gz
systemd-init-a127c4a12af6501f3d98c34b6f31a930f78d0cfd.tar.xz
systemd-init-a127c4a12af6501f3d98c34b6f31a930f78d0cfd.zip
Determine minimal set of needed applications.
-rwxr-xr-xtestModule/binaries/qemu-nbd-systemd-markbin7128103 -> 0 bytes
-rwxr-xr-xtestModule/binaries/systemd-preserve-process-markerbin7728 -> 7728 bytes
-rwxr-xr-xtestModule/hooks/pre-mount.sh4
-rw-r--r--testModule/module-setup.sh7
-rw-r--r--testModule/systemd-preserve-process-marker.c6
5 files changed, 10 insertions, 7 deletions
diff --git a/testModule/binaries/qemu-nbd-systemd-mark b/testModule/binaries/qemu-nbd-systemd-mark
deleted file mode 100755
index 03c2a6b1..00000000
--- a/testModule/binaries/qemu-nbd-systemd-mark
+++ /dev/null
Binary files differ
diff --git a/testModule/binaries/systemd-preserve-process-marker b/testModule/binaries/systemd-preserve-process-marker
index 0181cd80..45beb51d 100755
--- a/testModule/binaries/systemd-preserve-process-marker
+++ b/testModule/binaries/systemd-preserve-process-marker
Binary files differ
diff --git a/testModule/hooks/pre-mount.sh b/testModule/hooks/pre-mount.sh
index 86fe94bf..5a93aef3 100755
--- a/testModule/hooks/pre-mount.sh
+++ b/testModule/hooks/pre-mount.sh
@@ -6,8 +6,8 @@ else
export PRE_MOUNT_READY=true
warn '............PRE-MOUNT.............'
insmod /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/dnbd3.ko
- local dnbd3_device_node="$(dnbd3-client -h 132.230.4.1 -i stage4/torben/test \
- -r 1 -d /dev/dnbd0)"
+ local dnbd3_device_node="$(dnbd3-client -h 132.230.4.1 -i \
+ stage4/torben/test -r 1 -d /dev/dnbd0)"
# NOTE: Out comment this line if you need more than on dnbd0 device and
# determine it automatically.
dnbd3_device_node=/dev/dnbd0
diff --git a/testModule/module-setup.sh b/testModule/module-setup.sh
index fd6d51d7..0a95f957 100644
--- a/testModule/module-setup.sh
+++ b/testModule/module-setup.sh
@@ -33,7 +33,6 @@ install() {
inst "$moddir/binaries/dnbd3-client" /usr/bin/dnbd3-client
inst "$moddir/binaries/systemd-preserve-process-marker" \
/usr/bin/systemd-preserve-process-marker
- inst "$moddir/binaries/qemu-nbd" /usr/bin/qemu-nbd
inst "$moddir/kernel_modules/dnbd3.ko" \
/usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/dnbd3.ko
@@ -47,9 +46,11 @@ install() {
# NOTE: Hook "mount" isn't executed on tested version.
inst_hook pre-pivot 10 "$moddir/hooks/mount.sh"
+ # Debugging:
inst_multiple lsblk ping ip ifconfig sshd htop dhclient tail head cat vim \
touch sed lsmod insmod qemu-img sleep route wget find lsof strace \
- chroot switch_root pivot_root # qemu-nbd
- # Production: inst_multiple insmod qemu-img # qemu-nbd
+ chroot switch_root pivot_root qemu-nbd
+ # Production:
+ #inst_multiple insmod qemu-img qemu-nbd
return 0
}
diff --git a/testModule/systemd-preserve-process-marker.c b/testModule/systemd-preserve-process-marker.c
index 2525bc5f..8f0fc108 100644
--- a/testModule/systemd-preserve-process-marker.c
+++ b/testModule/systemd-preserve-process-marker.c
@@ -17,13 +17,15 @@ void print_array(int argc, char *argv[]) {
}
int main(int argc, char *argv[]) {
int count;
- char **copy = malloc(sizeof(char *) * (argc-1));
+ // Last item acts as null pointer.
+ char **copy = calloc(sizeof(char *), argc);
+ // Slice first given command line argument.
for (count = 0; count < argc - 1; count++)
copy[count] = strdup(argv[count + 1]);
// Adding systemd indicator to preserve wrapped process during changing
// root filesystem. We mark wrapper and child process.
- copy[0][0] = '@';
argv[0][0] = '@';
+ copy[0][0] = '@';
if (-1 == execvp(argv[1], copy)) {
perror("Executing child process failed.");
return -1;