Skip to content
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

M5Burner #2695

Open
4 tasks done
matu6968 opened this issue Dec 15, 2024 · 7 comments
Open
4 tasks done

M5Burner #2695

matu6968 opened this issue Dec 15, 2024 · 7 comments

Comments

@matu6968
Copy link

What is the name of the app?

M5Burner

Where is the app hosted?

decompiled version: https://github.com/matu6968/m5burner (this version will be used for the download process)
official version (available only for x64): https://docs.m5stack.com/en/download

About the app

M5Burner is an app meant to flash M5Stack devices (like M5Stack StickC or M5Stack Core) that comes with a repository of firmware images meant for the M5Stack hardware. This includes M5Stack's own firmware (like UIFlow) and community made firmware (like CatHack which mimics Flipper Zero's user interface or Bruce)

Upload file or Add PR Link

M5Burner.zip

Confirmations

Copy link
Contributor

A zipfile was found in the body of your issue.
The sha1sum of the zip was: 716b2242f50623c8e73bc410a862db2cd0ad8544

Click to show contents preview

M5Burner/credits

M5Stack for making the app, matu6968 for making the quality of life improvements and the arm64/armhf port

M5Burner/uninstall

#!/bin/bash

status "Removing M5Stack user directories"
read -n1 -r -p $"Warning: This will delete /home/${USER}/.cache/M5Burner, which means all downloaded firmware and cache will be deleted, if you agree to this press any key to continue otherwaise backup the firmware and/or cache folder and then continue."
sudo rm -rf /home/${USER}/.cache/M5Burner /home/${USER}/.cache/M5Burner/firmware /home/${USER}/.cache/M5Burner/images /home/${USER}/.cache/M5Burner/share /home/${USER}/.cache/M5Burner/tmp
status "Removing M5Stack binaries"
sudo rm -rf /opt/M5Burner || error "Failed to remove M5Burner binaries from /opt!"
sudo rm /usr/bin/M5Burner || error "Failed to remove M5Burner startup script in /usr/bin!"
sudo rm /usr/share/pixmaps/m5.png || error "Failed to remove M5Burner pixmap!"
status "Removing desktop entry for M5Burner..."
sudo rm /usr/share/applications/m5burner.desktop || error "Failed to copy .desktop entry!"

M5Burner/description

M5Burner is an app meant to flash M5Stack devices (like M5Stack StickC or M5Stack Core) that comes with a repository of firmware images meant for the M5Stack hardware. This includes M5Stack's own firmware (like UIFlow) and community made firmware (like CatHack which mimics Flipper Zero's user interface or Bruce.)

