diff options
author | Jonathan Bauer | 2016-04-19 16:02:32 +0200 |
---|---|---|
committer | Jonathan Bauer | 2016-04-19 16:02:32 +0200 |
commit | 79dc4db2862557de2fbb0fdacb22029904abfd60 (patch) | |
tree | 6b8c3fd50a2848d9a023535531db1ccde02ac08e /builder/build-initramfs.sh | |
parent | minor comments (diff) | |
download | systemd-init-79dc4db2862557de2fbb0fdacb22029904abfd60.tar.gz systemd-init-79dc4db2862557de2fbb0fdacb22029904abfd60.tar.xz systemd-init-79dc4db2862557de2fbb0fdacb22029904abfd60.zip |
also copy/build conf-tgz module (quick hack)
Diffstat (limited to 'builder/build-initramfs.sh')
-rwxr-xr-x | builder/build-initramfs.sh | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index adb9bf07..ae00d5c0 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -46,6 +46,10 @@ if ! [[ -d "$_needed_location" ]]; then cp --recursive \ "${_temporary_repository_location}/builder/dnbd3-rootfs" \ "$_needed_location" + # assume conf-tgz module is also missing + cp --recursive \ + "${_temporary_repository_location}/builder/conf-tgz" \ + "$(dirname "$_needed_location")/conf-tgz" rm --recursive --force "$_temporary_repository_location" fi set +o errexit @@ -549,30 +553,33 @@ main() { logging.info "Dracut isn't available yet loading it." initialize_dracut fi - - _dracut_modules_source='../../dnbd3-rootfs' - _dracut_modules_target="$(dirname "${BASH_SOURCE[0]}")/dracut/modules.d/90dnbd3-rootfs" - if [[ ! -L "$_dracut_modules_target" || "$(readlink \ - "$_dracut_modules_target")" != "$_dracut_modules_source" ]] - then - logging.info \ - "Link dnbd3 plugin into dracut modules folder ($_dracut_modules_source -> $_dracut_modules_target)." - if ! ln --symbolic --force "$_dracut_modules_source" \ - "$_dracut_modules_target" 2>/dev/null; then - logging.warn \ - "Linking \"$_dracut_modules_source\" to \"$_dracut_modules_target\" failed. We will copy them. So we have to recopy it every time to ensure that recompiled things take effect." - cp --recursive --force --no-target-directory \ - "$(dirname "${BASH_SOURCE[0]}")/$(basename "$_dracut_modules_source")" \ - "$_dracut_modules_target" + + declare -A _dracut_modules=( [dnbd3]='../../dnbd3-rootfs' [conf]='../../conf-tgz' ) + for mod in dnbd3 conf; do + _dracut_modules_source="${_dracut_modules[$mod]}" + _dracut_modules_target="$(dirname "${BASH_SOURCE[0]}")/dracut/modules.d/90$(basename "${_dracut_modules[$mod]}")" + if [[ ! -L "$_dracut_modules_target" || "$(readlink \ + "$_dracut_modules_target")" != "$_dracut_modules_source" ]] + then + logging.info \ + "Link ${mod} plugin into dracut modules folder ($_dracut_modules_source -> $_dracut_modules_target)." + if ! ln --symbolic --force "$_dracut_modules_source" \ + "$_dracut_modules_target" 2>/dev/null; then + logging.warn \ + "Linking \"$_dracut_modules_source\" to \"$_dracut_modules_target\" failed. We will copy them. So we have to recopy it every time to ensure that recompiled things take effect." + cp --recursive --force --no-target-directory \ + "$(dirname "${BASH_SOURCE[0]}")/$(basename "$_dracut_modules_source")" \ + "$_dracut_modules_target" + fi fi - fi + done # endregion # region prepare and perform final dracut call _loglevel='' if [ "$verbose" == 'yes' ]; then _loglevel='--verbose' fi - _modules='dnbd3-rootfs' + _modules='dnbd3-rootfs conf-tgz' if [ "$debug" == 'yes' ]; then _loglevel="$_loglevel --stdlog 4" _modules="$_modules i18n terminfo" |