From 4004985844cf709c1de8970240652a617c72f6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Thu, 3 Apr 2014 22:45:49 +0200 Subject: [PATCH] debian: use sudo to create file in the chroot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ${TARGET_ROOT} chroot is owned by the root user. Without this change, the build will fail for a standard user with a “Permission denied” error. Change-Id: I6eb87d3a14292da5620bdfd623ea7ef846fe2af6 --- elements/debian/root.d/08-debootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/debian/root.d/08-debootstrap b/elements/debian/root.d/08-debootstrap index 2f9a1f0c..d33b3a4f 100755 --- a/elements/debian/root.d/08-debootstrap +++ b/elements/debian/root.d/08-debootstrap @@ -70,7 +70,7 @@ LABEL=cloudimg-rootfs / ext4 errors=remount-ro 0 1 sudo sh -c "echo 'debian' > ${TARGET_ROOT}/etc/hostname" # specify a hostname so that cloud-init does not default to (None) - echo "hostname: debian" > ${TARGET_ROOT}/etc/cloud/cloud.cfg.d/01_hostname.cfg + sudo sh -c "echo 'hostname: debian' > ${TARGET_ROOT}/etc/cloud/cloud.cfg.d/01_hostname.cfg" echo Caching debootstrap result in $DEBOOTSTRAP_TARBALL sudo tar -C $TARGET_ROOT -zcf $DEBOOTSTRAP_TARBALL .