File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / rootfs / rc.er
Revision 1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Tue Sep 23 20:10:52 2014 UTC (9 years, 9 months ago) by misho
Branches: elwix2_3
adds new helper for cfg

    1: #!/bin/sh
    2: #
    3: # Shell script for cfg ER help
    4: #
    5: 
    6: CFG_NAND_MAP="/dev/ada0g"
    7: CFG_NAND_SIZE=262144
    8: 
    9: cd ${2:-/etc}
   10: 
   11: case "$1" in
   12: 	load)
   13: 		echo "Tries emergency load of NAND ..."
   14: 		dd if=${CFG_NAND_MAP} bs=${CFG_NAND_SIZE} 2>&- | \
   15: 		      gunzip 2>&- | cpio -iud 2>&- || exit 1
   16: 		echo "NAND loaded successfully!"
   17: 		;;
   18: 	erase)
   19: 		dd if=/dev/zero of=${CFG_NAND_MAP} bs=${CFG_NAND_SIZE} \
   20: 			count=1 conv=sync 2>&- || exit 1
   21: 		echo "Config NAND was erased!"
   22: 		;;
   23: 	*)
   24: 		echo "Missing parameter - available options are (load | erase)"
   25: 		;;
   26: esac

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>