From c52338d159ceaf07a72ad95009769e6846b2e127 Mon Sep 17 00:00:00 2001 From: torben Date: Fri, 4 Dec 2015 13:22:14 +0100 Subject: Remove unneeded kcl params. --- dev-tools/openslxTFTPRoot/pxelinux.cfg/default | 4 ++-- dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 -- cgit v1.2.3-55-g7522 From a3e8f1ed6f4dc09a461820c4a77b3bfa53a78750 Mon Sep 17 00:00:00 2001 From: torben Date: Fri, 4 Dec 2015 14:52:09 +0100 Subject: Fix submodules. Improve portability. --- .gitmodules | 3 +- builder/build-initramfs.sh | 58 +++++++++++++++++++++++++++++------- builder/dnbd3-rootfs/module-setup.sh | 12 ++++---- 3 files changed, 55 insertions(+), 18 deletions(-) diff --git a/.gitmodules b/.gitmodules index 267815c9..9b5b1023 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,5 +3,4 @@ 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..c81f4036 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,6 +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 + +echo 'AAA' + source "$(dirname "${BASH_SOURCE[0]}")/dnbd3-rootfs/scripts/rebash/core.sh" core.import logging core.import utils @@ -66,6 +85,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 +127,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 +176,14 @@ function build_initramfs_parse_command_line() { fi shift ;; + -) + shift + while [[ "$1" =~ ^.+$ ]]; do + build_initramfs_dracut_parameter+=" $1" + shift + done + shift + ;; '') break @@ -225,13 +256,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 +308,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 -- cgit v1.2.3-55-g7522 From 885ed0e878325bba0200df70f7cf908005d3164b Mon Sep 17 00:00:00 2001 From: torben Date: Fri, 4 Dec 2015 14:53:58 +0100 Subject: Fix. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 9b5b1023..29d77a7a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +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 -- cgit v1.2.3-55-g7522 From 5df5e06309b21f9d086af06163bc7c641a3ef58b Mon Sep 17 00:00:00 2001 From: torben Date: Fri, 4 Dec 2015 14:58:28 +0100 Subject: Sync --- builder/build-initramfs.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index c81f4036..41a8af24 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -71,9 +71,8 @@ if ! [[ -d "$build_initramfs__needed_location" ]]; then fi set +o errexit -echo 'AAA' - source "$(dirname "${BASH_SOURCE[0]}")/dnbd3-rootfs/scripts/rebash/core.sh" +exit 0 core.import logging core.import utils core.import exceptions -- cgit v1.2.3-55-g7522