mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
- 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"
35 lines
1.6 KiB
Bash
35 lines
1.6 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
|
|
#
|
|
# This file is a part of the Armbian Build Framework
|
|
# https://github.com/armbian/build/
|
|
|
|
function post_debootstrap_tweaks() {
|
|
display_alert "Applying post-tweaks" "post_debootstrap_tweaks" "debug"
|
|
|
|
# adjust tzselect to improve political correctness
|
|
sed -i "s/Please select a country/Please select a country or a region/g" "${SDCARD}"/usr/bin/tzselect
|
|
|
|
# activate systemd-resolved
|
|
display_alert "Activating systemd-resolved" "Symlinking /etc/resolv.conf to /run/systemd/resolve/stub-resolv.conf" "debug"
|
|
run_host_command_logged rm -fv "${SDCARD}"/etc/resolv.conf
|
|
# The method of symlinking to /run/systemd/resolve/stub-resolv.conf is recommended, see https://www.man7.org/linux/man-pages/man8/systemd-resolved.service.8.html
|
|
run_host_command_logged ln -s /run/systemd/resolve/stub-resolv.conf "${SDCARD}"/etc/resolv.conf
|
|
|
|
# remove service start blockers
|
|
run_host_command_logged rm -fv "${SDCARD}"/sbin/initctl "${SDCARD}"/sbin/start-stop-daemon
|
|
chroot_sdcard dpkg-divert --quiet --local --rename --remove /sbin/initctl
|
|
chroot_sdcard dpkg-divert --quiet --local --rename --remove /sbin/start-stop-daemon
|
|
run_host_command_logged rm -fv "${SDCARD}"/usr/sbin/policy-rc.d
|
|
|
|
call_extension_method "post_post_debootstrap_tweaks" "config_post_debootstrap_tweaks" <<- 'POST_POST_DEBOOTSTRAP_TWEAKS'
|
|
*run after removing diversions and qemu with chroot unmounted*
|
|
Last chance to touch the `${SDCARD}` filesystem before it is copied to the final media.
|
|
POST_POST_DEBOOTSTRAP_TWEAKS
|
|
|
|
return 0
|
|
}
|