Commit Graph

37 Commits

Author SHA1 Message Date
449d43e182 Exclude ifupdown as it slows down boot 2024-11-11 10:59:20 +00:00
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
Pev
d790fed832 Compare mount output using base of dirname (#771)
* Compare mount output using base of dirname

If you're building from a bind-mounted directory, the build will
fail as it will find two entries to unmount, but a single unmount
will remove them both causing an error. Adding a space means that
the mountpoint will only match with a single mount entry ; the
expected path, rather than the pre bind-mount.

* Switch to awk instead of mount, grep, cut pipes

Retry unmount 5 times and give up, letting the user know that they need to resolve the issue manually

---------

Co-authored-by: David Peverley <pev@analogue-micro.com>
Co-authored-by: Serge Schneider <serge@raspberrypi.com>
2024-05-15 15:45:43 +01:00
c029146a13 ensure_loopdev_partitions: let udev settle 2024-02-26 14:04:17 +00:00
1377e903b8 Ensure loop device partition nodes are created (#741)
Although the loop block device is created before attaching the image
to it, the devices for the partition that the image contains are still
not created. This patch creates those devices as well, when they are
not already available.

Fixes #482

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2024-01-04 11:05:51 +00:00
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
446f3e34c8 Adds call to mknod if loop dev does not exist after call to losetup -f (#483) 2023-08-17 16:24:47 +01:00
4e92753982 Use tmpfs for chroot /run and /tmp 2023-03-29 07:56:32 +01:00
1d13a292a7 use a single partitioned loop device (#641) 2022-11-11 08:56:04 +00:00
c3083ecd50 Add parameter to keep cap_setfcap
Fixes #643
2022-11-08 12:04:12 +00:00
40f67ce4ba Install ca-certificates during bootstrap
Fixes #424
2022-01-14 09:12:38 +00:00
6d2d36e7f2 Don't try to use qemu-debootstrap
Fixes #563
2022-01-14 09:11:46 +00:00
456aa2e50b bootstrap: do not install the info package 2021-10-05 17:26:51 +01:00
f9d44edb72 Copy debootstrap.log on failure 2021-06-22 15:48:09 +01:00
19c0188798 Ensure debootstrap runs through 'sh' rather than 'bash'
This fixes #338 and fixes #294
2019-10-30 13:31:07 +00:00
18b945ffb2 Moved git-hash determination to passed in build variable (#273) 2019-08-11 16:44:00 +01:00
f86cb0d54a script/common: Handle aarch64 host builds 2019-06-07 19:51:08 +01:00
7068086c94 Make sure unmount_image finds stale loop devices
Fixes #257 #104 #193

Instead of searching by full path, which is prone to fail, read full list and grep on filename.
2019-02-18 12:01:00 +00:00
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
3b90b7ffed Improve bootstrap() function in common script
* Tidy up and simplify function code
* Allow to pass extra arguments to debootstrap, e.g. `--variant minbase`
* Preserve compatibility with existing function calls
2019-02-18 09:21:10 +00:00
4fc1423fdf scripts: do not ignore errors inside on_chroot calls 2018-11-08 12:12:04 +00:00
f8b629d6c7 Check /debootstrap exists before trying to remove 2018-10-15 09:12:13 +01:00
7ccf8185b3 Remove /debootstrap 2018-10-11 16:29:31 +01:00
ff2d5edee1 shellcheck 2018-03-13 12:50:50 +00:00
530b66fd3f bootstrap: cope with NFS and FUSE filesystems 2017-06-20 16:17:12 +01:00
8e377c407f stage0: Verify Releases during bootstrap
Fixes #5
2017-05-10 13:09:20 +01:00
6c146a7bb7 Clean up clean up 2017-04-03 16:01:13 +01:00
667318116a Added Docker support (#40)
* Added Docker support

- replaced necessity for devicemapper (through kpartx) by using parted and
  losetup with offsets
- added Dockerfile
- added dependency for parted and grep
- added hints to README.md
- common: loop through unmounts, fix shellcheck warnings

* stage2: use debconf instead of console-setup patch. Fixes #41
2017-01-23 12:44:03 +00:00
c4fb032d3b Use capsh to ensure file capabilities aren't set 2016-11-14 23:55:45 +00:00
017d3a4341 rsync single file system (#25)
If proc is mounted in rootfs (e.g., via chroot), rsync will try copying kcore
when permitted to cross file system boundaries.
2016-10-09 22:09:25 +01:00
d1f766d2b8 Fix umount_image (#22)
* export-noobs/prerun.sh: Use nested mountpoint

While it seems elegant and intuitive to use separate bootfs and rootfs
mountpoints for compressing the partitions, doing so violates a
precondition of unmount_image that they be mounted as a tree.  This
causes the image to not be properly unmounted and detached.  A better
solution might be to pack up the previous stage's chroot directory, but
that rework can wait for the time being.

scripts/common.sh: Output device name correctly

A misplaced ) in unmount_image caused the loop device to be incorrectly
identified, resulting in a fair bit of chaos trying to unmount other
filesystems on /dev/mapper devices.  Such as / on a LUKS-encrypted
installation, for example.  The unmount will fail as it should and
build.sh will abort the build without any cleanup.  Best to avoid that.

These changes close RPi-Distro/pi-gen#19
2016-10-06 10:14:43 +01:00
cc5a65723c Add NOOBS export support 2016-05-27 11:54:56 +01:00
b61c63db8f common: Fix issue date 2016-05-05 14:55:53 +01:00
aca321fd70 Various fixes 2016-05-04 19:52:13 +01:00
612c1a73f1 Add missing /dev/pts
Missing /dev/pts causing "Can not write log, openpty() failed (/dev/pts not mounted?)"
2016-04-27 10:33:04 +01:00
2701f10c90 Initial build script 2016-04-11 07:21:07 +01:00
25b7d54af5 Setup initial layout 2016-04-08 03:32:06 +01:00