The utility was ported from the official Linux x64 version (https://docs.m5stack.com/en/download) and some quality of life improvements made (updating esptool.py to the latest version along with Electron)

To run: Menu -> Accessories -> M5Burner
To run in a terminal: /usr/bin/M5Burner

M5Burner/install-32

#!/bin/bash

sudo rm -rf /tmp/m5burner /opt/M5Burner
status "Downloading M5Burner binaries..."
wget -O /tmp/m5burner-3.0.0-pi-apps-armv7.zip https://github.com/matu6968/m5burner/releases/download/stable/m5burner-3.0.0-pi-apps-armv7.zip || error 'Failed to download M5Burner binaries!'
status "Extracting M5Burner binaries..."
unzip /tmp/m5burner-3.0.0-pi-apps-armv7.zip -d /tmp/m5burner || error "Failed to unzip M5Burner binaries!"
cd /tmp/m5burner
status "Copying M5Burner binaries..."
sudo mkdir /opt/M5Burner
sudo cp -r bin /opt/M5Burner/ || error "Failed to copy M5Burner binaries to /opt!"
sudo cp -r packages /opt/M5Burner/packages || error "Failed to copy M5Burner packages folder to /opt!" 
sudo cp M5Burner /usr/bin || error "Failed to copy M5Burner startup script to /usr/bin!"
sudo cp m5.png /usr/share/pixmaps || error "Failed to copy M5Burner pixmap!"
status "Making desktop entry for M5Burner..."
sudo cp m5burner.desktop /usr/share/applications || error "Failed to copy .desktop entry!"
status "Making writable user directories (cache, downloaded firmware images) for M5Burner..."
sudo rm -rf /home/${USER}/.cache/M5Burner /home/${USER}/.cache/M5Burner/firmware /home/${USER}/.cache/M5Burner/images /home/${USER}/.cache/M5Burner/share /home/${USER}/.cache/M5Burner/tmp
mkdir /home/${USER}/.cache/M5Burner /home/${USER}/.cache/M5Burner/firmware /home/${USER}/.cache/M5Burner/images /home/${USER}/.cache/M5Burner/share /home/${USER}/.cache/M5Burner/tmp || error "Failed to make directories for M5Burner in your user directory/.cache!"
sudo ln -s /home/${USER}/.cache/M5Burner/firmware /opt/M5Burner/packages/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
sudo ln -s /home/${USER}/.cache/M5Burner/images /opt/M5Burner/packages/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
sudo ln -s /home/${USER}/.cache/M5Burner/share /opt/M5Burner/packages/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
sudo ln -s /home/${USER}/.cache/M5Burner/tmp /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"

USER=`whoami`
CMD=`groups ${USER} | grep dialout`
if [ "$?" -ne "0" ];then
    status "Enabling dialout group for current user..."
    sudo usermod -a -G dialout ${USER}
    echo "Please reboot your system now to start using M5Burner"
fi

M5Burner/website

https://github.com/matu6968/m5burner

M5Burner/install-64

#!/bin/bash

sudo rm -rf /tmp/m5burner /opt/M5Burner
status "Downloading M5Burner binaries..."
wget -O /tmp/m5burner-3.0.0-pi-apps-arm64.zip https://github.com/matu6968/m5burner/releases/download/stable/m5burner-3.0.0-pi-apps-arm64.zip || error 'Failed to download M5Burner binaries!'
status "Extracting M5Burner binaries..."
unzip /tmp/m5burner-3.0.0-pi-apps-arm64.zip -d /tmp/m5burner || error "Failed to unzip M5Burner binaries!"
cd /tmp/m5burner
status "Copying M5Burner binaries..."
sudo mkdir /opt/M5Burner
sudo cp -r bin /opt/M5Burner/ || error "Failed to copy M5Burner binaries to /opt!"
sudo cp -r packages /opt/M5Burner/packages || error "Failed to copy M5Burner packages folder to /opt!" 
sudo cp M5Burner /usr/bin || error "Failed to copy M5Burner startup script to /usr/bin!"
sudo cp m5.png /usr/share/pixmaps || error "Failed to copy M5Burner pixmap!"
status "Making desktop entry for M5Burner..."
sudo cp m5burner.desktop /usr/share/applications || error "Failed to copy .desktop entry!"
status "Making writable user directories (cache, downloaded firmware images) for M5Burner..."
sudo rm -rf /home/${USER}/.cache/M5Burner /home/${USER}/.cache/M5Burner/firmware /home/${USER}/.cache/M5Burner/images /home/${USER}/.cache/M5Burner/share /home/${USER}/.cache/M5Burner/tmp
mkdir /home/${USER}/.cache/M5Burner /home/${USER}/.cache/M5Burner/firmware /home/${USER}/.cache/M5Burner/images /home/${USER}/.cache/M5Burner/share /home/${USER}/.cache/M5Burner/tmp || error "Failed to make directories for M5Burner in your user directory/.cache!"
sudo ln -s /home/${USER}/.cache/M5Burner/firmware /opt/M5Burner/packages/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
sudo ln -s /home/${USER}/.cache/M5Burner/images /opt/M5Burner/packages/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
sudo ln -s /home/${USER}/.cache/M5Burner/share /opt/M5Burner/packages/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
sudo ln -s /home/${USER}/.cache/M5Burner/tmp /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"

USER=`whoami`
CMD=`groups ${USER} | grep dialout`
if [ "$?" -ne "0" ];then
    status "Enabling dialout group for current user..."
    sudo usermod -a -G dialout ${USER}
    echo "Please reboot your system now to start using M5Burner"
fi

@Botspot
Copy link
Owner

Botspot commented Dec 16, 2024

Thanks for working on the scripts. I have not tested them yet, but they appear high quality and assuming the app runs as it should, I have no issues adding it to Pi-Apps.
I have a few thoughts about the scripts though:

  • /home/${USER}/ can be replaced with ~/ when not within ".
  • Towards the end you could replace that clunky $? if statement with:
if ! groups $USER | grep -q dialout ;then
  • I am assuming this app will receive updates, right? Updates in Pi-Apps will trigger whenever the install script is updated. for an update, it runs the old uninstall script, and then runs the new install-** script. The way you currently have your uninstall script, it will ask permission to delete all cached data during an update. This user prompt will annoy and confuse users during updates. Consider doing what we do elsewhere for other apps:
    • Either leave cache/config data in place, and tell the user where to go to delete it (such as with the Tor Browser)
    • Or check if the uninstall and install-** script was given the update flag in $1, and if so, skip data removal lines with an if statement. (such as in with Better Chromium)

Copy link
Contributor

A zipfile was found in the body of an issue comment.
The sha1sum of the zip was: bd407132782966ed98ad1787bce0715fc203b5f8

Click to show contents preview

M5Burner/credits

M5Stack for making the app, matu6968 for making the quality of life improvements and the arm64/armhf port

M5Burner/uninstall

#!/bin/bash

# Only remove the program binaries if an update is being performed
if [ "$1" == update ];then
  status "App is being updated, retaining user data"
  status "Removing M5Stack binaries"
  sudo rm -rf /opt/M5Burner || error "Failed to remove M5Burner binaries from /opt!"
  sudo rm /usr/bin/M5Burner || error "Failed to remove M5Burner startup script in /usr/bin!"
  sudo rm /usr/share/pixmaps/m5.png || error "Failed to remove M5Burner pixmap!"
  status "Removing desktop entry for M5Burner..."
  sudo rm /usr/share/applications/m5burner.desktop || error "Failed to remove .desktop entry!"
fi

status "Removing M5Stack user directories"
read -n1 -r -p $"Warning: This will delete /home/${USER}/.cache/M5Burner, which means all downloaded firmware and cache will be deleted, if you agree to this press any key to continue otherwaise backup the firmware and/or cache folder and then continue."
sudo rm -rf /home/${USER}/.cache/M5Burner /home/${USER}/.cache/M5Burner/firmware /home/${USER}/.cache/M5Burner/images /home/${USER}/.cache/M5Burner/share /home/${USER}/.cache/M5Burner/tmp
status "Removing M5Stack binaries"
sudo rm -rf /opt/M5Burner || error "Failed to remove M5Burner binaries from /opt!"
sudo rm /usr/bin/M5Burner || error "Failed to remove M5Burner startup script in /usr/bin!"
sudo rm /usr/share/pixmaps/m5.png || error "Failed to remove M5Burner pixmap!"
status "Removing desktop entry for M5Burner..."
sudo rm /usr/share/applications/m5burner.desktop || error "Failed to remove .desktop entry!"

M5Burner/description

M5Burner is an app meant to flash M5Stack devices (like M5Stack StickC or M5Stack Core) that comes with a repository of firmware images meant for the M5Stack hardware. This includes M5Stack's own firmware (like UIFlow) and community made firmware (like CatHack which mimics Flipper Zero's user interface or Bruce.)

The utility was ported from the official Linux x64 version (https://docs.m5stack.com/en/download) and some quality of life improvements made (updating esptool.py to the latest version along with Electron)

To run: Menu -> Accessories -> M5Burner
To run in a terminal: /usr/bin/M5Burner

M5Burner/install-32

#!/bin/bash
version=3.0.0

sudo rm -rf /tmp/m5burner /opt/M5Burner
status "Downloading M5Burner binaries..."
wget -O /tmp/m5burner-$version-pi-apps-armv7.zip https://github.com/matu6968/m5burner/releases/download/stable/m5burner-$version-pi-apps-armv7.zip || error 'Failed to download M5Burner binaries!'
status "Extracting M5Burner binaries..."
unzip /tmp/m5burner-$version-pi-apps-armv7.zip -d /tmp/m5burner || error "Failed to unzip M5Burner binaries!"
cd /tmp/m5burner
status "Copying M5Burner binaries..."
sudo mkdir /opt/M5Burner
sudo cp -r bin /opt/M5Burner/ || error "Failed to copy M5Burner binaries to /opt!"
sudo cp -r packages /opt/M5Burner/packages || error "Failed to copy M5Burner packages folder to /opt!" 
sudo cp M5Burner /usr/bin || error "Failed to copy M5Burner startup script to /usr/bin!"
sudo cp m5.png /usr/share/pixmaps || error "Failed to copy M5Burner pixmap!"
status "Making desktop entry for M5Burner..."
sudo cp m5burner.desktop /usr/share/applications || error "Failed to copy .desktop entry!"
# Only symlink back the directories if an update is being performed
if [ "$1" == update ];then
  status "Symlinking back folders to user's .cache/M5Burner directory"
  sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/firmware/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
  sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/images/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
  sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/share/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
  sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/tmp/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
  sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/dat/ || error "Failed to symlink dat directory for M5Burner to your user directory/.cache/tmp!"
  exit 0
fi
status "Making writable user directories (cache, downloaded firmware images) for M5Burner..."
sudo rm -rf ~/.cache/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat
mkdir ~/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat || error "Failed to make directories for M5Burner in your user directory/.cache!"
sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/firmware/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/images/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/share/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/tmp/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/dat/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/dat!"

if ! groups $USER | grep -q dialout ;then
    status "Enabling dialout group for current user..."
    sudo usermod -a -G dialout ${USER}
    echo "Please reboot your system now to start using M5Burner"
fi

M5Burner/website

https://github.com/matu6968/m5burner

M5Burner/install-64

#!/bin/bash
version=3.0.0

sudo rm -rf /tmp/m5burner /opt/M5Burner
status "Downloading M5Burner binaries..."
wget -O /tmp/m5burner-$version-pi-apps-arm64.zip https://github.com/matu6968/m5burner/releases/download/stable/m5burner-$version-pi-apps-arm64.zip || error 'Failed to download M5Burner binaries!'
status "Extracting M5Burner binaries..."
unzip /tmp/m5burner-$version-pi-apps-arm64.zip -d /tmp/m5burner || error "Failed to unzip M5Burner binaries!"
cd /tmp/m5burner
status "Copying M5Burner binaries..."
sudo mkdir /opt/M5Burner
sudo cp -r bin /opt/M5Burner/ || error "Failed to copy M5Burner binaries to /opt!"
sudo cp -r packages /opt/M5Burner/packages || error "Failed to copy M5Burner packages folder to /opt!" 
sudo cp M5Burner /usr/bin || error "Failed to copy M5Burner startup script to /usr/bin!"
sudo cp m5.png /usr/share/pixmaps || error "Failed to copy M5Burner pixmap!"
status "Making desktop entry for M5Burner..."
sudo cp m5burner.desktop /usr/share/applications || error "Failed to copy .desktop entry!"
# Only symlink back the directories if an update is being performed
if [ "$1" == update ];then
  status "Symlinking back folders to user's .cache/M5Burner directory"
  sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/firmware/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
  sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/images/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
  sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/share/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
  sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/tmp/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
  sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/dat/ || error "Failed to symlink dat directory for M5Burner to your user directory/.cache/tmp!"
  exit 0
fi
status "Making writable user directories (cache, downloaded firmware images) for M5Burner..."
sudo rm -rf ~/.cache/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat
mkdir ~/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat || error "Failed to make directories for M5Burner in your user directory/.cache!"
sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/firmware/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/images/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/share/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/tmp/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/dat/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/dat!"

if ! groups $USER | grep -q dialout ;then
    status "Enabling dialout group for current user..."
    sudo usermod -a -G dialout ${USER}
    echo "Please reboot your system now to start using M5Burner"
fi

@matu6968
Copy link
Author

Sorry, i didn't properly check the updated script to see if it would error out. I deleted the broken version so here is the fixed up again version:
M5Burner.zip

Copy link
Contributor

A zipfile was found in the body of an issue comment.
The sha1sum of the zip was: 0c0836726b93871b808c5048d9c77c59e55c06b1

Click to show contents preview

M5Burner/credits

M5Stack for making the app, matu6968 for making the quality of life improvements and the arm64/armhf port

M5Burner/uninstall

#!/bin/bash

# Only remove the program binaries if an update is being performed
if [ "$1" == update ];then
  status "App is being updated, retaining user data"
  status "Removing M5Stack binaries"
  sudo rm -rf /opt/M5Burner || error "Failed to remove M5Burner binaries from /opt!"
  sudo rm /usr/bin/M5Burner || error "Failed to remove M5Burner startup script in /usr/bin!"
  sudo rm /usr/share/pixmaps/m5.png || error "Failed to remove M5Burner pixmap!"
  status "Removing desktop entry for M5Burner..."
  sudo rm /usr/share/applications/m5burner.desktop || error "Failed to remove .desktop entry!"
fi

status "Removing M5Stack user directories"
read -n1 -r -p $"Warning: This will delete /home/${USER}/.cache/M5Burner, which means all downloaded firmware and cache will be deleted, if you agree to this press any key to continue otherwaise backup the firmware and/or cache folder and then continue."
sudo rm -rf /home/${USER}/.cache/M5Burner /home/${USER}/.cache/M5Burner/firmware /home/${USER}/.cache/M5Burner/images /home/${USER}/.cache/M5Burner/share /home/${USER}/.cache/M5Burner/tmp
status "Removing M5Stack binaries"
sudo rm -rf /opt/M5Burner || error "Failed to remove M5Burner binaries from /opt!"
sudo rm /usr/bin/M5Burner || error "Failed to remove M5Burner startup script in /usr/bin!"
sudo rm /usr/share/pixmaps/m5.png || error "Failed to remove M5Burner pixmap!"
status "Removing desktop entry for M5Burner..."
sudo rm /usr/share/applications/m5burner.desktop || error "Failed to remove .desktop entry!"

M5Burner/description

M5Burner is an app meant to flash M5Stack devices (like M5Stack StickC or M5Stack Core) that comes with a repository of firmware images meant for the M5Stack hardware. This includes M5Stack's own firmware (like UIFlow) and community made firmware (like CatHack which mimics Flipper Zero's user interface or Bruce.)

