systems/lctr-rpi4: add new system family for the new rpi versions (RPI4)
This commit is contained in:
parent
c7725832b1
commit
0e7d615c9f
7025
systems/lctr-rpi4/cfg/linux-4.19_2019-07-29.cfg
Normal file
7025
systems/lctr-rpi4/cfg/linux-4.19_2019-07-29.cfg
Normal file
File diff suppressed because it is too large
Load Diff
17
systems/lctr-rpi4/config
Normal file
17
systems/lctr-rpi4/config
Normal file
@ -0,0 +1,17 @@
|
||||
cfg_architecture='cortex-a8-hardfp'
|
||||
cfg_storage='data0:ext4:/opt'
|
||||
cfg_modules=''
|
||||
cfg_services0='network dropbear storage upgrade syslog ptpd'
|
||||
cfg_services2='dune'
|
||||
cfg_packages='dropbear rsync busybox e2fsprogs dosfstools ptpd rpcbind rpi-boot-firmware linux/rpi'
|
||||
cfg_target_linux_kernel='arch/arm/boot/zImage'
|
||||
cfg_ptpd_interface='eth0'
|
||||
cfg_eth_ext_mk='255.255.0.0'
|
||||
cfg_eth_ext_gw='10.0.0.1'
|
||||
cfg_terminal='tty1'
|
||||
cfg_partitions=\
|
||||
(
|
||||
rpi-boot BOOT0 512B 128MiB
|
||||
root root0 128MiB 640MiB
|
||||
data data0 640MiB -1
|
||||
)
|
13
systems/lctr-rpi4/fs/boot/config.txt
Normal file
13
systems/lctr-rpi4/fs/boot/config.txt
Normal file
@ -0,0 +1,13 @@
|
||||
# Core.
|
||||
arm_freq=1000
|
||||
sdram_freq=500
|
||||
core_freq=500
|
||||
over_voltage=2
|
||||
temp_limit=80 #Will throttle to default clock speed if hit.
|
||||
|
||||
# Disable BT on Rpi3.
|
||||
dtoverlay=pi3-disable-bt
|
||||
|
||||
# Enable RasPicam
|
||||
start_x=1
|
||||
gpu_mem=128
|
4
systems/lctr-rpi4/fs/etc/inittab
Normal file
4
systems/lctr-rpi4/fs/etc/inittab
Normal file
@ -0,0 +1,4 @@
|
||||
::sysinit:/sbin/services sysinit
|
||||
::restart:/sbin/init
|
||||
::respawn:-/usr/sbin/dropbear -F
|
||||
::shutdown:/sbin/services syshalt
|
2
systems/lctr-rpi4/fs/etc/mdev.conf
Normal file
2
systems/lctr-rpi4/fs/etc/mdev.conf
Normal file
@ -0,0 +1,2 @@
|
||||
ttyAMA0 root:root 660 >terminal
|
||||
ttyUSB[0-9]* root:root 660 */sbin/mdev-ttyusb
|
45
systems/lctr-rpi4/fs/etc/rc.d/lauv-storage-client
Normal file
45
systems/lctr-rpi4/fs/etc/rc.d/lauv-storage-client
Normal file
@ -0,0 +1,45 @@
|
||||
mount_path()
|
||||
{
|
||||
rpath="$cfg_lauv_storage_host:$1"
|
||||
lpath="$1"
|
||||
|
||||
mkdir -p "$lpath"
|
||||
|
||||
mount -t nfs -o wsize=32768 "$rpath" "$lpath"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "* Mounted '$rpath' in '$lpath'"
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
/usr/bin/rpcbind
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: failed to start rpcbind."
|
||||
return 1
|
||||
fi
|
||||
|
||||
for path in $cfg_lauv_storage_paths; do
|
||||
n=0; while [ $n -lt "$cfg_lauv_storage_timeout" ]; do
|
||||
mount_path "$path"
|
||||
if [ $? -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
let n++
|
||||
sleep 1
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
killall rpcbind
|
||||
|
||||
for path in $cfg_lauv_storage_paths; do
|
||||
umount "$path"
|
||||
done
|
||||
}
|
125
systems/lctr-rpi4/fs/etc/rc.d/lauv-storage-server
Normal file
125
systems/lctr-rpi4/fs/etc/rc.d/lauv-storage-server
Normal file
@ -0,0 +1,125 @@
|
||||
mount_storage()
|
||||
{
|
||||
echo "* Probing storage..."
|
||||
|
||||
bdev="$1"
|
||||
if ! [ -b "$bdev" ]; then
|
||||
echo "* Device $bdev does not exist."
|
||||
return 1
|
||||
fi
|
||||
|
||||
mount -o rw,relatime "$bdev" "$cfg_lauv_storage_dir" 2> /dev/null
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "* Failed to mount $bdev on $cfg_lauv_storage_dir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "* Mounted '$bdev' on '$cfg_lauv_storage_dir'"
|
||||
return 0
|
||||
}
|
||||
|
||||
try_mount_storage()
|
||||
{
|
||||
n=0; while [ $n -lt 30 ]; do
|
||||
mount_storage "$1"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
let n++
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
start_nfs_server()
|
||||
{
|
||||
echo "* Creating NFS administrative folder..."
|
||||
mkdir -p /var/lib/nfs
|
||||
if ! [ -d /var/lib/nfs ]; then
|
||||
echo "ERROR: failed to create data folder."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "* Launching rpcbind..."
|
||||
/usr/bin/rpcbind
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: failed to start rpcbind."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "* Launching rpc.statd..."
|
||||
/usr/bin/rpc.statd
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: failed to start rpc.statd."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "* Launching rpc.nfsd..."
|
||||
/usr/bin/rpc.nfsd
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: failed to start rpc.nfsd."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "* Creating NFS filesystem table..."
|
||||
/usr/bin/exportfs -ra
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: failed to create filesystem table."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "* Launching rpc.mountd..."
|
||||
/usr/bin/rpc.mountd
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: failed to start rpc.mountd."
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "* Exporting NFS filesystems..."
|
||||
/usr/bin/exportfs \
|
||||
-o rw,async,no_root_squash,no_subtree_check \
|
||||
10.0.0.0/16:"$cfg_lauv_storage_dir"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: failed to export filesystems."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
stop_nfs_server()
|
||||
{
|
||||
echo "* Unexporting NFS filesystems..."
|
||||
exportfs -au 2> /dev/null
|
||||
echo "* Terminating rpc.mountd..."
|
||||
killall rpc.mountd 2> /dev/null
|
||||
echo "* Terminating rpc.statd..."
|
||||
killall rpc.statd 2> /dev/null
|
||||
echo "* Terminating rpc.bind..."
|
||||
killall rpcbind 2> /dev/null
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
mkdir -p "$cfg_lauv_storage_dir"
|
||||
|
||||
# Removable storage.
|
||||
if [ "$cfg_lauv_storage" != "internal" ]; then
|
||||
try_mount_storage /dev/sda1
|
||||
fi
|
||||
|
||||
# FIXME: what to do if the above fails.
|
||||
start_nfs_server
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
stop_nfs_server
|
||||
|
||||
if [ "$cfg_lauv_storage" != "internal" ]; then
|
||||
echo "* Unmounting storage..."
|
||||
umount "$cfg_lauv_storage_dir"
|
||||
fi
|
||||
}
|
4
systems/lctr-rpi4/template.cfg
Normal file
4
systems/lctr-rpi4/template.cfg
Normal file
@ -0,0 +1,4 @@
|
||||
cfg_hostname='template'
|
||||
cfg_eth_ext_ip='10.0.20.125'
|
||||
cfg_packages="$cfg_packages opencv"
|
||||
cfg_modules="$cfg_modules ftdi_sio rt73usb"
|
Reference in New Issue
Block a user