source: hybrid/branches/releng-10/nanobsd/files/tools/update.inc.sh@ 13757

Last change on this file since 13757 was 13425, checked in by rick, 9 years ago

PoC: update script support for labels

File size: 529 bytes
Line 
1#!/bin/sh
2
3
4
5if echo $NANO_DRIVE | grep -q '^ufs/' then
6 NANO_LABEL=`echo $NANO_DRIVE | cut -c 5-`
7
8 # Detect GEOM drive to be updated based on the drive or label
9 GEOM_DRIVE=`glabel status | grep ${NANO_DRIVE} | awk '{print $3}' | sed -e 's/s[0-9a]*$//g' | uniq`
10
11 # Should never happen.
12 if [ `echo $GEOM_DRIVE | wc -l` -gt 1 ] ; then
13 echo "Bug: Multiple GEOM targets found with filter NANO_DRIVE=$NANO_DRIVE, unable to upgrade"
14 glabel status | sed "s/^/Bug: /g"
15 exit 1
16 fi
17else
18 NANO_LABEL=""
19 GEOM_DRIVE=$NANO_DRIVE
20fi
Note: See TracBrowser for help on using the repository browser.