Commit Graph

47 Commits

Author SHA1 Message Date
Daniel F. Dickinson
3f2ff883c3 Allow customizing exports (images) and document
There are use cases where pi-gen can be useful that need different
image generation that the current defaults.  Rather than force such
users to require carrying modified versions of the default exports,
allow users to specify alternate exports (e.g. instead of export-image
and export-noobs, or in addition to these).  We do this using a
mechanism similar to STAGE_LIST, except that the lists of images are
per-stage and default to paying attention to the presence of
EXPORT_IMAGE and EXPORT_NOOBS as is currently the case.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2020-01-16 09:59:52 -05:00
Sam Tygier
9d334bee66 WPA_PASSWORD length check should only occur if set
Test if WPA_PASSWORD is set before check that it has a valid length.
2020-01-08 08:59:55 +00:00
Sam Tygier
024840034e Check WPA_PASSWORD length early
WPA_PASSWORD needs to be between 8 adn 63 characters. Check early
to avoid hitting error in stage2.
2020-01-07 08:07:48 +00:00
Leander
5456c3801f Explicitly check if postrun script exists in BASE_DIR (#351) 2019-11-26 15:03:47 +00:00
Leander
5e19033387 Remove accidental trailing brace (#348) 2019-11-18 14:38:54 +00:00
Leander
7f143a185e Export base directory before loading config file (#347) 2019-11-18 13:32:16 +00:00
Rene Klootwijk
d30343f626 Added hostname parameter 2019-11-05 17:21:33 +00:00
Joshua Bussdieker
d1f7a38905 Support regional config settings (#323) 2019-08-14 11:26:55 +01:00
Kevin Stone
18b945ffb2 Moved git-hash determination to passed in build variable (#273) 2019-08-11 16:44:00 +01:00
Russ Kubes
4ca539cb45 Fix build.sh to run dependencies_check prior to using curl. (#299) 2019-07-01 13:17:12 +01:00
Serge Schneider
a90b6bd094 build.sh: run quilt upgrade before editing patches 2019-06-07 15:41:33 +01:00
Hugo Hromic
407663a57f Silence shellcheck warnings (#279)
* SC1091: the `config` file might not be present, which is normal.
* SC2086: Double quote to prevent globbing and word splitting.

Tested clean output using: `find -name "*.sh" -exec shellcheck -x {} \;`
2019-04-25 10:11:57 +01:00
samtygier
b7812278a8 Warn early if proxy not reachable (#262)
Avoids a later failure with a less informative message. See #248
2019-02-18 23:41:41 +00:00
Hugo Hromic
564f8ef1b8 Silence shellcheck warnings (#255)
* Made more specific shellcheck disables
* Fixed variable quoting (SC2086,SC2064)
* Use `$*` expansion instead of `$@` when not using arrays (SC2124)
* Use cleaner `$()` syntax instead of back quotes (SC2006)
* Improved comparator (SC2166)
* Minor improvements in coding style

Tested clean output using: `find -name "*.sh" | xargs -n1 shellcheck -x`.
2019-02-18 12:54:15 +00:00
Hugo Hromic
9e6af47045 Improve update_issue() function in common script
* Allow to customise pi-gen script name and repository in the generated issue file
* Preserve compatibility with existing function calls
2019-02-18 09:21:10 +00:00
Louis Matthijssen
61a994c88c Add a DEPLOY_ZIP setting 2019-01-30 19:05:22 +00:00
Sam Tygier
9714a11204 Add username validation
Check that the username is valid before doing any work. Use the default regex from debian's adduser.conf. Will also avoid risk of special characters causing issues.
2019-01-22 17:44:28 +10:00
Błażej Sowa
d88f536536 IMG_SUFFIX evaluation in export image (fix #241) 2019-01-22 17:33:18 +10:00
Sam Tygier
d7ef46b06a Allow custom stages
STAGE_LIST can be specified in the config file to run additional build stages.
2019-01-07 12:49:45 +10:00
Błażej Sowa
d7ca8e8f14 Allow custom deploy zip filename 2018-12-21 04:11:13 +00:00
Błażej Sowa
08405eb792 Allow custom image filename 2018-12-21 04:11:13 +00:00
Sam Tygier
7fbfdda31e Add commandline argument for config file
A config file can be specified when running build, e.g.:

  ./build.sh myconfig
2018-12-21 04:09:47 +00:00
Sam Tygier
cc6605695d Allow enabling ssh server from config
Add ENABLE_SSH option
2018-12-21 04:09:47 +00:00
Sam Tygier
f4dc2dcce6 Allow setting up wifi from config
Add WPA_ESSID, WPA_PASSWORD and WPA_COUNTRY options to config.
2018-12-21 04:09:47 +00:00
Sam Tygier
d07096ebb5 Allow setting user name and password from config
Add FIRST_USER_NAME and FIRST_USER_PASS variables that can be set
in the config (or enviroment). Defaults to the standard pi and
raspberry.
2018-12-21 04:09:47 +00:00
David Steele
343cabc8f5 Remove quotes in globbed patch CLEANup (#168)
Globbing does not work within single or double quotes.
https://unix.stackexchange.com/questions/67757/wildcards-inside-quotes
2018-03-24 17:36:18 +00:00
Serge Schneider
ff2d5edee1 shellcheck 2018-03-13 12:50:50 +00:00
Ben Pirt
066eb03d52 Allow image building to be skipped for stages (#137) 2018-01-03 12:48:31 +00:00
Jacen
26fcf59f3f [adding] qemu emulation layout to test images with qemu 2017-09-14 10:12:30 +01:00
Thomas Phillips
50e5c01f57 Image build date now honours timezone 2017-06-27 13:06:50 +01:00
Mike Roberts
000e61f84d Updated {i}-run-chroot script filename to match {i}-run.sh format 2017-03-20 15:53:55 +01:00
David C Wang
16b3133f46 Make WORK_DIR and DEPLOY_DIR configurable through config file 2017-03-14 14:00:28 +00:00
Serge Schneider
8373e58195 build.sh: execute postrun.sh, if executable 2017-03-13 17:44:31 +00:00
Serge Schneider
1f1ddb5f13 Specify additional variables in EXPORT_* files 2017-03-13 17:39:58 +00:00
Serge Schneider
8e74b4f15c Revert "Enable pi-gen build when "pi-gen/work" dir is a symlink"
This reverts commit 40b5af925b.
2017-03-06 14:37:13 +00:00
David C Wang
40b5af925b Enable pi-gen build when "pi-gen/work" dir is a symlink
* Occasionally, it is necessary to symbolically link the pi-gen/work
  directory to a different place on the filesystem.  This is true if
  the current partition is low on space, or when building within
  vagrant virtual machine shared mounts which do not support all
  regular fs operations.
* Without this change, the pi-gen build will fail to unmount because
  the OS 'mount' command returns canonical paths which fails to match
  the symbolically linked path to 'work' dir.
2017-03-06 11:56:12 +00:00
Serge Schneider
c4fb032d3b Use capsh to ensure file capabilities aren't set 2016-11-14 23:55:45 +00:00
Serge Schneider
24ad8c2adb Revert 7f0c59d5c1 2016-10-14 15:00:12 +01:00
Greg MacLellan
7f0c59d5c1 Add MAX_STAGE and RUN_STAGE variables (#21)
* Add MAX_STAGES variable

If set, only runs up to that stage

* Show "Skipping stageX" message for all skipped stages

* Add RUN_STAGE variable to run a single stage

* Document RUN_STAGE and MAX_STAGE

* Removed SKIP file support for main stage
2016-10-05 09:32:03 +01:00
Joseph Carter
0245cbb958 Dependency checks + important bugfix (#16) 2016-09-14 20:07:52 +10:00
Joseph Carter
abc3e45727 build.sh: Support comments in package files (#14)
* build.sh: Support comments in package files

This patch allows the use of hash comments inside patch files.  It's a
little ugly, but it strips comments and collapses all whitespace down to
single space characters between package names.  It handles comments
anywhere in a line, as well.

Was unsure if \ continuation of the long sed line or the inclusion of a
couple of lines of comments explaining what the sed expressions are
doing would be appreciated, so didn't include them in this patch.

* build.sh: whitespace fix

* build.sh: Use sed script for packages files

Broke the sed expressions out of build.sh and put them their own
documented sed script.  This greatly improves readability and avoids
build.sh getting messier.

Broke the substitution command into two separate subs.  The first just
deletes comments, and the second collapses all whitespace into a single
space.  This too is easier to read, and catches a couple of edge cases
that would result it not all whitespace being collapsed.  The result may
still have (one) leading and/or trailing space, which is acceptable.
2016-09-08 06:32:36 +10:00
Staroselskii Georgii
9b0a793dfb build.sh: fix for patchsets with same names in substages
In that case (i.e. stage2/01-sys-tweaks and stage2/02-net-tweaks) a
directory with a same name (00-pc) is getting created for both quilt
patch sets. This might yield a situation when second patch set is not
applied.

The fix is to come up with a more sophisticated naming convention for intermediate
patchset directory (which .pc symlinks to) and create separate
directories for each patchset.
2016-07-29 18:51:55 +03:00
Serge Schneider
cc5a65723c Add NOOBS export support 2016-05-27 11:54:56 +01:00
Serge Schneider
de878cc217 build.sh: fix patches 2016-05-05 16:55:35 +01:00
Serge Schneider
aca321fd70 Various fixes 2016-05-04 19:52:13 +01:00
Serge Schneider
2701f10c90 Initial build script 2016-04-11 07:21:07 +01:00
Serge Schneider
25b7d54af5 Setup initial layout 2016-04-08 03:32:06 +01:00