NAME="IPFire" # Software name
SNAME="ipfire" # Short name
VERSION="2.21" # Version number
-CORE="126" # Core Level (Filename)
-PAKFIRE_CORE="125" # Core Level (PAKFIRE)
+CORE="127" # Core Level (Filename)
+PAKFIRE_CORE="126" # Core Level (PAKFIRE)
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` # Git Branch
SLOGAN="www.ipfire.org" # Software slogan
CONFIG_ROOT=/var/ipfire # Configuration rootdir
configure_build_guess() {
case "${HOST_ARCH}" in
- x86_64|i686|i586)
+ x86_64)
+ echo "x86_64"
+ ;;
+ i?86)
echo "i586"
;;
umount $BASEDIR/build/usr/src/lfs 2>/dev/null;
umount $BASEDIR/build/usr/src/log 2>/dev/null;
umount $BASEDIR/build/usr/src/src 2>/dev/null;
+
+ # Umount ramdisk
+ ramdisk_save "${BASEDIR}/build"
}
now() {
exit 1
}
+ramdisk_save() {
+ local path="${1}"
+
+ # Check if the ramdisk is actually mounted
+ if ! mountpoint "${path}" &>/dev/null; then
+ return 1
+ fi
+
+ # Remove the bind-mount
+ umount "${path}"
+
+ echo -n "Saving ramdisk (this might take a moment)..."
+
+ # Copy all data
+ mkdir -p "${path}.tmpfs"
+ if ! rsync -aHAXq --delete "${path}.tmpfs/" "${path}/"; then
+ print_status FAIL
+ return 1
+ fi
+
+ # Umount ramdisk
+ umount "${path}.tmpfs"
+ rm -rf "${path}.tmpfs"
+
+ print_status DONE
+}
+
+ramdisk_restore() {
+ local path="${1}"
+
+ # Don't do anything if ramdisk support isn't enabled
+ if [ "${USE_RAMDISK}" != "1" ]; then
+ return 1
+ fi
+
+ # Check for sufficient memory
+ # XXX TODO
+
+ echo -n "Restoring ramdisk (this might take a moment)..."
+
+ # Mount new ramdisk
+ mkdir -p "${path}.tmpfs"
+ if ! mount -t tmpfs none "${path}.tmpfs"; then
+ exiterror "Could not mount ramdisk"
+ fi
+
+ # Restore all data
+ if ! rsync -aHAXq --delete "${path}/" "${path}.tmpfs/"; then
+ umount "${path}.tmpfs"
+ rm -rf "${path}.tmpfs"
+
+ exiterror "Could not restore ramdisk"
+ fi
+
+ # Overlay the files on disk
+ # We would use "mount --move ..." but systemd is always
+ # mounting / as shared which doesn't allow moving anything
+ mount --bind "${path}.tmpfs" "${path}"
+
+ print_status DONE
+}
+
prepareenv() {
# Are we running the right shell?
if [ -z "${BASH}" ]; then
export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
+ # Mount ramdisk (if requested)
+ ramdisk_restore "${BASEDIR}/build"
+
# Make some extra directories
mkdir -p "${BASEDIR}/build${TOOLS_DIR}" 2>/dev/null
mkdir -p $BASEDIR/build/{etc,usr/src} 2>/dev/null
rm -f $BASEDIR/ipfire-*
print_status DONE
;;
+docker)
+ # Build the docker image if it does not exist, yet
+ if ! docker images -a | grep -q ^ipfire-builder; then
+ if docker build -t ipfire-builder ${BASEDIR}/tools/docker; then
+ print_status DONE
+ else
+ print_status FAIL
+ exit 1
+ fi
+ fi
+
+ # Run the container and enter a shell
+ docker run -it --privileged -v "${BASEDIR}:/build" -w "/build" ipfire-builder bash -l
+ ;;
downloadsrc)
if [ ! -d $BASEDIR/cache ]; then
mkdir $BASEDIR/cache