Deployment of upstream library sources

Norman Feske norman.feske at ...1...
Mon Feb 9 11:54:39 CET 2015

Hi Roman,

> Just out of mere curiosity, there isn't yet (and in near future won't
> be) a way to create such a port list with additional version
> information? This way it's not necessary to reproduce the working
> directory of the offline computer on the online computer in order to
> download the correct versions of the ports.

there is more to the preparation procedure than downloading archives
from the right URLs. E.g., for some ports, the source code is obtained
directly from their respective Git or Subversion repositories. Even for
archives, the mere information about their URLs is not sufficient in the
general case. On the server side, someone might replace an archive with
a different version but keep the same file name. The port tool would
detect such a change by comparing the SHA checksum of the downloaded
archive with a known-good value (as contained in the port-description file).

All the version information (including SHA checksums of archives, or Git
revisions) of the ports is contained in the port-description files along
with their hash files. You can obtain a list of all those files via

  cd genode
  find -mindepth 4 -name "*.port" -or -name "*.hash"

The information contained in those files generally suffices for
downloading the 3rd-party code. However, in addition to downloading and
extracting code, the port tool also applies patches (depending on the
actual port) as part of the preparation procedure. Those patches are
located within the Genode source tree and have the suffix '.patch'.

Given this information, it is possible to create a tar archive with the
exact subset of the Genode's source tree needed to exercise the
prepare-port procedure. The archive must contain the following:

* The port-description files along with their hash files (as printed
  by the command above)
* The port tools (located at 'genode/tool/ports')
* All patches ('find -mindepth 4 -name "*.patch"')

The following command assembles such an archive:

  cd genode
  tar cfz genode_3rd.tgz \
     `find -mindepth 4 -name "*.port" \
                   -or -name "*.hash" \
                   -or -name "*.patch"` \

When transferring the resulting 'genode_3rd.tgz' archive to your online
computer, you will be able to perform the preparation of all ports using
the 'tool/ports/...' tools contained in the archive. The resulting
'contrib/' directory can then be transferred to your offline computer.

That said, I guess the intention behind your question is to keep your
custom code (you are referring to as "working directory") separate from
the upstream Genode repository. I think the best way to achieve that
would be to host your custom code in an entirely different repository
and keep the Genode source tree clean from your custom code. To
integrate your code with Genode, you can create a symlink
'genode/repos/romans_code' pointing to the location of your custom
repository. This approach has three benefits:

* It keeps your code well separated from Genode's upstream code.

* It allows you to use a revision control system of your choice to
  manage your code. I.e., if you prefer Mercurial over Git, you
  can use your preferred tool for your code.

* You will never need to transfer your private repository (or parts
  thereof) to the online computer in order to prepare 3rd-party
  software. Information always flows from the online computer to the
  offline computer but not vice versa.

Best regards

Dr.-Ing. Norman Feske
Genode Labs ·

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth

More information about the users mailing list