-
Notifications
You must be signed in to change notification settings - Fork 2
/
acq400_common.init
executable file
·67 lines (50 loc) · 1.63 KB
/
acq400_common.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
echo acq400_common.init
#PS1=acq400_common: /bin/sh
get_u-boot_env
mkdir -p /etc/acq400/
mount -t ramfs ram /etc/acq400
mkdir /etc/acq400/0
source /tmp/u-boot_env
if [ "x${EBREAK}" = "xyes" ]; then
echo BREAK to emergency shell ^D when done
PS1="${PS1%>*} EBREAK ${PS1#*>}" /bin/sh
fi
[ -e /mnt/local/sysconfig/acq400.sh ] && source /mnt/local/sysconfig/acq400.sh
[ "x$RSYSLOG_HOST" != "x" ] && /usr/local/CARE/start_rsyslog $RSYSLOG_HOST
MODEL=${devicetree_image%*.dtb};
MODEL=${MODEL#*/}
echo $MODEL >/etc/acq400/0/MODEL
echo $dtsn >/etc/acq400/0/SERIAL
echo ${hn#*=} >/etc/acq400/0/HN
/sbin/insmod /lib/modules/$(uname -r)/xilinx_devcfg.ko
[ -e /mnt/local/sysconfig/localtime ] && cp /mnt/local/sysconfig/localtime /etc
# possible to make wholesale changes to /etc, but insist on tarball to get
# permisssions right.
[ -e /mnt/local/sysconfig/etc.tgz ] && \
tar xvzf /mnt/local/sysconfig/etc.tgz -C /
patch_check() {
(
renice 10
head -n 1 /mnt/version | awk '{ print $2 }'
/mnt/bin/check_version >/dev/null
[ $? -ne 0 ] && echo PATCHED
) > /etc/acq400/0/software_version
}
daemon /usr/local/CARE/slug_spurious_uart_interrupts daemon 10
patch_check &
# /etc/services:
# customised for acq400
cat - >> /etc/services <<EOF
ssh 22/tcp # SSH
http 80/tcp www www-http # WorldWideWeb HTTP
acq4xx-epics-console 2222/tcp
acq4xx-aimonitor-console 2223/tcp
acq4xx-mdsshell-console 2224/tcp
acq4xx-transient-console 2225/tcp
acq4xx-nowhere-console 2226/tcp
acq4xx-transient-log-console 2235/tcp
EOF
sort_services
# may need to do this again later if more services are defined
make-console-links