From 49428abac50976f943806aa2b116597328148ddc Mon Sep 17 00:00:00 2001 From: Saya Andy Date: Mon, 7 Sep 2026 04:50:59 +0700 Subject: DRAFT: feat: use kernel tailored for surface pro 12-inch --- Fedora.kiwi | 1 + Jenkinsfile | 74 +++++++++++++++++++-- components/boot.xml | 59 +++++++++++----- components/liveinstall.xml | 11 ++- config-cdroot.tar | Bin 204800 -> 0 bytes config.sh | 66 ++++++++++++------ grub-arm.cfg.iso-template | 11 ++- repositories/kernel-surface.xml | 31 +++++++++ .../etc/kernel/devicetree | 2 +- .../etc/systemd/system/hexagonrpc.service | 1 - .../etc/systemd/system/iio-sensor-proxy.service | 11 --- .../60-surface-pro-12-inch.conf | 14 ++++ .../lib/kernel/install.d/60-surface-dtb.install | 21 +++++- .../kernel/install.d/95-surface-dtb-patch.install | 7 +- surface-editbootconfig.sh | 49 ++++++++++++++ 15 files changed, 288 insertions(+), 70 deletions(-) delete mode 100644 config-cdroot.tar create mode 100644 repositories/kernel-surface.xml delete mode 100644 root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service create mode 100644 root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf create mode 100755 surface-editbootconfig.sh diff --git a/Fedora.kiwi b/Fedora.kiwi index dda43e5..37d86a5 100644 --- a/Fedora.kiwi +++ b/Fedora.kiwi @@ -15,6 +15,7 @@ 45 + diff --git a/Jenkinsfile b/Jenkinsfile index 24aa17a..0797a5f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,6 +11,20 @@ pipeline { IMAGE_PROFILE = 'Workstation-Live' IMAGE_VERSION = '45' OUTPUT_DIR = 'outdir' + + B2_ENDPOINT = 'https://s3.eu-central-003.backblazeb2.com' + AWS_DEFAULT_REGION = 'eu-central-003' + RPM_BUCKET = 'dist-sayagit-fedora-rpm' + ISO_BUCKET = 'dist-sayagit-fedora-iso' + + // awscli2 sends CRC32 checksums by default, which B2 rejects. Ask for + // them only where the S3 API requires them. + AWS_REQUEST_CHECKSUM_CALCULATION = 'when_required' + AWS_RESPONSE_CHECKSUM_VALIDATION = 'when_required' + + // Must match the in + // repositories/kernel-surface.xml. + KERNEL_SURFACE_REPO = '/var/lib/kernel-surface-repo' } stages { @@ -51,6 +65,41 @@ spec: container('kiwi') { script { try { + // The kernel-surface RPM is a build input, not + // something this repository can produce: the image + // installs kernel-surface by name and s + // Fedora's kernel packages, so it has to be in the + // local repository before kiwi starts. The buckets + // stay private, so it is pulled with credentials + // rather than fetched over a public URL. + withCredentials([usernamePassword( + credentialsId: 'backblaze-b2-dist-rpm', + usernameVariable: 'AWS_ACCESS_KEY_ID', + passwordVariable: 'AWS_SECRET_ACCESS_KEY')]) { + sh ''' + set -eux + + dnf --assumeyes install awscli2 createrepo_c + + mkdir -p "${KERNEL_SURFACE_REPO}" + aws s3 sync --endpoint-url "${B2_ENDPOINT}" \\ + "s3://${RPM_BUCKET}/fedora/${IMAGE_VERSION}/aarch64/" \\ + "${KERNEL_SURFACE_REPO}/" \\ + --exclude '*' --include 'kernel-surface-*.rpm' + + # Say so here rather than letting kiwi fail + # several minutes later on an unresolvable + # package name. + if ! ls "${KERNEL_SURFACE_REPO}"/kernel-surface-*.rpm; then + echo "No kernel-surface RPM in ${RPM_BUCKET} for Fedora ${IMAGE_VERSION}." >&2 + echo "Run the kernel-surface pipeline first." >&2 + exit 1 + fi + + createrepo_c "${KERNEL_SURFACE_REPO}" + ''' + } + sh ''' dnf --assumeyes install git kiwi kiwi-systemdeps distribution-gpg-keys git config --global --add safe.directory . @@ -102,12 +151,25 @@ spec: steps { container('s5cmd') { unstash "fedora-workstation-live-iso-stash" - sh ''' - cd ${OUTPUT_DIR}-build - moddate=$(date -r Fedora.aarch64-${IMAGE_VERSION}.iso -u +"%Y%m%d-%H%M%S") - mv Fedora.aarch64-${IMAGE_VERSION}.iso "Fedora.Surface-Pro-12in.${IMAGE_PROFILE}.${IMAGE_VERSION}.${moddate}.aarch64.iso" - ls -lh - ''' + withCredentials([usernamePassword( + credentialsId: 'backblaze-b2-dist-iso', + usernameVariable: 'AWS_ACCESS_KEY_ID', + passwordVariable: 'AWS_SECRET_ACCESS_KEY')]) { + sh ''' + set -eux + + cd "${OUTPUT_DIR}-build" + src="Fedora.aarch64-${IMAGE_VERSION}.iso" + moddate=$(date -r "${src}" -u +"%Y%m%d-%H%M%S") + dst="Fedora.Surface-Pro-12in.${IMAGE_PROFILE}.${IMAGE_VERSION}.${moddate}.aarch64.iso" + mv "${src}" "${dst}" + ls -lh + + s5cmd --endpoint-url "${B2_ENDPOINT}" cp \\ + "${dst}" \\ + "s3://${ISO_BUCKET}/fedora/${IMAGE_VERSION}/aarch64/${dst}" + ''' + } } } } diff --git a/components/boot.xml b/components/boot.xml index 816bb91..36d8ffa 100644 --- a/components/boot.xml +++ b/components/boot.xml @@ -42,17 +42,44 @@ - - - - - + + - - + + + + + + @@ -66,16 +93,12 @@ - - - - - diff --git a/components/liveinstall.xml b/components/liveinstall.xml index c04ca7f..6b683b2 100644 --- a/components/liveinstall.xml +++ b/components/liveinstall.xml @@ -12,6 +12,7 @@ firmware="efi" efiparttable="gpt" efifatimagesize="30" kernelcmdline="quiet rhgb mem_sleep_default=s2idle clk_ignore_unused pd_ignore_unused systemd.tpm2_wait=0 rd.live.ram=1" fscreateoptions="-Efragments -C 1048576" + editbootconfig="surface-editbootconfig.sh" > @@ -28,12 +29,10 @@ - - - + diff --git a/config-cdroot.tar b/config-cdroot.tar deleted file mode 100644 index 6aafdc9..0000000 Binary files a/config-cdroot.tar and /dev/null differ diff --git a/config.sh b/config.sh index c431bcb..690cb48 100755 --- a/config.sh +++ b/config.sh @@ -58,7 +58,7 @@ if [[ "$kiwi_profiles" != *"Container"* ]] && [[ "$kiwi_profiles" != *"FEX"* ]] ## "devicetree /dtb-$kver/$GRUB_DEVICETREE". /etc/kernel/devicetree does ## nothing here: /boot/ does not exist, so kernel-install runs ## with layout=other and 90-loaderentry.install (which would read it) bails. - echo "GRUB_DEVICETREE=qcom/x1p42100-microsoft-surface-pro-12-inch.dtb" >> /etc/default/grub + echo "GRUB_DEVICETREE=qcom/x1p42100-microsoft-sp12in.dtb" >> /etc/default/grub ## Upstream sets menu_auto_hide=1 + boot_indeterminate=1 here for Disk images ## to match anaconda's behaviour. Deliberately not done for Surface Pro 12": ## with the menu hidden, GRUB counts down GRUB_TIMEOUT against a blank screen @@ -436,18 +436,39 @@ fi # Surface Pro 12" customizations #-------------------------------------- -# /etc/surface-dtb is the master copy 60-surface-dtb.install re-stages into each -# new kernel's module tree on update. The other two are what that hook and -# 10-devicetree.install would normally produce, done up front here because -# kernel-install never runs during this build -- without the module-tree copy, -# anything keyed off /usr/lib/modules/$kver/dtb (including the anaconda -# post-script) finds nothing and silently does nothing. -install -Dm644 /tmp/harrisonvanderbyl/surface-pro-12-inch-linux/boot/dtb \ - "/etc/surface-dtb/x1p42100-microsoft-surface-pro-12-inch.dtb" -install -Dm644 /tmp/harrisonvanderbyl/surface-pro-12-inch-linux/boot/dtb \ - "/usr/lib/modules/$kver/dtb/qcom/x1p42100-microsoft-surface-pro-12-inch.dtb" -install -Dm644 /tmp/harrisonvanderbyl/surface-pro-12-inch-linux/boot/dtb \ - "/boot/dtb-$kver/qcom/x1p42100-microsoft-surface-pro-12-inch.dtb" +# Device tree. kernel-surface compiles the patched dts in-tree and installs the +# result twice: into its own module tree (dtb/qcom, from dtbs_install) and +# version-independently into /usr/lib/surface-dtb. The latter is the master copy +# 60-surface-dtb.install re-stages into each new kernel's module tree on update, +# which is the only reason the image no longer carries a prebuilt blob of its +# own -- the description installs kernel-surface by name and s Fedora's +# kernel packages, so the package is always there. +# +# One name throughout, upstream's: this block, GRUB_DEVICETREE above, both +# kernel-install plugins, /etc/kernel/devicetree, and the ISO grub template. +# +# The module-tree and /boot copies plus the /boot/dtb symlink are what that hook +# and grubby's 10-devicetree.install would normally produce, done up front here +# because kernel-install does not run again during this build -- without the +# module-tree copy, anything keyed off /usr/lib/modules/$kver/dtb (including the +# anaconda post-script) finds nothing and silently does nothing. +dtb_name=x1p42100-microsoft-sp12in.dtb +dtb_src="/usr/lib/surface-dtb/$dtb_name" +if [[ ! -f "$dtb_src" ]]; then + printf 'Error: %s is missing, so kernel-surface (built from ../kernel-surface) is not installed.\n' "$dtb_src" >&2 + exit 1 +fi +install -Dm644 "$dtb_src" "/usr/lib/modules/$kver/dtb/qcom/$dtb_name" +install -Dm644 "$dtb_src" "/boot/dtb-$kver/qcom/$dtb_name" +# dtbs_install ships every arm64 device tree, ~1000 boards, and the module tree +# goes straight into the image filesystem. This image targets exactly one board, +# so drop the rest -- the same objection that rules out kernel-uki-dtbloader in +# components/boot.xml. Only affects the image; a later kernel-surface update on +# the installed system restores the full tree. +find "/usr/lib/modules/$kver/dtb" -mindepth 1 \ + \! -path "/usr/lib/modules/$kver/dtb/qcom" \ + \! -name "$dtb_name" \ + -delete # /boot/dtb -> dtb-$kver is what grubby's 10-devicetree.install maintains, and # what the boot loader entry's devicetree path resolves through ln -sfn "dtb-$kver" /boot/dtb @@ -507,7 +528,7 @@ fi # documented way to disable a plugin: a /dev/null symlink of the same name). mkdir -p /etc/kernel/install.d ln -sf /dev/null /etc/kernel/install.d/51-dracut-rescue.install -# kernel-core's own package scriptlet already ran kernel-install once, before +# kernel-surface's %posttrans scriptlet already ran kernel-install once, before # this mask existed (root overlay lands after package install), leaving a # stale rescue image behind. Remove it now so kiwi's systemd_boot EFI-FAT-image # step doesn't try to cram it in too. @@ -604,11 +625,18 @@ dnf install -y alsa-ucm-utils install -Dm644 /tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service \ /etc/systemd/system/hexagonrpc.service -install -Dm644 /tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service \ - /etc/systemd/system/iio-sensor-proxy.service -install -Dm644 /tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/udev/rules.d/61-sensors-surface-pro-12-inch.rules \ - /etc/udev/rules.d/61-sensors-surface-pro-12-inch.rules -systemctl enable hexagonrpc.service iio-sensor-proxy.service + +# iio-sensor-proxy keeps the unit its own build installed, and gets only the +# ordering against hexagonrpcd added on top. The drop-in is dead weight if that +# unit is not there, so check rather than let it pass silently. +test -f /usr/lib/systemd/system/iio-sensor-proxy.service +install -Dm644 /tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf \ + /etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf + +# Only hexagonrpcd is enabled statically. iio-sensor-proxy is started through +# its D-Bus name by whatever asks for net.hadess.SensorProxy, which then pulls +# hexagonrpc.service in through the drop-in above. +systemctl enable hexagonrpc.service # Rear camera pipeline (msm/camss) needs /dev/media0, which only exists once the # real silicon probes on the booted system -- install the wiring but do not run diff --git a/grub-arm.cfg.iso-template b/grub-arm.cfg.iso-template index 8badfb5..447a1f3 100644 --- a/grub-arm.cfg.iso-template +++ b/grub-arm.cfg.iso-template @@ -26,19 +26,24 @@ set timeout_style=${boot_timeout_style} search ${search_params} +# Surface Pro 12" (Snapdragon X1P-42-100): the dtb the entries below load is a +# plain file in this same loader directory on the ISO9660 filesystem. GRUB +# cannot read the erofs root image, and kiwi has no device tree support, so +# surface-editbootconfig.sh copies it there out of the kernel-surface RPM in the +# image root. See that script for why editbootconfig is the hook that can. menuentry "Start ${title}" --class fedora --class gnu-linux --class gnu --class os { - devicetree ($$root)${bootpath}/x1p42100-microsoft-surface-pro-12-inch.dtb + devicetree ($$root)${bootpath}/x1p42100-microsoft-sp12in.dtb linux ($$root)${bootpath}/${kernel_file} ${boot_options} initrd ($$root)${bootpath}/${initrd_file} } menuentry "Test this media & start ${title}" --class fedora --class gnu-linux --class gnu --class os { - devicetree ($$root)${bootpath}/x1p42100-microsoft-surface-pro-12-inch.dtb + devicetree ($$root)${bootpath}/x1p42100-microsoft-sp12in.dtb linux ($$root)${bootpath}/${kernel_file} ${boot_options} rd.live.check initrd ($$root)${bootpath}/${initrd_file} } submenu "Troubleshooting -->" { menuentry "Start ${title} in basic graphics mode" --class fedora --class gnu-linux --class gnu --class os { - devicetree ($$root)${bootpath}/x1p42100-microsoft-surface-pro-12-inch.dtb + devicetree ($$root)${bootpath}/x1p42100-microsoft-sp12in.dtb linux ($$root)${bootpath}/${kernel_file} ${boot_options} $${basicgfx} initrd ($$root)${bootpath}/${initrd_file} } diff --git a/repositories/kernel-surface.xml b/repositories/kernel-surface.xml new file mode 100644 index 0000000..f92c1b0 --- /dev/null +++ b/repositories/kernel-surface.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/devicetree b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/devicetree index 37226e7..2acf815 100644 --- a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/devicetree +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/kernel/devicetree @@ -1 +1 @@ -qcom/x1p42100-microsoft-surface-pro-12-inch.dtb +qcom/x1p42100-microsoft-sp12in.dtb diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service index 5b252fd..2e3cf82 100644 --- a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/hexagonrpc.service @@ -1,6 +1,5 @@ [Unit] Description=HexagonRPC Service -After=network.target [Service] ExecStart=/usr/local/bin/hexagonrpcd -f /dev/fastrpc-adsp-secure -s diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service deleted file mode 100644 index f0eb446..0000000 --- a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=IIO Sensor Proxy Service -After=network.target hexagonrpc.service -Requires=hexagonrpc.service - -[Service] -ExecStart=/usr/libexec/iio-sensor-proxy -Restart=on-failure - -[Install] -WantedBy=multi-user.target diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf new file mode 100644 index 0000000..7b3cfcb --- /dev/null +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/etc/systemd/system/iio-sensor-proxy.service.d/60-surface-pro-12-inch.conf @@ -0,0 +1,14 @@ +# Surface Pro 12" (Snapdragon X1P-42-100) +# +# The sensors on this device are not IIO devices. They live behind the SLPI +# DSP, reached over fastrpc by hexagonrpcd, and iio-sensor-proxy only sees them +# through the SSC backend it is built with here (-Dssc-support=enabled). So it +# has to start after that daemon, and stop being useful if the daemon dies. +# +# A drop-in rather than a replacement unit: upstream's own unit is D-Bus +# activated (Type=dbus, BusName=net.hadess.SensorProxy), which is how anything +# asking for net.hadess.SensorProxy gets the service started, and overriding it +# wholesale traded that away for nothing but this ordering. +[Unit] +Requires=hexagonrpc.service +After=hexagonrpc.service diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install index c12ff47..2dadac5 100644 --- a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/60-surface-dtb.install @@ -5,11 +5,28 @@ umask 022 COMMAND="$1" KVER="$2" -SRC="/etc/surface-dtb/x1p42100-microsoft-surface-pro-12-inch.dtb" -DEST="/usr/lib/modules/${KVER}/dtb/qcom/x1p42100-microsoft-surface-pro-12-inch.dtb" +DTB_NAME=x1p42100-microsoft-sp12in.dtb +DEST="/usr/lib/modules/${KVER}/dtb/qcom/${DTB_NAME}" + +# The master copy comes from kernel-surface: it builds the dtb in-tree from the +# patched dts and installs it under /usr/lib/surface-dtb, deliberately outside +# any /usr/lib/modules/, so it can be re-staged into any kernel installed +# alongside it. +SRC="/usr/lib/surface-dtb/${DTB_NAME}" +[ -f "${SRC}" ] || SRC="" case "${COMMAND}" in add) + # No master and no dtb already in this kernel's tree means there is + # nothing this board can boot with, so say so rather than failing + # silently three steps later in the boot loader. + if [ -z "${SRC}" ]; then + if [ -f "${DEST}" ]; then + exit 0 + fi + echo "60-surface-dtb: no ${DTB_NAME} in /usr/lib/surface-dtb" >&2 + exit 1 + fi mkdir -p "$(dirname ${DEST})" cp -f "${SRC}" "${DEST}" chmod 644 "${DEST}" diff --git a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install index 375b085..f0314b0 100644 --- a/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install +++ b/root/tmp/SayaAndy/surface-pro-12-inch-linux-fedora/usr/lib/kernel/install.d/95-surface-dtb-patch.install @@ -29,15 +29,16 @@ KVER="${2:-}" [ "$COMMAND" = "add" ] || exit 0 [ -n "$KVER" ] || exit 0 -DTB_NAME=x1p42100-microsoft-surface-pro-12-inch.dtb +DTB_NAME=x1p42100-microsoft-sp12in.dtb DTB_REL="qcom/$DTB_NAME" BOOT_ROOT="${KERNEL_INSTALL_BOOT_ROOT:-/boot}" # 60-surface-dtb.install stages the dtb into this kernel's module tree; fall -# back to the master copy if it has not run (or was removed). +# back to kernel-surface's version-independent master copy if it has not run +# (or was removed). DTB_SRC="/usr/lib/modules/${KVER}/dtb/${DTB_REL}" if [ ! -f "$DTB_SRC" ]; then - DTB_SRC="/etc/surface-dtb/$DTB_NAME" + DTB_SRC="/usr/lib/surface-dtb/$DTB_NAME" fi [ -f "$DTB_SRC" ] || exit 0 diff --git a/surface-editbootconfig.sh b/surface-editbootconfig.sh new file mode 100755 index 0000000..a426645 --- /dev/null +++ b/surface-editbootconfig.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Surface Pro 12" (Snapdragon X1P-42-100): put the device tree on the ISO. +# +# kiwi has no device tree support of its own, and the ISO's GRUB needs the dtb +# as a plain file it can read: it loads it with a "devicetree" line before the +# kernel (see grub-arm.cfg.iso-template), it cannot read the erofs root image, +# and kiwi copies only the kernel and the initrd into the ISO's loader +# directory. +# +# editbootconfig is the one hook that reaches the ISO tree. kiwi's live builder +# calls it with "iso:" as the first argument and the image root as +# the working directory, after setup_media_loader_directory has created the +# loader directory and the GRUB config has been written. So the dtb can be +# taken straight out of the kernel-surface RPM installed in the image root, +# which is why config-cdroot.tar is no longer needed to carry a committed copy. + +set -euo pipefail + +target="${1:-}" +case "${target}" in + iso:*) media_dir="${target#iso:}" ;; + *) + echo "surface-editbootconfig: expected an iso: target, got '${target}'" >&2 + exit 1 + ;; +esac + +dtb_name=x1p42100-microsoft-sp12in.dtb + +# The working directory is the image root, so this is kernel-surface's own +# version-independent copy. config.sh has already failed the build if the +# package did not provide it. +dtb_src="usr/lib/surface-dtb/${dtb_name}" +if [[ ! -f "${dtb_src}" ]]; then + echo "surface-editbootconfig: ${dtb_src} not found in the image root" >&2 + exit 1 +fi + +# ${bootpath} in the GRUB template is /boot//loader. Read +# the directory back off the media tree rather than recomputing that name, so +# the dtb cannot end up somewhere the GRUB config does not look. +loader_dirs=("${media_dir}"/boot/*/loader) +if [[ ${#loader_dirs[@]} -ne 1 || ! -d "${loader_dirs[0]}" ]]; then + echo "surface-editbootconfig: expected one ${media_dir}/boot/*/loader, found ${#loader_dirs[@]}" >&2 + exit 1 +fi + +install -Dm644 "${dtb_src}" "${loader_dirs[0]}/${dtb_name}" +echo "surface-editbootconfig: staged ${loader_dirs[0]}/${dtb_name}" -- cgit v1.3.1+16