-
Notifications
You must be signed in to change notification settings - Fork 48
Build local app bundle #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
218f692
8975ddc
e06b3da
6093ffb
5bc388f
15dd265
1a3d282
187c4c9
481d8aa
4cba7d9
f804603
1595e77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| Contents/Resources/IPMIView | ||
| SM_download/ | ||
| *~ | ||
| .*.sw* | ||
| /SM_download/ | ||
| /IPMIView.app/ |
| 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 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,7 @@ cd IPMIView.app | |||||
| bash script.sh | ||||||
| ``` | ||||||
|
|
||||||
| 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. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| 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. | ||||||
|
|
||||||
|
|
@@ -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`: | ||||||
|
|
@@ -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: | ||||||
|
|
||||||
|
|
@@ -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. | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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}/") | ||||||||||||||||
|
|
@@ -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" | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for updating the version! 💪 |
||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| LOCAL_DOWNLOAD_LOCATION="./SM_download" | ||||||||||||||||
|
|
@@ -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" | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| 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)" | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| echo "* to run properly." | ||||||||||||||||
| echo "*" | ||||||||||||||||
| echo "* The Java platform is $jarch for JAVA_HOME=$JAVA_HOME" | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| 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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| 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 | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(for consistency 😄) |
||||||||||||||||
| echo "* softwareupdate --install-rosetta" | ||||||||||||||||
| echo "*" | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| echo | ||||||||||||||||
| echo "IPMIView.app was not built. Please read the messages above." | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| 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" | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we keep this contract (that the script yields
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There's no reason to require it to go there other than it gets into Launchpad (eventually). You could also install it into
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll fix this and maybe make it a completely separate PR. |
||||||||||||||||
There was a problem hiding this comment.
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.