Initial commit

This commit is contained in:
domenico
2025-06-24 15:51:28 +02:00
commit 22031d9dab
6862 changed files with 1462554 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/sh
. /lib/functions/uci-defaults.sh
board=$(board_name)
board_config_update
case $board in
"akitio,myloud")
ucidef_set_led_default "status" "status" "akitio:red:status" "0"
;;
"mitrastar,stg-212")
ucidef_set_led_default "power" "power" "zyxel:blue:status" "1"
ucidef_set_led_usbdev "usb" "USB" "zyxel:orange:copy" "1-1"
;;
"shuttle,kd20")
ucidef_set_led_default "power" "power" "kd20:blue:status" "1"
;;
"cloudengines,pogoplug"*)
ucidef_set_led_default "power" "power" "pogoplug:blue:internal" "1"
;;
esac
board_config_flush
exit 0

View File

@@ -0,0 +1,45 @@
#!/bin/sh
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
board_config_update
lan_mac=""
bootloader_cmdline_var() {
local param
local pval
for arg in $(cat /proc/device-tree/chosen/bootloader-args); do
param="$(echo $arg | cut -d'=' -f 1)"
pval="$(echo $arg | cut -d'=' -f 2-)"
if [ "$param" = "$1" ]; then
echo "$pval"
fi
done
}
legacy_boot_mac_adr() {
local macstr
local oIFS
macstr="$(bootloader_cmdline_var mac_adr)"
oIFS="$IFS"
IFS=","
set -- $macstr
printf "%02x:%02x:%02x:%02x:%02x:%02x" $1 $2 $3 $4 $5 $6
IFS="$oIFS"
}
case "$(board_name)" in
"shuttle,kd20")
lan_mac="$(legacy_boot_mac_adr)"
;;
esac
ucidef_set_interface_lan "eth0" "dhcp"
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
board_config_flush
exit 0

View File

@@ -0,0 +1,41 @@
#!/bin/sh
# Copyright (C) 2009-2013 OpenWrt.org
. /lib/functions.sh
. /lib/functions/leds.sh
get_status_led() {
case $(board_name) in
"akitio,mycloud")
status_led="akitio:red:status"
;;
"mitrastar,stg-212")
status_led="zyxel:blue:status"
;;
"shuttle,kd20")
status_led="kd20:blue:status"
;;
"cloudengines,pogoplug"*)
status_led="pogoplug:blue:internal"
;;
esac
}
set_state() {
get_status_led
case "$1" in
preinit)
status_led_blink_preinit
;;
failsafe)
status_led_blink_failsafe
;;
preinit_regular)
status_led_blink_preinit_regular
;;
done)
status_led_on
;;
esac
}

View File

@@ -0,0 +1,22 @@
#!/bin/sh /etc/rc.common
START=99
get_irq() {
local name="$1"
grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'
}
set_irq_affinity() {
local name="$1"
local val="$2"
local irq="$(get_irq "$name")"
[ -n "$irq" ] || return
echo "$val" > "/proc/irq/$irq/smp_affinity"
}
start() {
set_irq_affinity ehci_hcd 2
set_irq_affinity xhci_hcd 2
set_irq_affinity sata 2
}

View File

@@ -0,0 +1,9 @@
REQUIRE_IMAGE_METADATA=1
platform_check_image() {
return 0
}
platform_do_upgrade() {
nand_do_upgrade $1
}