upower: relocate the cross-install udev leak, and assert it stays gone
udev rules and hwdb installed under the sysroot prefix, so none of the fork's quirks were ever active on the phone.
This commit is contained in:
parent
2170ba686f
commit
7eb2135906
2 changed files with 36 additions and 0 deletions
|
|
@ -245,6 +245,34 @@ jobs:
|
|||
# fail even on a good build.
|
||||
file "$GITHUB_WORKSPACE/src/upower/dest-aarch64/usr/libexec/upowerd" \
|
||||
| grep -q aarch64 || { echo "aarch64 upowerd is not aarch64" >&2; exit 1; }
|
||||
# Cross-install leak. upower asks pkg-config for the udev dir, and
|
||||
# with a sysroot in play that answer comes back sysroot-prefixed, so
|
||||
# the rules and hwdb install under $DESTDIR/home/casey/aarch64-sysroot/
|
||||
# instead of /usr/lib/udev. systemdsystemunitdir is passed explicitly
|
||||
# above for exactly this reason; the udev dir was missed. Measured on
|
||||
# the phone 2026-07-27: all four of 60-upower-battery.{rules,hwdb},
|
||||
# 95-upower-wup.rules and 95-upower-hid.hwdb were absent from
|
||||
# /usr/lib/udev and present only under the junk path — so the fork's
|
||||
# udev quirks had never once been applied on the device.
|
||||
# Fold any leaked tree back before the tar, then refuse to ship a
|
||||
# tree containing anything but usr/ and etc/.
|
||||
DEST="$GITHUB_WORKSPACE/src/upower/dest-aarch64"
|
||||
LEAK="$DEST$HOME/aarch64-sysroot"
|
||||
if [ -d "$LEAK" ]; then
|
||||
echo "cross install leaked into $HOME/aarch64-sysroot — relocating"
|
||||
cp -a "$LEAK/." "$DEST/"
|
||||
rm -rf "$LEAK"
|
||||
fi
|
||||
stray=$(find "$DEST" -mindepth 1 -maxdepth 1 ! -name usr ! -name etc -printf '%f\n')
|
||||
if [ -n "$stray" ]; then
|
||||
echo "upower tree would ship outside usr/ and etc/: $stray" >&2
|
||||
exit 1
|
||||
fi
|
||||
# And the rules must have landed where udev actually reads them.
|
||||
for f in usr/lib/udev/rules.d/60-upower-battery.rules \
|
||||
usr/lib/udev/hwdb.d/60-upower-battery.hwdb; do
|
||||
[ -e "$DEST/$f" ] || { echo "upower tree is missing $f" >&2; exit 1; }
|
||||
done
|
||||
tar -C "$GITHUB_WORKSPACE/src/upower/dest-aarch64" \
|
||||
-cf "$GITHUB_WORKSPACE/src/Souveraine/upower-tree-aarch64.tar" .
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,14 @@ sha256sums=('SKIP' 'SKIP')
|
|||
|
||||
package() {
|
||||
bsdtar -xf "$srcdir/upower-tree.tar" -C "$pkgdir"
|
||||
|
||||
# Detector, not a fixer — ci.yml is where a leaked cross-install tree gets
|
||||
# folded back. If one reaches here the tarball is wrong, and shipping it
|
||||
# would put /home/<user>/aarch64-sysroot/... on the device and leave udev
|
||||
# with no rules (measured on the phone 2026-07-27). Fail loudly instead.
|
||||
local stray
|
||||
stray=$(find "$pkgdir" -mindepth 1 -maxdepth 1 ! -name usr ! -name etc -printf '%f\n')
|
||||
[[ -z $stray ]] || { error "upower tree ships outside usr/ and etc/: %s" "$stray"; return 1; }
|
||||
# Keep the canonical interface XML discoverable for introspection.
|
||||
install -Dm644 "$srcdir/org.freedesktop.UPower.Device.xml" \
|
||||
"$pkgdir/usr/share/dbus-1/interfaces/org.freedesktop.UPower.Device.xml"
|
||||
|
|
|
|||
Loading…
Reference in a new issue