DietPi-Software | Explain how to add new installations to the sourcecode (for contributors) #490

Closed
Fourdee opened this Issue Sep 1, 2016 · 3 comments

Projects

None yet

1 participant

@Fourdee
Owner
Fourdee commented Sep 1, 2016

As per @zone22's suggestion: #168 (comment)

@Fourdee Fourdee added the enhancement label Sep 1, 2016
@Fourdee Fourdee added this to the v130 milestone Sep 1, 2016
@Fourdee Fourdee self-assigned this Sep 1, 2016
@Fourdee
Owner
Fourdee commented Sep 2, 2016 edited

@zone22

Adding new software to DietPi-Software.

For this example we will add Owncloud to DietPi-Software:

To get a full list of current DietPi-Software installation options:

dietpi-software list

Obtain a unique installation Index for this software:

Run the following command, make a note of this number.

dietpi-software list | grep 'index Current'

A unique Index of 47 will be used in this guide.

Choose a category index for the software

https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-software#L265-L283
In this example, Owncloud will require "Cloud / Backups":

aSOFTWARE_CATEGORY_INDEX[$index_current]=4

Check pre-reqs. Does it require other software to be installed?:

https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-software#L357-L368
In this example, Owncloud will require:

aSOFTWARE_REQUIRES_WEBSERVER[$index_current]=1
aSOFTWARE_REQUIRES_MYSQL[$index_current]=1

Add the new Owncloud entry:

You should end up with the entry below:
https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-software#L709-L719

NB: By default, all installation options are enabled for all devices HW_MODEL and CPU Architectures HW_ARCH, full list: https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-obtain_hw_model#L14-L49

Example: disable the installation option for non-RPi devices
Add this code to the end of the Owncloud entry you did previously:
https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-software#L546-L552

Example: disable the installation option for x86_64 (Currently VM image):
Add this code to the end of the Owncloud entry you did previously:
https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-software#L588-L589

Add the installation code:

Inside function Install_Dietpi_Software()
https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-software#L2666-L2698

Add the configuration code:

Inside function Install_Apply_Configs()
https://github.com/Fourdee/DietPi/blob/96dbdc5b39957872e8e7d4230e0d25d7d8f8e765/dietpi/dietpi-software#L5322-L5388

Thats it.
If successful, your new entry will be available from dietpi-software optimized menu and dietpi-software list

@Fourdee Fourdee added a commit that referenced this issue Sep 2, 2016
@Fourdee v130
+ Soruce code contribs, add software to dietpi-software:
#490
851797c
@Fourdee Fourdee closed this Sep 2, 2016
@ghost
ghost commented Sep 6, 2016 edited

Note to others you can use FTPs to transfer your edited files into an existing Dietpi installs in for testing purposes. An alternative to using your own get repository testing branch.

@Fourdee
What are the files such as DietPi-Software written as?
I would like to set up a debugger but I'm unsure of what language per se to set up for.

@Fourdee
Owner
Fourdee commented Sep 6, 2016 edited

@Zone22

What are the files such as DietPi-Software written as?

Bash / Unix Shell.

As for debugging bash, the only one I know and use is: http://www.shellcheck.net/

This was referenced Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment