msm8916-openwrt/target/linux/armsr/base-files/lib/preinit/01_sysinfo_acpi
Mathew McBride 40b02a2301
armsr: rename from armvirt
Now that the armvirt target supports real hardware, not just
VMs, thanks to the addition of EFI, rename it to something
more appropriate.

'armsr' (Arm SystemReady) was chosen after the name of
the Arm standards program.

The 32 and 64 bit targets have also been renamed
armv7 and armv8 respectively, to allow future profiles
where required (such as armv9).

See https://developer.arm.com/documentation/102858/0100/Introduction
for more information.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
2023-06-10 21:30:19 +02:00

53 lines
1.0 KiB
Plaintext

# SPDX-License-Identifier: GPL-2.0-or-later
sanitize_name_arm64() {
sed -e '
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
s/[^a-z0-9_-]\+/-/g;
s/^-//;
s/-$//;
' "$@"
}
do_sysinfo_arm64() {
local vendor product file
for file in sys_vendor board_vendor; do
vendor="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
case "$vendor" in
empty | \
System\ manufacturer | \
To\ [bB]e\ [fF]illed\ [bB]y\ O\.E\.M\.)
continue
;;
esac
[ -n "$vendor" ] && break
done
for file in product_name board_name; do
product="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
case "$vendor:$product" in
?*:empty | \
?*:System\ Product\ Name | \
?*:To\ [bB]e\ [fF]illed\ [bB]y\ O\.E\.M\.)
continue
;;
?*:?*)
break
;;
esac
done
[ -d "/sys/firmware/devicetree/base" ] && return
[ -n "$vendor" -a -n "$product" ] || return
mkdir -p /tmp/sysinfo
echo "$vendor $product" > /tmp/sysinfo/model
sanitize_name_arm64 /tmp/sysinfo/model > /tmp/sysinfo/board_name
}
boot_hook_add preinit_main do_sysinfo_arm64