Initial FRCVision commit.
This commit is contained in:
parent
4fc1423fdf
commit
d687acb744
|
@ -48,6 +48,16 @@ ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \
|
|||
ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \
|
||||
| cut -d" " -f 4 | tr -d B)
|
||||
|
||||
# Loopback crash workaround
|
||||
# https://github.com/RPi-Distro/pi-gen/issues/104
|
||||
#losetup -D
|
||||
#for i in $(seq 0 5); do
|
||||
# dd if=/dev/zero of=virtualfs$i bs=1024 count=30720
|
||||
# losetup /dev/loop$i virtualfs$i
|
||||
# losetup -d /dev/loop$i
|
||||
# rm virtualfs$i
|
||||
#done
|
||||
|
||||
BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}")
|
||||
ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}")
|
||||
echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH"
|
||||
|
@ -59,11 +69,13 @@ for FEATURE in metadata_csum 64bit; do
|
|||
ROOT_FEATURES="^$FEATURE,$ROOT_FEATURES"
|
||||
fi
|
||||
done
|
||||
mkdosfs -n boot -F 32 -v "$BOOT_DEV" > /dev/null
|
||||
mkdosfs -n boot -F 32 -I -v "$BOOT_DEV" > /dev/null
|
||||
mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null
|
||||
|
||||
mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4
|
||||
mkdir -p "${ROOTFS_DIR}/boot"
|
||||
mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot" -t vfat
|
||||
|
||||
rsync -aHAXx --exclude var/cache/apt/archives "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
|
||||
rsync -aHAXx --exclude var/cache/apt/archives --exclude dev --exclude boot "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
|
||||
rsync -aHAx --exclude var/cache/apt/archives "${EXPORT_ROOTFS_DIR}/boot/" "${ROOTFS_DIR}/boot/"
|
||||
rsync -aHAx --exclude var/cache/apt/archives "${EXPORT_ROOTFS_DIR}/dev/" "${ROOTFS_DIR}/dev/"
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,6 @@
|
|||
proc /proc proc defaults 0 0
|
||||
BOOTDEV /boot vfat defaults 0 2
|
||||
ROOTDEV / ext4 defaults,noatime 0 1
|
||||
tmpfs /tmp tmpfs nosuid,nodev 0 0
|
||||
tmpfs /var/log tmpfs nosuid,nodev 0 0
|
||||
tmpfs /var/tmp tmpfs nosuid,nodev 0 0
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,25 +1,25 @@
|
|||
java-common
|
||||
ntp
|
||||
daemontools daemontools-run
|
||||
busybox-syslogd
|
||||
ssh less fbset sudo psmisc strace ed ncdu crda
|
||||
console-setup keyboard-configuration debconf-utils parted unzip
|
||||
build-essential manpages-dev python bash-completion gdb pkg-config
|
||||
python gdbserver pkg-config
|
||||
python-rpi.gpio v4l-utils
|
||||
avahi-daemon
|
||||
lua5.1
|
||||
luajit
|
||||
hardlink ca-certificates curl
|
||||
fake-hwclock nfs-common usbutils
|
||||
libraspberrypi-dev libraspberrypi-doc libfreetype6-dev
|
||||
fake-hwclock usbutils
|
||||
dosfstools
|
||||
dphys-swapfile
|
||||
raspberrypi-sys-mods
|
||||
pi-bluetooth
|
||||
apt-listchanges
|
||||
usb-modeswitch
|
||||
apt-transport-https
|
||||
libpam-chksshpwd
|
||||
rpi-update
|
||||
libmtp-runtime
|
||||
rsync
|
||||
htop
|
||||
man-db
|
||||
policykit-1
|
||||
ssh-import-id
|
||||
|
|
|
@ -11,11 +11,40 @@ install -m 644 files/console-setup "${ROOTFS_DIR}/etc/default/"
|
|||
|
||||
install -m 755 files/rc.local "${ROOTFS_DIR}/etc/"
|
||||
|
||||
# disable wireless
|
||||
install -m 644 files/raspi-blacklist.conf "${ROOTFS_DIR}/etc/modprobe.d/"
|
||||
|
||||
install -m 644 files/frc.json "${ROOTFS_DIR}/boot/"
|
||||
|
||||
install -m 755 -o 1000 -g 1000 files/multiCameraServer "${ROOTFS_DIR}/home/pi/"
|
||||
|
||||
cat files/jdk_11.0.1-strip.tar.gz | sh -c "mkdir -p ${ROOTFS_DIR}/usr/lib/jvm && cd ${ROOTFS_DIR}/usr/lib/jvm/ && tar xzf - --transform=s/^jdk/jdk-11.0.1/"
|
||||
cp files/jdk-11.0.1.jinfo "${ROOTFS_DIR}/usr/lib/jvm/.jdk-11.0.1.jinfo"
|
||||
|
||||
on_chroot << EOF
|
||||
cd /usr/lib/jvm
|
||||
grep /usr/lib/jvm .jdk-11.0.1.jinfo | awk '{ print "update-alternatives --install /usr/bin/" \$2 " " \$2 " " \$3 " 2"; }' | bash
|
||||
update-java-alternatives -s jdk-11.0.1
|
||||
EOF
|
||||
|
||||
on_chroot << EOF
|
||||
rm -rf /var/lib/dhcp/ /var/run /var/spool /var/lock
|
||||
ln -s /tmp /var/lib/dhcp
|
||||
ln -s /run /var/run
|
||||
ln -s /tmp /var/spool
|
||||
ln -s /tmp /var/lock
|
||||
sed -i -e 's/d \/var\/spool/#d \/var\/spool/' /usr/lib/tmpfiles/var.conf
|
||||
sed -i -e 's/\/var\/lib\/ntp/\/var\/tmp/' /etc/ntp.conf
|
||||
EOF
|
||||
|
||||
cat files/bash.bashrc >> "${ROOTFS_DIR}/etc/bash.bashrc"
|
||||
|
||||
cat files/bash.logout >> "${ROOTFS_DIR}/etc/bash.bash_logout"
|
||||
|
||||
on_chroot << EOF
|
||||
systemctl disable hwclock.sh
|
||||
systemctl disable nfs-common
|
||||
systemctl disable rpcbind
|
||||
systemctl disable ssh
|
||||
systemctl enable ssh
|
||||
systemctl enable regenerate_ssh_host_keys
|
||||
EOF
|
||||
|
||||
|
@ -49,4 +78,17 @@ on_chroot << EOF
|
|||
usermod --pass='*' root
|
||||
EOF
|
||||
|
||||
install -v -d "${ROOTFS_DIR}/service/camera"
|
||||
|
||||
install -m 755 files/camera_run "${ROOTFS_DIR}/service/camera/run"
|
||||
|
||||
on_chroot << EOF
|
||||
cd /service/camera && rm -f supervise && ln -s /tmp/camera-supervise supervise
|
||||
cd /etc/service && rm -f camera && ln -s /service/camera .
|
||||
EOF
|
||||
|
||||
install -m 755 -o 1000 -g 1000 files/runCamera "${ROOTFS_DIR}/home/pi/"
|
||||
install -m 755 -o 1000 -g 1000 files/runInteractive "${ROOTFS_DIR}/home/pi/"
|
||||
install -m 755 -o 1000 -g 1000 files/runService "${ROOTFS_DIR}/home/pi/"
|
||||
|
||||
rm -f "${ROOTFS_DIR}/etc/ssh/"ssh_host_*_key*
|
||||
|
|
11
stage2/01-sys-tweaks/files/bash.bashrc
Normal file
11
stage2/01-sys-tweaks/files/bash.bashrc
Normal file
|
@ -0,0 +1,11 @@
|
|||
# set variable identifying the filesystem you work in (used in the prompt below)
|
||||
set_bash_prompt(){
|
||||
fs_mode=$(mount | sed -n -e "s/^\/dev\/.* on \/ .*(\(r[w|o]\).*/\1/p")
|
||||
PS1='\[\033[01;32m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
}
|
||||
|
||||
alias ro='sudo mount -o remount,ro / ; sudo mount -o remount,ro /boot'
|
||||
alias rw='sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot'
|
||||
|
||||
# setup fancy prompt
|
||||
PROMPT_COMMAND=set_bash_prompt
|
2
stage2/01-sys-tweaks/files/bash.logout
Normal file
2
stage2/01-sys-tweaks/files/bash.logout
Normal file
|
@ -0,0 +1,2 @@
|
|||
sudo mount -o remount,ro /
|
||||
sudo mount -o remount,ro /boot
|
4
stage2/01-sys-tweaks/files/camera_run
Executable file
4
stage2/01-sys-tweaks/files/camera_run
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
sleep 1
|
||||
cd /home/pi
|
||||
exec ./runCamera
|
13
stage2/01-sys-tweaks/files/frc.json
Normal file
13
stage2/01-sys-tweaks/files/frc.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"team": 294,
|
||||
"cameras": [
|
||||
{
|
||||
"name": "rPi Camera 0",
|
||||
"path": "/dev/video0",
|
||||
"pixel format": "mjpeg",
|
||||
"width": 160,
|
||||
"height": 120,
|
||||
"fps": 30
|
||||
}
|
||||
]
|
||||
}
|
36
stage2/01-sys-tweaks/files/jdk-11.0.1.jinfo
Normal file
36
stage2/01-sys-tweaks/files/jdk-11.0.1.jinfo
Normal file
|
@ -0,0 +1,36 @@
|
|||
name=jdk-11.0.1
|
||||
priority=900
|
||||
section=main
|
||||
|
||||
hl rmid /usr/lib/jvm/jdk-11.0.1/bin/rmid
|
||||
hl java /usr/lib/jvm/jdk-11.0.1/bin/java
|
||||
hl keytool /usr/lib/jvm/jdk-11.0.1/bin/keytool
|
||||
hl jjs /usr/lib/jvm/jdk-11.0.1/bin/jjs
|
||||
hl pack200 /usr/lib/jvm/jdk-11.0.1/bin/pack200
|
||||
hl rmiregistry /usr/lib/jvm/jdk-11.0.1/bin/rmiregistry
|
||||
hl unpack200 /usr/lib/jvm/jdk-11.0.1/bin/unpack200
|
||||
hl jexec /usr/lib/jvm/jdk-11.0.1/lib/jexec
|
||||
jdkhl jlink /usr/lib/jvm/jdk-11.0.1/bin/jlink
|
||||
jdkhl jdeps /usr/lib/jvm/jdk-11.0.1/bin/jdeps
|
||||
jdkhl jinfo /usr/lib/jvm/jdk-11.0.1/bin/jinfo
|
||||
jdkhl jstat /usr/lib/jvm/jdk-11.0.1/bin/jstat
|
||||
jdkhl javadoc /usr/lib/jvm/jdk-11.0.1/bin/javadoc
|
||||
jdkhl jmod /usr/lib/jvm/jdk-11.0.1/bin/jmod
|
||||
jdkhl jhsdb /usr/lib/jvm/jdk-11.0.1/bin/jhsdb
|
||||
jdkhl jps /usr/lib/jvm/jdk-11.0.1/bin/jps
|
||||
jdkhl jstack /usr/lib/jvm/jdk-11.0.1/bin/jstack
|
||||
jdkhl jrunscript /usr/lib/jvm/jdk-11.0.1/bin/jrunscript
|
||||
jdkhl javac /usr/lib/jvm/jdk-11.0.1/bin/javac
|
||||
jdkhl javap /usr/lib/jvm/jdk-11.0.1/bin/javap
|
||||
jdkhl jar /usr/lib/jvm/jdk-11.0.1/bin/jar
|
||||
jdkhl jshell /usr/lib/jvm/jdk-11.0.1/bin/jshell
|
||||
jdkhl rmic /usr/lib/jvm/jdk-11.0.1/bin/rmic
|
||||
jdkhl jdeprscan /usr/lib/jvm/jdk-11.0.1/bin/jdeprscan
|
||||
jdkhl jimage /usr/lib/jvm/jdk-11.0.1/bin/jimage
|
||||
jdkhl jstatd /usr/lib/jvm/jdk-11.0.1/bin/jstatd
|
||||
jdkhl jmap /usr/lib/jvm/jdk-11.0.1/bin/jmap
|
||||
jdkhl jdb /usr/lib/jvm/jdk-11.0.1/bin/jdb
|
||||
jdkhl serialver /usr/lib/jvm/jdk-11.0.1/bin/serialver
|
||||
jdkhl jcmd /usr/lib/jvm/jdk-11.0.1/bin/jcmd
|
||||
jdkhl jarsigner /usr/lib/jvm/jdk-11.0.1/bin/jarsigner
|
||||
jdk jconsole /usr/lib/jvm/jdk-11.0.1/bin/jconsole
|
6
stage2/01-sys-tweaks/files/raspi-blacklist.conf
Normal file
6
stage2/01-sys-tweaks/files/raspi-blacklist.conf
Normal file
|
@ -0,0 +1,6 @@
|
|||
#wifi
|
||||
blacklist brcmfmac
|
||||
blacklist brcmutil
|
||||
#bt
|
||||
blacklist btbcm
|
||||
blacklist hci_uart
|
|
@ -16,6 +16,7 @@ case "$1" in
|
|||
resize2fs $ROOT_DEV &&
|
||||
update-rc.d resize2fs_once remove &&
|
||||
rm /etc/init.d/resize2fs_once &&
|
||||
sed -i '/vfat\|ext4/s/defaults/defaults,ro/' /etc/fstab &&
|
||||
log_end_msg $?
|
||||
;;
|
||||
*)
|
||||
|
|
3
stage2/01-sys-tweaks/files/runCamera
Executable file
3
stage2/01-sys-tweaks/files/runCamera
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
sleep 5
|
||||
./multiCameraServer
|
10
stage2/01-sys-tweaks/files/runInteractive
Executable file
10
stage2/01-sys-tweaks/files/runInteractive
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
SVCPID=`ps ax | grep runCamera | grep -v grep | cut -c -6 | sed -e 's/ *//g'`
|
||||
sudo svc -d /service/camera
|
||||
if [[ ! -z $SVCPID ]]; then
|
||||
sudo kill $SVCPID
|
||||
sleep 1
|
||||
sudo kill -9 $SVCPID
|
||||
sleep 1
|
||||
fi
|
||||
exec ./runCamera
|
2
stage2/01-sys-tweaks/files/runService
Executable file
2
stage2/01-sys-tweaks/files/runService
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
sudo svc -u /service/camera
|
|
@ -6,3 +6,13 @@ install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.serv
|
|||
install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant"
|
||||
install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/"
|
||||
|
||||
on_chroot << EOF
|
||||
rm -f /etc/resolv.conf
|
||||
touch /tmp/dhcpcd.resolv.conf
|
||||
ln -s /tmp/dhcpcd.resolve.conf /etc/resolv.conf
|
||||
sed -i -e 's/\/run\//\/var\/run\//' /etc/systemd/system/dhcpcd5.control
|
||||
mv /etc/dhcpcd.conf /boot/
|
||||
chown root:root /boot/dhcpcd.conf
|
||||
ln -s /boot/dhcpcd.conf /etc/dhcpcd.conf
|
||||
EOF
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user