From ccfc0135e00986e037a2ce5fc0b3ae18bfa9bcf2 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 16 Oct 2015 15:31:37 +0200 Subject: reproducible: work around mv not moving read-only directories --- bin/reproducible_arch_schroot_setup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/reproducible_arch_schroot_setup.sh b/bin/reproducible_arch_schroot_setup.sh index 0d7ee9d1..b29464cb 100755 --- a/bin/reproducible_arch_schroot_setup.sh +++ b/bin/reproducible_arch_schroot_setup.sh @@ -16,9 +16,8 @@ bootstrap() { echo "$(date -u) - downloading Archlinux bootstrap.tar.gz." curl -O https://mirrors.kernel.org/archlinux/iso/2015.08.01/archlinux-bootstrap-2015.08.01-x86_64.tar.gz tar xzf archlinux-bootstrap-2015.08.01-x86_64.tar.gz - mv root.x86_64/* $SCHROOT_TARGET - rmdir root.x86_64 - rm archlinux-bootstrap-2015.08.01-x86_64.tar.gz + mv root.x86_64/* $SCHROOT_TARGET || true # proc and sys have 0555 perms, thus mv will fail... also see below + rm archlinux-bootstrap-2015.08.01-x86_64.tar.gz root.x86_64 -rf # write the schroot config echo "$(date -u ) - writing schroot configuration for $TARGET." sudo tee /etc/schroot/chroot.d/jenkins-"$TARGET" <<-__END__ @@ -32,6 +31,8 @@ bootstrap() { __END__ # finally, put it in place mv $SCHROOT_TARGET $SCHROOT_BASE/$TARGET + mkdir $SCHROOT_BASE/$TARGET/proc $SCHROOT_BASE/$TARGET/sys + chmod 555 $SCHROOT_BASE/$TARGET/proc $SCHROOT_BASE/$TARGET/sys } cleanup() { -- cgit v1.2.3-70-g09d2