70 Commits

Author SHA1 Message Date
Tom Dewey
fb48183f0d
Expand trap cleanup function (#773)
* build.sh: Unmount intermediates on trap

Iterate through image files which might be in use and detach them

Avoid silent failures - let the user know whether the build failed

* common: update unmount_image

Use udevadm settle instead of sleep if possible

Use losetup's -j option to find the loop device associated with a give image file

* build.sh: update clean-up trap term

---------

Co-authored-by: Serge Schneider <serge@raspberrypi.com>
2024-05-15 15:50:40 +01:00
Serge Schneider
d87f764fcb build.sh: Warn user of unsupported build environment architecture and fail early if binfmt_misc isn't working as expected 2024-05-13 16:10:11 +01:00
Serge Schneider
e95e00f879 Set a default IMG_NAME
This also adds the 'ARCH' environment variable, which will help reduce the delta between master and arm64 branches.
2024-05-13 16:10:11 +01:00
Kristof Nachtergaele
5780b1ff64 export stage list 2024-04-29 10:52:50 +01:00
Mark Spatz
502e5fa0e3
Remove QCOW2 build mechanism (#648) 2024-02-23 04:19:10 +00:00
Stefan Becker
d966897395
README.md: add PI_GEN_RELEASE (#720)
This is the text written to "/etc/issue.txt" by update_issue(). The
default is the name used by official Raspberry Pi builds.

Fixes #719
2023-10-23 12:11:43 +01:00
Serge Schneider
8dd23cbc1d Remove dhcpcd and associated options 2023-09-25 15:04:19 +01:00
Serge Schneider
6aca615037 Switch to Bookworm 2023-09-25 15:04:19 +01:00
Serge Schneider
c3083ecd50 Add parameter to keep cap_setfcap
Fixes #643
2022-11-08 12:04:12 +00:00
Serge Schneider
549681f6e2 Updates to avoid common pitfalls when changing the RELEASE variable
Fixes #635, fixes #645, fixes #632
2022-11-08 11:29:37 +00:00
kralo
f00b72208c
apt/retries: specify option from the Acquire group (#638)
per man apt.conf, Acquire group is not part of the apt group
2022-10-14 14:48:30 +01:00
Romain Bazile
01b2432007
Create a DISABLE_FIRST_BOOT_USER_RENAME flag to be set in config (#618)
Closes #614
2022-06-17 15:45:08 +01:00
Serge Schneider
95ac3cfb3b Remove default password 2022-03-18 15:03:23 +00:00
Romain Bazile
5d044ba71b
Addition of a DEPLOY_COMPRESSION option to the configuration (#592) 2022-03-01 16:23:42 +00:00
Romain Bazile
8862e4d9ff Add check and warning for a space presence in the base path 2022-02-02 14:12:39 +00:00
Serge Schneider
c393ef105e Strip trailing spaces 2022-02-02 14:04:25 +00:00
Serge Schneider
68fee340f9 Do not use qcow2 images by default 2021-11-08 08:44:36 +00:00
Serge Schneider
d9b4a4a985 Switch to bullseye 2021-10-05 16:59:28 +01:00
Serge Schneider
2f12cf985a Remove IMG_DATE from work directories 2021-09-21 16:36:26 +01:00
Holger Pandel
bf8c9f5383
Add QCOW2 build mechanism (#349) 2021-02-10 10:37:15 +00:00
Daniel F. Dickinson
c1a7dae113
Enable adding SSH pubkey and setting pubkey only (#380)
This commit add the ability to specify an SSH public key as well as the
option to disable password authentication and only allow public key
authentication for SSH.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2020-09-08 21:16:07 +01:00
DragonEagle
08fc0b9a82
Exposed RELEASE as a configurable variable (#391)
Exposed RELEASE as a configurable variable and updated README.md.  As a
bonus, there is only on place to change the release name when the next
release is stable now.
2020-02-26 13:36:39 +00:00
Luigi F. Cruz
38d22e976a
Retry apt downloads 3 times
Fixes #194
2020-02-20 17:18:50 +00:00
Serge Schneider
24bb01dec2 Rename HOSTNAME variable to TARGET_HOSTNAME
Bash sets the HOSTNAME variable, overriding our default
2020-01-21 17:45:22 +00: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