diff options
| -rw-r--r-- | .gitmodules | 5 | ||||
| -rwxr-xr-x | builder/build-initramfs.sh | 57 | ||||
| -rwxr-xr-x | builder/dnbd3-rootfs/module-setup.sh | 12 | ||||
| -rwxr-xr-x | dev-tools/openslxTFTPRoot/pxelinux.cfg/default | 4 | ||||
| -rw-r--r-- | dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default | 4 |
5 files changed, 59 insertions, 23 deletions
diff --git a/.gitmodules b/.gitmodules index 267815c9..29d77a7a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "builder/dnbd3-rootfs/scripts/rebash"] path = builder/dnbd3-rootfs/scripts/rebash - url = git@github.com:jandob/rebash.git + url = git://github.com/jandob/rebash.git [submodule "dnbd3"] path = builder/dnbd3-rootfs/binaries/dnbd3 - url = git@git.openslx.org/dnbd3.git - ignore = dirty + url = git://git.openslx.org/dnbd3.git diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index cb85a86e..41a8af24 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # -*- coding: utf-8 -*- -# region header +# region header # Copyright Torben Sickert (t.sickert["~at~"]gmail.com) 29.10.2015 # Janosch Dobler (TODO) 29.10.2015 @@ -54,7 +54,25 @@ # endregion +set -o errexit +build_initramfs__needed_location='./dnbd3-rootfs' +if ! [[ -d "$build_initramfs__needed_location" ]]; then + echo "The dnbd3 dracut plugin isn't available, loading it." + build_initramfs__temporary_repository_location="$(mktemp --directory)" + git clone git://git.openslx.org/openslx-ng/systemd-init.git \ + "$build_initramfs__temporary_repository_location" + pushd "$build_initramfs__temporary_repository_location" + git submodule init + git submodule update + popd + cp --recursive "$build_initramfs__temporary_repository_location" \ + "$build_initramfs__needed_location" + rm --recursive --force "$build_initramfs__temporary_repository_location" +fi +set +o errexit + source "$(dirname "${BASH_SOURCE[0]}")/dnbd3-rootfs/scripts/rebash/core.sh" +exit 0 core.import logging core.import utils core.import exceptions @@ -66,6 +84,7 @@ logging.set_log_level critical # region properties +build_initramfs_dracut_parameter='--force --no-hostonly' build_initramfs_verbose='no' build_initramfs_debug='no' build_initramfs_create_system_image='' @@ -107,6 +126,9 @@ function build_initramfs_print_command_line_option_description() { -i --create-system-image Creates an image under given path from current system. (default: "$build_initramfs_create_system_image"). + +Additional dracut parameter and normal parameter can be deleimiter via a single +dash (-) (default: "$build_initramfs_dracut_parameter"). EOF } function build_initramfs_print_help_message() { @@ -153,6 +175,14 @@ function build_initramfs_parse_command_line() { fi shift ;; + -) + shift + while [[ "$1" =~ ^.+$ ]]; do + build_initramfs_dracut_parameter+=" $1" + shift + done + shift + ;; '') break @@ -225,13 +255,16 @@ function build_initramfs_cleanup() { # region controller -# TODO check for existing kernel headers: - # ubuntu: sudo apt-get install linux-headers-$(uname -r) -# TODO Check for: -# /usr/lib/x86_64-linux-gnu/libz.so ldconfig -p |grep libz.so -# for dnbd3 - utils.dependency_check "${build_initramfs_dependencies[*]}" +# TODO check for existing kernel headers. +if false; then + logging.error "You have to install the compression library \"libz\". Otherwise we aren't able to compile dnbd3 for your kernel." + exit 1 +fi +if ! ldconfig --print-cache | grep libz.so; then + logging.critical "You have to install the compression library \"libz\". Otherwise we aren't able to compile dnbd3 for your kernel." + exit 1 +fi if ! build_initramfs_parse_command_line "$@"; then build_initramfs_print_help_message "$0" exit 1 @@ -274,10 +307,14 @@ elif [[ "$build_initramfs_cleanup" == 'yes' ]]; then build_initramfs_cleanup else logging.info 'Build initramfs.' - dracut/dracut.sh --local $build_initramfs__loglevel --force --modules \ - "$build_initramfs__modules" --no-hostonly /boot/initramfs-test.img + # NOTE: We deactivate our exception handle since dracut returns "1" if it + # is launched with help parameter ("-h" or "--help"). + exceptions.deactivate + dracut/dracut.sh --local $build_initramfs__loglevel --modules \ + "$build_initramfs__modules" ${build_initramfs_dracut_parameter[*]} \ + /boot/initramfs-test.img + exceptions.activate fi -logging.info 'Done!' exceptions.deactivate # endregion diff --git a/builder/dnbd3-rootfs/module-setup.sh b/builder/dnbd3-rootfs/module-setup.sh index 2d5528f8..64452cfe 100755 --- a/builder/dnbd3-rootfs/module-setup.sh +++ b/builder/dnbd3-rootfs/module-setup.sh @@ -45,14 +45,14 @@ check() { # NOTE: This are workarounds for: # - distributions where "systemd-udevd" doesn't lives in "/usr/lib" but in # "/lib". - if [[ ! -f "${systemdutildir}/systemd-udevd" ]] && [[ -f /lib/systemd/systemd-udevd ]]; then + local alternate_systemd_udevd_location='/lib/systemd/systemd-udevd' + if [[ ! -f "${systemdutildir}/systemd-udevd" ]] && \ + [[ -f "$alternate_systemd_udevd_location" ]]; then mkdir --parents "${initdir}${systemdutildir}" - # TODO - #echo "${initdir}${systemdutildir}/systemd-udevd" - #echo /usr/lib/systemd/systemd-udevd - #ln --symbolic --force /lib/systemd/systemd-udevd \ + ln --symbolic --force "$alternate_systemd_udevd_location" \ + "${initdir}${systemdutildir}/systemd-udevd" + #cp "$alternate_systemd_udevd_location" \ # "${initdir}${systemdutildir}/systemd-udevd" - cp /lib/systemd/systemd-udevd "${initdir}${systemdutildir}/systemd-udevd" fi # - "/usr/bin/sh" isn't available. if [[ ! -f /usr/bin/sh ]] && [[ -f /bin/sh ]]; then diff --git a/dev-tools/openslxTFTPRoot/pxelinux.cfg/default b/dev-tools/openslxTFTPRoot/pxelinux.cfg/default index 0f936e4e..80a02627 100755 --- a/dev-tools/openslxTFTPRoot/pxelinux.cfg/default +++ b/dev-tools/openslxTFTPRoot/pxelinux.cfg/default @@ -62,7 +62,7 @@ LABEL net MENU LABEL ^Dracut TEST Torben KERNEL http://132.230.4.201:8080/archLinux/vmlinuz-linux INITRD http://132.230.4.201:8080/archLinux/initramfs-test.img - APPEND loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=132.230.4.201:8080 slxbase=archLinux/ vga=current + APPEND loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=132.230.4.201:8080 slxbase=archLinux/ SYSAPPEND 2 IPAPPEND 3 MENU DEFAULT @@ -71,7 +71,7 @@ LABEL net MENU LABEL ^Dracut TEST Janosch KERNEL http://132.230.4.202:8080/archLinux/archLinux-vmlinuz-linux INITRD http://132.230.4.202:8080/archLinux/archLinux-initramfs-test.img - APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=132.230.4.202:8080 slxbase=archLinux/ vga=current + APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=132.230.4.202:8080 slxbase=archLinux/ SYSAPPEND 2 IPAPPEND 3 MENU DEFAULT diff --git a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default index 3371b5ed..01b3652f 100644 --- a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default +++ b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default @@ -8,13 +8,13 @@ MENU TITLE Janosch und Torbens Bastelspassmenu LABEL arch MENU LABEL ^arch network boot KERNEL /archLinux-vmlinuz-linux -APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ vga=current +APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ SYSAPPEND 2 LABEL ubuntu MENU LABEL ^ubuntu network boot KERNEL /ubuntu-vmlinuz-linux -APPEND initrd=/ubuntu-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 net.ifnames=1 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=ubuntu/ vga=current +APPEND initrd=/ubuntu-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 net.ifnames=1 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=ubuntu/ SYSAPPEND 2 LABEL BootNormal |
