diff options
author | jandob | 2016-03-10 18:24:58 +0100 |
---|---|---|
committer | jandob | 2016-03-10 18:24:58 +0100 |
commit | 2814091de28e1d0d0135e086401828cee2e0a5fc (patch) | |
tree | e5227f24e96db5a0c8d92092c7cc93b01c09bcbf /builder/dnbd3-rootfs/scripts/build.sh | |
parent | Merge branch 'master' of git.openslx.org:openslx-ng/systemd-init (diff) | |
download | systemd-init-2814091de28e1d0d0135e086401828cee2e0a5fc.tar.gz systemd-init-2814091de28e1d0d0135e086401828cee2e0a5fc.tar.xz systemd-init-2814091de28e1d0d0135e086401828cee2e0a5fc.zip |
build.sh
Diffstat (limited to 'builder/dnbd3-rootfs/scripts/build.sh')
-rw-r--r-- | builder/dnbd3-rootfs/scripts/build.sh | 150 |
1 files changed, 48 insertions, 102 deletions
diff --git a/builder/dnbd3-rootfs/scripts/build.sh b/builder/dnbd3-rootfs/scripts/build.sh index 936305f2..6066e721 100644 --- a/builder/dnbd3-rootfs/scripts/build.sh +++ b/builder/dnbd3-rootfs/scripts/build.sh @@ -5,12 +5,18 @@ source "$(dirname "${BASH_SOURCE[0]}")/rebash/core.sh" core.import logging build_compile_qemu_xmount() { - # Compiles qemu libxmount. - # NOTE: expects xmount installation under - # $1/../xmount/trunk/build/release_build/ - # - # Provides the following file: - # "$1/libxmount_input_qemu.so" + local __doc__=' + Compiles qemu libxmount. + NOTE: expects xmount installation under + $1/../xmount/trunk/build/release_build/ + + Provides the following file: + "$1/libxmount_input_qemu.so" + + Example: + + `build_compile_qemu_xmount /qemu_source /xmount/installation` + ' pushd "$1" local xmount_installation="../xmount/trunk/build/release_build/usr" [ ! -z "$2" ] && xmount_installation="$2" @@ -26,16 +32,23 @@ build_compile_qemu_xmount() { return $ret } build_clean_qemu_xmount() { + local __doc__='Clean the build of `build_compile_qemu_xmount`.' pushd "$1" make clean popd return $? } build_compile_xmount() { - # Compiles xmount - # - # Provides the xmount installation under: - # "$1/trunk/build/release_build/" + local __doc__=' + Compiles xmount. + + Provides the xmount installation under: + "$1/trunk/build/release_build/" + + Example: + + `build_compile_xmount /xmount_source /xmount_source/build /usr` + ' pushd "$1" local destination_directory="./release_build" @@ -54,81 +67,22 @@ build_compile_xmount() { return $ret } build_clean_xmount() { + local __doc__='Clean the build of `build_compile_xmount`.' rm --recursive --force "$1/trunk/build" } -build_clean_qemu_nbd() { - pushd "$1" - git clean --force -x || make clean - popd - return $? -} -build_compile_qemu_nbd() { - # Downloads and compiles qemu-nbd. - # - # Examples: - # - # >>> build_compile_qemu_nbd path/to/nbd/directory/ - # ... - # Provides the following file: - # "$1/qemu-nbd" - logging.info 'Compiling static qemu-nbd binary. This takes a while,' \ - 'grab a cup of coffee...' - # TODO check if need all, after disabling features - # TODO check dependencies - #su -s /bin/bash nobody - #yaourt --noconfirm -S glib2-static glibc-static pcre-static - #exit - pushd "$(dirname "$1")" - # TODO check what other features can be disabled - # --static - ./configure --target-list=x86_64-linux-user \ - --python="$(which python2)" --disable-docs --disable-gtk --disable-vnc \ - --disable-kvm --disable-libssh2 --enable-user --disable-system \ - --disable-fdt --disable-libnfs --disable-glusterfs --disable-libiscsi \ - --disable-gcrypt --disable-nettle - make -j4 qemu-nbd - local ret=$? - popd - return $ret -} -build_compile_nbd() { - # Downloads and compiles nbd. - # - # Examples: - # - # >>> build_compile_nbd path/to/nbd/directory/ - # ... - # Provides the following file: - # "$1/nbd.ko" - pushd "$1" - logging.info 'Compile the nbd kernel module.' - make -j4 - popd - return $? -} -build_clean_nbd() { - # Cleans nbd specific generated files - # - # Examples: - # - # >>> build_clean_nbd path/to/nbd/directory/ - # ... - # Removes the following file: - # "$1/nbd.ko" - pushd "$1" - make clean - popd - return $? -} build_compile_dnbd3() { - # Downloads and compiles dnbd3. - # - # Examples: - # - # >>> build_compile_dnbd3 path/to/dnbd3/directory/ - # ... - # Provides the following file: - # "$1/build/dnbd3.ko" + local __doc__=' + Compiles dnbd3 kernel module and client. + + Provides the following file: + "$1/build/dnbd3.ko" + "$1/build/dnbd3-client" + + Examples: + + `build_compile_dnbd3 path/to/dnbd3/source/` + + ' pushd "$1" # NOTE: The generic way would be: "./build.sh" but this tries to build # more than we really need and takes more time. @@ -137,39 +91,31 @@ build_compile_dnbd3() { cmake ../ make -j4 dnbd3 dnbd3-client popd - ## - popd return $? } build_clean_dnbd3() { - # Removes generated dnbd3 specific files. - # - # Examples: - # - # >>> build_clean_dnbd3 path/to/dnbd3/directory/ - # ... - # Removes the following directory: - # "$1/build" + local __doc__='Clean the build of `build_compile_dnbd3`.' rm --recursive --force "$1/build" return $? } build_compile_systemd_preserve_process_marker() { - # Compiles simple c program. - # - # Examples: - # - # >>> build_compile_systemd_preserve_process_marker path/to/program/folder + local __doc__=' + Compiles simple c program. + + Examples: + + `build_compile_systemd_preserve_process_marker path/to/program/folder` + ' pushd "$1" make popd return $? } build_clean_systemd_preserve_process_marker() { - # Removes compiled simple c program. - # - # Examples: - # - # >>> build_clean_systemd_preserve_process_marker path/to/program/folder + local __doc__=' + Clean the build of + `build_compile_systemd_preserve_process_marker`. + ' pushd "$1" make clean popd |