File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_update_a_netbsd_system_with_haze.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Mon Apr 8 22:01:50 2019 UTC (19 months, 3 weeks ago) by sevan
Branches: MAIN
CVS tags: HEAD
Link to tech-userlevel post with link to src.

    1: ##  What it does:
    2: 
    3: Offer a system to generate binary updates for NetBSD (NOT patches), install,
    4: remove with full "rollback to previous state" support, and manage them. Simple
    5: dependencies are allowed. It also allows auto-generating security advisories
    6: from update data.
    7: 
    8: Without further ado, here's how to use it.
    9: 
   10: ##  Update producer: (people who *create* updates)
   11: 
   12:     
   13:       1. Write the .plist file to describe the update, and put it online.
   14:          Update the index file to include the update id. (for example,
   15:          NetBSD-UP2007-0001)
   16:     
   17:     
   18:          Examples for updates are available:
   19:     
   20:     
   21:          <http://www.NetBSD.org/~elad/haze/Updates/2006/NetBSD-UP2006-0001.plist>
   22:          <http://www.NetBSD.org/~elad/haze/Updates/2006/NetBSD-UP2006-0002.plist>
   23:     
   24:     
   25:          The index file looks like this:
   26:     
   27:     
   28:          <http://www.NetBSD.org/~elad/haze/Updates/2006/INDEX>
   29:     
   30:     
   31:          Note the directory hierarchy: the year is important; everything
   32:          else can be tuned, but the structure. For now.
   33:     
   34:     
   35:       2. Maintain a build directory for ports you want to generate updates
   36:          for. This is "obj-dir" in the config file (/etc/haze/haze.conf):
   37:     
   38: 
   39: <key>obj-dir</key> <string>/usr/netbsd/objdir/xphyre/destdir.%m</string>
   40: 
   41:     
   42:          Haze knows to replace "%m" with the machine type. The default is
   43:          "/usr/obj/%s-%r/destdir.%m", where "%s" will be replaced by the
   44:          string "NetBSD", and "%r" will be replaced by the release, for
   45:          example, "4.0".
   46:     
   47:     
   48:          To keep this directory up-to-date, all the producer has to do is
   49:          run the build after the source is updated with the fix.
   50:     
   51:     
   52:       3. Maintain a list of "targets" you want to monitor. Haze calls a
   53:          combination of OS-release-machine a "target". For example,
   54:          "NetBSD-4.0-amd64" is a target. By default, Haze will only generate
   55:          updates for the host it runs on. You can override that, though:
   56:     
   57: 
   58: <key>generate-targets</key> <array> <string>NetBSD-4.0-amd64</string>
   59: <string>NetBSD-4.0-i386</string> <string>NetBSD-3.0-amd64</string>
   60: <string>NetBSD-3.0-i386</string> </array>
   61: 
   62:     
   63:       4. After the new files are built, generate updates. This is done using
   64:          the -G flag. For example, if you just rebuilt for
   65:          NetBSD-UP2007-0001, and want to generate updates for it:
   66:     
   67: 
   68: haze -G -U NetBSD-UP2007-0001
   69: 
   70:     
   71:          The updates will show up in the output dir, /tmp by default, and
   72:          will be in the form of NetBSD-UP2007-0001-4.0-amd64.tar.gz.
   73:     
   74:     
   75:       5. Put the updates online, in the Updates/ directory. For example,
   76:          this would be a valid URL to an update package:
   77:     
   78:     
   79:           <http://www.NetBSD.org/~elad/haze/Updates/NetBSD-UP2006-0001-3.0-amd64.tgz>
   80:     
   81: 
   82: ##  Update consumer: (people who *apply* updates)
   83: 
   84:     
   85:       1. Make sure there's a /etc/haze directory and that it's writable by
   86:          the user Haze is running as. I would elaborate on this too much,
   87:          but you *should* be able to tell Haze to perform updating on a
   88:          specified root directory, and then do the sync yourself, if you
   89:          don't trust running Haze as root. If you do:
   90:     
   91: 
   92: # mkdir /etc/haze
   93: 
   94:     
   95:          Everything else, including the configuration file and local
   96:          database, will be created by Haze automagically. You can inspect
   97:          the default values used in haze.h.
   98:     
   99:     
  100:       2. By default, things should pretty much Just Work. Therefore, here
  101:          are some usage examples:
  102:     
  103: 
  104: Show the batch of updates waiting to be installed:
  105: 
  106: haze -B
  107: 
  108: Install all pending updates:
  109: 
  110: haze
  111: 
  112: Show locally known updates (including installed, ignored, and not applicable
  113: updates):
  114: 
  115: haze -L
  116: 
  117: Install a specific update:
  118: 
  119: haze -U NetBSD-UP2006-0001
  120: 
  121: Rollback an update:
  122: 
  123: haze -R -U NetBSD-UP2006-0001
  124: 
  125: View details about an update:
  126: 
  127: haze -V -U NetBSD-UP2006-0001
  128: 
  129: Explicitly ignore an update:
  130: 
  131: haze -i -U NetBSD-UP2006-0001
  132: 
  133: Operate in dummy mode, and just print stuff you'd do:
  134: 
  135: haze -x ...
  136: 
  137: Generate a security advisory skeleton for an update:
  138: 
  139: haze -S -U NetBSD-UP2006-0001
  140: 
  141: List available command line options:
  142: 
  143: haze -h
  144: 
  145: #See also
  146: [NetBSD updating system](https://mail-index.netbsd.org/tech-userlevel/2007/11/06/0001.html)

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb