From 3644391ed4924c46a995af765072c7a47edb67db Mon Sep 17 00:00:00 2001 From: Roel Date: Mon, 21 Apr 2014 10:51:26 +0200 Subject: [PATCH] added a lazyinstall script for dev purposes --- lazyinstall/README.md | 3 +++ lazyinstall/fstab | 21 +++++++++++++++++++++ lazyinstall/fstab_extroot | 21 +++++++++++++++++++++ lazyinstall/lazyinstall1.sh | 25 +++++++++++++++++++++++++ lazyinstall/lazyinstall2.sh | 31 +++++++++++++++++++++++++++++++ lazyinstall/network | 20 ++++++++++++++++++++ lazyinstall/wireless | 8 ++++++++ 7 files changed, 129 insertions(+) create mode 100644 lazyinstall/README.md create mode 100644 lazyinstall/fstab create mode 100644 lazyinstall/fstab_extroot create mode 100644 lazyinstall/lazyinstall1.sh create mode 100644 lazyinstall/lazyinstall2.sh create mode 100644 lazyinstall/network create mode 100644 lazyinstall/wireless diff --git a/lazyinstall/README.md b/lazyinstall/README.md new file mode 100644 index 0000000..717b886 --- /dev/null +++ b/lazyinstall/README.md @@ -0,0 +1,3 @@ +This is a very primitive script to automate the openwrt setup. +It's probably best not used at this point. + diff --git a/lazyinstall/fstab b/lazyinstall/fstab new file mode 100644 index 0000000..cfb4712 --- /dev/null +++ b/lazyinstall/fstab @@ -0,0 +1,21 @@ +#/etc/config/fstab from Meshenger project + +config global automount + option from_fstab 1 + option anon_mount 1 + +config global autoswap + option from_fstab 1 + option anon_swap 0 + +config mount + option target / + option device /dev/sda1 + option fstype ext4 + option options rw,sync + option enabled 1 + option enabled_fsck 0 + +config swap + option device /dev/sda2 + option enabled 0 diff --git a/lazyinstall/fstab_extroot b/lazyinstall/fstab_extroot new file mode 100644 index 0000000..745b760 --- /dev/null +++ b/lazyinstall/fstab_extroot @@ -0,0 +1,21 @@ +#/etc/config/fstab from Meshenger project + +config global automount + option from_fstab 1 + option anon_mount 1 + +config global autoswap + option from_fstab 1 + option anon_swap 0 + +config mount + option target / + option device /dev/sda1 + option fstype ext4 + option options rw,sync + option enabled 1 + option enabled_fsck 0 + +config swap + option device /dev/sda2 + option enabled 1 diff --git a/lazyinstall/lazyinstall1.sh b/lazyinstall/lazyinstall1.sh new file mode 100644 index 0000000..524b558 --- /dev/null +++ b/lazyinstall/lazyinstall1.sh @@ -0,0 +1,25 @@ +#!/bin/bash + + +echo 'This is the meshenger lazy install!' +echo 'It presumes your OpenWRT router has a connection to the internet' +echo 'And that you have a properly formatted usb flash drive' +echo 'more info + manual instructions: https://github.com/jngrt/meshenger' + +opkg update +opkg install block-mount kmod-usb-storage kmod-usb2 kmod-fs-ext4 + +mkdir /mnt/sda1 +mount -t ext4 /dev/sda1 /mnt/sda1 + +echo 'Copying filesystem to USB drive' +mkdir -p /tmp/cproot +mount --bind / /tmp/cproot +tar -C /tmp/cproot -cvf - . | tar -C /mnt/sda1 -xf +umount /tmp/cproot + +mv fstab /etc/config/fstab + +echo 'Reboot' +reboot -f + diff --git a/lazyinstall/lazyinstall2.sh b/lazyinstall/lazyinstall2.sh new file mode 100644 index 0000000..93340ba --- /dev/null +++ b/lazyinstall/lazyinstall2.sh @@ -0,0 +1,31 @@ +#!/bin/bash + + +echo 'This is the meshenger lazy install part two!' +echo 'It presumes you already ran part 1!' +echo 'You should review the settings of "wireless" and "network"' + +mkswap /dev/sda2 +swapon /dev/sda2 + +mv fstab_extroot /etc/config/fstab + +head -n 10 /etc/config/wireless >> tmp_wireless +cat wireless >> tmp_wireless +mv tmp_wireless /etc/config/wireless +rm tmp_wireless + +mv network /etc/config/network +opkg update +opkg install kmod-batman-adv kmod-ipv6 + +sed -i -e "s/mesh/adhoc0/g" /etc/config/batman-adv + +opkg install python git +git clone git://github.com/jngrt/meshenger.git + +echo 'my ip address is:' +ifconfig br-lan | grep 'inet addr' + +echo 'rebooting' +reboot -f \ No newline at end of file diff --git a/lazyinstall/network b/lazyinstall/network new file mode 100644 index 0000000..ed768bf --- /dev/null +++ b/lazyinstall/network @@ -0,0 +1,20 @@ +config interface 'loopback' + option ifname 'lo' + option proto 'static' + option ipaddr '127.0.0.1' + option netmask '255.0.0.0' + +config interface 'lan' + option ifname 'eth0' + option type 'bridge' + option proto 'static' + option ipaddr '192.168.1.115' #change me! + option netmask '255.255.255.0' + option gateway '192.168.1.2' #change me! + list dns '8.8.8.8' + +config interface 'mesh' + option ifname 'adhoc0' + option mtu '1528' + option proto 'none' + diff --git a/lazyinstall/wireless b/lazyinstall/wireless new file mode 100644 index 0000000..13683ec --- /dev/null +++ b/lazyinstall/wireless @@ -0,0 +1,8 @@ + +config wifi-iface 'wmesh' + option device 'radio0' + option ifname 'adhoc0' + option network 'mesh' + option mode 'adhoc' + option ssid 'mesh' + option bssid '66:66:66:66:66:66' \ No newline at end of file