Browse Source

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
tags/2.33.0
Mohammed Naser 2 months ago
parent
commit
6f1b51627f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist

+ 2
- 2
diskimage_builder/elements/modprobe/extra-data.d/50-modprobe-blacklist View File

@@ -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


Loading…
Cancel
Save