Browse Source

added a lazyinstall script for dev purposes

develop
Roel 11 years ago
parent
commit
3644391ed4
  1. 3
      lazyinstall/README.md
  2. 21
      lazyinstall/fstab
  3. 21
      lazyinstall/fstab_extroot
  4. 25
      lazyinstall/lazyinstall1.sh
  5. 31
      lazyinstall/lazyinstall2.sh
  6. 20
      lazyinstall/network
  7. 8
      lazyinstall/wireless

3
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.

21
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

21
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

25
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

31
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

20
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'

8
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'
Loading…
Cancel
Save