Commit Graph

120 Commits

Author SHA1 Message Date
Alex Simkin b47445c990 add CRYPTROOT_AUTOUNLOCK option and fix CRYPTROOT for uefi builds
fixes #6280
2025-11-02 20:15:19 +01:00
Jianfeng Liu d890a4b3f3 partitioning: allow single root partition for all filesystem type 2025-10-17 19:33:52 +02:00
Rolf Leggewie aec8988419 lib / partitioning.sh: remove some whitespace at end-of-line 2025-09-04 01:59:32 +08:00
Mecid 02fb49bced Make the Partition Type UUID if-chain more readable 2025-09-04 01:59:32 +08:00
Mecid Urganci 61526350f3 Partitioning UFS: Add rockchip support 2025-09-04 01:59:32 +08:00
Ricardo Pardini fa0d9ab820 rootfs-to-image: do not use --sparse, it's _very slow_ on certain IO/FS combos
- Revert "rootfs-to-image: preserve sparse files when moving artefacts to final destination with rsync"

This reverts commit 4fd0e0c29d.
2025-05-29 17:55:27 +02:00
alex3d df6a133a14 partitioning: fix compressed BTRFS creation 2025-05-18 17:43:21 +02:00
Franklyn Tackitt 4a8199b992 partitioning: Use btrfs set-default MOUNT/subvolume
This simplifies the code, removing the need to grep/cut the output of btrfs subvolume list
2025-05-05 06:15:50 +02:00
Franklyn Tackitt 76470b1dad partitioning: Rely on the btrfs default subvolume for remounting
This allows changes to the default subvolume in `btrfs_root_add_subvolumes`
 to propagate as needed into the final image.
2025-05-05 06:15:50 +02:00
Franklyn Tackitt 9f37e55980 partitioning: Add BTRFS_ROOT_SUBVOLUME switch
This allows changing the default root subvolume from @ to any user
 defined subvolume name
2025-05-05 06:15:50 +02:00
FantasyGmm 76229701ca Adding Variables to Set the Sector Size for UFS Devices 2025-04-19 13:19:13 +02:00
Igor Velkov ab6587ac05 If rootfs placed on btrfs filesystem, place root on @ subvolume
It makes possible to work with snapshots of a root filesystem
2025-04-16 23:33:07 +02:00
Igor Pecovnik ec2544e005 Bugfix: Remove directories from sha files 2025-02-10 20:17:25 +01:00
Igor Pecovnik 5cc3e2e872 Fix handling loop devices 2025-01-08 13:17:47 +01:00
Ricardo Pardini 6755e9190a don't ship qemu binary in rootfs cache + armhf image/rootfs building on non-armhf-capable-arm64 hosts (Apple M1+)
- refactor `prepare_host_binfmt_qemu()` out of `prepare_host_noninteractive()` and into `rootfs/qemu-static.sh`
  - further split into more functions and return early to avoid deep nesting
  - implement force import and load of qemu-arm for non-armhf capable arm64 hosts (incl magic numbers)
- enhance `deploy_qemu_binary_to_chroot()` & `undeploy_qemu_binary_from_chroot()`;
  - add 2nd param "caller" for better logging/tracking
  - does sanity-check and preserve existing binary if it exists
- explicitly deploy/undeploy for the 3 cases:
  - image: moved undeploy from `post_debootstrap_tweaks()` into image build proper for consistency
  - rootfs: was leaving trash behind (since post_debootstrap_tweaks never ran for rootfs), now properly undeploys
  - initrd: was already fine, just added caller info
- added `arch-test` host dependency
  - ensure `arch-test ${ARCH}` works during prepare-host
- > tl,dr: "can build 32-bit armv7 armhf using Apple silicon; can use rootfs cache cross-arch reliably"
2024-12-31 11:52:12 +01:00
Alex Shumsky 4fd0e0c29d rootfs-to-image: preserve sparse files when moving artefacts to final destination with rsync 2024-12-24 22:33:51 +01:00
M.Schmidt 6607728e24 improve(lvm,cryptroot): export private key with a structurally equal naming scheme; cleanup 2024-12-13 10:01:19 +01:00
M.Schmidt 590b75fd6f improve(lvm+cryptroot extensions): enable possibility for LVM on LUKS 2024-12-13 10:01:19 +01:00
M.Schmidt 3ec24d40e8 fix(lvm,cryptroot extensions): introduce another variable to keep track of the physical partition/uuid and rootdevice/uuid seperately 2024-12-13 10:01:19 +01:00
user 502e139598 New option: CRYPTROOT_MAPPER. Make ROOT_MAPPER name for CRYPTROOT changable. 2024-11-05 16:35:02 +01:00
user 817519210b Fix partitioning root UUID bug in /etc/crypttab. 2024-11-05 16:35:02 +01:00
rafael dcff6cf71d fixes #7210 for extensions that modify rootdevice 2024-09-14 21:44:52 +02:00
Igor Pecovnik 8ee40367d4 Revert "Store list of preinstalled extensions EXTENSIONS and add VENDORPRETTYNAME to image fingerprint"
This reverts commit 9af94d5977.
2024-09-08 16:22:02 +02:00
Igor Pecovnik 9af94d5977 Store list of preinstalled extensions EXTENSIONS and add VENDORPRETTYNAME to image fingerprint 2024-09-03 22:03:04 +02:00
ColorfulRhino b8dbe607e5 partitioning: Declare `rootpart` as local variable
The others like `uefipart` and `bootpart` are also defined as local var. Establish consistency.
2024-08-05 20:39:57 +02:00
ColorfulRhino 1092d60d3e partitioning: Set correct partition type UUID for root filesystem
Previously, only the type "Generic Linux filesystem" was used.
Use the correct type "Linux root ($ARCHITECTURE)" for the root filesystem.
2024-08-05 20:39:57 +02:00
ColorfulRhino a027c4be37 partitioning: Add check to use legacy BIOS boot partition with GPT only, not MBR
Exit with an error message if trying to add this partition to an MBR disk.
2024-08-05 20:39:57 +02:00
ColorfulRhino 01d8716bf9 partitioning: Output the partitioning options to the debug log 2024-08-05 20:39:57 +02:00
ColorfulRhino 0b6d61f4c4 partitioning: Add some comments to improve readbility 2024-08-05 20:39:57 +02:00
ColorfulRhino d638276fcc partitioning: Reduce `commit` mount option for btrfs and ext4 to 120
Mount option `commit=600` (=10 minutes) seems pretty high.
Reduce it to 120 for ext4 (default for ext4 is `commit=5`)
and 120 for btrfs (default for btrfs is `commit=30`) to reduce
risk of losing data on power loss.

Sources:
- https://www.kernel.org/doc/html/latest/admin-guide/ext4.html
- https://wiki.archlinux.org/title/Btrfs#Commit_interval
- https://btrfs.readthedocs.io/en/latest/Administration.html
2024-07-09 11:31:51 +02:00
Ricardo Pardini 1ff783d867 fix: partitioning: disable `orphan_file` (`FEATURE_C12`) for ext4 filesystems on 1.47+ e2fsprogs host
- otherwise:
  ```
  fsck.ext4 -a -C0 /dev/mmcblk0p1
  /dev/mmcblk0p1 has unsupported feature(s): FEATURE_C12
  e2fsck: Get a newer version of e2fsck!
  ```
- `orphan_file` can only be disabled on recent-enough e2fsprogs, thus check version and compare
2024-06-27 14:25:20 +02:00
Igor Pecovnik 75ce67f329 Run shellfmt to complete code 2024-06-22 19:22:24 +02:00
Alex Shumsky bbd5699e13 partitioning: fix race condition on loop device allocation 2024-06-21 22:14:01 -04:00
JohnTheCoolingFan 7da42c8a42 Revert "Added a call to losetup -f"
This reverts commit b3d9a17a57.
2024-05-20 15:58:51 +02:00
JohnTheCoolingFan b3d9a17a57 Added a call to losetup -f
See https://github.com/armbian/build/issues/6568
2024-05-20 08:51:39 +02:00
Ricardo Pardini 40371934d2 lib & config: give shellcheck directions (to /dev/null for dynamic, to repo-relative path for static) for all sourced references
- in preparation for tightening the shellcheck severity level
  - it needs to be able to follow all sources; dynamic ones are ignored, static ones need root-relative prefix
2024-05-19 19:41:35 +02:00
Igor 33906869c0
Improve loop devices management by allocating random free device instead of next one (#6345) 2024-03-06 01:09:54 +01:00
BlitzKrieg 85eced8d64 Adds --partscan parameter to losetup command for forcing the kernel to scan partition table. #6333 2024-03-02 21:00:55 +01:00
Rafael 94d4c007d1
Feature lvm support (#6204)
* using the configured volume group name
* added LVM support
* ensuring /boot never on LVM volume, created hook to setup root device
* preparing root device via extension, not assuming any particular partition for root
* using tab spacing
* using global parameter to require a boot partition
* using boot require, moving cryptroot code to extension
* adds crypt image suffix
---------

Co-authored-by: rafael <rvalle@privaz.io>
2024-02-01 20:01:58 +01:00
Alex Shumsky eee0d33bbc partitioning: allow to disable boot partition if bootloader known to support rootfs 2024-01-22 21:18:15 +01:00
Alex Shumsky 86a743ad83 partitioning: do not force image size estimation for (potentially) compressed btrfs rootfs 2024-01-22 21:18:15 +01:00
Igor Pecovnik 565a33d62d Add SWITCH to define XZ compression as a parameter and leave defaults as is 2024-01-17 13:08:13 +01:00
Ricardo Pardini c434c3613c core: semantic change, KERNELSOURCE must be explicitly 'none' to avoid kernel compilation (not unset) 2024-01-07 18:58:36 +01:00
Gunjan Gupta 1c3b7ec36c
Raspberry Pi: Added rpi5 support and removed flash-kernel dependency (#6039)
* Disable flash kernel and rearrage functions inorder they are executed
* Add board config for raspberry pi 5
* Change config.txt and cmdline.txt to match official rpi version
* Install Rpi related packages from Armbian repository
* Remove ddk branch aka RASPI (Ubuntu) kernel
* We still have unsupported releases, but for different reason
* Lower kernel output at booting to meet our other builds. Default is too mouch for end user
* Add more info where we import packages
* Add testing targets
---------
Co-authored-by: Igor <igor@armbian.com>
Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2023-12-17 16:48:22 +01:00
Gunjan Gupta c45a63e63b Add option to include home directory in the final image 2023-11-21 20:29:37 +05:30
Igor 6bcf74f2e7
Anonymize default build engine settings (#5865)
Improve naming confusion by changing build framework defaults. Set framework defaults VENDOR to Armbian-unofficial for self build images. Unsupported boards and unsupported distribution have framework defaults, except VENDOR and VENDORURL. We build images with predefined values.
2023-11-15 22:00:21 +01:00
Ricardo Pardini 28b87b0641 initrd: cache: add `/etc/modprobe.d` to cache key (eg for MODULES_BLACKLIST) 2023-11-15 00:32:16 +01:00
Ricardo Pardini 46728e94f2 rootfs-to-image: create_image_from_sdcard_rootfs(): ignore `/home` during rsync; fixes #5864 2023-11-06 16:17:21 +01:00
Ricardo Pardini 1f436bddba initrd: if debugging, don't filter update-initramfs output (errors might be lurking in there) 2023-10-31 08:08:06 +01:00
Ricardo Pardini bba856bb57 partitioning: efi: introduce `UEFI_MOUNT_POINT_SKIP_FSTAB`, if set to yes, skips /etc/fstab entry for the ESP
- sometimes we just don't want the ESP listed in the fstab, otherwise works the same
2023-10-14 00:03:12 +02:00