Annotation of elwix/config/etc/default/rc.flash, revision 1.1.2.1
1.1.2.1 ! misho 1: #!/bin/sh
! 2: #
! 3: # Update ELWIX OS flash images
! 4: #
! 5: # $Id:$
! 6:
! 7: die() { echo -n "ERROR:: " >&2; echo "$@" >&2; exit 1; }
! 8:
! 9: case "$1" in
! 10: primary|first|main|A|1)
! 11: CFG_NAND_MAP=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"a") { printf("/dev/%s", $3); }'`
! 12: CFG_NAND_SIZE=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"a") { printf("%s", $2 * 512); }'`
! 13:
! 14: sysctl -w kern.geom.debugflags=16
! 15: imgupd -is $CFG_NAND_SIZE -f $CFG_NAND_MAP
! 16: tunefs -L elwix $CFG_NAND_MAP
! 17: /etc/rc.cfg boot
! 18: reboot
! 19: ;;
! 20: secondary|second|backup|B|2)
! 21: CFG_NAND_MAP=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"f") { printf("/dev/%s", $3); }'`
! 22: CFG_NAND_SIZE=`gpart show -p | awk '(NR == 1) { disk = $4; } ($3 == disk"f") { printf("%s", $2 * 512); }'`
! 23:
! 24: imgupd -is $CFG_NAND_SIZE -f $CFG_NAND_MAP
! 25: tunefs -L elwix2 $CFG_NAND_MAP
! 26: /etc/rc.cfg boot2
! 27: reboot
! 28: ;;
! 29: *)
! 30: die "Unknown $1 image ..."
! 31: ;;
! 32: esac
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>