From a127c4a12af6501f3d98c34b6f31a930f78d0cfd Mon Sep 17 00:00:00 2001 From: torben Date: Mon, 20 Apr 2015 15:34:33 +0200 Subject: Determine minimal set of needed applications. --- testModule/binaries/qemu-nbd-systemd-mark | Bin 7128103 -> 0 bytes testModule/binaries/systemd-preserve-process-marker | Bin 7728 -> 7728 bytes testModule/hooks/pre-mount.sh | 4 ++-- testModule/module-setup.sh | 7 ++++--- testModule/systemd-preserve-process-marker.c | 6 ++++-- 5 files changed, 10 insertions(+), 7 deletions(-) delete mode 100755 testModule/binaries/qemu-nbd-systemd-mark (limited to 'testModule') diff --git a/testModule/binaries/qemu-nbd-systemd-mark b/testModule/binaries/qemu-nbd-systemd-mark deleted file mode 100755 index 03c2a6b1..00000000 Binary files a/testModule/binaries/qemu-nbd-systemd-mark and /dev/null differ diff --git a/testModule/binaries/systemd-preserve-process-marker b/testModule/binaries/systemd-preserve-process-marker index 0181cd80..45beb51d 100755 Binary files a/testModule/binaries/systemd-preserve-process-marker and b/testModule/binaries/systemd-preserve-process-marker 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; -- cgit v1.2.3-55-g7522