Skip to content

Create a new work app

negan07 edited this page Jan 6, 2018 · 10 revisions

Packages

Packages are located in work dir. Work dir is divided in 4 main segments:

  • builtinlib: modified built-in shared libraries.
  • builtin: modified built-in apps.
  • thirdpartylib: additional libs not included into the original firmware.
  • thirdparty: additional apps not included into the original firmware.

A possible approach is as follows. Distinguish if:

1. app/package is already present on netgear's firmware source pack (builtin) (e.g. iproute2, utelnetd, nvram, ...)

2. app/package not present on netgear's firmware source pack (thirdparty) (e.g. netperf, opkg, ...)

3. a brand new one is to be created from zero (thirdparty) (e.g. ancistrus-core)

1) App/package is already present on netgear's firmware source pack (builtin/builtinlib)

Obtain the original source pack of the app: be sure to get the same version (usually not the last available).

Compare with diff -urN origpack netgearpack > pack.diff the sources coming from app developers and the one coming from netgear's sources.

Now fetch, download and unpack the latest version of the app.

Apply the pack.diff patch obtained before into the latest version of the app: sometimes may result very annoying and hard to do because code may have been changed deeply from both side and may need some programming experience.

Then make you own modification to run the app correctly, if needed.

If the app doesn't include a configure, adapt the Makefile including Rules.mak to use environmental variables (e.g. on root source dir include ../Rules.mak): use the other work apps as examples to follow.

If the app has a configure, the work Makefile will create a sub dir moving all files inside, so you have to create a main Makefile containing configure and all other stuffs: use the other work apps as examples to follow.

If needed, create the opkg controls script inside the main Makefile (see opkg documentation).

Test the app and when ready diff your own modified app with the original source app (dev's latest version, not the netgear one):

separate the patch .diff files in a logical way (see the other patches on diff dir as example to follow).

2) App/package not present on netgear's firmware source pack (thirdparty/thirdpartylib)

Fetch, download and unpack the latest version of the app.

Then make you own modification to run the app correctly, if needed.

If the app doesn't include a configure, adapt the Makefile including Rules.mak to use environmental variables (e.g. on root source dir include ../Rules.mak): use the other work apps as examples to follow.

If the app has a configure, the work Makefile will create a sub dir moving all files inside, so you have to create a main Makefile containing configure and all other stuffs: use the other work apps as examples to follow.

If needed, create the opkg controls script inside the main Makefile (see opkg documentation).

Test the app and when ready diff your own modified app with the original source app: separate the patch .diff files in a logical way (see the other patches on diff dir as example to follow).

3) A brand new one is to be created from zero (thirdparty/thirdpartylib)

Create your own app

(typically: bash/awk script or c program), create a Makefile including control files creation for opkg if needed and test it.