From 5a3f1d4723727c16f0535d35066e01f93dbfd3ca Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 18 Sep 2019 14:34:51 +0200 Subject: build-initramfs.sh: remove 'in-target' stuff --- builder/build-initramfs.sh | 59 ---------------------------------------------- 1 file changed, 59 deletions(-) diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index fe5786ec..8825eacb 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -575,65 +575,6 @@ main() { [ -n "$qcow_handler" ] && logging.info " * qcow2 handler: $qcow_handler" # endregion - # region handle delegated operations to specified target - if [[ "$target" != '' ]]; then - _target="$target" - if [[ -f "$target" ]]; then - _target="$(mktemp --directory)" - _xmount_mountpoint_target="$(mktemp --directory)" - xmount --in qemu "$target" --out raw "$_xmount_mountpoint_target" - _xmount_device_target="$(losetup --find)" - losetup --partscan "$_xmount_device_target" \ - "${_xmount_mountpoint_target}/"*.dd - # TODO Use partscan - mount "$_xmount_device_target" "$_target" - fi - if [[ -d "$_target" ]]; then - _temporary_working_directory="$(chroot "$_target" mktemp --directory)" - mount --bind "$(pwd)" "${_target}${_temporary_working_directory}" - _parameter_skip=false - _parameter_to_forward=() - for _parameter; do - if $_parameter_skip; then - _parameter_skip=false - elif [[ "$_parameter" == '-t' ]] || \ - [[ "$_parameter" == '--target' ]]; then - _parameter_skip=true - else - _parameter_to_forward+=("$_parameter") - fi - done - # NOTE: We would have to temporary patch dracut to avoid removing the - # environment variables "LD_LIBRARY_PATH" and "LD_PRELOAD" to get - # "fakechroot" working with dracut. So we should remove this variables - # before running the patched dracut version to follow the initial - # intention. You should first do: - # >>> unset LD_LIBRARY_PATH - # >>> unset LD_PRELOAD - # and patch "dracut.sh" temporary to comment out: - # >>> unset LD_LIBRARY_PATH - # >>> unset LD_PRELOAD - # To avoid to broke the "fakechroot" environment pipe the ldconfig call - # to the native one: - # >>> FAKECHROOT_CMD_SUBST=/usr/bin/ldconfig=/usr/bin/ldconfig - # shellcheck disable=SC2086 - change_root "${_target}" \ - "${_temporary_working_directory}/${BASH_SOURCE[0]}" \ - ${_parameter_to_forward[*]} - mv "${_target}/$file_path" "$file_path" - # Do cleanup procedures. - umount "${_target}${_temporary_working_directory}" - rm --recursive --force "${_target}${_temporary_working_directory}" - if [[ -f "$target" ]]; then - umount "$_target" - losetup --detach "$_xmount_device_target" - umount "$_xmount_mountpoint_target" - rm --recursive --force "$_target" "$_xmount_mountpoint_target" - fi - fi - exit 0 - fi - # endregion # region handle '--update' to update all the modules in 'modules.d' if [ "$update" == "yes" ]; then pushd "${_repo_dir}" -- cgit v1.2.3-55-g7522