Commit Graph

164 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
748f23269b Check for the existance of /etc/inittab before attempting to modify it. 2019-06-13 16:23:36 +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
28a1802136 Enable lock debug. 2019-05-27 18:55:37 +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
4810a3be14 Add --timestamp and --sha1 to specify these explicitly.
Useful for setting up a build tree populated by packages from a previous build.
2019-05-09 12:58:08 +00:00
Jeffrey Townsend
071c4d5b2e Packages that fail the distcheck() should not be loaded. 2019-05-02 16:00:40 +00:00
Jeffrey Townsend
03cb360bc1 Powerpc must now pull from archive.debian.org instead of normal mirrors. This is just a quick fix to be revisited properly. 2019-03-25 17:31:25 +00:00
Jeffrey Townsend
ddc89a3325 Initial 2019-03-04 13:40:22 -08:00
Jeffrey Townsend
51a237dabe Modify permissions when dropping ASR data into a parent directory. 2019-02-06 18:33:05 +00:00
Jeffrey Townsend
bcd9cfd792 Add the debian release number as part of the image name. 2019-02-04 20:43:24 +00:00
Jeffrey Townsend
c07892d3a2 Add the contents of /etc/os-release under separate key in the rfs manifest. 2019-02-04 19:53:57 +00:00
Jeffrey Townsend
d554708b87 Merge pull request #479 from OrdnanceNetworks/fix-onlversion-subst
mkinstaller.py: Substitude ONLVERSION in installer.sh.in template
2018-12-26 09:09:56 -08:00
Jeffrey Townsend
96a697bdcc Tool updates to support armhf. 2018-12-25 15:42:07 +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
1e9fbe9932 Merge branch 'master' of github.com:opencomputeproject/OpenNetworkLinux into iproc-4.14
Conflicts:
	packages/base/any/kernels/modules/ym2651y.c
	packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts
	packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-54/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts
2018-12-20 07:34:35 -08:00
Sergey Popovich
ce306bfe03 mkinstaller.py: Substitude ONLVERSION in installer.sh.in template
To show ONL version at image installation time add --onl-version
option to mkinstaller.py and pass VERSION_STRING to it.

Fixes: 9a98e40c09 ("Use the new mkinstaller script.")
Signed-off-by: Sergey Popovich <sergey.popovich@ordnance.co>
2018-11-07 00:03:42 +02:00
Jeffrey Townsend
789324a016 Enhance for custom includes for kernel module builds. 2018-10-26 00:08:13 +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
Wataru Ishida
4f803704b1 rfs: fix bug that bash doesn't return on error
bash doesn't respect -ex flags when it is not written in the first line

Signed-off-by: Wataru Ishida <ishida@nel-america.com>
2018-07-13 14:59:47 -07:00
Jeffrey Townsend
5c10874cf4 Allow multistrap config sections to be filtered by architecture. 2018-06-26 21:58:15 +00:00
Wataru Ishida
a681cf6c81 Support building systemd based system
Signed-off-by: Wataru Ishida <ishida@nel-america.com>
2018-05-31 19:41:23 -07:00
Jeffrey Townsend
95917ac48a Small operational improvements. 2018-05-07 16:52:53 +00:00
Jeffrey Townsend
78f953c2fb Add REPO/gitignore. 2018-05-06 19:26:12 +00:00
Jeffrey Townsend
553fbbabfa Initial tool to create NOS repository frameworks based on ONL. 2018-05-06 19:12:22 +00:00
Jeffrey Townsend
fbb7f751a8 Handle directory creation collisions hit during parallel builds. 2018-05-03 19:09:40 +00:00
Jeffrey Townsend
a91f3d7e8f Merge branch 'add-arm64-lts4.9-and-nxp-layerscape-platforms' of github.com:shengzhou/OpenNetworkLinux 2018-04-26 06:53:08 -07:00
Jeffrey Townsend
dce188731e Unbork resolv.conf processing. 2018-04-24 16:38:00 +00:00
Shengzhou Liu
1215e014a0 Update for arm64 on builder9 and arm64-nxp-layerscape struct
Signed-off-by: Guo Hanyue <guo.hanyue@nxp.com>
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@nxp.com>
2018-04-24 13:46:35 +08:00
Jeffrey Townsend
1297ea341e Clean the REPO prior to transfer. 2018-04-20 14:10:52 +00:00
Jeffrey Townsend
c50b4bf705 Add verbose option. 2018-04-18 17:03:13 -07:00
Jeffrey Townsend
c43e647c02 Allow a package to declare its desired symlink behavior. 2018-04-18 16:35:26 +00:00
Jeffrey Townsend
b0f4a6f209 Fix resolv.conf restoration. 2018-04-15 23:39:29 +00:00
Jeffrey Townsend
43d76e58f6 RFS Management Enhancements
This is a baby step in reorganizing the RFS tools to support arbitrary automation and modification after
the initial multistrap configuration has been performed.

- All RFS modifications are now done under the new OnlRfsContext object.
  - This object mounts/unmounts /dev and /proc
  - This object installs and removes the local resolv.conf so network operations
    can be performed in the chroot context.
2018-04-15 22:43:43 +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
e37acae2f7 Disable logfile.: 2018-03-18 16:03:46 +00:00
Jeffrey Townsend
04cc75fc76 Add profiling for ASR generation. 2018-03-16 09:08:21 -07:00
Jeffrey Townsend
21d00075c4 Rudimentary profiling and color enhancements. 2018-03-16 09:06:56 -07:00
Jeffrey Townsend
0b6da573ab Update default versioning scheme for development and release builds.
- Development builds will be marked with the branch and build id.
- Release builds will contain the specific release name and
  a simplified system issue string.
2018-03-14 16:31:31 +00:00
Carl D. Roth
55615155b3 Incremental update/install support
- also add a '--no-configure' flag
2018-02-28 17:41:46 -08:00
Carl D. Roth
7aa876cda4 Enable the --lookup feature 2018-02-28 17:41:16 -08:00
Jeffrey Townsend
316351ce1b Use ONL relative paths. 2018-01-21 20:04:07 +00:00
Jeffrey Townsend
e129347af6 Add an option to enable root accounts after filesystem creation
This is a minor hack. The code should be rearranged to allow
a more natural workflow to modify filesystems post-creation.
2018-01-21 19:09:06 +00:00