The utility was ported from the official Linux x64 version (https://docs.m5stack.com/en/download) and some quality of life improvements made (updating esptool.py to the latest version along with Electron)

To run: Menu -> Accessories -> M5Burner
To run in a terminal: /usr/bin/M5Burner

M5Burner/install-32

#!/bin/bash
version=3.0.0

sudo rm -rf /tmp/m5burner /opt/M5Burner
status "Downloading M5Burner binaries..."
wget -O /tmp/m5burner-$version-pi-apps-armv7.zip https://github.com/matu6968/m5burner/releases/download/stable/m5burner-$version-pi-apps-armv7.zip || error 'Failed to download M5Burner binaries!'
status "Extracting M5Burner binaries..."
unzip /tmp/m5burner-$version-pi-apps-armv7.zip -d /tmp/m5burner || error "Failed to unzip M5Burner binaries!"
cd /tmp/m5burner
status "Copying M5Burner binaries..."
sudo mkdir /opt/M5Burner
sudo cp -r bin /opt/M5Burner/ || error "Failed to copy M5Burner binaries to /opt!"
sudo cp -r packages /opt/M5Burner/packages || error "Failed to copy M5Burner packages folder to /opt!" 
sudo cp M5Burner /usr/bin || error "Failed to copy M5Burner startup script to /usr/bin!"
sudo cp m5.png /usr/share/pixmaps || error "Failed to copy M5Burner pixmap!"
status "Making desktop entry for M5Burner..."
sudo cp m5burner.desktop /usr/share/applications || error "Failed to copy .desktop entry!"
# Only symlink back the directories if an update is being performed
if [ "$1" == update ];then
  status "Symlinking back folders to user's .cache/M5Burner directory"
  sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/packages/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
  sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/packages/ || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
  sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/packages/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
  sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
  sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/packages/ || error "Failed to symlink dat directory for M5Burner to your user directory/.cache/dat!"
  exit 0
fi
status "Making writable user directories (cache, downloaded firmware images) for M5Burner..."
sudo rm -rf ~/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat /opt/M5Burner/packages/dat
mkdir ~/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat || error "Failed to make directories for M5Burner in your user directory/.cache!"
sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/packages/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/packages/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/packages/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/dat!"

if ! groups $USER | grep -q dialout ;then
    status "Enabling dialout group for current user..."
    sudo usermod -a -G dialout ${USER}
    echo "Please reboot your system now to start using M5Burner"
fi

M5Burner/website

https://github.com/matu6968/m5burner

M5Burner/install-64

#!/bin/bash
version=3.0.0

sudo rm -rf /tmp/m5burner /opt/M5Burner
status "Downloading M5Burner binaries..."
wget -O /tmp/m5burner-$version-pi-apps-arm64.zip https://github.com/matu6968/m5burner/releases/download/stable/m5burner-$version-pi-apps-arm64.zip || error 'Failed to download M5Burner binaries!'
status "Extracting M5Burner binaries..."
unzip /tmp/m5burner-$version-pi-apps-arm64.zip -d /tmp/m5burner || error "Failed to unzip M5Burner binaries!"
cd /tmp/m5burner
status "Copying M5Burner binaries..."
sudo mkdir /opt/M5Burner
sudo cp -r bin /opt/M5Burner/ || error "Failed to copy M5Burner binaries to /opt!"
sudo cp -r packages /opt/M5Burner/packages || error "Failed to copy M5Burner packages folder to /opt!" 
sudo cp M5Burner /usr/bin || error "Failed to copy M5Burner startup script to /usr/bin!"
sudo cp m5.png /usr/share/pixmaps || error "Failed to copy M5Burner pixmap!"
status "Making desktop entry for M5Burner..."
sudo cp m5burner.desktop /usr/share/applications || error "Failed to copy .desktop entry!"
# Only symlink back the directories if an update is being performed
if [ "$1" == update ];then
  status "Symlinking back folders to user's .cache/M5Burner directory"
  sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/packages/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
  sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/packages/ || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
  sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/packages/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
  sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
  sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/packages/ || error "Failed to symlink dat directory for M5Burner to your user directory/.cache/dat!"
  exit 0
fi
status "Making writable user directories (cache, downloaded firmware images) for M5Burner..."
sudo rm -rf ~/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat /opt/M5Burner/packages/dat
mkdir ~/.cache/M5Burner ~/.cache/M5Burner/firmware ~/.cache/M5Burner/images ~/.cache/M5Burner/share ~/.cache/M5Burner/tmp ~/.cache/M5Burner/dat || error "Failed to make directories for M5Burner in your user directory/.cache!"
sudo ln -s ~/.cache/M5Burner/firmware /opt/M5Burner/packages/ || error "Failed to symlink firmware directory for M5Burner to your user directory/.cache/firmware!"
sudo ln -s ~/.cache/M5Burner/images /opt/M5Burner/packages/  || error "Failed to symlink images directory for M5Burner to your user directory/.cache/images!"
sudo ln -s ~/.cache/M5Burner/share /opt/M5Burner/packages/ || error "Failed to symlink share directory for M5Burner to your user directory/.cache/share!"
sudo ln -s ~/.cache/M5Burner/tmp /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/tmp!"
sudo ln -s ~/.cache/M5Burner/dat /opt/M5Burner/packages/ || error "Failed to symlink tmp directory for M5Burner to your user directory/.cache/dat!"

if ! groups $USER | grep -q dialout ;then
    status "Enabling dialout group for current user..."
    sudo usermod -a -G dialout ${USER}
    echo "Please reboot your system now to start using M5Burner"
fi

@theofficialgman
Copy link
Collaborator

Any chance you can just build debs with https://classic.yarnpkg.com/en/package/electron-installer-debian ? You are doing a lot of things manually in these scripts that would just be automated by using that tool to build debs in the first place.

@matu6968
Copy link
Author

matu6968 commented Jan 6, 2025

Any chance you can just build debs with https://classic.yarnpkg.com/en/package/electron-installer-debian ? You are doing a lot of things manually in these scripts that would just be automated by using that tool to build debs in the first place.

This does not work as electron-installer-debian assumes that everything is in the electron app which for M5Burner isn't as it needs esptool.py from an external packages folder and isn't in the node dependencies (+ nvs and the other python 3 dependencies it needs) and in that case trying to compile it in the root of the folder (which in the root includes the runner script and the M5Burner is all the way in opt) will get you an error saying it can't find the resources folder: Creating package (this may take a while) Error: Could not determine resources directory in Electron app at /home/ximipi5/m5burner/node_modules/electron-installer-common/src/readmetadata.js:44:13 at async /home/ximipi5/m5burner/node_modules/electron-installer-debian/src/installer.js:135:21 at async Promise.all (index 0) at async DebianInstaller.generateDefaults (/home/ximipi5/m5burner/node_modules/electron-installer-debian/src/installer.js:134:42) at async module.exports (/home/ximipi5/m5burner/node_modules/electron-installer-debian/src/installer.js:257:3) Error: Could not determine resources directory in Electron app at /home/ximipi5/m5burner/node_modules/electron-installer-common/src/readmetadata.js:44:13 at async /home/ximipi5/m5burner/node_modules/electron-installer-debian/src/installer.js:135:21 at async Promise.all (index 0) at async DebianInstaller.generateDefaults (/home/ximipi5/m5burner/node_modules/electron-installer-debian/src/installer.js:134:42) at async module.exports (/home/ximipi5/m5burner/node_modules/electron-installer-debian/src/installer.js:257:3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants