每个人的mac地址都不一样,这个脚本可以保证每个人生成的uboot的唯一性.
- #! /bin/sh
- UBOOT_NAME=/tmp/tuboot.bin
- RAW_UBOOT_LEN=`wc -c $UBOOT_NAME | awk '{print $1 }'`
- NEED_PAD_LEN=$((0x1fc00-$RAW_UBOOT_LEN))
- #Generate a file used as pad ...
- dd if=/dev/zero of=/tmp/pad.bin bs=1 count=$NEED_PAD_LEN
- cat $UBOOT_NAME /tmp/pad.bin >/tmp/tuboot_0x1fc00.bin
- echo "Backup some config first,just like MAC address ..."
- dd if=/dev/mtd0 of=/tmp/config.bin bs=1 skip=$((0x1fc00))
- cat /tmp/tuboot_0x1fc00.bin /tmp/config.bin >uboot.bin
- #mtd -r write /uboot.bin u-boot
- #!/bin/bash
- # blink_arg.bash -- must run as
- #
- # Blink GPIO pin on and off
- LEDPIN=${1-57}
- OFF=1
- ON=0
- # Make sure we have root access
- if [ $EUID -ne 0 ]; then
- echo "You must be root to run this. Try 'sudo $0'"
- exit
- fi
- # Clean up procedure--turn off the LED, unexport the GPIO, and exit
- cleanup()
- {
- PIN=$1
- echo $OFF > /sys/class/gpio/gpio$PIN/value # turn off
- echo $PIN > /sys/class/gpio/unexport
- echo Interrupted.
- exit
- }
- # Set up--select the pin and direction. Catch Control-C SIGHUP SIGKILL
- echo $LEDPIN > /sys/class/gpio/export
- echo out > /sys/class/gpio/gpio$LEDPIN/direction
- trap 'cleanup $LEDPIN' 1 2 15
- while true
- do
- echo $ON > /sys/class/gpio/gpio$LEDPIN/value # turn on
- sleep 1
- echo $OFF > /sys/class/gpio/gpio$LEDPIN/value # turn off
- sleep 1
- done
--- Openwrt 的懒人编译脚本,送给爱跟trunk同步升级的强迫症党
老爱编译trunk最新版本的朋友用这个脚本鼠标点击运行即可,通过make menuconfig保存好默认的编译配置
更新svn后,按Y/N 选择是否运行make clean,然后开始编译了。。
复制如下内容保存成 build.sh 放到openwrt /trunk目录下。默认是16线程编译,cpu不够强大的把16改成其他数字即可,比如2~4.
- #!/bin/bash
- svn up
- ./scripts/feeds update -a
- ./scripts/feeds install -a
- make defconfig
- echo "Make clean? Please answer yes or no."
- read YES_OR_NO
- case "$YES_OR_NO" in
- yes|y|Yes|YES)
- make clean
- make V=99 -j 16
- ;;
- [nN]*)
- echo "DO NOT make clean!"
- make V=99 -j 16
- ;;
- *)
- echo "Sorry, $YES_OR_NO not recognized. Enter yes or no."
- exit 1
- ;;
- esac
阅读(1112) | 评论(0) | 转发(0) |