55 Commits

Author SHA1 Message Date
Jeffrey Townsend
09d70858d5 Add builder architecture check.
All available architectures in the current builder are collected and packages for architectures which are not supported
in the current builder instance are culled.

This is a much easier way to eliminate architectures that depend only on a given debian suite than
specifying the dists: key in the package file.

The dists keys are still used for packages which have additional restrictions (like kernels too old to compile with
newer toolchains, even if the architecture itself is supported).
2019-07-08 21:32:13 +00:00
Jeffrey Townsend
0df1c0e5aa Fix bug in add_package() when the realpath of the package contains an underscore.
When a package is added to the REPO any duplicates are supposed to be removed automatically.
The (package-name, version, arch) was determined by splitting the (fullpath) name by underscore.

If an underscore was present in any of the parent directories then the split did not yield
the correct information. As a result any duplicate packages were not removed and were instead
left in the REPO.

This fix splits the package basename instead of the package path.

You may now clone your ONL worktree as JEFF_IS_STUPID and it should work now.
2019-06-11 17:10:45 +00:00
Jeffrey Townsend
96aa9d850f Revert the no_build_missing change. 2019-05-29 10:47:10 -07:00
Jeffrey Townsend
caf8fb7fbf Automatically include local makefile. 2019-05-28 17:55:40 +00:00
Jeffrey Townsend
e3c67d6001 Package Build Fixes
- Fix the OnlPackageRepo lock.
  The lock for the package repo has always been broken for some requests due to the nested nature of some of the calls.
  This would cause the repo lock to be release prematurely in the middle of operations.
  This becomes obvious once large parallel package builds are enabled.

  The OnlPackageRepo class has been renamed to OnlPackageRepoLocked() and all locking has been removed.
  All operations performed by the OnlPackageRepoLocked() class are now assumed to be non-concurrent.

  The OnlPackageRepo class is now a wrapper around the OnlPackageRepoLocked class with acquires the lock
  prior to requesting any operations. This change is transparent to the callers but ensures
  that no nested locks (and premature unlocks) are performed.

- Improve the parallel makefile generation.
  - Set pipefail to that targets fail even with the log tee.
  - Allow packages with broken dependencies to set their stage explicitly.
  - Parallel package builds require that the package cache be treated as read-only.
  - Packages must specify their package prerequisites properly in their PKG file.
    - In order to detect and correct this situation packages will no longer
      be implicitly built as part of calls to onlpm find and link operations.
      We may be able to relax this restriction once the build is tight.

- Package Cache Corruption
  - If the package cache is corrupt (usually due to an aborted operation) then it we will
    automatically rebuild it instead of just whining about it.
2019-05-27 19:22:14 +00:00
Jeffrey Townsend
8b1dfdb4b8 Show the PKG_DEFAULT file generating an exception and allow dot versions. 2019-05-10 15:36:36 +00:00
Jeffrey Townsend
04c54acb14 Get the package defaults at initial yaml load time so the default dict can be used for all variables in the initial load. 2019-05-09 18:23:21 +00:00
Jeffrey Townsend
b00271f297 Improve Package Field Generation
Specifying useful package fields has been historically pretty lazy since most systems have been built as self-contained images without dynamic package updates.
This commit hopes to improve the situation.

