Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
sanitize_name_loongarch64() {
|
||||
sed -e '
|
||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
|
||||
s/[^a-z0-9_-]\+/-/g;
|
||||
s/^-//;
|
||||
s/-$//;
|
||||
' "$@"
|
||||
}
|
||||
|
||||
do_sysinfo_loongarch64() {
|
||||
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_loongarch64 /tmp/sysinfo/model > /tmp/sysinfo/board_name
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main do_sysinfo_loongarch64
|
||||
@@ -0,0 +1,19 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
move_config() {
|
||||
local partdev parttype=ext4
|
||||
|
||||
. /lib/upgrade/common.sh
|
||||
|
||||
if export_bootdevice && export_partdevice partdev 1; then
|
||||
part_magic_fat "/dev/$partdev" && parttype=vfat
|
||||
if mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt; then
|
||||
if [ -f "/mnt/$BACKUP_FILE" ]; then
|
||||
mv -f "/mnt/$BACKUP_FILE" /
|
||||
fi
|
||||
umount /mnt
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
boot_hook_add preinit_mount_root move_config
|
||||
Reference in New Issue
Block a user