diff options
| author | jandob | 2015-12-10 15:03:53 +0100 |
|---|---|---|
| committer | jandob | 2015-12-10 15:03:53 +0100 |
| commit | cc03889c6d38848a930a1b500c0c4ec27ef75142 (patch) | |
| tree | fe386146d12c35e6bfb32d2e051a40e255a4ebd8 | |
| parent | add exception handling inside initramfs (diff) | |
| parent | Now working if you run it from any location. (diff) | |
| download | systemd-init-cc03889c6d38848a930a1b500c0c4ec27ef75142.tar.gz systemd-init-cc03889c6d38848a930a1b500c0c4ec27ef75142.tar.xz systemd-init-cc03889c6d38848a930a1b500c0c4ec27ef75142.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/systemd-init
| -rwxr-xr-x | builder/build-initramfs.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index 754f8829..45a54b2b 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -54,10 +54,16 @@ # endregion +# region ensure presence of needed dependencies + set -o errexit -build_initramfs__needed_location='./dnbd3-rootfs' +build_initramfs__needed_location="$(dirname "${BASH_SOURCE[0]}")/dnbd3-rootfs" if ! [[ -d "$build_initramfs__needed_location" ]]; then echo "The dnbd3 dracut plugin isn't available, loading it." + if ! hash git 2>/dev/null; then + echo "Needed dependency \"git\" isn't available. Please install \"git\" or provide the repositories data structure in \"$(dirname "${BASH_SOURCE[0]}")\"." + result=1 + fi build_initramfs__temporary_repository_location="$(mktemp --directory)" git clone git://git.openslx.org/openslx-ng/systemd-init.git \ "$build_initramfs__temporary_repository_location" @@ -71,6 +77,8 @@ if ! [[ -d "$build_initramfs__needed_location" ]]; then fi set +o errexit +# endregion + source "$(dirname "${BASH_SOURCE[0]}")/dnbd3-rootfs/scripts/rebash/core.sh" core.import exceptions exceptions.activate @@ -270,12 +278,12 @@ if ! build_initramfs_parse_command_line "$@"; then exit 1 fi logging.info 'Checking dracut.' -if ! [[ -d ./dracut ]]; then +if ! [[ -d "$(dirname "${BASH_SOURCE[0]}")/dracut" ]]; then logging.info "Dracut isn't available yet loading it." build_initramfs_initialize_dracut fi build_initramfs__dracut_modules_source='../../dnbd3-rootfs' -build_initramfs__dracut_modules_target='dracut/modules.d/90dnbd3-rootfs' +build_initramfs__dracut_modules_target="$(dirname "${BASH_SOURCE[0]}")/dracut/modules.d/90dnbd3-rootfs" if [[ ! -L "$build_initramfs__dracut_modules_target" || "$(readlink \ "$build_initramfs__dracut_modules_target")" != \ "$build_initramfs__dracut_modules_source" ]] |
