71 Commits

Author SHA1 Message Date
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
Serge Schneider
f1c166a283 export-image: run du with -x to avoid crossing filesystem boundaries
Fixes #537
2024-04-29 14:37:36 +01:00
Serge Schneider
3b5e214f5e export-image: format boot partition with appropriate FAT size 2024-03-13 18:16:30 +00:00
Mark Spatz
502e5fa0e3
Remove QCOW2 build mechanism (#648) 2024-02-23 04:19:10 +00:00
Serge Schneider
c20ce09fac export-image: make sure initramfs is created
Fixes #749
2024-01-30 14:43:17 +00:00
Vasilis Tsiligiannis
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
Serge Schneider
ae81834945 export-image: Add issue.txt symlink 2023-11-29 01:32:10 +00:00
Serge Schneider
c856800c72 Switch to new kernel and firmware packages 2023-09-25 15:04:19 +01:00
Serge Schneider
4a4a66ed36 export-image: auto-remove and purge packages on dist-upgrade 2023-09-25 15:04:19 +01:00
bamartin125
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
Serge Schneider
5d2c6f31ce export-image: change boot partition lable to 'bootfs'
Fixes #669
2023-02-14 15:09:57 +00:00
rfc6919
1d13a292a7
use a single partitioned loop device (#641) 2022-11-11 08:56:04 +00:00
Serge Schneider
6a61be9295 Disable first run wizard if DISABLE_FIRST_BOOT_USER_RENAME is set 2022-09-22 13:06:38 +01:00
Serge Schneider
00da85177c Adjust partition formatting and mount options
Format the root partition with the metadata_csum option

Format the boot partition with 4 sectors per cluster for a slight performance boost

Remove 'flush' mount option from the boot partition
2022-06-17 15:48:27 +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
b0316ae870 Enable userconf-pi on first boot 2022-03-21 08:37:25 +00:00
Romain Bazile
5d044ba71b
Addition of a DEPLOY_COMPRESSION option to the configuration (#592) 2022-03-01 16:23:42 +00:00
Holger Pandel
bf8c9f5383
Add QCOW2 build mechanism (#349) 2021-02-10 10:37:15 +00:00
Serge Schneider
0f59f0085a export-image: get apt lists from public repo 2020-11-17 15:22:12 +00:00
kdoren
d1596451b9
workaround build failure on AWS M6g instances (#449) 2020-09-23 19:54:37 +01:00
Serge Schneider
0a6624b26d Update ROOT_MARGIN 2020-01-24 12:48:57 +00:00
Matthijs Kooijman
99f702f0ff Use parted for partitioning (#285)
Previously, fdisk was used by sending commands into its stdin, which is
not very robust (since it heavily relies on the interactive prompts
offered by fdisk as well as the default values it offers, which seem
prone to changing in future version).

It seems likely that in the past, fdisk was easier than parted since it
provides default values that make it easier to create adjacent
partitions, without precalculating all positions in the script. However
now that partitions are manually being aligned, all data must be
calculated anyway.

This commit changes the partition generation to use parted rather than
fdisk. For this, it rewrites various calculations and renames variables
to be easier to read as well. All values are now in number of bytes,
rather than mixing bytes and sectors.

This commit also makes makes sure that the boot partition and root
partition are always adjacent (previously the root partition was aligned
without also rounding the boot partition size, leaving some empty space
in between).

As a side effect of using parted, this also causes the "bootcode" part
of the MBR to be filled with some default x86 bootcode. This is totally
irrelevant for booting the Raspberry Pi, but it does prevent triggering
a bug in parted. When using parted to change the partition table (e.g.
when resizing the root partition on first boot by raspi-config's
init_resize.sh), the disk identifier would be changed due to this bug,
which would change the PARTUUID of all partitions. The init_resize.sh
script would work around this by updating the PARTUUID in e.g. fstab,
but that's fragile at best.  This commit prevents the bug from
triggering and keeps the disk identifier the same.

See https://debbugs.gnu.org/35714 for details about this parted bug.

This commit fixes #284.
2019-09-25 13:46:38 +01:00
Russ Kubes
00c22ab57e Updated export-image to not depend on fake-hwclock and hardlink. (#326) 2019-08-27 18:16:24 +01:00
Serge Schneider
e8460beb3b Revert "export-image: Remove interfaces.dpkg-old"
This reverts commit a016561600292047971b65d034f0e6eaeadd1122.
2019-08-14 15:54:50 +01:00
Serge Schneider
a016561600 export-image: Remove interfaces.dpkg-old 2019-08-14 15:28:12 +01:00
Serge Schneider
0cdec86026 Disable ld.so.preload while building 2019-06-07 19:51:08 +01:00
Serge Schneider
afeea46a39 export-image: remove /etc/network/interfaces.dpkg-old 2019-06-07 19:51:08 +01:00
Serge Schneider
0308e92705 export-image: Set /boot size to 256MB 2019-06-07 15:54:22 +01:00
Serge Schneider
22c8878f5d Remove Oracle Java 2019-06-07 15:49:18 +01:00
Serge Schneider
0552ef239b Update to Buster
Remove ui and staging components
2019-06-07 15:45:15 +01:00
Hugo Hromic
8acf95f237 Do not assume the changelog file is always present for the info file (#280)
The `(..)/raspberrypi-kernel/changelog.Debian.gz` file is not guaranteed
to be present in the built `ROOTFS_DIR`, for example when building very
minimal images without package documentation. In these cases, the `firmware`
variable will be left empty and the subsequent calls to `curl` will return
large 404 HTML content from GitHub.

Instead, simply check if the changelog file exists before using it.
2019-04-25 10:28:48 +01:00
Andrew Scheller
30a1528ae1 Switch to using parted's machine parseable output (#270) 2019-03-18 14:49:18 +00:00
Sam Tygier
82bcfa427a Use different rsync options for boot and root
When copying files to boot, options that are not supported on fat32 can cause errors. For example owner, group and xattrs.
2019-02-18 09:45:10 +00:00
Louis Matthijssen
3961bff8a4 Decrease zerofree verbosity
Fixes #251
2019-01-30 20:49:45 +00:00
Louis Matthijssen
61a994c88c Add a DEPLOY_ZIP setting 2019-01-30 19:05:22 +00:00
XECDesign
d945d422d4
Update 00-run.sh
Fix typo
2019-01-23 15:32:08 +00:00
Błażej Sowa
d88f536536 IMG_SUFFIX evaluation in export image (fix #241) 2019-01-22 17:33:18 +10:00
rkubes
189b8f0400 Fixed a hard reference to the 'pi' user name 2019-01-15 12:16:42 +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
Hugo Hromic
fea9e2945a export-image: clean additional backup files (#186) 2018-06-04 09:43:42 +01:00
David Steele
555417bbe6 Fix some quoted globs in export-image cleanup (#173) 2018-03-26 13:06:10 +01:00
Serge Schneider
ff2d5edee1 shellcheck 2018-03-13 12:50:50 +00:00
Serge Schneider
4d689a25fd export-image: don't round up if already a multiple of 4MB
Fixes #156
2018-03-01 18:02:01 +00:00
James Ruan
40eae05204 make root filesystem 4M aligned (#154) 2018-03-01 17:52:26 +00:00
Serge Schneider
c430f618d0 Remove ld.so.preload and policy-rc.d changes 2018-03-01 15:54:12 +00:00
Serge Schneider
aa8731012e Round image size up to nearest 4M block 2017-11-24 10:12:08 +00:00
Andrew Wedgbury
35994f5d9c Remove /etc/vnc/updateid when finalising 2017-11-22 15:49:37 +00:00
XECDesign
31fcc80953
Fix typo in export-image
Fixes #132
2017-11-07 05:43:01 +00:00
XECDesign
90adfb1551
Label root partition
Fixes #131
2017-11-06 10:53:05 +00:00