blob: 5daad731d4c3955403ea9c2998e5334dfabd8262 [file] [log] [blame]
Parker Schuh46b48812019-02-22 20:45:36 -08001#!/bin/sh
2
3if [ "$(id -u)" != "0" ]
4then
5 echo "Please run as root: $(id -u)"
6 exit
7fi
8
9DEV_BASE=/dev/mmcblk0p
10
11echo "Please check that ${DEV_BASE}3 is the correct drive to format. This is a destructive command so please be sure."
12read -p "Enter \"yes\" when you are ready: " input
13
14if [ "$input" != "yes" ]
15then
16 echo "Format aborted."
17 exit -1
18fi
19
20# need to disable some new features on 17.x
21sudo mkfs.ext4 -L JEVOIS -O ^64bit,uninit_bg,^metadata_csum ${DEV_BASE}3
22
23echo "Mounting JEVOIS."
24mkdir -p /tmp/JEVOIS
25sudo mount ${DEV_BASE}3 /tmp/JEVOIS
26
27echo "Mounting LINUX."
28mkdir -p /tmp/LINUX
29sudo mount ${DEV_BASE}2 /tmp/LINUX
30
31echo "Make JEVOIS directories."
32mkdir -p /tmp/JEVOIS/packages
33mkdir -p /tmp/JEVOIS/modules
34mkdir -p /tmp/JEVOIS/config
35mkdir -p /tmp/JEVOIS/lib
36
37echo "Copy configs."
38cp ./austin_cam.sh /tmp/JEVOIS
39cp ./videomappings.cfg /tmp/JEVOIS/config/
40cp ./rcS_script.txt /tmp/LINUX/etc/init.d/rcS
41cp Jevois_fstab /tmp/LINUX/etc/fstab
42
43echo "Un-mounting JEVOIS"
44sudo umount /tmp/JEVOIS
45
46echo "Un-mounting LINUX"
47sudo umount /tmp/LINUX
48
49