Merge pull request #773 from maralcbr/settings-runtime-detector
Build settings for #13362's HOOKS baseline without a detector copy
This commit is contained in:
4 files changed
+8
-35
No files matched your search
@@ -1,7 +1,7 @@
|
||||
# Maintainer: Ryan Hughes <ryan@omarchy.org>
|
||||
pkgname='omarchy-settings-dev'
|
||||
pkgver=4.0.0.r6694.g821ae58
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
# Pinned by the upstream watch in .omarchy/package.json (bin/sync-upstream):
|
||||
# every quattro tip becomes a commit pin here, so the package is versioned,
|
||||
# checksummed and built exactly like a release, just more often. The r-number
|
||||
@@ -439,15 +439,6 @@ EOF
|
||||
install -Dm755 bin/omarchy-hw-platform \
|
||||
"$pkgdir/usr/share/libalpm/scripts/omarchy-hw-platform"
|
||||
fi
|
||||
# 00-omarchy-hooks.conf places a Mac through this detector copy; without it
|
||||
# an Aurora Mac gets the busybox line and its initramfs cannot unlock root.
|
||||
# x86_64 keeps the busybox line either way.
|
||||
if [[ $CARCH == aarch64 ]] &&
|
||||
grep -qs omarchy-hw-platform "$pkgdir/etc/mkinitcpio.conf.d/00-omarchy-hooks.conf" &&
|
||||
[[ ! -x $pkgdir/usr/share/libalpm/scripts/omarchy-hw-platform ]]; then
|
||||
echo "etc/mkinitcpio.conf.d/00-omarchy-hooks.conf needs the omarchy-hw-platform copy the source does not ship" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Branding assets (logos, icons).
|
||||
install -Dm644 logo.txt "$pkgdir/usr/share/omarchy/logo.txt"
|
||||
|
||||
@@ -13,7 +13,7 @@ pkgname='omarchy-settings'
|
||||
_tag='v4.0.4'
|
||||
_commit='c668141e9c42b13c80c9ca4ea108e11708c5e8a5'
|
||||
pkgver=4.0.4
|
||||
pkgrel=4
|
||||
pkgrel=5
|
||||
pkgdesc='Omarchy user defaults, /etc/skel content, fonts, plymouth theme, and support helpers'
|
||||
# Arch-specific because the shipped /etc tree is not the same on every
|
||||
# architecture for older sources: their zram and oomd drop-ins belong to the
|
||||
@@ -447,15 +447,6 @@ EOF
|
||||
install -Dm755 bin/omarchy-hw-platform \
|
||||
"$pkgdir/usr/share/libalpm/scripts/omarchy-hw-platform"
|
||||
fi
|
||||
# 00-omarchy-hooks.conf places a Mac through this detector copy; without it
|
||||
# an Aurora Mac gets the busybox line and its initramfs cannot unlock root.
|
||||
# x86_64 keeps the busybox line either way.
|
||||
if [[ $CARCH == aarch64 ]] &&
|
||||
grep -qs omarchy-hw-platform "$pkgdir/etc/mkinitcpio.conf.d/00-omarchy-hooks.conf" &&
|
||||
[[ ! -x $pkgdir/usr/share/libalpm/scripts/omarchy-hw-platform ]]; then
|
||||
echo "etc/mkinitcpio.conf.d/00-omarchy-hooks.conf needs the omarchy-hw-platform copy the source does not ship" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Branding assets (logos, icons).
|
||||
install -Dm644 logo.txt "$pkgdir/usr/share/omarchy/logo.txt"
|
||||
|
||||
@@ -3,15 +3,12 @@
|
||||
# after it add their hooks to it instead of being overwritten by it.
|
||||
#
|
||||
# Apple Silicon boots a systemd initramfs, and its platform package adds the
|
||||
# firmware and encryption hooks. Every other machine keeps the busybox line. The
|
||||
# runtime's detector answers, or else the copy omarchy-settings ships for its
|
||||
# platform guard, so a settings package newer than the runtime still places a
|
||||
# Mac. Without either, the busybox line stays. A detector that cannot place the
|
||||
# firmware and encryption hooks. Every other machine keeps the busybox line, as
|
||||
# does one without the runtime's detector. A detector that cannot place the
|
||||
# machine stops the build rather than let it produce an image for the wrong
|
||||
# platform.
|
||||
_omarchy_platform=""
|
||||
_omarchy_detector=$(command -v omarchy-hw-platform) || _omarchy_detector=/usr/share/libalpm/scripts/omarchy-hw-platform
|
||||
if [[ -x $_omarchy_detector ]]; then
|
||||
if _omarchy_detector=$(command -v omarchy-hw-platform); then
|
||||
_omarchy_platform=$("$_omarchy_detector") || return 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -217,19 +217,15 @@ split=$scratch/split/omarchy
|
||||
mkdir -p "$scratch/split"
|
||||
cp -a "$fixture" "$split"
|
||||
cp "$fixtures"/omarchy-13362/*.conf "$split/etc/mkinitcpio.conf.d/"
|
||||
# Its 00-omarchy-hooks.conf asks the detector copy the platform guard ships.
|
||||
for path in default/libalpm/hooks/00-omarchy-platform-guard.hook \
|
||||
default/libalpm/scripts/omarchy-platform-guard bin/omarchy-hw-platform; do
|
||||
mkdir -p "$(dirname "$split/$path")"
|
||||
printf 'fixture for %s\n' "$path" > "$split/$path"
|
||||
done
|
||||
# Its 00-omarchy-hooks.conf asks the runtime's own detector (omarchy-hw-platform
|
||||
# on PATH), so the package builds without a copy of it and ships none.
|
||||
for recipe in omarchy-settings omarchy-settings-dev; do
|
||||
package_aarch64 "$recipe" "$split" "$scratch/split-$recipe" >/dev/null
|
||||
for conf in 00-omarchy-hooks.conf omarchy_hooks.conf; do
|
||||
cmp "$fixtures/omarchy-13362/$conf" "$scratch/split-$recipe/etc/mkinitcpio.conf.d/$conf"
|
||||
done
|
||||
grep -Fxq etc/mkinitcpio.conf.d/00-omarchy-hooks.conf "$scratch/split-$recipe.backup"
|
||||
[[ -x $scratch/split-$recipe/usr/share/libalpm/scripts/omarchy-hw-platform ]]
|
||||
[[ ! -e $scratch/split-$recipe/usr/share/libalpm/scripts/omarchy-hw-platform ]]
|
||||
done
|
||||
layout="omacom/omarchy#13362 (00-omarchy-hooks.conf)"
|
||||
packaged=$scratch/split-omarchy-settings/etc/mkinitcpio.conf.d
|
||||
@@ -275,8 +271,6 @@ refuse "a hooks file that sets no HOOKS" "$unsafe" omarchy_hooks.conf 'FILES+=(/
|
||||
refuse "a HOOKS line with a trailing comment" "$unguardable" omarchy_hooks.conf "HOOKS=($omarchy_hooks) # local"
|
||||
refuse "a HOOKS line split over lines" "$unguardable" omarchy_hooks.conf "HOOKS=(base udev"$'\n'" block encrypt filesystems)"
|
||||
refuse "an indented HOOKS that ignores asahi" "$unsafe" 00-omarchy-hooks.conf "if true; then"$'\n'" HOOKS=($omarchy_hooks)"$'\n'"fi"
|
||||
refuse "#13362's hooks without the platform detector" "needs the omarchy-hw-platform copy" \
|
||||
00-omarchy-hooks.conf "$(cat "$fixtures/omarchy-13362/00-omarchy-hooks.conf")"
|
||||
|
||||
# Upgrades: pacman replaces an unmodified hooks file, keeps a modified one and
|
||||
# leaves the guarded version as .pacnew, and installs it where it was absent.
|
||||
|
||||
Reference in new issue
Block a user