Skip to content

How to add files into platform

Jan Poctavek edited this page Oct 13, 2019 · 2 revisions

There are multiple places where you might want to add a file.

/opt/erigones

The simplest and best way is to add it into the esdc-ce repo. It will be present on all nodes and also inside mgmt01.local VM under /opt/erigones. The second advantage is that it will be automatically downloaded during upgrade of a new version.

USB key and management VMs

You have to add it into esdc-factory repo and add/modify appropriate ansible task to place the file there. The file will be placed into newly built images (VM and USB). Additionally, we want to keep the current installations in sync with new factory changes, so you should consider adding the change also into esdc-ce upgrade dir so the change will be applied with the upgrade (we are talking here about the OS changes, not changes in /opt/erigones, e.g. configuring a serial console inside management VM or adding a new service on a node into /opt/custom).

Platform (illumos/SmartOS) SMF service

Things from now onwards are not something you need to do every day because it is complicated enough to try to avoid it. The best way how to avoid it is to use the above (factory) method to add services into /opt/custom/smf. But if you want your service to be run early enough or to be part of something bigger (e.g. network milestone), you have to take this path.

This change goes into illumos-joyent repo. Find the appropriate (newest) branch. Then:

  • add xml descriptor and also shell script into usr/src/cmd/svc/milestone/
  • add the descriptor and script into the appropriate list in usr/src/cmd/svc/milestone/Makefile (e.g. network-related xml into NETSVCS; all scripts into SVCMETHOD)
  • add to projects/illumos/manifest

/root and skel files

Also illumos-joyent repo.

  • add file into usr/src/cmd/nsadmin/
  • add to the appropriate list into usr/src/cmd/nsadmin/Makefile
  • add to projects/illumos/manifest

/usr/sbin and simmilar stuff

This goes into smartos-live repo, checkout the newest branch.

  • place your script into src/ (including the .sh/.js/.d extension that will be automatically stripped during install)
  • add into src/Makefile:
  1. into BUILT_TARGETS
  2. into cp command in install: all $(SUBDIRS) target
  • add into src/manifest (no need to add it into illumos manifest)
  • see as an example e.g. fssstat command

/etc

On a running system, this directory is non-persistent (on a ramdisk) so if you want to add or modify something here, it has to be already in the platform during boot.

The smartos-live repo again, checkout the newest branch.

  • copy the file into src/etc
  • add to src/Makefile into ETC_TARGETS
  • if you need to create a directory, see and modify the part inside src/Makefile where ETC_TARGETS moved into place (add your new directory name there)

/etc/issue and /etc/motd

These are very special files that are templated during install phase. The most common replacement is the build number.

It's in the illumos-joyent repo.

  • add/modify the usr/src/cmd/Adm/sun/issue.in
  • string 00000000T000000Z will be replaced by actual build number
  • also version number is replacable, see the Makefile/scripts in that directory

Next steps

After doing the modifications, you have to do things according to the repo:

  • esdc-ce: tag a new version number (for consistency, the tag should be created in all repos - esdc-ce, esdc-factory, esdc-docs, esdc-shipment, smartos-live, illumos-joyent). After that everybody can upgrade to this version. If you want the new version to be publicly visible (e.g. in GUI after click on Get latest version) add it to the version list.

  • esdc-factory: build a new DC version (USB image or management VMs + USB image).

  • smartos-live or illumos-joyent: build a new SmartOS platform, then change the platform number in the esdc-factory, download the new platform and build a new USB.

Clone this wiki locally