From 6f1b51627fe24cb8435b47f963e4d16e84131013 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Wed, 18 Dec 2019 11:26:17 -0500 Subject: [PATCH] modprobe.d: use $TMP_MOUNT_PATH The hook inside extra-data.d runs outside the chroot when building the image which means that we need to prefix paths inside the hook to avoid running things on the host. We also run it with sudo because if we're running DIB not as root, /etc is uid 0 and we'll get a permission denied. Change-Id: I1838890fe124c84c879285a471bcc78fe47d6c23 --- .../elements/modprobe/extra-data.d/50-modprobe-blacklist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist b/diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist index f763d8b64..05b9b53bb 100755 --- a/diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist +++ b/diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist @@ -12,9 +12,9 @@ set -o pipefail # this to work can allow modules that do other things that *are* # useful for a container to "just work" without a whole bunch of # refactoring. -if [ ! -d /etc/modprobe.d ]; then +if [ ! -d $TMP_MOUNT_PATH/etc/modprobe.d ]; then # ^ so we can see in the logs if we took this path ... - mkdir -p /etc/modprobe.d + sudo mkdir -p $TMP_MOUNT_PATH/etc/modprobe.d fi # copy all modprobe.d snippets to /etc/modprobe.d