Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,20 @@ function unpack() {
then
owner=$3
fi

mkdir -p /tmp/unpack/
# $from/. may look funny, but does exactly what we want, copy _contents_
# from $from to $to, but not $from itself, without the need to glob -- see
# http://stackoverflow.com/a/4645159/2028598
cp -v -r --preserve=mode,timestamps $from/. $to
cp -v -r --preserve=mode,timestamps $from/. /tmp/unpack/

if [ -n "$owner" ]
then
chown -hR $owner:$owner $to
chown -hR $owner:$owner /tmp/unpack/
fi

cp -v -r --preserve=mode,ownership,timestamps /tmp/unpack/. $to
rm -r /tmp/unpack

}

function detach_all_loopback(){
Expand Down
6 changes: 5 additions & 1 deletion src/variants/armbian/pre_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ yes 1234 | passwd

#cleanup
mkdir -p /var/cache/apt/archives
apt-get clean
if [ -n "$BASE_APT_CACHE" ] && [ "$BASE_APT_CACHE" != "no" ]; then
apt-get autoclean
else
apt-get clean
fi
apt-get update --allow-releaseinfo-change
apt-get -y --force-yes install avahi-daemon || true
apt-get -y --force-yes install python python-distutils-extra || true
Expand Down
6 changes: 5 additions & 1 deletion src/variants/bananapi-m1/pre_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ unpack /filesystem/root /

#cleanup
mkdir -p /var/cache/apt/archives
apt-get clean
if [ -n "$BASE_APT_CACHE" ] && [ "$BASE_APT_CACHE" != "no" ]; then
apt-get autoclean
else
apt-get clean
fi
6 changes: 5 additions & 1 deletion src/variants/example/post_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ install_chroot_fail_on_error_trap
unpack /filesystem/root /

#cleanup
apt-get clean
if [ -n "$BASE_APT_CACHE" ] && [ "$BASE_APT_CACHE" != "no" ]; then
apt-get autoclean
else
apt-get clean
fi