Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] OXT-1736 : do-build.sh zeus uprev and usability improvements #365

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

stacktrust
Copy link

This is a collection of usability improvements for the non-container build script. This is a precursor to adding support for OE multiconfig builds.

  • Check for bash on systems (e.g. Devuan) where default shell is not bash
  • Regenerate local.conf (with version strings) for every build
  • Create symlink to most recent build, useful for PXE boot package repo.
  • Enable "interactive" mode to skip log collection and use non-scrolling bitbake status
  • Enable memory-resident bitbake with short timeout for multiple bb invocations.
  • Example config: pyro -> zeus7, bitbake 1.34 -> bitbake 1.44
  • Remove unused code, initialize undefined variables

OXT-1736

Rich Persaud added 9 commits January 27, 2020 12:36
If /bin/sh is not symlinked to bash, some packages in the OpenXT
build will fail with non-obvious error messages. Before starting
the build, confirm that the default non-interactive shell is bash.
In Debian/Devuan, the default is dash.

Future improvement: identify and patch each offending package to
explicitly require bash in shell scripts. This would avoid imposing
the overhead of bash on all build scripts, at the cost of OpenXT
carrying patches until they could be upstreamed.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
Since bitbake is called multiple times by do_build, keeping it
memory resident for 30 seconds will reduce recipe parsing.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
For faster interactive use, retain bitbake interactive status
display instead of piping output to cumulative build log.
Skip release-oriented steps such as source ISO generation
generation and log compression.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
Remove logic for syncui and nilf/vpn vm, which are no longer built.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
Create a symlink (build-output/_do_build_latest) to the most recent
build output directory. This can be used to specify the location of
an HTTP package repository for PXE installs.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
local.conf contains version information that is embedded in
the OpenXT installer. It must be generated for each build.
Define filename as variable.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
Other OpenXT repos have been moved to OE zeus, do the same here.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
On build machines with multiple cores, bitbake can execute build
tasks in parallel.  These defaults should be modified to match the
number of cores on the build machine.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
Initialize some undefined variables identified by set -u.  Future
work: document original feature purpose, current relevance and whether
to remove or test/fix.

OXT-1736

Signed-off-by: Rich Persaud <[email protected]>
@stacktrust stacktrust force-pushed the oxt-1736-do-build-sh-uprev-and-usability-improvements-v2 branch from d099bda to 6436d4e Compare January 27, 2020 18:02
@@ -1,5 +1,9 @@
CONF_VERSION = "1"

# Enable parallel builds on multi-core machines
BB_NUMBER_THREADS ?= "4"
PARALLEL_MAKE ?= "-j 4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were removed in c6b7942 since bitbake sets a default.

# OpenXT build requires system shell to be bash
SYSTEM_SHELL=$(basename $(readlink -f /bin/sh))
[[ ${SYSTEM_SHELL} == "bash" ]] || \
{ echo "OpenXT build requires bash as system shell. Please symlink /bin/sh to bash"; exit 1; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build-scripts/oe/setup.sh suggests this which seems more debian friendly:

# Use bash instead of dash for /bin/sh
echo "dash dash/sh boolean false" > /tmp/preseed.txt
debconf-set-selections /tmp/preseed.txt
dpkg-reconfigure -f noninteractive dash

@@ -24,6 +24,9 @@ SYSTEM_SHELL=$(basename $(readlink -f /bin/sh))
# Keep bitbake memory-resident between invocations
export BB_SERVER_TIMEOUT=30

# Optional interactive use: set to 1 to disable logs
INTERACTIVE=0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems weird - just run MACHINE=... ./bb <recipe> from openxt/build manually? I expected to see a cli flag to enable this option.

@@ -100,16 +102,18 @@ do_oe_setup()
mkdir -p conf
fi

if [ ! -f "conf/local.conf" -o "conf/local.conf" -ot "conf/local.conf-dist" ]; then
cp conf/local.conf-dist conf/local.conf
# Force generation of local.conf with latest build version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace

if [ ! -f "conf/local.conf" -o "conf/local.conf" -ot "conf/local.conf-dist" ]; then
cp conf/local.conf-dist conf/local.conf
# Force generation of local.conf with latest build version
rm -f ${CONF_LOCAL}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clobber local.conf every time will lose customization. If you want changing build info, then many do something like bordel generating and including a separate file:
https://github.com/apertussolutions/bordel/blob/fed91e907435072ceab1309bcc8ab46454b93041/cmds/build#L24
https://github.com/apertussolutions/bordel/blob/008cf2793b229ad9b138ea12f6e450436f29cc8a/templates/master/local.conf#L97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants