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

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

Closed
Fourdee opened this issue Sep 1, 2016 · 9 comments
Assignees
Labels
Enhancement 💨 META Everything that is not code related, e.g. GitHub, Wiki, website, community
Milestone

Comments

@Fourdee
Copy link
Collaborator

Fourdee commented Sep 1, 2016

As per @zone22's suggestion: https://github.com/Fourdee/DietPi/issues/168#issuecomment-244120375

@Fourdee Fourdee added this to the v130 milestone Sep 1, 2016
@Fourdee Fourdee self-assigned this Sep 1, 2016
@Fourdee
Copy link
Collaborator Author

Fourdee commented Sep 2, 2016

@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/master/dietpi/dietpi-obtain_hw_model

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 referenced this issue Sep 2, 2016
+ Soruce code contribs, add software to dietpi-software:
https://github.com/Fourdee/DietPi/issues/490
@Fourdee Fourdee closed this as completed Sep 2, 2016
@ghost
Copy link

ghost commented Sep 6, 2016

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
Copy link
Collaborator Author

Fourdee commented Sep 6, 2016

@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/

@svh1985
Copy link
Contributor

svh1985 commented Sep 9, 2019

dietpi-software list | grep 'index Current' does not work anymore. Not sure how to solve tho :)

@MichaIng
Copy link
Owner

@svh1985
You can use dietpi-software free now to obtain the first free software ID that can be used for the new implementation.
See the new HowTo in wiki: https://github.com/MichaIng/DietPi/wiki/How-to-add-a-new-software-title

@MichaIng MichaIng added the META Everything that is not code related, e.g. GitHub, Wiki, website, community label Sep 11, 2019
@foxy82
Copy link

foxy82 commented Jun 4, 2021

Note: Install_Dietpi_Software() is now called: Install_Software()
And: Install_Apply_Configs() is now called: Configure_Software()

@MichaIng
Copy link
Owner

MichaIng commented Jun 4, 2021

Many thanks. With last DietPi update, it has changed quite a bit. I'll update that page.

@Joulinar
Copy link
Collaborator

Joulinar commented Jun 4, 2021

I guess whole wiki section we would need to rework. https://github.com/MichaIng/DietPi/wiki/How-to-add-a-new-software-title
Or should it go to docs?

@MichaIng
Copy link
Owner

MichaIng commented Jun 4, 2021

I'm currently updating the Wiki. I think for now it's okay to keep such contributor/dev infos in the Wiki, as there is no developer section in the docs.

EDIT: Done: https://github.com/MichaIng/DietPi/wiki/How-to-add-a-new-software-title

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💨 META Everything that is not code related, e.g. GitHub, Wiki, website, community
Projects
None yet
Development

No branches or pull requests

5 participants