mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-22 10:10:46 +01:00
Avoid cache/RELEASE dirs creation on Linux jails
Don't create unused/stale cache/RELEASE directory/datasets on Linux jails creation.
This commit is contained in:
@@ -127,19 +127,29 @@ bootstrap_directories() {
|
|||||||
if [ "${bastille_zfs_enable}" = "YES" ]; then
|
if [ "${bastille_zfs_enable}" = "YES" ]; then
|
||||||
if [ -n "${bastille_zfs_zpool}" ]; then
|
if [ -n "${bastille_zfs_zpool}" ]; then
|
||||||
zfs create ${bastille_zfs_options} -o mountpoint="${bastille_cachedir}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/cache"
|
zfs create ${bastille_zfs_options} -o mountpoint="${bastille_cachedir}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/cache"
|
||||||
zfs create ${bastille_zfs_options} -o mountpoint="${bastille_cachedir}/${RELEASE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/cache/${RELEASE}"
|
# Don't create unused/stale cache/RELEASE directory on Linux jails creation.
|
||||||
|
if [ -z "${NOCACHEDIR}" ]; then
|
||||||
|
zfs create ${bastille_zfs_options} -o mountpoint="${bastille_cachedir}/${RELEASE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/cache/${RELEASE}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
mkdir -p "${bastille_cachedir}/${RELEASE}"
|
mkdir -p "${bastille_cachedir}"
|
||||||
|
# Don't create unused/stale cache/RELEASE directory on Linux jails creation.
|
||||||
|
if [ -z "${NOCACHEDIR}" ]; then
|
||||||
|
mkdir -p "${bastille_cachedir}/${RELEASE}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
## create subsequent cache/XX.X-RELEASE datasets
|
## create subsequent cache/XX.X-RELEASE datasets
|
||||||
elif [ ! -d "${bastille_cachedir}/${RELEASE}" ]; then
|
elif [ ! -d "${bastille_cachedir}/${RELEASE}" ]; then
|
||||||
if [ "${bastille_zfs_enable}" = "YES" ]; then
|
# Don't create unused/stale cache/RELEASE directory on Linux jails creation.
|
||||||
if [ -n "${bastille_zfs_zpool}" ]; then
|
if [ -z "${NOCACHEDIR}" ]; then
|
||||||
zfs create ${bastille_zfs_options} -o mountpoint="${bastille_cachedir}/${RELEASE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/cache/${RELEASE}"
|
if [ "${bastille_zfs_enable}" = "YES" ]; then
|
||||||
|
if [ -n "${bastille_zfs_zpool}" ]; then
|
||||||
|
zfs create ${bastille_zfs_options} -o mountpoint="${bastille_cachedir}/${RELEASE}" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/cache/${RELEASE}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
mkdir -p "${bastille_cachedir}/${RELEASE}"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
mkdir -p "${bastille_cachedir}/${RELEASE}"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -305,6 +315,7 @@ bootstrap_release() {
|
|||||||
debootstrap_release() {
|
debootstrap_release() {
|
||||||
|
|
||||||
# Make sure to check/bootstrap directories first.
|
# Make sure to check/bootstrap directories first.
|
||||||
|
NOCACHEDIR=1
|
||||||
RELEASE="${DIR_BOOTSTRAP}"
|
RELEASE="${DIR_BOOTSTRAP}"
|
||||||
bootstrap_directories
|
bootstrap_directories
|
||||||
|
|
||||||
@@ -445,6 +456,7 @@ else
|
|||||||
HW_MACHINE_ARCH_LINUX=${HW_MACHINE_ARCH}
|
HW_MACHINE_ARCH_LINUX=${HW_MACHINE_ARCH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
NOCACHEDIR=
|
||||||
RELEASE="${1}"
|
RELEASE="${1}"
|
||||||
OPTION="${2}"
|
OPTION="${2}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user