-
-
Notifications
You must be signed in to change notification settings - Fork 494
How to add a new software title
#------------------ Desktops: LXDE ------------------
software_id=23
aSOFTWARE_NAME[$software_id]='LXDE'
aSOFTWARE_DESC[$software_id]='ultra lightweight desktop'
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
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 if/where the software is listed. "0" will be listed in the "Software Optimised" menu. "1" will be listed in the "Software Additional" menu. Choose "-1" if the software should be not listed in any menu, e.g. if it shall be only pulled as dependency, via choice- or preference system.
Choose a category under which the software title should be listed in the menu. This depends on aSOFTWARE_TYPE
"0" or "1". See the aSOFTWARE_CATEGORIES_DIETPI
(TYPE=0) and aSOFTWARE_CATEGORIES_LINUX
(TYPE=1) arrays in the current DietPi-Software script for available categories.
Every software title should have it's documentation page in the DietPi forum: https://dietpi.com/phpbb/viewtopic.php?p=5#p5
Add the URI arguments of the post as string to this array entry: 'p=<post_id>#p<post_id>'
The <post_id>
can be found as very last integer of the URI, when selecting the post in your web browser.
Add required software titles to be install priorly. Currently available:
aSOFTWARE_REQUIRES_ALSA
aSOFTWARE_REQUIRES_XSERVERXORG
aSOFTWARE_REQUIRES_DESKTOP
aSOFTWARE_REQUIRES_RSYSLOG
aSOFTWARE_REQUIRES_FFMPEG
aSOFTWARE_REQUIRES_JAVA_JRE_JDK
aSOFTWARE_REQUIRES_NODEJS
aSOFTWARE_REQUIRES_BUILDESSENTIAL
aSOFTWARE_REQUIRES_GIT
aSOFTWARE_REQUIRES_WEBSERVER
aSOFTWARE_REQUIRES_PHP
aSOFTWARE_REQUIRES_MYSQL
aSOFTWARE_REQUIRES_SQLITE
For more specific dependencies add a custom entry to the function: Install_Flag_Prereq_Software()
Define if the installation process requires manual 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):
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
software_id=52 # Cuberite
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
# x86_64
if (( $G_HW_ARCH == 10 )); then
INSTALL_URL_ADDRESS='https://builds.cuberite.org/job/Cuberite%20Linux%20x64%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz'
# 32bit ARM
elif (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then
INSTALL_URL_ADDRESS='https://builds.cuberite.org/job/Cuberite%20Linux%20raspi-armhf%20Master/lastSuccessfulBuild/artifact/Cuberite.tar.gz'
fi
Download_Install "$INSTALL_URL_ADDRESS" $G_FP_DIETPI_USERDATA/cubrite
# - Move everything into base directory (cuberite)
mv $G_FP_DIETPI_USERDATA/cubrite/Server/* $G_FP_DIETPI_USERDATA/cubrite/
rm -R $G_FP_DIETPI_USERDATA/cubrite/Server
fi
-
software_id
needs to match the one chosen above. -
(( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 ))
checks if the software title is marked for install (=1). -
Banner_Installing
to print an informational banner. -
INSTALL_URL_ADDRESS
is usually used to define a download URL. -
G_CHECK_URL "$INSTALL_URL_ADDRESS"
can be used to check if the URL is actually available. -
Download_Install "$INSTALL_URL_ADDRESS"
includes the URL check, downloads the resource and automatically installs DPKG packages or extracts archives, based on file type. -
DEPS_LIST='<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.
software_id=80 # Ubooquity
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Configuration
useradd -rM ubooquity -G dietpi -s /usr/sbin/nologin
mkdir -p $G_FP_DIETPI_USERDATA/ebooks $G_FP_DIETPI_USERDATA/comics
chmod +x $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar
cat << _EOF_ > /etc/systemd/system/ubooquity.service
[Unit]
Description=Ubooquity (DietPi)
After=dietpi-boot.service network.target
[Service]
User=ubooquity
WorkingDirectory=$G_FP_DIETPI_USERDATA/ubooquity
ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --libraryport 2039
[Install]
WantedBy=multi-user.target
_EOF_
fi
- Similar to install code but used to create run users, set permission, create systemd units and/or adjust program settings, if required.
software_id=34 # Subsonic
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
G_AGP subsonic
getent passwd subsonic &> /dev/null && userdel -rf subsonic
[[ -d /var/subsonic ]] && rm -R /var/subsonic
fi
- Similar to install/config code but runs when software titles has been selected for uninstall.
- Purge related APT/DPKG packages, remove manually created run users, files and directories.
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