-
-
Notifications
You must be signed in to change notification settings - Fork 496
How to add a new software title
software_id=23
aSOFTWARE_NAME[$software_id]='LXDE'
aSOFTWARE_DESC[$software_id]='ultra lightweight desktop'
aSOFTWARE_CATX[$software_id]=0
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/desktop/#lxde'
aSOFTWARE_DEPS[$software_id]='5 6 browser'
Choose a free unique software ID. On a current DietPi system run dietpi-software free
to list currently unused IDs.
Run dietpi-software list
to list all software titles with their ID.
Add the name to be displayed in the DietPi-Software install menu.
Add a short description to be displayed next to the software name.
Choose a category under which the software title should be listed in the menu. See the aSOFTWARE_CATEGORIES
array in the current DietPi-Software script for available categories.
Every software title should have it's documentation page: https://dietpi.com/docs/software/
It can be added via our DietPi-Docs repository: https://github.com/MichaIng/DietPi-Docs
Include the full URL that points to the documentation, including the header anchor (e.g. #lxde
).
Add software titles that need to be installed as dependency, as space-separated list of software IDs. This example will install ALSA (ID: 5), X.Org X server (ID: 6), and offers users a choice for installing a web browser, as usual dependencies for any desktop:
aSOFTWARE_DEPS[$software_id]='5 6 browser'
Define if the installation process requires interactive user input, e.g. when some choice needs to be made or an external installer requires such. By this the software title will never be installed automated when chosen for first run install (DietPi-Automation) or if no input terminal is available.
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,$i]=0
aSOFTWARE_AVAIL_G_DISTRO[$software_id,$i]=0
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
$i
needs to be the related index, identifying the architecture, distro version or hardware model respectively. The following script shows the related indices: https://github.com/MichaIng/DietPi/blob/dev/dietpi/func/dietpi-obtain_hw_model
E.g. to disable the install option for all non-RPi (0-9 are reserved for RPi):
(( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0
if To_Install 41 emby-server # Emby Server
then
case $G_HW_ARCH in
2) local arch='armhf';;
3) local arch='arm64';;
*) local arch='amd64';;
esac
local fallback_url="https://github.com/MediaBrowser/Emby.Releases/releases/download/4.7.10.0/emby-server-deb_4.7.10.0_$arch.deb"
Download_Install "$(curl -sSfL 'https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/emby-server-deb_[^\"\/]*_$arch\.deb\"/{print \$4}")"
G_EXEC systemctl stop emby-server
# User: The DEB package install overrides this, hence the method needs to be changed when using an APT repository!
Create_User -g dietpi -G emby,video,render -d /var/lib/emby emby
Download_Test_Media
fi
- The first argument passed to
To_Install
needs to match thesoftware_id
chosen above. - The second argument is optional and the software's service name. This is used to unmask the service before starting the installation and to enable it after all installs have finished. These are often only failsafe steps since usually the service is not masked and enabled automatically when installed via DEB package.
-
G_CHECK_URL "$INSTALL_URL_ADDRESS"
can be used to check if the URL is actually available. -
Download_Install "<URL>"
includes the URL check, downloads the resource and automatically installs DEB packages or extracts archives, based on file type. -
aDEPS=('<pkg_name1>' '<pkg_name2>' ...)
can be used to have APT packages installed in parallel to the resource download, if required. This has to be defined prior toDownload_Install
call to be handled. - See the comments above the
Download_Install()
function declaration for more details.
if To_Uninstall 52 # Cuberite
then
Remove_Service cuberite 1 1 # removes the "cuberite.service" ($1), a user ($2) and a group ($3) with the same name
[[ -d '/mnt/dietpi_userdata/cuberite' ]] && G_EXEC rm -R /mnt/dietpi_userdata/cuberite
fi
- Similar to install/config code but runs when software the title has been selected for uninstall.
- Purge related APT/DEB packages, remove created services, users, files and directories.
- The
Remove_Service
function is a shortcut for removing any systemd and init.d service given by the first argument. The second argument is an optional username which shall be removed, or1
if it matches the service name. The 3rd argument is an optional group name to remove, or1
if it matches the service name.
Project management
Extend
- DietPi-Software list
- DietPi TCP/UDP port usage list
- How to add a new software title
- How to create a DietPi image for Raspberry Pi
- How to create a DietPi image for VirtualBox
- How to create a DietPi image for VMware
- How to create a DietPi image for Parallels (macOS)
- How to create a DietPi image for x86_64 PCs (BIOS)
- How to create a DietPi image for x86_64 PCs (UEFI)
Knowledge Base