Commit graph

78 commits

Author SHA1 Message Date
cmitu
5503e7372f image: switch to LZMA for compression
Using LZMA (xz) for compression instead LZ77 (gzip) reduces the image size by approx 30% more. Image writing utilities with compressed image support (RPI Imager, Balena Etcher) already support it and the RaspiOS or Armbian images are already distributed as `.xz` files.

Changed our image compression format from `.gz` to `.xz` and thus reduce the download size for all images.
2024-07-21 06:31:00 +01:00
Jools Wills
12cfe1b2b8 image - fix chroot path for create_image 2023-10-16 20:36:39 +01:00
Jools Wills
d46a068fb0 image - use distribution name for default chroot location
When making a chroot use the distribution name rather than the default $md_build/chroot

Require the chroot location parameter for the chroot, init and deinit functions.

Adjust the _get_info function so it can be used directly from the builder module.
2023-09-30 20:24:03 +01:00
Jools Wills
522aeea4ab image - use bootfs for boot partition name 2023-08-15 17:09:33 +01:00
Jools Wills
d82f9a1ffa image - use "dmsetup remove" to remove device mapper files
kpartx doesn't seem to reliably remove the loopback device mapper files it creates.
2023-08-08 19:09:58 +01:00
Jools Wills
f5ad10136b image - rework logic to use ini configuration for distributions
New function _get_info_image reads values from the distribution ini configuration files stored in image/dists

This simplifies the code and avoids having logic for different versions in multiple functions.

The ini format is as follows - it may change and be extended in the future.
The filename is the dist name that is passed into the building functions.
The current images now have a prefix "rpios-"

 * name: name of distro - eg buster
 * version: rpios/debian version
 * url: url for image file
 * format: format of the image file - currently supported is zip and xz (used by raspberrypi.org)
 * platforms: list of the platforms supported (eg. rpi1 rpi2 rpi3 rpi4)
 * file_PLATFORM (name to be used in the image file for each platform)

 * title_PLATFORM (user friendly name of file for each platform - used for rpi imager json)
2023-08-08 19:09:58 +01:00
Jools Wills
b15685b609 image - build additional rpi3 images for bullseye
For bullseye we have separate binaries for the rpi3.

Adjust image naming accordingly.
2023-08-08 19:09:42 +01:00
Jools Wills
2a10ecc42d image - disable 64bit kernel 2023-08-05 19:43:59 +01:00
Jools Wills
1b0adad8a9 image - set password and disable userconfig in chroot
Set the "pi" password in the chroot install script rather than via userconfig.txt.

Disable the Raspberry Pi OS userconfig service for now. This stops the code to rename user after partition resize.
This would also disable autologin (with a var/lib/userconf-pi/autologin) file, but since our set-up doesn't currently
work with renaming the user RetroPie was installed for due to some hardcoded paths on install, it's safer to bypass this functionality.

Enable getty@tty1.

Note: Have tested with RPI-Imager, which when using a local image, checks it and thinks it can be configured.
This also resolves this case where it would allow a username change.

In the future we may be able to change the few config paths that are hardcoded to allow configuration of the user via RPI-imager.
2023-07-30 20:58:48 +01:00
Jools Wills
425807c10c image - use the mke2fs config from the chroot for ext4 filesystem
This ensures the filesystem is created with supported features if images are created on a system with a newer mkfs.ext4.

Remove metadata_csum disabling as it's no longer needed with above changes (and was added for compatibility with Jessie).

Disable 64bit ext4 feature as with the Raspberry Pi OS images.
2023-07-30 20:58:00 +01:00
Jools Wills
4e48d65e8a image - use fat32 for boot partition and remove unneeded boot flag 2023-07-30 20:58:00 +01:00
Jools Wills
01b5697709 image - only set gpu_mem on buster for rpi1-3 2023-07-30 20:58:00 +01:00
Jools Wills
fc7eb75d7b image - add distribution parameter to install_rp
The parameter ordering has changed - install_rp takes the parameters platform, dist, and chroot.
If platform and dist are not included an error is shown. chroot location defaults to "$md_build/chroot".

