Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Contents/Resources/IPMIView
SM_download/
*~
.*.sw*
/SM_download/
/IPMIView.app/
4 changes: 3 additions & 1 deletion Contents/MacOS/IPMIView
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${DIR}/../Resources/IPMIView"
"${DIR}/../Resources/IPMIView/Contents/Home/bin/java" -jar IPMIView20.jar
# Explicitly export JAVA_HOME so the KVM Console launches using the same Java
export JAVA_HOME="${DIR}/../Resources/IPMIView/Contents/Home"
"${JAVA_HOME}/bin/java" -jar IPMIView20.jar
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cd IPMIView.app
bash script.sh
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the very least, let's get a short **Note:** ... here guiding users how to invoke this on arm64 Macs; we're close enough to EOL that it's worth doing, IMO.


You should now have an application icon in your home directory's Applications (aka `~/Applications`) folder.
You should now have an application icon in the current directory. You can copy it into `/Applications/` or into `~/Applications/` ror run it from the current location if you'd like.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You should now have an application icon in the current directory. You can copy it into `/Applications/` or into `~/Applications/` ror run it from the current location if you'd like.
You should now have an application icon in the current directory. You can copy it into `/Applications/`, `~/Applications/`, or run it from the git repo root, if you'd like.


For some versions of macOS, you may also need to add a security exception for `java`; see [Using the KVM Console](#using-the-kvm-console) for details.

Expand All @@ -28,6 +28,17 @@ Running the commands in the [Quick Start](#quick-start) section above will autom

The script in this repo downloads files from SuperMicro's website located at: https://www.supermicro.com/wdl/utility/IPMIView/Linux/

### Intel x86-64 versus Apple Silicon

While the IPMIView application from SuperMicro is mostly written in Java, there are some native binaries required for the KVM console and possibly other parts of it. Oddly enough, the Linux bundle contains binaries for MacOS, but they are x86-64 *only*.

If you are using MacOS on Apple Silicon (aka arm64 aka aarch64), it's still possible to run these x86-64-only binaries as long as you have:

1. Rosetta 2
2. Java Development Kit for MacOS x86-64

When building on MacOS aarch64, `script.sh` will prompt you to install Rosetta 2 and a usable JDK. You can simply set `$JAVA_HOME` to point to that JDK before running `script.sh`.

### Using the KVM Console

You need to add an `Input Monitoring` exception for `java` in the `Security & Privacy -> Privacy` Tab in `System Preferences`:
Expand All @@ -40,6 +51,7 @@ You need to add an `Input Monitoring` exception for `java` in the `Security & Pr
- In the top of the new window, select `Macintosh HD` in the pulldown `Library -> Java -> JavaVirtualMachines -> jdk<version>.jdk -> bin -> Contents -> Home -> bin`
- Double click on `java`
- Make sure the box next to `java` is now checked and close the window
- (You may also have to do this for the Java embedded in the IPMIView.app bundle)

When you attempt to launch the console, you may be presented with a message that says the developer is not verified. DO NOT click "Move to Trash" - this will delete the files necessary to run the graphical console. Once you get this message:

Expand All @@ -58,3 +70,5 @@ java -jar IPMIView20.jar
```

If you have issues with IMPIView loading correctly with this method, please contact SuperMicro support. The problem is related to the app and your computer setup, not the wrapper.

Remember, if you are using MacOS aarch64, you will need to use an x86-64 version of the JDK/JRE in order to run the KVM Console.
85 changes: 67 additions & 18 deletions script.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ INFO_URL="${BASE_URL}/downloadcenter/smsdownload\?category\=IPMI"
API_URL="https://www.supermicro.com/support/resources/getfile.php?SoftwareItemID=DLID&type=serversoftwarefile"

if which curl >/dev/null; then
echo "Detecting current SuperMicro software versions..."
# this area is subject to problems if SuperMicro changes their page format
DL_ID=$(curl -s ${INFO_URL} | grep "data-sms-name=\"Linux\".*sms_radio_buttons_IPMIView" | cut -d"'" -f4)
DL_URL=$(echo $API_URL | sed "s/DLID/${DL_ID}/")
Expand All @@ -19,7 +20,7 @@ if which curl >/dev/null; then
echo "[WARNING!] Problem parsing latest version..."
echo "Falling back to last known version."
echo "Please file an issue at https://github.com/TheCase/IPMIView.app/issues regarding latest version discovery."
DOWNLOAD_FILENAME="IPMIView_2.21.1_build.230720_bundleJRE_Linux_x64.tar.gz"
DOWNLOAD_FILENAME="IPMIView_2.24.0_build.251224_bundleJRE_Linux_x64.tar.gz"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the version! 💪

fi

LOCAL_DOWNLOAD_LOCATION="./SM_download"
Expand Down Expand Up @@ -78,26 +79,74 @@ else
echo "Press [Enter] to continue" && read answer
fi

echo "Extracting contents of downloaded IPMIView archive..."
if [[ -d Contents/Resources/IPMIView ]]; then
rm -rf Contents/Resources/IPMIView
echo "Using Java from $JAVA_HOME"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this entire block/check to the top so the script can fail fast - right now the script will download files (which can take a bit, depending on the user's internet connection), and then show this message to the user; its be better UX to fail fast.

arch=$( arch )
if [ "$arch" = "x86_64" ] ; then
echo "Using ${arch} platform."
elif [ "$arch" = "arm64" -o "$arch" = "aarch64" ] ; then
echo "Using ${arch} platform. Checking Java version..."
Comment on lines +84 to +87
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ "$arch" = "x86_64" ] ; then
echo "Using ${arch} platform."
elif [ "$arch" = "arm64" -o "$arch" = "aarch64" ] ; then
echo "Using ${arch} platform. Checking Java version..."
echo "Using ${arch} platform."
if [ "$arch" = "arm64" -o "$arch" = "aarch64" ] ; then
echo "Checking Java version..."


jarch=$( "${JAVA_HOME}/bin/java" -XshowSettings:properties -version 2>&1 | grep 'os.arch' | sed -e 's/.*=[ ]*//' )

if [ "x86_64" != "$jarch" ] ; then
echo "*"
echo "* This application bundle requires on x86-64 Java Runtime Environment (JRE/JDK)"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "* This application bundle requires on x86-64 Java Runtime Environment (JRE/JDK)"
echo "* This application bundle requires a x86-64 Java Runtime Environment (JRE/JDK)"

echo "* to run properly."
echo "*"
echo "* The Java platform is $jarch for JAVA_HOME=$JAVA_HOME"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "* The Java platform is $jarch for JAVA_HOME=$JAVA_HOME"
echo "* The Java platform is ${jarch} for JAVA_HOME=${JAVA_HOME}"

(personal pref, but suggesting this for consistency sake)

echo "*"
echo "* Set your JAVA_HOME environment variable to an x86-64 JRE/JDK"
echo "* and run this script again."
echo "*"
echo "* In order to run an x86-64 JRE/JDK on your ${arch} computer, you will"
echo "* need to install Apple's Rosetta 2 software."
Comment on lines +101 to +102
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "* In order to run an x86-64 JRE/JDK on your ${arch} computer, you will"
echo "* need to install Apple's Rosetta 2 software."
echo "* In order to run an x86-64 JRE/JDK on your ${arch} computer,"
echo "* Apple's Rosetta 2 software is required."

echo "*"

if arch -x86_64 /usr/bin/true 2> /dev/null; then
echo "* Rosetta 2 appears to be installed, so you will already be able to run"
echo "* the x86-64 JRE/JDK once you install it (if necessary) and set JAVA_HOME"
echo "* to point to it."
Comment on lines +107 to +108
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "* the x86-64 JRE/JDK once you install it (if necessary) and set JAVA_HOME"
echo "* to point to it."
echo "* the x86-64 JRE/JDK once installed and JAVA_HOME is set to point to it."

else
echo "* Rosetta 2 can't be detected on this system, so it is probably not installed."
echo "* You can install it using this command:"
echo
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo
echo "*"

(for consistency 😄)

echo "* softwareupdate --install-rosetta"
echo "*"
fi

echo
echo "IPMIView.app was not built. Please read the messages above."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "IPMIView.app was not built. Please read the messages above."
echo "[ERROR] IPMIView.app was not built. Please read the messages above."


exit 1
else
echo "Java platform is $jarch for JAVA_HOME=$JAVA_HOME"
fi
else
echo "Unsupported platform: $arch"
exit 1
fi
mkdir -p Contents/Resources/IPMIView/Contents/Home/bin
tar -zxf "${LOCAL_DOWNLOAD_LOCATION}"/IPMIView*.tar* --strip=1 -C ./Contents/Resources/IPMIView/. ||
{ echo "Something went wrong, check download of IPMIView archive" && exit 1; }

echo "Linking 'java' and 'jre'..."
ln -s "${JAVA_HOME}/bin/java" Contents/Resources/IPMIView/Contents/Home/bin/java
rm -rf Contents/Resources/IPMIView/jre/*
pushd Contents/Resources/IPMIView/jre/ >/dev/null &&
ln -s ../Contents . &&
popd >/dev/null || exit
echo "Building IPMIView.app..."
if [ -f IPMIView.app/Contents/Resources/IPMIView/IPMIView.properties ] ; then
echo "Saving configuration properties IPMIView.app/Contents/Resources/IPMIView/IPMIView.properties"
cp -a IPMIView.app/Contents/Resources/IPMIView/IPMIView.properties ./IPMIView.properties.tmp ||
{ echo "Failed to save IPMIView.properties. Exiting."; exit 1; }
fi
rm -rf IPMIView.app
mkdir IPMIView.app
cp -a README.md Contents IPMIView.app/
mkdir -p IPMIView.app/Contents/Resources/IPMIView/Contents/Home/bin
tar -zxf "${LOCAL_DOWNLOAD_LOCATION}"/IPMIView*.tar* --strip=1 --exclude='*/jre/*' -C IPMIView.app/Contents/Resources/IPMIView/. ||
{ echo "Something went wrong, check download of IPMIView archive" && exit 1; }
ln -s "${JAVA_HOME}/bin/java" IPMIView.app/Contents/Resources/IPMIView/Contents/Home/bin/java
if [ -f IPMIView.properties.tmp ] ; then
echo "Restoring IPMIView.app/Contents/Resources/IPMIView/IPMIView.properties"
cp -a IPMIView.properties.tmp IPMIView.app/Contents/Resources/IPMIView/IPMIView.properties ||
{ echo "Failed to restore IPMIView.properties. Exiting."; exit 1; }

echo "Copying IPMIView.app over to ~/Applications directory..."
pushd .. >/dev/null &&
rsync -ar --exclude=.git --exclude=Contents/Resources/IPMIView/jre IPMIView.app ~/Applications &&
popd >/dev/null || exit
rm IPMIView.properties.tmp
fi

echo "Completed."
echo
echo "You can now open ~/Applications/IPMIView.app"
echo "You can now open ./IPMIView.app or copy it into ~/Applications"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep this contract (that the script yields ~/Applications/IPMIView.app) the same? any particular reason to change it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not married to local-only build, but this is the only product I know of that really wants to put itself into ~/Applications.

There's no reason to require it to go there other than it gets into Launchpad (eventually). You could also install it into /Applications if you chose to.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understand - ultimately, it's up to the person running this script to decide where they ultimately want the app to live (in /Applications, or elsewhere). My point is that the change here is moving where it is currently stored, which might be unexpected by users who have known the script to generate the app into ~/Applications directory. If that's something that we really really want to change, then I'd recommend we also update all other references to this, and put a clear notification to folks in the README stating that the location the app is generated to has moved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this and maybe make it a completely separate PR.