Browse Source

Make sure $TMP_BUILD_DIR/mnt is owned by root

The path $TMP_BUILD_DIR/mnt becomes the / inside the chroot during
the chroot phases of diskimage-builder. Previously this path was being
created using the account running diskimage-builder. This account may
not be valid inside the chroot. This causes path validation, when running
on a Ubuntu bionic host, to fail.
This patch chown's the $TMP_BUILD_DIR/mnt to root.root to make sure
that / is owned by a valid account inside the chroot.

Change-Id: Ifedc136baa67c7952942aed2c8cb1041902fef91
Closes-Bug: 1811113
changes/44/629744/2
Michael Johnson 4 years ago
parent
commit
cfba9ea79d
  1. 4
      diskimage_builder/lib/common-functions

4
diskimage_builder/lib/common-functions

@ -339,6 +339,10 @@ function arg_to_elements() {
function create_base () {
mkdir $TMP_BUILD_DIR/mnt
# Make sure the / inside the chroot is owned by root
# If it is not owned by root, some Ubuntu bionic packages will fail
# path validation at install time.
sudo chown root.root $TMP_BUILD_DIR/mnt
export TMP_MOUNT_PATH=$TMP_BUILD_DIR/mnt
# Copy data in to the root.
TARGET_ROOT=$TMP_MOUNT_PATH run_d root

Loading…
Cancel
Save