kernel-debs: postinst/etc: fix: unify is_boot_dev_vfat() function; make work during image build too via env var

- determinining if `/boot` is vfat is more complex than it looks;
  - use a common function to unify across all scripts
- during image build, the kernel install is always done with a non-fat, non-mounted /boot
  - use a special variable passed through the env so unified function can know ahead of time
  - introduce `extra_apt_envs` param to `chroot_sdcard_apt_get()`; array with extra environment vars
- if vfat /boot:
  - `linux-update-symlinks` is not called (Debian would just choke on this)
  - don't even try to symlink Armbian stuff, move instead
- more/better logging board-side (unfortunately mixed in all the set -x debugs)
This commit is contained in:
Ricardo Pardini
2023-04-29 12:41:51 +02:00
committed by igorpecovnik
parent f8ddf7f9e2
commit c692676da7
4 changed files with 62 additions and 16 deletions

View File

@@ -58,6 +58,8 @@ function create_image_from_sdcard_rootfs() {
display_alert "Copying files to" "/boot (MOUNT /boot)"
if [[ $(findmnt --noheadings --output FSTYPE --target "$MOUNT/boot" --uniq) == vfat ]]; then
run_host_command_logged rsync -rLtWh --info=progress0,stats1 "$SDCARD/boot" "$MOUNT" # fat32
# @TODO: -L causes symlinks to be replaced with copies, but what if they don't exist?
# Also: what's the sense in replacing symlinks with copies?
else
run_host_command_logged rsync -aHWXh --info=progress0,stats1 "$SDCARD/boot" "$MOUNT" # ext4
fi