From 1709148ddc661f5a1d05a33128753926a1c23588 Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Thu, 6 Aug 2020 13:00:52 -0400 Subject: [PATCH] Account for root ownership of overlay files. Since we chown and chmod files in the overlay, we need to ensure that we can write to them in each of the bootstrap-rootfs-overlay generation scripts. Eventually, I think we should make overlays as tarballs with ownership and permissions inside the archive to avoid this dance. Changelog: Title Signed-off-by: Drew Moseley --- .dockerignore | 1 + scripts/bootstrap-rootfs-overlay-demo-server.sh | 1 + scripts/bootstrap-rootfs-overlay-hosted-server.sh | 1 + scripts/bootstrap-rootfs-overlay-production-server.sh | 1 + 4 files changed, 4 insertions(+) diff --git a/.dockerignore b/.dockerignore index 94e5f31..20223c4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ deploy input work +rootfs_overlay* diff --git a/scripts/bootstrap-rootfs-overlay-demo-server.sh b/scripts/bootstrap-rootfs-overlay-demo-server.sh index 18cb251..b608c20 100755 --- a/scripts/bootstrap-rootfs-overlay-demo-server.sh +++ b/scripts/bootstrap-rootfs-overlay-demo-server.sh @@ -52,6 +52,7 @@ if [ -z "${server_ip}" ]; then exit 1 fi +sudo chown -R $(id -u).$(id -g) ${output_dir} mkdir -p ${output_dir}/etc/mender cat <<- EOF > ${output_dir}/etc/mender/mender.conf { diff --git a/scripts/bootstrap-rootfs-overlay-hosted-server.sh b/scripts/bootstrap-rootfs-overlay-hosted-server.sh index 355b56c..e73c514 100755 --- a/scripts/bootstrap-rootfs-overlay-hosted-server.sh +++ b/scripts/bootstrap-rootfs-overlay-hosted-server.sh @@ -53,6 +53,7 @@ if [ -z "${tenant_token}" ]; then exit 1 fi +sudo chown -R $(id -u).$(id -g) ${output_dir} mkdir -p ${output_dir}/etc/mender cat <<- EOF > ${output_dir}/etc/mender/mender.conf { diff --git a/scripts/bootstrap-rootfs-overlay-production-server.sh b/scripts/bootstrap-rootfs-overlay-production-server.sh index cca6e5a..ef70c8d 100755 --- a/scripts/bootstrap-rootfs-overlay-production-server.sh +++ b/scripts/bootstrap-rootfs-overlay-production-server.sh @@ -57,6 +57,7 @@ if [ -z "${server_url}" ]; then exit 1 fi +sudo chown -R $(id -u).$(id -g) ${output_dir} mkdir -p ${output_dir}/etc/mender cat <<- EOF > ${output_dir}/etc/mender/mender.conf {