Mount unionfs for pkg while fetching debootstrap

Mount unionfs for pkg while fetching `debootstrap` packages
This commit is contained in:
JRGTH
2025-09-16 08:21:56 -04:00
parent 7362708895
commit 4664d71f31
3 changed files with 21 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
======================
Version Description
1.2.05......Mount unionfs for pkg while fetching debootstrap packages.
1.2.04......Fix for missing variable affecting embedded platforms, thanks to tga.
1.2.03......Added post upgrade function for convenience, cleanup obsolete code.
1.2.02......Always execute extension script after upgrade from WebGUI, code changes.

20
unionfs.sh Executable file → Normal file
View File

@@ -106,9 +106,27 @@ unload_kmods() {
}
fetch_pkg() {
if [ ! -d "/var/db/pkg" ]; then
mkdir -p "/var/db/pkg"
fi
if [ ! -d "${CWDIR}/system/var/db/pkg" ]; then
mkdir -p ${CWDIR}/system/var/db/pkg
fi
if ! df | grep -q "${CWDIR}/system/var/db/pkg"; then
echo "Enabling UnionFS for ${CWDIR}/system/var/db/pkg."
mount_unionfs -o avobe ${CWDIR}/system/var/db/pkg /var/db/pkg
fi
echo "Fetching required packages."
# Fetch deboostrap and dependency packages.
pkg fetch -y -d -o ${CWDIR}/system/ debootstrap || error_notify "Error while fetching packages, exiting."
echo "Done."
if df | grep -q "${CWDIR}/system/var/db/pkg"; then
echo "Disabling UnionFS for ${CWDIR}/system/var/db/pkg."
umount -f /var/db/pkg
fi
extract_pkg
}
@@ -150,7 +168,7 @@ unionfs_on() {
echo "Enabling UnionFS for ${CWDIR}/system/usr/local."
mount_unionfs -o above ${CWDIR}/system/usr/local /usr/local
fi
if ! df | grep -q "${CWDIR}/system/var/run"; then
echo "Enabling UnionFS for ${CWDIR}/system/var/run."
mount_unionfs -o avobe ${CWDIR}/system/var/run /var/run

View File

@@ -1 +1 @@
1.2.04
1.2.05