- Timestamp:
- Jan 17, 2017, 12:31:32 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-11/nanobsd/tools/image
r13683 r13709 53 53 # Release update cycle depends on the release we are coming from 54 54 echo "# Host has FreeBSD Release: $release" 55 if echo $release | grep -q '^[1234567]\.*-RELEASE'; then 55 updatecmd="/tmp/update$$" 56 cat >> $updatecmd <<'EOF' 57 # 58 # Pre-cleaning of /cfg 59 # 60 mount -wo noatime /cfg || exit 1 61 find /cfg -type f | grep -v -e '^/cfg/\(pf.hybrid.conf.local\|resolv.conf\|motd\|rc.conf.local\)$' \ 62 -e '^/cfg/local/\(ntp.drift\|dhcpd.conf\|dnsmasq.conf\|unbound.wleiden.conf\|wleiden.yaml\)$' \ 63 -e '^/cfg/ssh/ssh_host_*' \ 64 -e '^/cfg/ssh/authorized_keys$' \ 65 | xargs rm -v || exit 1 66 umount /cfg || exit 1 67 68 # 69 # Release specific update 70 # 71 EOF 72 if echo $release | grep -q -e '^9\.[0-9]-RELEASE[-$]'; then 73 cat >> $updatecmd <<'EOF' 74 tunefs -L WLIMGs3 /dev/ada0s3 || exit 1 75 echo /tools/update || exit 1 76 EOF 77 elif echo $release | grep -q -e '^11\.[0-9]-RELEASE[-$]'; then 78 cat >> $updatecmd <<'EOF' 79 echo /tools/update || exit 1 80 EOF 81 else 56 82 p_err "$release not supported for upgrade" 57 83 exit 1 58 elif echo $release | grep -q '^8\.*-RELEASE'; then 59 # Hack to make sure we update the fstab the right way when converting from 60 # 8.X-RELEASE to 9.X-RELEASE. ad0 naming changed to ada0, secondly an 61 # specific update script had to be called. 62 command="/tmp/update$$" 63 cat > $command <<'EOF' 64 # Write new image 65 echo "FreeBSD Release : `uname -r`" 66 echo "Active Partition: `df -H / | tail -1`" 67 if [ "`uname -r`" = "9.0-RELEASE" ]; then 68 echo "Error not valid update cycle!" 69 exit 1 70 else 71 if df / | grep -q '1a ' ; then 72 echo "New Partition : /dev/ad0s2a" 73 echo /tools/updatep2 74 75 # Quirck to fix partitions 76 # mount -uwo noatime /dev/ad0s2a 77 # sed -i "" "s/ada0s1/ada0s2/" /mnt/conf/base/etc/fstab /mnt/etc/fstab 78 # umount 79 else 80 echo "New Partition : /dev/ad0s1a" 81 echo /tools/updatep1 82 fi 83 fi 84 EOF 85 cat $command | ssh $host "cat > $command" || exit 1 86 cat $img | ssh $host "sh $command" || exit 1 87 else 88 cat $img | ssh $host /tools/update || exit 1 89 fi 84 fi 85 86 cat $updatecmd | ssh $host "cat > $updatecmd" || exit 1 87 cat $img | ssh $host "sh -x $updatecmd" || exit 1 90 88 91 89 if $do_reboot; then
Note:
See TracChangeset
for help on using the changeset viewer.