fixes for os x

This commit is contained in:
Greg DiCristofaro 2022-08-18 11:24:21 -04:00
parent 281872e692
commit c62249f9fb
4 changed files with 53 additions and 41 deletions

View File

@ -8,7 +8,7 @@
*A script to install these dependencies that can be found [here](install_prereqs_osx.sh).* *A script to install these dependencies that can be found [here](install_prereqs_osx.sh).*
- Using [Homebrew](https://brew.sh/), install dependencies that have formulas: - Using [Homebrew](https://brew.sh/), install dependencies that have formulas:
``` ```
brew install ant automake libtool afflib libewf libpq testdisk imagemagick gstreamer gst-plugins-base gst-plugins-good imagemagick brew install ant automake libtool afflib libewf postgresql testdisk
``` ```
- You will also need to install Java 8 and JavaFX to run autopsy. We recommend Liberica OpenJDK which can be installed by tapping this third-party dependency: - You will also need to install Java 8 and JavaFX to run autopsy. We recommend Liberica OpenJDK which can be installed by tapping this third-party dependency:
``` ```
@ -22,6 +22,7 @@
``` ```
/usr/libexec/java_home -v 1.8 /usr/libexec/java_home -v 1.8
``` ```
- If you want gstreamer to open media, you can download and install gstreamer here: `https://gstreamer.freedesktop.org/data/pkg/osx/1.20.3/gstreamer-1.0-1.20.3-universal.pkg`
## On Linux (Ubuntu / Debian-based) ## On Linux (Ubuntu / Debian-based)
@ -113,8 +114,8 @@
``` ```
- At this point, you should be able to run Autopsy with the command `./autopsy` from within the `bin` directory of the extracted folder. - At this point, you should be able to run Autopsy with the command `./autopsy` from within the `bin` directory of the extracted folder.
## Setup Homebrew JNA paths ## Setup OSX JNA paths
A few features in Autopsy will only work (i.e. gstreamer) will only work if the JNA paths are specified. If you installed the necessary dependencies through Homebrew, you will want to either run this [script](add_homebrew_jna.sh) or manually add all the gstreamer lib and dependency lib paths to the env variable `jre_flags`. A few features in Autopsy will only work (i.e. gstreamer) if the JNA paths are specified. If you installed the necessary dependencies through Homebrew, you will want to either run this [script](add_osx_jna.sh) or manually add all the gstreamer lib and dependency lib paths to the env variable `jre_flags` with jre flag: `-Djna.library.path`.
# Caveats # Caveats
- Not all current features in Autopsy are functional in a Linux and Mac environment including but not limited to: - Not all current features in Autopsy are functional in a Linux and Mac environment including but not limited to:

View File

@ -1,36 +0,0 @@
#!/bin/bash
# Updates jna paths for mac
usage() {
echo "Usage: add_homebrew_jna.sh [-c config_file]" 1>&2
}
while getopts "c:" o; do
case "${o}" in
c)
append_path=${OPTARG}
;;
*)
usage
exit 1
;;
esac
done
if [[ -z "$append_path" ]]; then
usage
exit 1
fi
gstreamer_paths=$({ brew deps --installed gst-plugins-base gst-plugins-good gstreamer; echo -e "gst-plugins-base\ngst-plugins-good\ngstreamer" ; } \
| sort \
| uniq \
| xargs brew ls \
| grep /lib/ \
| xargs -I{} dirname {} \
| sort \
| uniq \
| sed -e :a -e '$!N; s/\n/:/; ta')
echo -e "\njreflags=\"\$jreflags -Djna.library.path=\\\"$gstreamer_paths\\\"\"" >> $append_path

View File

@ -0,0 +1,34 @@
#!/bin/bash
# Updates jna paths for mac
usage() {
echo "Usage: add_osx_jna.sh [-i base_install_location (i.e. /home/usr/autopsy)] [-a application_name (default: autopsy)]" 1>&2
}
APPLICATION_NAME="autopsy"
while getopts "a:i:" o; do
case "${o}" in
i)
INSTALL_LOC=${OPTARG}
;;
a)
APPLICATION_NAME=${OPTARG}
;;
*)
usage
exit 1
;;
esac
done
if [[ -z "$INSTALL_LOC" ]]
then
usage
exit 1
fi
awk '!/^\s*#?\s*export jreflags=.*$/' $INSTALL_LOC/etc/$APPLICATION_NAME.conf > $INSTALL_LOC/etc/$APPLICATION_NAME.conf.tmp && \
mv $INSTALL_LOC/etc/$APPLICATION_NAME.conf.tmp $INSTALL_LOC/etc/$APPLICATION_NAME.conf && \
echo -e "\nexport jreflags=-Djna.library.path=\"/Library/Frameworks/GStreamer.framework/Versions/1.0/lib\"" >> $INSTALL_LOC/etc/$APPLICATION_NAME.conf

View File

@ -1,14 +1,27 @@
#!/bin/bash #!/bin/bash
echo "Installing dependencies..." echo "Installing dependencies..."
# dependencies taken from: https://github.com/sleuthkit/autopsy/pull/5111/files # dependencies taken from: https://github.com/sleuthkit/autopsy/pull/5111/files
# brew install postgresql gettext cppunit && \ # brew install gettext cppunit && \
brew install ant automake libtool afflib libewf libpq testdisk gstreamer gst-plugins-base gst-plugins-good brew install ant automake libtool afflib libewf postgresql testdisk
if [[ $? -ne 0 ]] if [[ $? -ne 0 ]]
then then
echo "Unable to install necessary dependencies" >> /dev/stderr echo "Unable to install necessary dependencies" >> /dev/stderr
exit 1 exit 1
fi fi
# brew gstreamer packages don't seem to play nice with autopsy. Installing directly from gstreamer
echo "Installing gstreamer..."
gstreamer_tmp_path=$TMPDIR/gstreamer-1.0-1.20.3-universal.pkg
curl -k -o $gstreamer_tmp_path 'https://gstreamer.freedesktop.org/data/pkg/osx/1.20.3/gstreamer-1.0-1.20.3-universal.pkg' && \
sudo installer -pkg //Users/4911_admin/Downloads/gstreamer-1.0-1.20.3-universal.pkg -target /
gstreamer_install_result=$?
rm $gstreamer_tmp_path
if [[ $? -ne 0 ]]
then
echo "Unable to install gstreamer" >> /dev/stderr
exit 1
fi
echo "Installing liberica java 8..." echo "Installing liberica java 8..."
brew tap bell-sw/liberica && \ brew tap bell-sw/liberica && \
brew install --cask liberica-jdk8-full brew install --cask liberica-jdk8-full