Ignore:
Timestamp:
Oct 4, 2015, 10:02:22 PM (9 years ago)
Author:
rick
Message:

PoC: update script support for labels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-10/nanobsd/files/tools/updatep2

    r13424 r13425  
    4343fi
    4444
     45. /tools/update.inc.sh
     46
    4547# Blow away old system.
    46 dd if=/dev/zero of=/dev/${NANO_DRIVE}s2 bs=1m count=1 > /dev/null 2>&1
     48dd if=/dev/zero of=/dev/${GEOM_DRIVE}s2 bs=1m count=1 > /dev/null 2>&1
    4749
    4850# Copy in new system
    49 dd of=/dev/${NANO_DRIVE}s2 obs=64k
     51dd of=/dev/${GEOM_DRIVE}s2 obs=64k
     52
     53# Rebuild UFS label
     54if [ -n "${NANO_LABEL}" ]; then
     55        tunefs -L ${NANO_LABEL}"s2a" /dev/${GEOM_DRIVE}s2a
     56fi
    5057
    5158# Check that it worked
    52 fsck_ffs -n /dev/${NANO_DRIVE}s2a
     59fsck_ffs -n /dev/${GEOM_DRIVE}s2a
    5360
    5461# Update the /etc/fstab
    5562trap "umount /mnt" 1 2 15 EXIT
    56 mount /dev/${NANO_DRIVE}s2a /mnt
    57 sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIVE}s2/" /mnt/conf/base/etc/fstab
    58 sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIVE}s2/" /mnt/etc/fstab
     63mount /dev/${GEOM_DRIVE}s2a /mnt
     64sed -i "" "s+${NANO_DRIVE}s1+${NANO_DRIVE}s2+" /mnt/conf/base/etc/fstab
     65sed -i "" "s+${NANO_DRIVE}s1+${NANO_DRIVE}s2+" /mnt/etc/fstab
    5966umount /mnt
    6067trap 1 2 15 EXIT
    6168
    62 gpart set -a active -i 2 ${NANO_DRIVE}
     69gpart set -a active -i 2 ${GEOM_DRIVE}
    6370
Note: See TracChangeset for help on using the changeset viewer.