firmware/bsp/board_dir300.bsp

71 lines
2.0 KiB
Plaintext

machine=dir300
target=$builddir/$machine
board_prepare() {
echo "nothing todo" > /dev/null
}
board_prebuild() {
cp ./bsp/$machine/.config $target/.config
cp ./bsp/$machine/kernel_config-3.3 $target/target/linux/atheros/config-3.3
cp -r ./bsp/$machine/root_file_system/* $target/files/
}
board_postbuild() {
cp $target/bin/atheros/openwrt-atheros-root.squashfs ./bin/openwrt-$machine-root.squashfs
cp $target/bin/atheros/openwrt-atheros-vmlinux.lzma ./bin/openwrt-$machine-vmlinux.lzma
cp $target/bin/atheros/openwrt-atheros-combined.squashfs.img ./bin/openwrt-$machine-combined.squashfs.img
}
board_flash() {
if [ ! "`whoami`" = "root" ]
then
echo "You need to be root to flash!"
exit 1
fi
echo "Do not plugin your router now, you will be asked to do this later!"
echo "Stopping Network manager and starting normal network and tftp server..."
if [ -f /etc/rc.d/networkmanager ];then
/etc/rc.d/networkmanager stop
/etc/rc.d/tftpd start
elif [ -f /etc/init.d/networkmanager ];then
/etc/init.d/networkmanager stop
/etc/init.d/tftpd start
elif [ -f /usr/sbin/invoke-rc.d ];then
invoke-rc.d tftpd-hpa start || invoke-rc.d tftpd-hpa start || invoke-rc.d tftpd-hpa start || echo "FAILED TO START TFTD"
invoke-rc.d network-manager stop
fi
ifconfig $1 up
echo "Clearing Firewall!"
iptables -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
echo "Flashing now! Please plugin your router into the powerline now"
if [ -f /usr/sbin/dir300-flash ]; then
/usr/sbin/dir300-flash $1 ./bin/openwrt-$machine-vmlinux.lzma ./bin/openwrt-$machine-root.squashfs
else
./flash_tools/dir300-flash/dir300-flash.sh $1 ./bin/openwrt-$machine-vmlinux.lzma ./bin/openwrt-$machine-root.squashfs
fi
echo "Starting Networkmanager again"
sleep 5;
if [ -f /etc/rc.d/networkmanager ];then
/etc/rc.d/networkmanager start
elif [ -f /etc/init.d/networkmanager ];then
/etc/init.d/networkmanager start
elif [ -f /usr/sbin/invoke-rc.d ];then
invoke-rc.d tftpd-hpa stop
invoke-rc.d network-manager start
fi
}
board_clean() {
/bin/rm -rf $target bin/*$machine*
}