From de7e8716be7d441a83faee12f9bf75bf494dbe3a Mon Sep 17 00:00:00 2001 From: torben Date: Thu, 10 Dec 2015 17:10:13 +0100 Subject: more fakeroot support. --- builder/build-initramfs.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index dc56def6..1d48f5ef 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -269,10 +269,6 @@ function build_initramfs_cleanup() { utils.dependency_check "${build_initramfs_dependencies[*]}" # TODO check for existing kernel headers. # Find lib locations: $(gcc -print-prog-name=cc1plus) -v -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 @@ -291,9 +287,10 @@ if [[ "$build_initramfs_target" != '' ]]; then #qemu-nbd "$build_initramfs_target" "$build_initramfs__target" fi if [[ -d "$build_initramfs__target" ]]; then - build_initramfs__temporary_working_directory="${build_initramfs__target:0:-1}$(fakeroot \ + build_initramfs__temporary_working_directory="$(fakeroot \ fakechroot chroot "$build_initramfs__target" mktemp --directory)" - mount --bind "$(pwd)" "$build_initramfs__temporary_working_directory" + mount --bind "$(pwd)" \ + "${build_initramfs__target}${build_initramfs__temporary_working_directory}" build_initramfs__parameter_skip=false build_initramfs__parameter_to_forward=() for build_initramfs__parameter; do @@ -307,7 +304,10 @@ if [[ "$build_initramfs_target" != '' ]]; then build_initramfs__parameter_to_forward+=("$build_initramfs__parameter") fi done - "${build_initramfs__temporary_working_directory}/${BASH_SOURCE[0]}" ${build_initramfs__parameter_to_forward[*]} + fakeroot fakechroot chroot "${build_initramfs__target}" \ + "${build_initramfs__temporary_working_directory}/${BASH_SOURCE[0]}" \ + ${build_initramfs__parameter_to_forward[*]} + # TODO grap result from /boot/initramfs-test.img fi exit 0 fi @@ -347,7 +347,6 @@ if [ "$build_initramfs_debug" == 'yes' ]; then fi if [[ "$build_initramfs_create_system_image" != '' ]]; then logging.info 'Create system image.' - echo "$build_initramfs_create_system_image" build_initramfs_create_qcow2_system "$build_initramfs_create_system_image" elif [[ "$build_initramfs_cleanup" == 'yes' ]]; then logging.info 'Removing distribution specific files.' -- cgit v1.2.3-55-g7522