Move the default username/password setting for bullseye to the install_rp function.
2023-07-30 20:58:00 +01:00
cmitu
c5562d30ed image: pre-set the default user on RPI OS (11)
Raspberry PI OS images have added a first-boot wizard to change the default username/password [1].
In order to skip this step and keep the (former) default username 'pi', add a 'userconf.txt' to preset the info needed for the default user.

[1] https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022
2023-03-18 20:30:03 +00:00
Jools Wills
f36e8f2edf dosbox-staging - fix building for armv6
The speexdsp meson wrap enables armv7/neon instructions when building for armv6 (Raspberry Pi 1). This causes compilation to fail.

Patch meson.build to disable the simd option for older arm platforms (that don't have the neon platform flag).
2022-10-21 12:40:54 +01:00
Jools Wills
1aa7823511 image / create_chroot - support OS images that are compressed with xz
Image files for Raspberry Pi OS buster (oldstable) and bulleye are now single files compressed with .xz instead of the zip files used previously.

Add support for decompressing xz as well as an additional check to make sure the image was extracted ok before continuing. Added return codes to the function.
2022-05-03 19:02:27 +01:00
Jools Wills
e1506e15a6 image - update rpi2 image name/meta data to include Zero 2 W 2022-01-24 06:42:12 +00:00
Jools Wills
e12f285667 image - updated buster raspios lite image url
Buster is now being supported as the "oldstable" release and newer downloads are available via

https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf_latest redirect
2022-01-24 06:36:01 +00:00
Jools Wills
259d94a2bb image / create_chroot - update buster image location, and add entry for bullseye.
Default to "buster" if no dist parameter is provided.

Raspberry Pi OS bulleye based image is now out, and is the default image so we needed to update the URL
for buster to the last archived version.
2021-11-09 17:43:21 +00:00
Jools Wills
44be8542eb image - use download function 2021-01-21 05:20:29 +00:00
freddii
4ac341ac9f
fixed some incorrectly spelt words (#3293) 2021-01-21 02:32:29 +00:00
Jools Wills
668270774d image - generate json file for rpi-imager on image creation 2020-11-04 21:59:57 +00:00
Jools Wills
24430a3b51 image - remove tmp as root to avoid leaving behind tmp/build 2020-10-31 22:08:28 +00:00
cmitu
4d720b382f image: update the URL for latest Buster image 2020-05-29 14:44:55 +01:00
Jools Wills
52f6aadc01 image - consistent quoting / one case of missing quotes for $chroot 2020-03-19 02:29:43 +00:00
Jools Wills
753d699b10 image - enable for arm and various fixes
* only use qemu-arm-static for x86
 * remove qemu-arm-static from chroot in _deinit function
 * remove leftover comment that should have been removed
2020-03-19 02:25:43 +00:00
Jools Wills
47249dc0e6 Revert "image - avoid updating packages on image build to avoid upstream issues"
second thoughts - we actually already handle remove ssh host keys, and set autologin after. I partly misread
some error logs, and though this may have helped a situation, but actually we need the latest packages really,
and certainly when building based on older images like stretch.

This reverts commit 211fa81841.
2020-03-17 03:43:28 +00:00
Jools Wills
211fa81841 image - avoid updating packages on image build to avoid upstream issues
when upstream image is out of date, some package updates can cause issues - eg udev conflicts with auto login, and openssh-server generating host keys (we don't want to ship with any keys pregenerated)
Although some of these can be circuvented, it's easier to just leave updating to the user for now - I may revisit this.
2020-03-17 01:13:41 +00:00
Jools Wills
6cca2b9afa image - add parameter to generate berryboot images (disabled by default) 2020-03-02 01:28:33 +00:00
Jools Wills
238e91c4fd image - enable rpi4 image building by default (with stretch inclusion)
* change an exit to a return 1
2019-12-25 23:12:38 +00:00
Jools Wills
cf5c76ce35 Merge remote-tracking branch 'retropie/master' into fkms_rpi4 2019-12-23 06:43:28 +00:00
Jools Wills
6bf025f025 image - remove old qemu hack to force newer cpu for rpi0/1
* was added due to old qemu bugs with arm1176 - but will cause issues with bins for newer cpus. Suspect it's also no longer needed but will do some testing
2019-12-23 05:49:33 +00:00
Jools Wills
852de22632 image - adjust image naming to support rpi4 platform 2019-12-19 05:50:02 +00:00
Jools Wills
018a8b0aad image - added __chroot_branch for configuration of RetroPie-Setup branch for image building 2019-12-19 05:23:32 +00:00
Jools Wills
d1433cef45 image - added __chroot_has_binaries for development to pass __has_binaries into chroot 2019-12-19 05:14:03 +00:00
Jools Wills
9afa9b1088 Merge remote-tracking branch 'retropie/master' into fkms_rpi4 2019-11-06 06:18:16 +00:00
Jools Wills
7c6c2a3ae4 image - include raspbian version name in image target
* use $dist rather than $version as variable name for clarity
2019-11-06 05:43:02 +00:00
Conn O'Griofa
bbf7513564 image: don't set custom gpu_mem allocation for mesa targets
The RPI VC4/VC6 drivers use the kernel CMA heap allocation for GPU memory
(which defaults to 256MB on 1GB+ targets) instead of the gpu_mem allocation.

Although the gpu_mem allocation is still used, it's needed only for camera and
hardware decoders, but the default allocation (~64-76MB) is sufficient.

Without this change, we are losing ~192MB of user-addressible kernel memory
for no reason.
2019-10-28 16:40:31 +00:00
Jools Wills
e80b54fbac image - cosmetic - remove space 2019-10-20 01:24:07 +01:00
Jools Wills
70e6f4c605 image - allow manual setting of nameserver for chroot 2019-10-20 01:20:04 +01:00
Tarek Soliman
d8ffee64ba image: really set boot partition to 256MiB
The Pi4 Buster recommendation is actually 256MiB but the script was creating
a much smaller boot partition (240MiB)  because of two bugs:

- parted mkpart units defaults to MB not MiB for input (256MiB is 268MB)

- parted's parameters are `start` `end` not `start` `size`. We need to specify
  260 as an end because the start is 4

I changed the default unit to MiB because while explicitly specifying 260MiB
is possible, specifying units on mkpart disables parted's helpful range of
sloppiness.
2019-09-08 03:24:12 -05:00
cmitu
f5b00bb20e image: boot partition should be 256Mb now
The Pi4 Buster recommendation is for a larger boot image:
* https://www.raspberrypi.org/blog/buster-the-new-version-of-raspbian/#comment-1510398

Upstream `pi-gen` has been updated also with the new size:
* 0308e92705
2019-07-17 17:48:05 +03:00
Jools Wills
f14ab65e8d image - backup/restore /etc/ld.so.preload in chroot to avoid warnings
* this happens with buster image (also was an issue before with wheezy)
2019-06-25 02:44:42 +01:00
Jools Wills
6894fc48e0 image - raspberrypi.org now uses buster as their default image
* switch stretch location to last stretch lite image
 * add buster image
2019-06-25 02:13:11 +01:00
Jools Wills
c8f921675a usbromservice - move to optional packages
* on desktop systems doing a "basic install" the usbromservice may not be wanted
 * make sure we install it when creating our image again
2019-03-27 17:00:35 +00:00
Conn O'Griofa
23526148de image: add binfmt-support to depends
This is required for chroot via qemu-user-static.
2019-03-02 19:41:32 +00:00
Conn O'Griofa
f374b766f7 image: don't assume hardcoded dev mapper node
Recent distributions are unlikely to allocate /dev/mapper/loop0* due to
the presence of snapd mounts on a standard desktop installation.
2019-03-02 19:19:06 +00:00
Jools Wills
abef070131 image - move default gpu_mem and overscan_scale settings out of the ES module and into image creation
* users may want to change these and not have them reset to defaults when updating ES.
2018-12-05 15:30:50 +00:00
Jools Wills
438fd413b5 image - missing $ in temp dir var name 2018-04-14 18:52:07 +01:00
Jools Wills
9d7ac23ce1 image - reworked module to be more flexible so it can be used from other code
* rename chroot to create_chroot
 * add new chroot function
 * use mktemp for temporary location names when building images
 * allow choosing of image path and chroot location
2018-03-20 04:34:28 +00:00