easyinstall: build hfsutils from source if needed

This commit is contained in:
Daniel Markstedt
2025-11-27 00:10:39 +01:00
parent 9194ecced5
commit c99eeef4bf
2 changed files with 38 additions and 3 deletions

View File

@@ -153,8 +153,11 @@ function installPackagesWeb() {
$APT_PACKAGES_PYTHON \
$APT_PACKAGES_WEB
if ! sudo apt-get install --no-install-recommends --assume-yes -qq hfsutils; then
echo "WARNING: Failed to install 'hfsutils'. HFS disk image support may be unavailable."
if ! command -v hformat >/dev/null 2>&1 ]; then
if ! sudo apt-get install --no-install-recommends --assume-yes -qq hfsutils; then
echo "hfsutils package not found in apt repositories; compiling from source..."
installHfsutils
fi
fi
}
@@ -439,6 +442,24 @@ function installHfdisk() {
fi
}
# Clone, compile and install 'hfsutils', HFS disk image tools
function installHfsutils() {
sudo apt-get install --no-install-recommends --assume-yes -qq autoconf automake libtool m4 </dev/null
if [ -d "$BASE/hfsutils" ]; then
echo "hfsutils source dir already exists; deleting before re-cloning..."
rm -rf "$BASE/hfsutils"
fi
git clone https://github.com/rdmark/hfsutils.git "$BASE/hfsutils"
cd "$BASE/hfsutils" || exit 1
git checkout v2025.12.1
autoreconf -i
./configure
make -j "$CORES"
sudo make install
}
# Fetch HFS drivers that the Web Interface uses
function fetchHardDiskDrivers() {
DRIVER_ARCHIVE="mac-hard-disk-drivers"

View File

@@ -143,13 +143,27 @@ function installNetatalk() {
echo "[$AFP_SHARE_NAME]"
echo "path = $AFP_SHARE_PATH"
echo "volume name = $AFP_SHARE_NAME"
} | sudo sudo tee -a "$AFPCONF" > /dev/null
} | sudo tee -a "$AFPCONF" > /dev/null
echo "Added share section for $AFP_SHARE_NAME to afp.conf"
else
echo "Share section [$AFP_SHARE_NAME] already exists; not updating afp.conf"
fi
fi
if [[ "$ADDITIONAL_SHARE_NAME" && "$ADDITIONAL_SHARE_PATH" ]]; then
if ! grep -q "^\[$ADDITIONAL_SHARE_NAME\]" "$AFPCONF"; then
{
echo
echo "[$ADDITIONAL_SHARE_NAME]"
echo "path = $ADDITIONAL_SHARE_PATH"
echo "volume name = $ADDITIONAL_SHARE_NAME"
} | sudo tee -a "$AFPCONF" > /dev/null
echo "Added share section for $ADDITIONAL_SHARE_NAME to afp.conf"
else
echo "Share section [$ADDITIONAL_SHARE_NAME] already exists; not updating afp.conf"
fi
fi
if [[ "$APPLETALK_INTERFACE" ]]; then
echo "$NETATALK_CONFDIR/atalkd.conf:"
echo "$APPLETALK_INTERFACE" | sudo tee -a "$NETATALK_CONFDIR/atalkd.conf"