sof/installer
Marc Herbert c6edc5f51e New install/GNUmakefile to gradually replace scripts in sof-bin.git
More specifically replacing sof-bin/go.sh and sof-bin/publish.sh and
also sof/scripts/sof-target-install.sh eventually.

"make install" code has always belonged to source repositories because
developers need to install too and we want everyone to use the same
installers. It's also easier to have all the information in a single
place.

Once the layout in sof-bin mirrors the /lib/firmware/intel layout
exactly, sof-bin does not need any installation code any more.

Mixing source and binaries in the same repo is also a "code smell",
notably because it forces branching them together.

Using a higher level build tool for installation instead of plain
scripts has a few benefits:

- Multiple entry points: easy to invoke (and test) any part of the
  installer individually
- ... while invoking dependencies automatically.
- Other features "for free" like:
  - errexit
  - error messages like "dunno how to build file x"
  - commands are logged by default

- Also gets rid of most of the large code duplication in go.sh and
  publish.sh, so:
  - Enabling or disabling a platform is a 3-character change
  - Allows platform selection in local config file (even just one platform)
  - Much harder to add inconsistencies
  - Much easier to review correctness, for instance no need to
    scrutinize every line to see which platforms are aliased.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-16 11:23:28 +00:00
..
.gitignore New install/GNUmakefile to gradually replace scripts in sof-bin.git 2021-02-16 11:23:28 +00:00
GNUmakefile New install/GNUmakefile to gradually replace scripts in sof-bin.git 2021-02-16 11:23:28 +00:00
README.md New install/GNUmakefile to gradually replace scripts in sof-bin.git 2021-02-16 11:23:28 +00:00
sample-config.mk New install/GNUmakefile to gradually replace scripts in sof-bin.git 2021-02-16 11:23:28 +00:00

README.md

The GNUmakefile in this directory prepares /lib/firmware/intel/sof/ and /lib/firmware/intel/sof-tplg/ directories.

It extracts what's needed from the output of the scripts ./scripts/xtensa-build-all.sh -a and ./scripts/build-tools.sh -T -l; running these scripts is a pre-requisite.

It does not copy anything to /lib/firmware/ directly but to local, "staging" subdirectory first. The staging area can then be installed with rsync to a local or remote /lib/firmware/intel/ or to a release location. This gives an opportunity to inspect the staging area and avoids running everything as root.

The default target (re-)generates the staging area:

make -C installer/

Then, to install the staging area:

sudo make -C installer/ rsync

By default, the "rsync" target installs to the local /lib/firmware/intel/ directory. To install to a different host or different directory, copy the sample-config.mk file to config.mk and follow the instructions inside the file. config.mk can also be used to change the list of platforms installed and a number of other Make variables. As usual with Make, many parameters can also be overridden on the command line.

To stage and install in one go:

make -C installer/ stage rsync

"stage" is the default target and it tries to stage everything: firmware, dictionaries and topologies. As usual with Make, it's possible to invoke individual targets. Find a list of targets at the top of GNUMakefile.

Sample output:

staging/sof: symbolic link to sof-v1.6.1
staging/sof-v1.6.1/
├── community/
│   ├── sof-tgl.ri
│   ├── sof-cnl.ri
│   ├── sof-icl.ri
│   ├── sof-jsl.ri
│   ├── sof-apl.ri
│   ├── sof-cfl.ri -> sof-cnl.ri
│   ├── sof-cml.ri -> sof-cnl.ri
│   ├── sof-ehl.ri -> sof-tgl.ri
│   └── sof-glk.ri -> sof-apl.ri
├── intel-signed/
├── sof-bdw.ri
├── sof-cht.ri
├── sof-byt.ri
├── sof-cnl.ldc
├── sof-tgl.ldc
├── sof-icl.ldc
├── sof-jsl.ldc
├── sof-apl.ldc
├── sof-bdw.ldc
├── sof-byt.ldc
├── sof-cht.ldc
├── sof-apl.ri -> intel-signed/sof-apl.ri
├── sof-cfl.ri -> intel-signed/sof-cfl.ri
├── sof-cml.ri -> intel-signed/sof-cml.ri
├── sof-cnl.ri -> intel-signed/sof-cnl.ri
├── sof-ehl.ri -> intel-signed/sof-ehl.ri
├── sof-glk.ri -> intel-signed/sof-glk.ri
├── sof-icl.ri -> intel-signed/sof-icl.ri
├── sof-jsl.ri -> intel-signed/sof-jsl.ri
├── sof-tgl.ri -> intel-signed/sof-tgl.ri
├── sof-cfl.ldc -> sof-cnl.ldc
├── sof-cml.ldc -> sof-cnl.ldc
├── sof-ehl.ldc -> sof-tgl.ldc
└── sof-glk.ldc -> sof-apl.ldc