Add stage3

- Install libnss-mdns package
- Sudo without password
- Add and enable vision service
pull/318/head
Nathan Mutin 2019-07-29 17:55:54 +02:00
parent 7870976ae7
commit d8787ee10e
6 changed files with 34 additions and 1 deletions

View File

@ -96,7 +96,7 @@ export -f on_chroot
update_issue() {
local GIT_HASH
GIT_HASH=$(git rev-parse HEAD)
echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue"
echo -e "${IMG_NAME} built on ${IMG_DATE}\nGenerated using ${PI_GEN}, ${PI_GEN_REPO}, ${GIT_HASH}, ${1}" > "${ROOTFS_DIR}/etc/rpi-issue"
}
export -f update_issue

View File

@ -0,0 +1 @@
libnss-mdns

View File

@ -0,0 +1,4 @@
#!/bin/bash -e
# Enable password-less sudo for everyone
echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> "${ROOTFS_DIR}/etc/sudoers"

View File

@ -0,0 +1,12 @@
#!/bin/bash -e
# Install the service so the system can run it
install -m 755 files/vision.service "${ROOTFS_DIR}/etc/systemd/system"
on_chroot << EOF
# Reload the system services
sudo systemctl daemon-reload
# Enable our vision service on startup
sudo systemctl enable vision
EOF

View File

@ -0,0 +1,11 @@
[Unit]
Description=FRC Vision Service
[Service]
Type=simple
Restart=always
ExecStart=/home/vision/visionProgram
WorkingDirectory=/home/vision
[Install]
WantedBy=multi-user.target

5
stage3/prerun.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash -e
if [ ! -d "${ROOTFS_DIR}" ]; then
copy_previous
fi