The recommended package organization for ONL and for systems built with ONL as the base follow the pattern of $project/packages/base/$arch/* and $project/packages/platforms/$vendor/$arch/
The heirarchy of directories in which the packages reside also provide a natural inheritence heirarchy for debian package fields.

This property is now exploited to allow default package keys to be specified base on their location in the filesystem heirarchy as follows:

Before a PKG.yml file is evaluated its parent directory heirarchy is traversed looking for either or both of these files:

PKG_DEFAULTS.yml -- This is an onlyaml file which can specify the values of package keys.
PKG_DEFAULTS     -- If this file is executable it is expected to output valid yaml containing package keys.

All of these values are then combined in reverse order to provide a default dict for the package.

Example usages:
- Fields global to all packages in the project (like Vendor, Maintainer, Version [for coherent builds], maintainer, etc) can be specified in the top-most PKG_DEFAULTS.
- Archicture can be specified in the $arch/PKG_DEFAULTS.
- Platform Vendors can specify their information at the top of their platform directory.

By specifying your own PKG_DEFAULTS you can coexist the ONL versions and your own version without ineheriting any of the defaults from ONL itself.

These are only the defaults for keys not specified in the PKG file. You can still obviously override every field in each package declaration.

The ONL package files will be updated in a separate commit to use this new hierarchical approach.

Package version numbers, copyrights, and general information fields have all
2019-05-09 16:47:59 +00:00
Jeffrey Townsend
071c4d5b2e Packages that fail the distcheck() should not be loaded. 2019-05-02 16:00:40 +00:00
Jeffrey Townsend
ce19018897 Package Distribution Restrictions
Packages can now restrict the debian distribution for which they can build using the new 'dists' package key.
This is a csv list of distribution codenames. If the currently building distribution is not in the list then
the package is ignored.
2018-12-25 15:29:32 +00:00
Jeffrey Townsend
eea5db9aef Fix symbolic link handling in the 'links' package section.
The 'links' section specifies symbolic links which should be added to the package in key : value format.

The key is the source of the link. It must be exist in the filesystem already (as part of the 'files' section)
and be relative to the root of the filesystem.

The value is the name of the link, and can be relative or absolute to the final filesystem.

For example, given that a package produces the real binary "/usr/bin/foobar" and you want /usr/bin/foobar-link -> /usr/bin/foobar
it will be specified as follows:

    links:
        /usr/bin/foobar : /usr/bin/foobar-link
2018-08-08 01:20:06 +00:00
Jeffrey Townsend
fbb7f751a8 Handle directory creation collisions hit during parallel builds. 2018-05-03 19:09:40 +00:00
Jeffrey Townsend
c43e647c02 Allow a package to declare its desired symlink behavior. 2018-04-18 16:35:26 +00:00
Jeffrey Townsend
fca1b92a9f The postinst script now checks /usr/sbin/policy-rc.d
Some complicated service dependencies will fail to configure
under normal circumstances because invoke-rc.d will kill service
start based on policy-rc.d but this is not taken into account when
configuring services that are dependent on that service.

The dependency check fails prior to the policy-rc.d check and as a result
some packages will remain unconfigured after we have finished constructing
the root filesystem. This is ok for most cases but precludes dynamic modification
of that filesystem post-creation and will even cause
those unconfigured services to be restarted the first time a new package is
installed.

Checking policy-rc.d first in the postinst script allows the configuration
step to complete for all services and their dependents to fix these problems.
2018-04-15 22:32:34 +00:00
Jeffrey Townsend
fde45aafd7 Disable ASR generation by default. Packages using ASR must be updated explicitly. 2018-04-05 17:27:21 +00:00
Jeffrey Townsend
e740ba56ab Merge pull request #319 from carlroth/master
Developer optimizations for incremental rootfs builds
2018-03-19 07:23:02 -07:00
Jeffrey Townsend
04cc75fc76 Add profiling for ASR generation. 2018-03-16 09:08:21 -07:00
Carl D. Roth
7aa876cda4 Enable the --lookup feature 2018-02-28 17:41:16 -08:00
Andreas Rammhold
a4cefaf8f5 tools: use /usr/bin/python2 instead of /usr/bin/python
python3 is starting to become the default on all major distributions.
Using `/usr/bin/python2` should be safe for the near future.
2017-06-30 11:40:29 +02:00
Jeffrey Townsend
fbc38a58b5 Change extract message from warn to info. 2017-05-23 08:12:43 -07:00
Jeffrey Townsend
5b46c04e24 Allow absolute paths (relative to the package root). 2017-02-15 18:36:53 +00:00
Jeffrey Townsend
61f9268995 Allow optional files in package declarations.
Files listed in the new 'optional-files' key will be included if present
but will not report packaging errors if missing.
2017-02-15 15:58:31 +00:00
Jeffrey Townsend
d3a1f1546d Allow comma-separated package lists in prerequisites. Makes some templating easier. 2016-12-31 20:58:20 +00:00
Carl D. Roth
001aa48a45 Merge branch 'master' of github.com:opencomputeproject/OpenNetworkLinux
Conflicts:
	packages/base/all/vendor-config-onl/src/python/onl/install/BaseInstall.py
2016-11-04 16:02:18 -07:00
Jeffrey Townsend
d3c65d04dd Remove output. 2016-11-04 21:32:08 +00:00
Jeffrey Townsend
54e292f0ba Factor out file delivery so it can be shared between packaging and release. 2016-11-04 21:16:03 +00:00
Jeffrey Townsend
08977b8e4c Use new unified infra asr too. 2016-11-01 19:23:55 +00:00
Jeffrey Townsend
51f23a3c7a Make asre generation configurable. 2016-10-31 22:10:47 +00:00
Jeffrey Townsend
cd61449e52 Automatically generate ASRE documentation for each package. 2016-10-31 20:22:53 +00:00
Jeffrey Townsend
65af997801 Add support for priority, replaces, provides, conflicts, and virtual (all three). 2016-10-31 18:31:04 +00:00
Jeffrey Townsend
384f4d24b4 Support automatic service install/remove scripts. 2016-10-31 09:41:55 -07:00
Carl D. Roth
6f9d993696 the --extract option is unimplemented 2016-10-26 12:37:24 -07:00
Shengzhou Liu
1ed3041b9d Add arm64 support for build and installer 2016-08-17 00:57:01 +08:00
Jeffrey Townsend
3174eb6db1 Make the RELEASE directory customizable. 2016-05-20 14:53:45 +00:00
Jeffrey Townsend
0477d8d90d Init at INFO. 2016-05-17 12:47:28 -07:00
Jeffrey Townsend
76ed0a772c Merge branch 'master' of github.com:opencomputeproject/OpenNetworkLinux
Conflicts:
	builds/any/rootfs/jessie/common/common-packages.yml
	builds/any/rootfs/wheezy/common/common-packages.yml
2016-05-16 14:18:18 -07:00
Carl D. Roth
7a1a873985 Fixed whitespace in command args 2016-05-06 16:37:10 -07:00
Carl D. Roth
71e0cc65c2 Added list_platforms api call 2016-05-06 11:07:54 -07:00
Carl D. Roth
7c2bb91b7c Clean up onlpm and make it embeddable 2016-05-02 13:00:55 -07:00
Steven Noble
90f0218b57 Update REPO directories to match standard APT names binary-arch 2016-04-19 14:53:58 -07:00
Jeffrey Townsend
d9db525297 Merge pull request #67 from carlroth/master
Initial rollup of installer WIP
2016-04-13 14:25:03 -07:00
Carl D. Roth
d9ba34c606 Eanble verbose build 2016-04-13 13:52:19 -07:00
Jeffrey Townsend
4e2130a0e7 The package cache should be instanced per-distro.
The package caches contain paths relative to the distro name (from the $BUILD_DIR variable).
As such the cache can become invalid when switching in-place between distro containers.
Keeping the cache instanced per-container makes sure they don't contaminate each other.
2016-04-05 17:02:52 -07:00
Jeffrey Townsend
06568c9d64 Rename properly to armel. 2016-03-30 18:28:47 -07:00
Jeffrey Townsend
8f6e933b08 Add ARM architecture support to the build environment. 2016-03-30 18:13:31 -07:00
Jeffrey Townsend
b2b66c9885 Include parallel make flags. 2016-01-29 22:28:51 +00:00
Jeffrey Townsend
3298209d91 - Do not allow duplicate packages in the repository.
- Use correct extract path while invalidating on new package install.
2016-01-05 18:39:59 +00:00
Jeffrey Townsend
2b63fc6f78 Allow missing files key. 2015-12-16 20:46:23 +00:00
Jeffrey Townsend
04beeb594c Allow filtering by architecture list. 2015-12-16 00:54:19 +00:00
Jeffrey Townsend
79e626bb38 Build directories are now instanced per suite. 2015-12-15 12:04:19 -08:00