summaryrefslogtreecommitdiffstats
path: root/builder/build-initramfs.sh
diff options
context:
space:
mode:
authortorben2015-12-10 17:10:13 +0100
committertorben2015-12-10 17:10:13 +0100
commitde7e8716be7d441a83faee12f9bf75bf494dbe3a (patch)
tree80fd4187fa690813d6e31fbc606028fe54c475be /builder/build-initramfs.sh
parentMore fakechroot features. (diff)
downloadsystemd-init-de7e8716be7d441a83faee12f9bf75bf494dbe3a.tar.gz
systemd-init-de7e8716be7d441a83faee12f9bf75bf494dbe3a.tar.xz
systemd-init-de7e8716be7d441a83faee12f9bf75bf494dbe3a.zip
more fakeroot support.
Diffstat (limited to 'builder/build-initramfs.sh')
-rwxr-xr-xbuilder/build-initramfs.sh15
1 files 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.'