Skip to content

Commit 9eaa276

Browse files
benhoffigorpecovnik
authored andcommitted
add in cache to the image, allowing caching in customize image step
1 parent 23d6043 commit 9eaa276

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/functions/general/chroot-helpers.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function mount_chroot() {
1616
local target
1717
target="$(realpath "$1")" # normalize, remove last slash if dir
1818
display_alert "mount_chroot" "$target" "debug"
19+
1920
mkdir -p "${target}/run/user/0"
21+
mkdir -p "${target}/armbian/cache"
2022

2123
# tmpfs size=50% is the Linux default, but we need more.
2224
mount -t tmpfs -o "size=99%" tmpfs "${target}/tmp"
@@ -26,6 +28,8 @@ function mount_chroot() {
2628
mount -t sysfs chsys "${target}"/sys
2729
mount --bind /dev "${target}"/dev
2830
mount -t devpts chpts "${target}"/dev/pts || mount --bind /dev/pts "${target}"/dev/pts
31+
32+
mount --bind /armbian/cache "${target}/armbian/cache"
2933
}
3034

3135
# umount_chroot <target>
@@ -36,7 +40,7 @@ function umount_chroot() {
3640
local target
3741
target="$(realpath "$1")" # normalize, remove last slash if dir
3842
display_alert "Unmounting" "$target" "info"
39-
while grep -Eq "${target}\/(dev|proc|sys|tmp|var\/tmp|run\/user\/0)" /proc/mounts; do
43+
while grep -Eq "${target}\/(dev|proc|sys|tmp|var\/tmp|run\/user\/0|armbian\/cache)" /proc/mounts; do
4044
display_alert "Unmounting..." "target: ${target}" "debug"
4145
umount "${target}"/dev/pts || true
4246
umount --recursive "${target}"/dev || true
@@ -45,6 +49,7 @@ function umount_chroot() {
4549
umount "${target}"/tmp || true
4650
umount "${target}"/var/tmp || true
4751
umount "${target}"/run/user/0 || true
52+
umount "${target}"/armbian/cache || true
4853
wait_for_disk_sync "after umount chroot"
4954
run_host_command_logged grep -E "'${target}/(dev|proc|sys|tmp)'" /proc/mounts "||" true
5055
done

0 commit comments

Comments
 (0)