]> rtime.felk.cvut.cz Git - can-eth-gw.git/blobdiff - rootfs/post-build.sh
Add buildroot a linux config for easier testing
[can-eth-gw.git] / rootfs / post-build.sh
diff --git a/rootfs/post-build.sh b/rootfs/post-build.sh
new file mode 100755 (executable)
index 0000000..972fcf1
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+TARGET=$1
+BR_TOOLCHAIN_DIR=$PWD/host/usr/bin
+
+make CC=$PWD/../host/usr/bin/i686-pc-linux-gnu-gcc -C ../../can-utils clean cegw
+
+install -v ../../can-utils/cegw $TARGET/bin
+
+cat <<EOF > $TARGET/etc/init.d/S60can
+for i in 0 1 2 3; do
+    ip link set can\$i up type can bitrate 1000000
+    ifconfig can$i txqueuelen 1000
+done
+ip link add vcan0 type vcan
+ip link set vcan0 up
+EOF
+chmod +x $TARGET/etc/init.d/S60can
+
+fgrep -q eth0 $TARGET/etc/network/interfaces || cat <<EOF >> $TARGET/etc/network/interfaces
+auto eth0
+iface eth0 inet dhcp
+EOF