Add new Skeleton.

This commit is contained in:
2016-11-16 22:04:31 +01:00
parent 05de7d6c04
commit 317c040ea8
46 changed files with 16694 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
# <file system> <mount pt> <type> <options> <dump> <pass>
/dev/root / ext2 rw,noauto 0 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts defaults,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
tmpfs /tmp tmpfs mode=1777 0 0
tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 /mnt/user vfat defaults 0 2

View File

@@ -0,0 +1,3 @@
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mmcblk0 0x88000 0x20000 0x20000
#/boot/uboot.env 0x0000 0x4000 0x4000

View File

@@ -0,0 +1,18 @@
[
[ "case", "ACTION", {
"add": [
[ "if",
[ "has", "FIRMWARE" ],
[
[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ],
[ "load-firmware", "/lib/firmware" ],
[ "return" ]
]
],
],
}, ],
[ "if",
[ "eq", "SUBSYSTEM", "button" ],
[ "exec", "/etc/rc.button/failsafe" ]
],
]

View File

@@ -0,0 +1,7 @@
[ ifup = "$ACTION" ] && {
uci_toggle_state network "$INTERFACE" up 1
[ -n "$DEVICE" ] && {
uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
}
}

View File

@@ -0,0 +1,9 @@
#!/bin/sh
if [ "$ACTION" = add ]; then
for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
[ ! -f "$CONF" ] && continue;
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
sysctl -e -p - | logger -t sysctl
done
fi

View File

@@ -0,0 +1,80 @@
[
[ "case", "ACTION", {
"add": [
[ "if",
[ "and",
[ "has", "MAJOR" ],
[ "has", "MINOR" ],
],
[
[ "if",
[ "or",
[ "eq", "DEVNAME",
[ "null", "full", "ptmx", "zero" ],
],
[ "regex", "DEVNAME",
[ "^gpio", "^hvc" ],
],
],
[
[ "makedev", "/dev/%DEVNAME%", "0666" ],
[ "return" ],
]
],
[ "if",
[ "or",
[ "eq", "DEVNAME", "mapper/control" ],
[ "regex", "DEVPATH", "^ppp" ],
],
[
[ "makedev", "/dev/%DEVNAME%", "0600" ],
[ "return" ],
],
],
[ "if",
[ "has", "DEVNAME" ],
[ "makedev", "/dev/%DEVNAME%", "0644" ],
],
],
],
[ "if",
[ "has", "FIRMWARE" ],
[
[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ],
[ "load-firmware", "/lib/firmware" ],
[ "return" ]
]
],
],
"remove" : [
[ "if",
[ "and",
[ "has", "DEVNAME" ],
[ "has", "MAJOR" ],
[ "has", "MINOR" ],
],
[ "rm", "/dev/%DEVNAME%" ]
]
]
} ],
[ "if",
[ "and",
[ "has", "BUTTON" ],
[ "eq", "SUBSYSTEM", "button" ],
],
[ "button", "/etc/rc.button/%BUTTON%" ]
],
[ "if",
[ "and",
[ "eq", "SUBSYSTEM", "usb-serial" ],
[ "regex", "DEVNAME",
[ "^ttyUSB", "^ttyACM" ]
]
],
[ "exec", "/sbin/hotplug-call", "tty" ],
[ "if",
[ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
]
],
]

View File

@@ -0,0 +1,27 @@
#!/bin/sh /etc/rc.common
#
START=10
STOP=98
boot() {
mount -a
ConfigState=`fw_printenv is_configured | cut -d'=' -f2`
if [ "$ConfigState" = "0" ]; then
echo "Reset the Device Name to Factory."
mkdir -p /mnt/user/UserSettings/
rm /mnt/user/UserSettings/*
/usr/local/bin/Device_Name mediaCTRLRenderer.ini mediaCTRLServer.ini SlavePlayer.ini
fw_setenv is_configured 1
fi
# Set our device Hostname using the friendlyName
friendlyname=`cat /usr/local/configs/mediaCTRLRenderer.ini | grep friendlyname | cut -f2 -d'='`
mac=`fw_printenv ethaddr | cut -f4-6 -d':' | sed s/://g`
hostname $friendlyname-$mac
echo Device hostname is `hostname`
# Temporary Hack
ifconfig lo up
ifconfig eth0 up
udhcpc -i eth0
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh /etc/rc.common
STOP=99
stop() {
sync
/bin/umount -a -d -r
}

View File

@@ -0,0 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
::respawn:/sbin/getty -L 115200 console vt100

View File

@@ -0,0 +1,3 @@
#!/bin/sh
[ -z "$PREINIT" ] && exec /sbin/init

View File

@@ -0,0 +1,5 @@
# Acces aux scripts personnels et code metier.
PATH=$PATH:/usr/local/bin
# Prompt indiquant nom d'hote et repertoire courant.
PS1='\h[\W]\$ '

View File

@@ -0,0 +1,143 @@
#!/bin/sh
# Copyright (C) 2006-2012 OpenWrt.org
. $IPKG_INSTROOT/lib/functions.sh
. $IPKG_INSTROOT/lib/functions/service.sh
initscript=$1
action=${2:-help}
shift 2
start() {
return 0
}
stop() {
return 0
}
reload() {
return 1
}
restart() {
trap '' TERM
stop "$@"
start "$@"
}
boot() {
start "$@"
}
shutdown() {
stop
}
disable() {
name="$(basename "${initscript}")"
rm -f "$IPKG_INSTROOT"/etc/rc.d/S??$name
rm -f "$IPKG_INSTROOT"/etc/rc.d/K??$name
}
enable() {
name="$(basename "${initscript}")"
disable
[ -n "$START" -o -n "$STOP" ] || {
echo "/etc/init.d/$name does not have a START or STOP value"
return 1
}
[ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}"
[ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}"
}
enabled() {
name="$(basename "${initscript}")"
[ -x "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" ]
}
depends() {
return 0
}
help() {
cat <<EOF
Syntax: $initscript [command]
Available commands:
start Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if that fails)
enable Enable service autostart
disable Disable service autostart
$EXTRA_HELP
EOF
}
# for procd
start_service() {
return 0
}
stop_service() {
return 0
}
service_triggers() {
return 0
}
service_running() {
return 0
}
${INIT_TRACE:+set -x}
. "$initscript"
[ -n "$USE_PROCD" ] && {
EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
. $IPKG_INSTROOT/lib/functions/procd.sh
basescript=$(readlink "$initscript")
rc_procd() {
procd_open_service "$(basename ${basescript:-$initscript})" "$initscript"
"$@"
procd_close_service
}
start() {
rc_procd start_service "$@"
if eval "type service_started" 2>/dev/null >/dev/null; then
service_started
fi
}
trace() {
TRACE_SYSCALLS=1
start "$@"
}
stop() {
stop_service "$@"
procd_kill "$(basename ${basescript:-$initscript})" "$1"
}
reload() {
if eval "type reload_service" 2>/dev/null >/dev/null; then
reload_service "$@"
else
start
fi
}
running() {
service_running "$@"
}
}
ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
list_contains ALL_COMMANDS "$action" || action=help
[ "$action" = "reload" ] && action='eval reload "$@" || restart "$@" && :'
$action "$@"

View File

@@ -0,0 +1 @@
../init.d/umount

View File

@@ -0,0 +1 @@
../init.d/boot