| 202 | == C. Fetch node configuration onto image, write to CF disk or remotely update == |
| 203 | |
| 204 | C.1. Fetch configuration |
| 205 | |
| 206 | {{{ |
| 207 | build# $R/tools/image config for <HybridNodename> |
| 208 | }}} |
| 209 | |
| 210 | The script is connecting to the [http://svn.wirelessleiden.nl/svn/node-config/genesis/nodes/ Wireless Leiden 'genesis' database]. First make sure that the configuration file is up to date by clicking the 'update' button on [http://sunfire.wirelessleiden.nl/wleiden/config/ http://sunfire.wirelessleiden.nl/wleiden/config/] Pick your situation! Note: proxy configurations are [http://sunfire.wirelessleiden.nl/wleiden/config/ here]. |
| 211 | |
| 212 | You can inspect the image bij mounting as memory disk: |
| 213 | {{{ |
| 214 | build# mdconfig -a -t vnode -f /usr/obj/nanobsd.wleiden-hybrid/_.disk.full |
| 215 | build# mount /dev/md0s1a /mnt |
| 216 | build# ls /mnt |
| 217 | build# umount /mnt |
| 218 | build# mount /dev/md0s3 /mnt |
| 219 | build# ls /mnt |
| 220 | build# umount /mnt |
| 221 | build# mdconfig -d -u 0 |
| 222 | }}} |
| 223 | |
| 224 | Editing can also be done using the image script: |
| 225 | {{{ |
| 226 | build# $R/tools/image edit |
| 227 | }}} |
| 228 | |
| 229 | C.2. Write the correct image to CF (media based on SLC and not MLC flash seem to perform much better). |
| 230 | ---- |
| 231 | ''NOTE:'' '''''_.disk.full''''' is required for '''new CF cards''' as it contains two base systems and one configuration. [[BR]] |
| 232 | '''''_.disk.image''''' on the other hand can be used to update an '''existing CF card''' |
| 233 | ---- |
| 234 | |
| 235 | a. '''New image''': Put full image on compact flash disk (attach a card reader/writer with a CF disk of minimum 1 GB) |
| 236 | Use the script |
| 237 | {{{ |
| 238 | build# $R/tools/write-image.sh |
| 239 | }}} |
| 240 | or the command line: |
| 241 | {{{ |
| 242 | build# dd bs=64k if=/usr/obj/nanobsd.wleiden-hybrid/_.disk.full of=/dev/da0 |
| 243 | }}} |
| 244 | (assuming {{{/dev/da0}}} is your compact flash entry; this takes about 15 minutes, check progress by typing Ctrl-T; you may wish to check afterwards with fdisk whether there |
| 245 | are three partitions on the disk, you can also mount /dev/da0s1a and /dev/da0s3 and check the configuration) |
| 246 | |
| 247 | a. '''Existing image''': Put partial image on slice (slice 2) (attach a card reader/writer with the CF disk containing the existing image) |
| 248 | {{{ |
| 249 | build# dd bs=64k if=/usr/obj/nanobsd.wleiden-hybrid/_.disk.image of=/dev/da0s2 |
| 250 | }}} |
| 251 | |
| 252 | a. '''Existing image remote update''' (slice 2) (network connection to machine 172.x.y.z required) |
| 253 | |
| 254 | For remotely updating an existing configuration use: |
| 255 | the image script |
| 256 | {{{ |
| 257 | build# $R/tools/image deploy on <node> [and reboot] |
| 258 | }}} |
| 259 | or manually: |
| 260 | {{{ |
| 261 | build# dd if=/usr/obj/nanobsd.wleiden-hybrid/_.disk.image bs=10k | ssh root@172.x.y.z /tools/updatep2 |
| 262 | }}} |
| 263 | |
| 264 | You may adjust the block size to make the transfer more efficient (additionally ssh -C is possible) and you can use Ctrl-T to check progress. |
| 265 | |
| 266 | '''WARNING''': in case of a remote update from 7.2 to 8.0 you must scp the new rc.conf.local to the node before reboot because the interface configuration statements are quite different. If you do not adjust the configuration before reboot the interfaces will not be configured after reboot and you will not be able to reach the node!(see F.4 below) |
| 267 | |
| 268 | == D. Check the cf card and apply last minute changes == |
| 269 | |
| 270 | D.1. Check cf card |
| 271 | |
| 272 | While the cf card is still in your flash card reader you can check whether the image has been written correctly. Check whether you can mount the partitions, e.g. |
| 273 | {{{ |
| 274 | build# mount /dev/da0s1a /mnt |
| 275 | build# ls /mnt |
| 276 | build# umount /mnt |
| 277 | }}} |
| 278 | and the configuration partition: |
| 279 | {{{ |
| 280 | build# mount /dev/da0s3 /mnt |
| 281 | build# ls /mnt |
| 282 | }}} |
| 283 | |
| 284 | If you cannot mount the partitions, take a fresh cf card and start again with writing the image. |
| 285 | |