Commit Graph

140 Commits

Author SHA1 Message Date
hzyitc
9a004bfd52
Disable Github API in get_rootfs_cache_list (#4152) 2022-09-03 09:28:39 +02:00
hzyitc
6302958347
Typo in create_rootfs_cache version (#4149) 2022-09-02 20:47:39 +02:00
hzyitc
71f4e4091d
Refactor rootfs cache (#4080)
* Lint

* Rename: rootfs-cache for finding local cache easily

* Search local caches if we can't download any remote caches

* Use github api to get cache list instand of just try

* Use 0000 as default version to generate rootfs cache

* Use YYYYMMDD as rootfs version

* Rewrite the process

* Check local and remote cache at same time

* Add quote for jq to avoid a strange bug

* Remove creation of .current file

* Add package versions and silense debsums by default

* Typo

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2022-09-02 13:21:47 +02:00
hzyitc
ac20afc062
Fix nfs build (#4139)
* Tweak the size of NFS boot image to avoid no space while update_initramfs

* Bind mount root for update_initramfs when ROOTFS_TYPE=nfs
2022-09-01 23:07:14 +02:00
hzy
a9214fba77 Use a shorter label as the default value for bootfs.
mkfs.vfat doesn't support more than 11 characters LABEL
2022-08-19 14:03:40 +08:00
Igor Pečovnik
e871b8e2ea
Rootfs cache refactoring (#4057)
* First part of rootfs cache refactoring

* Add support for checking previous caches.

* New default starting number

* Move back to n

* Add zstd compressor to the host dependencies

* Change cache compression to ZST

* Cleaning cache support
2022-08-10 00:17:28 +02:00
hzy
a803fb15ab Bugfix: mkfs: flag for label 2022-08-06 12:05:21 +08:00
Igor Pečovnik
be8b2dcf01
Cache creation cleanup (#4036)
* Cache creation cleanup

Closing https://github.com/armbian/build/issues/3531

* Remove monthoffset parameter from action script

* - address displaying which variant is needed
- remove not needed text
- change ROOT_FS_CREATE_ONLY to yes / no
2022-07-31 16:48:25 +02:00
Igor Pečovnik
07d7d1a077
Remove deprecated functionality (#4034)
* Remove deprecated functionality

Since we are storing version number outside, we don't neet to deal with month cache rebuild here. Removing the code

* Change cron to more appropriate date

We tend to make releases by the end of the month, so cache rebuild in the middle is better then at the start of the month
2022-07-31 11:28:44 +02:00
Alexey Vazhnov
6f0837231c
lib/debootstrap.sh: add ROOT_FS_LABEL and BOOT_FS_LABEL (#4031) 2022-07-31 10:35:34 +02:00
Igor Pečovnik
3c83dabebf
Revert "Fix for build error on aarch64 with ERROR in function check_loop_device (#3831)" (#4027)
This reverts commit 8d16d9f810.
2022-07-29 18:24:42 +02:00
Igor Pečovnik
659af355c2
Cleanup: remove deprecated functionality (#3996)
* Remove deprecated functionality

* Forgot to remove few bits of BUILD_ALL
2022-07-14 20:49:52 +02:00
Igor Pečovnik
0b4fe79ad7
Removing escaping which proved to cause the problem here (#3983) 2022-07-10 20:45:56 +02:00
Igor Pečovnik
047a2447f6
Verifying md5 of installed deb packages with debsums (#3955)
* Typo in packaga name

* WIP: Test for packages integrity just before closing images

* Working debsum check

* Dialog is not needed

* Optimisations - uninstall debsums as we don't need it later on

* Cosmetics

Assuming this is related to both Ubuntu and Debian

Co-authored-by: Werner <EvilOlaf@users.noreply.github.com>
2022-07-09 11:36:52 +02:00
Igor Pečovnik
20ee8c5450
Add support for month cache, limit push to master branch (#3939)
* Add support for month cache, limit push to master branch
* Bump cache version
* Add calculator
* Control file can't be zero lenght
* Remove non-existing package
* Remove non-existing pkg
* Wrong secret used
* Fix broken packages
* Improve download methods. No more errors
* Fix mechanism for using old cache files
2022-06-28 18:04:31 +02:00
Igor Velkov
a1acdc95de
Move locale preparation and set from rootfs to image customization (#3856) 2022-06-07 20:40:50 +02:00
Igor Velkov
8d16d9f810
Fix for build error on aarch64 with ERROR in function check_loop_device (#3831) 2022-06-06 10:06:25 +02:00
Igor Velkov
4b05414c19
Fix 'cannot change locale (en_US.UTF-8)' warning #3850 (#3851) 2022-06-04 11:29:25 +02:00
Chun-Sheng, Li
974eafea4c
Closes #2880 (#3819) 2022-05-26 07:56:44 +02:00
lanefu
e621d25adc
Revert "modifications of firstrun scripts (#3642)" (#3772)
This reverts commit c8855aa08d.
2022-05-08 13:49:05 -04:00
Derek
c8855aa08d
modifications of firstrun scripts (#3642)
* modifications of firstrun scripts

* Further making use of systemd statements to order firstboot scripts

* allow systemd ordering of ssh to avoid restarting in firstrun script

* suggested changes, add wants=first-boot-complete

* Remove SSH keys in debootstrap process

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2022-05-07 15:52:31 +02:00
Derek
63a6593336
begin to support u-boot distroboot (#3675) 2022-04-23 12:33:01 +02:00
Igor Pečovnik
db408b61c4
Purge bionic, impish, hirsute, stretch (#3600)
* Purge bionic, impish, hirsute, stretch

- up jammy to supported (will be soon anyway)

* Change recommended build env to Jammy
2022-04-05 16:19:51 +02:00
Igor Pečovnik
28d5c93bb4
Add support for CLI PPA (#3605)
* Cleanup PPA related in desktop / deboostrap

* Add Nala, a front-end for apt

Bullseye, Sid, Focal, Jammy

* Reduce duplication

* Remove duplicate message
2022-04-01 19:45:43 +02:00
iav
3cb8dc709b
remove wrong assumpsion "btrfs compressed fs always < current size" (#3485) 2022-02-14 19:06:22 +01:00
Igor Pečovnik
078b58df01
u-boot install fallback - use version which was downloaded from repo (#3475) 2022-02-12 10:30:07 +01:00
Oleg
a3fd209abe
fix extlinux.conf (#3468) 2022-02-10 15:02:09 +01:00
Igor Pečovnik
26cef397c0
Add switch to skip image creation if it already exists (#3454)
* Move artefact creation directory into from deboostrap into configuration

This is needed to support function of early checking for artefacts. Useful for CI

* Introduce IMAGE_PRESENT parameter which we can use when creating a lot of images so we don't need to recreate whole CI if one image fails
2022-02-02 20:54:42 +01:00
Igor Pečovnik
72e8fc7d36
Improve cache creation process by removing /root and /home to be syched (#3439) 2022-01-26 12:48:13 +01:00
Igor Pecovnik
e11af914a2
Introducing new internal function for deploying images in folders
This was previously done automatically with BUILD_ALL but since we are building images differently, we need a new name. BUILD_ALL covers other functions, so we need to detach and make a new VARIABLE.
2021-12-15 18:30:23 +01:00
Igor Pečovnik
06c931c9c2
Add support for rootfs / toolchain bind (u)mount (#3342)
* Add support for rootfs / toolchain bind (u)mount

* Bugfixes
2021-12-12 17:41:03 +01:00
The-going
146803353c
Remove the garbage from the install.log file (#3333)
* Remove the garbage from the `install.log` file

You cannot use `--info=progress2` for the `rsync`
command when all output is sent to a file.
This creates a large garbage file.

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Changes megous reverse commit. Just disable the patch

commit bd592ec43b76b298be29126e667850113b84376d (tag: orange-pi-5.15-20211125-1352)
Author: Ondrej Jirman <megous@megous.com>
Date:   Thu Nov 25 13:51:59 2021 +0100

    Revert "rtw88: Add more channels"

    This reverts commit cb1e3839822d4f782a9af6c27568540414093ba6.
2021-12-10 08:32:44 +01:00
Ricardo Pardini
da062debdd
[PR] multiple fixes for the eval + PIPESTATUS construct (#3280)
- try this on your bash shell:
  - `ONEVAR="testing" eval 'bash -c "echo value once $ONEVAR && false && echo value twice $ONEVAR"' '| grep value'  '| grep value' ; echo ${PIPESTATUS[*]}`
  - Notice how PIPESTATUS has only one element. and it is always true, although we failed explicitly with false in the middle of the bash.
  - That is because eval itself is considered a single command, no matter how many pipes you put in there, you'll get a single value, the return code of the LAST pipe.
  - Lets export the value of the pipe inside eval so we know outside what happened:
  - `ONEVAR="testing" eval 'bash -e -c "echo value once $ONEVAR && false && echo value twice $ONEVAR"' '| grep value'  '| grep value' ';EVALPIPE=(${PIPESTATUS[@]})' ; echo ${EVALPIPE[*]}`
- also: pass LC_ALL=C LANG=C to avoid locale warnings

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
2021-12-07 20:10:47 +01:00
Ricardo Pardini
90e0fe0ba2
extensions framework + UEFI aarch64/x86 + rpi4b + core changes/fixes (#3300)
* extensions framework (née "fragments")

- this should actually change nothing at this point, just add capabilities
- the framework is implemented in lib/extensions.sh
- the "if function x exists then call x" replaced with call_extension_method()
  - +inline documentation
  - +compatibility names

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions framework; meta-extensions: auto-docs and sample extension gen

- 2 extensions dealing with extensibility itself
  - detect-unused-extensions: shows which extensions are enabled, but never called.
  - gen-sample-extension-docs: generates a sample empty extension & Markdown documentation for extensions

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* new extension methods and features via config variables in core Armbian

- `SKIP_EXTERNAL_TOOLCHAINS=yes` - does not download or use any linaro toolchains, only build host-installed ones
- `SKIP_BOOTSPLASH=yes` - does not patch kernel for splash file
- `EXTRA_BSP_NAME=xyz` - allows for BSP variants, useful for when extensions modify the BSP
- `EXTRA_ROOTFS_MIB_SIZE=x` - add x mib's to rootfs size, for use with very small images
- `KERNEL_EXTRA_TARGETS` - what extra targets to make kernel for, default to "modules dtbs"
- `BOOTCONFIG=none` - does not build nor install u-boot; also doesn't handle bootscripts et al
- `unset KERNELSOURCE` - does not build nor install kernel, nor build initrd, nor build nor install firmware
- `ARMHF_ARCH=skip` - does not add armhf to apt/dpkg, thus pure arm64
- `SKIP_ARMBIAN_REPO=yes` - results in armbian.list.disabled in the final image
- define `APT_EXTRA_DIST_PARAMS` with apt-cacher-ng options and use it for `PACKAGE_LIST_INSTALL/REMOVE` et al
- initial support for targeting x86/amd64 UEFI and BIOS
    - some do's/don'ts for x86/amd64, like a different `UBUNTU_MIRROR` default
    - GPT/EFI(ESP) partitions (fat, `UEFISIZE=256` to enable, mount `UEFI_MOUNT_POINT=/boot/efi`, first on disk but ends
      up at `$uefipart`=15)
    - GPT/BIOS partitions (fat, `BIOSSIZE=1` to enable, second on disk but ends up at partition 14)
    - `UEFI_FS_LABEL="armbiefi"` - to set the FAT label for the EFI partition, visible in Win/Mac
    - hard-requires gdisk package host-side
- add add_host_dependencies() extension method; fill `EXTRA_BUILD_DEPS="pkg pkg2"` to install to host before toolchains
  download
- add pre_prepare_partitions() extension method, for custom partition size calculations
- add create_partition_table() extension method, used to do full-custom partitioning if `USE_HOOK_FOR_PARTITION=yes`
- add post_create_partitions() extension method, mostly for easy debugging
- add post_write_sdcard() extension method, where you can also set `SKIP_VERIFY=yes` to skip sdcard verification
- add post_install_kernel_debs() extension method.
- multiple fixes to bsp to avoid spurious errors when files are not where it expects
- v4: detect `update-initramfs` failure and abort build with useful message if it does
- v4: show useful stacktrace in `exit_with_error`
  - if `ERROR_DEBUG_SHELL=yes`, drop into a shell before unmounting/deleting everything, so we can inspect what went wrong
- v4: display a message before `apt-get remove PACKAGE_LIST_BOARD_REMOVE` packages, so any errors while removing are easy to understand
- v4: preserve kernel .config's dates when copying

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions framework; refactor tool fetching/building into extensions

- a few examples of core refactoring using extensions
- sunxi-tools extension, enabled by 2 different sunxi family includes ("reuse" example)
- marvel-tools extension, enabled by 2 different mvebu family includes
- rkbin-tools extension, enabled by rockship64_common family include
- amlogic-fip/c2-blobs stuff refactored directly into meson64_common.inc ("single-use" example)
- removed the 'testings' fetch_from_repo completely since not used anywhere.

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* .wip's for UEFI arm64 and UEFI/BIOS x86 via new GRUB extension

- v3: added `growroot`-awareness to `armbian-resize-filesystem`
    - the partition-growing part of `armbian-resize-filesystem` does not deal correctly with the UEFI layout
    - `growroot` is installed on UEFI images by default, that handles growing partition during initramfs
    - now `armbian-resize-filesystem` handles `resize2fs` only, and works.
- v4: reworked UEFI board/family/include structure:
    - use Distro's `linux-generic` kernel only for `current`
    - `edge` now builds it's own pure-mainline `5.15.y` kernel, for both x86 and arm64
        - `.config` taken from Ubuntu, probably needs tuning for EXTRAWIFI=yes et al
- v4: introduce `SKIP_KERNEL_SYMLINK=yes`, tested in `builddeb`
    - to avoid symlinking kernel; u-boot likes it, but grub and flash-kernel hates it
- v5: many fixes
- v7: more small fixes.

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* .wip for the RaspberryPi 4B via new flash-kernel extension

- this does not build it's own kernel "yet", but uses default linux-raspi kernel from Ubuntu
- flash-kernel is not really a bootloader
    - it just prepares kernel et al a FAT partition for booting by the RPi4b bootloader
    - flash-kernel is standard Debian package, but has only been tested on Ubuntu releases
- it is really only known-working since Hirsute release.
  - Debian's rpi kernel is armhf only, so out of scope here, at least until we add source-built kernels.
- v3: fixed focal rootfs build. untested.
- v3: better variable names, preparing for source-built kernel.
- v5: new edge build with pure mainline kernel.
- v6: many fixes and some hacks for packaging and layout, also firmware (using Ubuntu's)

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* Added first patch to edge x86 related to wifi drivers

* extensions: leave hostapd alone; remove hackish ext; block reentrancy

- package-list-utils does not belong in this PR
- grub or bcm2711 is not the place to remove hostapd
- block recursive enable_extension() calls, for now.

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* gen-sample-extension-docs: fix: avoid counter in generated sample

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions: dependencies: enable_extension() in extensions with a stack

- and better stacktraces, I hope

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* Remove code from package list since we don't have it in repository
Adjust kernel config to disable driver that needs further polishing.

* Allow amd64 to build the same desktops as aarch64. We only have this limit for armhf, where some desktops don't work

* amd64: allow building amd64 on aarch64 with system toolchain

- conditionally add gcc-x86-64-linux-gnu to hostdeps

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* add libelf-dev directly to hostdeps (and Dockerfile), remove extension

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* packaging: remove SKIP_KERNEL_SYMLINK hack, fix the root cause

- which was the missing $image_name for non-arm64 & non-arm, so: x86 for example

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* grub: really obliterate u-boot stuff from BSP

- for now. soon we'll refactor u-boot so not have to do this

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* flash-kernel: really obliterate u-boot stuff from BSP

- for now. soon we'll refactor u-boot so not have to do this

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions: add host_dependencies_ready() hook

- this passes FINAL_HOST_DEPS containing all hostdeps for the run after they're installed

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* Add verification functions for correct selection.

* If UEFI Skip symlink creation

* Do not create dtb package for amd64

* Skip scripts folder cleaning if build process native.

Skip creating  postinst prerm scripts  for headers.

* Skip applying headers-debian-byteshift.patch if build native

* Fix architecture syntax as x86_64

* Revert "amd64: allow building amd64 on aarch64 with system toolchain"

This reverts commit 0c5ee20bb1.

* Compare architectures before starting compilation.



Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* extensions: cleanups after fixes by the-Going

- packaging:
  - there is _no need_ anymore for the symlink hack, CONFIG_EFI or no. But check is great, see below
  - it's not `amd64` that has no DTB's, it's all UEFI, thus: `is_enabled CONFIG_EFI`, thanks!
- Explicitly disallow "reverse cross compile" in amd64.conf.
- whitespace-only-deletions: revert. we shall shellfmt the whole thing one day, but not today.
- fix a few syntax warnings in newly introduced code (floating `$ARCH` vs `"${ARCH}`) - blame shellcheck

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* packaging: fix: turns out a lot of boards have CONFIG_EFI=y, can't use that for dtb/no-dtb decision.

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* grub: remove debug

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* firmware: allow installing `armbian-firmware-full`; make it really full

- can now use `BOARD_FIRMWARE_INSTALL="-full"` to install full firmware for the board. enable for UEFI.
- don't rely on KERNELSOURCE for firmware-related decisions. introduce `INSTALL_ARMBIAN_FIRMWARE` which defaults to `yes`
- rpi4b/flash-kernel: disable Armbian firmware; we need linux-firmware-raspi2, which conflicts.

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions: log to /${LOG_SUBPATH}/ instead of fixed /debug/

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions: introduce cleanup_extension_manager() called by build-all-ng's unset_all()

- to reset/unset everything done by the the initializer, so build can run again

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions: remove 'global' logging, for use with build_all_ng

- enable_extensions() will have to live on without logging to file. it's just too early.
- now init EXTENSION_MANAGER_TMP_DIR in initialize_extension_manager()
- now init EXTENSION_MANAGER_LOG_FILE in initialize_extension_manager()

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* extensions: build-all-ng.sh bugfix due to extension's debug to stdout

- extensions (among other things) can produce output to stdout when activated
- fix: check_hash() produced "idential" (sic, now changed to IDENTICAL) to stdout as a trigger
- debugging output got mixed with "idential", rendering hash cache void for families that used extensions
  - eg: sunxi, others
- fix is to send stdout to the bitbucket when sourcing the board & arch config files
- proper fix would be stop using stdout in this case and use return code for check_hash()
  - one day soon

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* Add CI build targets

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
Co-authored-by: The-going <48602507+The-going@users.noreply.github.com>
2021-12-06 09:49:49 +01:00
Igor Pečovnik
dde00cf6cf
Add cache integrity checking - used internally when making cache (#3303) 2021-11-30 21:51:04 +01:00
Igor Pecovnik
a7da24a2f4
Revert "[PR] multiple fixes for the eval + PIPESTATUS construct (#3280)"
This reverts commit efeb4d19e2.
2021-11-25 12:11:53 +01:00
Ricardo Pardini
efeb4d19e2
[PR] multiple fixes for the eval + PIPESTATUS construct (#3280)
- try this on your bash shell:
  - `ONEVAR="testing" eval 'bash -c "echo value once $ONEVAR && false && echo value twice $ONEVAR"' '| grep value'  '| grep value' ; echo ${PIPESTATUS[*]}`
  - Notice how PIPESTATUS has only one element. and it is always true, although we failed explicitly with false in the middle of the bash.
  - That is because eval itself is considered a single command, no matter how many pipes you put in there, you'll get a single value, the return code of the LAST pipe.
  - Lets export the value of the pipe inside eval so we know outside what happened:
  - `ONEVAR="testing" eval 'bash -e -c "echo value once $ONEVAR && false && echo value twice $ONEVAR"' '| grep value'  '| grep value' ';EVALPIPE=(${PIPESTATUS[@]})' ; echo ${EVALPIPE[*]}`
- also: pass LC_ALL=C LANG=C to avoid locale warnings

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
2021-11-22 11:04:38 +01:00
Igor Pečovnik
2a47ad5c78
Add support for next Ubuntu LTS (#3234)
* Add support for next Ubuntu LTS

* Update build-cache.yml

* Update build-cache.yml

* Update build-cache.yml

* Update build-cache.yml

* Jammy repository creation

* Enable docker build support on Jammy
2021-11-09 18:15:04 +01:00
Igor Pecovnik
e02753ecf9
Backend - optimise images compression method 2021-10-29 16:53:54 +02:00
Igor Pecovnik
83217ea30c
CI runners support - take more memory from host 2021-10-15 00:12:25 +02:00
Igor Pečovnik
84ef3d5289
Extending free memory detection to swap (#3195)
Host machines with 4Gb physical memory are unable to build all images. During workiin on CI improvements it was noticed that runners with just 4Gb of memory are unable to create rootfs cache or make an images even that should be sufficient. Memory reservations are set very conservatively and we can keep that since adding a swap into the equation proves to be enough. If host machine is running Armbian (which will be in most cases) our ZRAM / ZSWAP memory management takes care of securing that extra needed memory.
2021-10-14 00:01:23 +02:00
Igor Pečovnik
e8c5d07a89
Switch to matrix jobs scheduler and upload build logs (#3157) 2021-09-26 08:42:24 +02:00
Vyacheslav
3ab1bff470
Fix gpg signing when sudo unavailable. (#3100)
Signed-off-by: Vyacheslav Bocharov <devel@lexina.in>
2021-09-02 21:57:41 +02:00
Igor Pečovnik
d256411e2d
Do compress and sign operation in the temp folder (#3079) 2021-08-04 16:55:35 -04:00
lanefu
894cb29ca7
Feature/get_log_path/ (#3064)
* custom log path of debug/ via LOG_SUBPATH=
2021-07-27 07:24:06 -04:00
Igor Pecovnik
bc19b9beab Change the way how RC images are build
RC images are neither beta neither stable. If we use this parameter, they are put into subdir RC. If they are made from beta or not, we choose with other BETA=yes parameter
2021-07-22 12:34:54 +02:00
Igor Pečovnik
cbcad64f1c
Typo - missing space in IF statement 2021-07-22 08:24:17 +02:00
lanefu
b1d82308db
RC upload flag (#3027)
* RC upload flag

* Update build-all-ng.sh

* Try RC Images

Co-authored-by: Igor Pečovnik <igorpecovnik@users.noreply.github.com>
2021-07-19 20:36:46 -04:00
Igor Pečovnik
a7e16da2ce
Add Ubuntu Impish (#3006) 2021-07-14 08:45:30 +02:00
Lane Jennison
6ee2ce463a additional post image hook to assist in img conversion to qcow2 for virtual-qemu image 2021-07-11 14:03:22 -04:00