1 () () 2 3 4 5 <?xml version='1.0' encoding='UTF-8' ?> 6 7 <!-- 8 CDDL HEADER START 9 10 The contents of this file are subject to the terms of the 11 Common Development and Distribution License (the "License"). 12 You may not use this file except in compliance with the License. 13 14 You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 15 or http://www.opensolaris.org/os/licensing. 16 See the License for the specific language governing permissions 17 and limitations under the License. 18 19 When distributing Covered Code, include this CDDL HEADER in each 20 file and include the License file at usr/src/OPENSOLARIS.LICENSE. 21 If applicable, add the following below this CDDL HEADER, with the 22 fields enclosed by brackets "[]" replaced with your own identifying 23 information: Portions Copyright [yyyy] [name of copyright owner] 24 25 CDDL HEADER END 26 27 Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 28 Copyright (c) 2011, Joyent, Inc. All rights reserved. 29 30 DO NOT EDIT THIS FILE. 31 32 Copyright 2014 Nexenta Systems, Inc. All rights reserved. --> 33 34 <!-- 35 verify_cfg 36 37 Identifies the program to be invoked by zonecfg to verify that the 38 zone's configuration is legal, and that all the configured devices, 39 attributes, etc. are legal for this brand. 40 41 The program is called with a single argument: the path to a file 42 containing a temporary config.xml file the zone. It should return 0 43 on success and non-0 on failure. Any detailed error messages should be 44 displayed to stderr. 45 46 It has no attributes. 47 48 --> <!ELEMENT verify_cfg (#PCDATA) > <!ATTLIST verify_cfg> <!-- 49 verify_adm 50 51 Identifies the program invoked by zoneadm to perform brand-specific 52 checks as to the viability of a zone on this specific machine. 53 54 The following replacements are performed: 55 56 %z Name of zone 57 %R Zonepath of zone 58 Additional arguments, if any, are appended. 59 60 The program should return 0 on success and non-0 on failure. Any 61 detailed error messages should be displayed to stderr. 62 63 It has no attributes. 64 65 --> <!ELEMENT verify_adm (#PCDATA) > <!ATTLIST verify_adm> 66 67 <!-- 68 install 69 70 Identifies the program to invoke when installing a zone. The following 71 replacements are performed: 72 73 %z Name of zone 74 %R Zonepath of zone 75 Additional arguments, if any, are appended. 76 77 It has no attributes. --> <!ELEMENT install (#PCDATA) > <!ATTLIST 78 install> 79 80 <!-- 81 installopts 82 83 Identifies the command-line options supported by the brand's 84 installation program, allowing zoneadm to parse the install line 85 properly. 86 87 It has no attributes. --> <!ELEMENT installopts (#PCDATA) > <!ATTLIST 88 installopts> 89 90 <!-- 91 boot 92 93 This is a program which gets run by zoneadmd when a zone is booted. 94 The program will be invoked as the last step in the zone booting 95 process before the the first process is spawned inside the zone. 96 97 If this programs succeeds it should not generate any output. 98 If this program returns an error, any output generated by the 99 program will be sent to the zoneadmd message log. 100 101 The following replacements are performed: 102 103 %z Name of zone 104 %R Zonepath of zone 105 Additional arguments, if any, are appended. 106 107 It has no attributes. --> <!ELEMENT boot (#PCDATA) > <!ATTLIST boot> 108 109 <!-- 110 sysboot 111 112 This is a program that will be run by zoneadm during system boot for an 113 installed zone that won't automatically boot. 114 115 If the program succeeds, then it should not generate output. 116 If the program returns an error, then the output it generates will be 117 sent to the zones SMF service's message log. 118 119 The following replacements are performed: 120 121 %z Name of the target zone 122 %R Zonepath of the target zone 123 Additional arguments, if any, are appended. 124 125 This element has no attributes. --> <!ELEMENT sysboot (#PCDATA) > 126 <!ATTLIST sysboot> 127 128 <!-- 129 halt 130 131 This is a program which gets run by zoneadmd when a zone is being 132 halted. This callback is provided to allow a brand to cleanup any 133 special configuration that was setup during boot. 134 135 This program will also be invoked by zoneadmd if any part of the zone 136 booting process fail, even if the booting process failed before the 137 brand boot program was invoked. It is also possible that if the zone 138 fails to halt after invoking this program, future attempts to halt the 139 zone will invoke this program again. So this program should be 140 designed to clean up any resources allocated to a zone but it should 141 also be able to gracefully handle the case where resources that it 142 expects to release are not actually allocated (or have been already 143 released.) 144 145 If this programs succeeds it should not generate any output. If this 146 program returns an error, any output generated by the program will be 147 sent to the zoneadmd message log. 148 149 The following replacements are performed: 150 151 %z Name of zone 152 %R Zonepath of zone 153 Additional arguments, if any, are appended. 154 155 It has no attributes. --> <!ELEMENT halt (#PCDATA) > <!ATTLIST halt> 156 157 <!-- 158 shutdown 159 160 This is a program which gets run by zoneadmd when a zone is being 161 shutdown gracefully. Currently only asynchronous mode is supported. 162 163 If this program succeeds it should not generate any output. If this 164 program returns an error, any output generated by the program will be 165 sent to the zoneadmd message log. 166 167 The following replacements are performed: 168 169 %z Name of zone 170 %R Zonepath of zone 171 Additional arguments, if any, are appended. 172 173 It has no attributes. --> <!ELEMENT shutdown (#PCDATA) > <!ATTLIST 174 shutdown> 175 176 <!-- 177 modname 178 179 Path to the kernel module that implements the kernel-level 180 functionality of the brand. 181 182 It has no attributes. --> <!ELEMENT modname (#PCDATA) > <!ATTLIST 183 modname> 184 185 <!-- 186 initname 187 188 Path to the initial executable that should be launched when booting a 189 branded zone. 190 191 It has no attributes. --> <!ELEMENT initname (#PCDATA) > <!ATTLIST 192 initname> 193 194 <!-- 195 restartinit, restartinit0 and restartinitreboot 196 197 These three boolean elements control what action is taken when the 198 program specified by the 'initname' element exits. 199 200 The default values are: 201 202 restartinit: true 203 restartinit0: false 204 restartinitreboot: false 205 206 If 'restartinit' is set to false then the init process will never be 207 restarted and the zone will shut down once init exits. In this case, the 208 other restartinit elements are ignored. 209 210 When 'restartinit0' is set, init will only be restarted if it exited with 211 an exit status of 0, otherwise the zone will shut down. 212 213 If 'restartinitreboot' is set to true then whenever init should be 214 restarted, based on the other restartinit elements, the zone will instead 215 be rebooted. 216 217 These have no attributes. --> <!ELEMENT restartinit (#PCDATA) > 218 <!ATTLIST restartinit> <!ELEMENT restartinit0 (#PCDATA) > <!ATTLIST 219 restartinit0> <!ELEMENT restartinitreboot (#PCDATA) > <!ATTLIST 220 restartinitreboot> 221 222 <!-- 223 login_cmd 224 225 Path to the initial login binary that should be executed when 226 attempting to zlogin into a branded zone. 227 228 The following replacements are performed: 229 230 %Z Name of the current zone 231 %u User login name 232 233 It has no attributes. --> <!ELEMENT login_cmd (#PCDATA) > <!ATTLIST 234 login_cmd> 235 236 <!-- 237 forcedlogin_cmd 238 239 Path to the initial login binary that should be executed when 240 attempting to zlogin into a branded zone without authentication. 241 242 The following replacements are performed: 243 244 %Z Name of the current zone 245 %u User login name 246 247 It has no attributes. --> <!ELEMENT forcedlogin_cmd (#PCDATA) > 248 <!ATTLIST forcedlogin_cmd> 249 250 <!-- 251 user_cmd 252 253 Path to the binary that will translate a user name to a passwd(4) entry. 254 255 The following replacements are performed: 256 257 %u User login name 258 259 It has no attributes. The passwd(4) entry is used to determine $LOGNAME, 260 $HOME, and $SHELL for non-interactive "zlogin -l <user> <cmd>". --> 261 <!ELEMENT user_cmd (#PCDATA) > <!ATTLIST user_cmd> 262 263 <!-- 264 attach 265 266 Path to a hook that will perform any necessary processing on 267 a zone to allow it to be attached. The zone will be in the "configured" 268 state when this hook is run. This hook is never called when the zone 269 is "force attached" (-F). 270 271 If this hook exits with a non-zero exit status, the attach operation 272 will fail. 273 274 The following replacements are performed: 275 276 %z Name of zone 277 %R Zonepath of zone 278 Additional arguments, if any, are appended. 279 280 If no hook is provided, the internal zoneadm attach code will be used. 281 282 It has no attributes. --> <!ELEMENT attach (#PCDATA) > <!ATTLIST 283 attach> 284 285 <!-- 286 postattach 287 288 Path to a hook that will perform any necessary post-processing on 289 a zone after it has been attached. The zone will be in the "installed" 290 state when this hook is run. This hook is never called when the zone 291 is "force attached" (-F). 292 293 If this hook exits with a non-zero exit status, the attach operation 294 will fail and the zone state will be reset to "configured". 295 296 The following replacements are performed: 297 298 %z Name of zone 299 %R Zonepath of zone 300 Additional arguments, if any, are appended. 301 302 It has no attributes. --> <!ELEMENT postattach (#PCDATA) > <!ATTLIST 303 postattach> 304 305 <!-- 306 postclone 307 308 Path to a hook that will perform any necessary post-processing on 309 a zone after it has been cloned. The zone will be in the "incomplete" 310 state when this hook is run. 311 312 If this hook exits with a non-zero exit status, the clone operation 313 will fail and the zone will be left in the "incomplete" state, 314 otherwise the state will be changed to the "installed" state. 315 316 The following replacements are performed: 317 318 %z Name of zone 319 %R Zonepath of zone 320 Additional arguments, if any, are appended. 321 322 It has no attributes. --> <!ELEMENT postclone (#PCDATA) > <!ATTLIST 323 postclone> 324 325 <!-- 326 postinstall 327 328 Path to a script that will perform any necessary post-processing on 329 a zone after it has been freshly installed. This hook will run after the 330 install hook completes and the zone is in the installed state. The 331 additional arguments are the same as what is passed to the install hook. 332 333 The following replacements are performed: 334 335 %z Name of zone 336 %R Zonepath of zone 337 Additional arguments, if any, are appended. 338 339 It has no attributes. --> <!ELEMENT postinstall (#PCDATA) > <!ATTLIST 340 postinstall> 341 342 <!-- 343 predetach 344 345 Path to a hook that will perform any necessary pre-processing on 346 a zone before it is detached. The zone will be in the "installed" 347 state when this hook is run. 348 349 It is possible that if the zone fails to detach after invoking this 350 hook, future attempts to detach the zone will invoke this hook again. 351 So this hook should be designed to gracefully handle the case where 352 it is run multiple times on the same zone. If this hook exits with 353 a non-zero exit status, the detach operation will fail. 354 355 This hook is most commonly used when there is pre-processing for detaching 356 a zone but the built-in detach support will be used for the actual 357 detach. Otherwise, if a detach hook is provided, then it can be used 358 to do both preprocessing as well as the actual detach. 359 360 The following replacements are performed: 361 362 %z Name of zone 363 %R Zonepath of zone 364 Additional arguments, if any, are appended. 365 366 It has no attributes. --> <!ELEMENT predetach (#PCDATA) > <!ATTLIST 367 predetach> 368 369 <!-- 370 detach 371 372 Path to a hook that will perform any necessary processing on 373 a zone to allow it to be detached. The zone will be in the "installed" 374 state when this hook is run. 375 376 It is possible that if the zone fails to detach while running this 377 hook, future attempts to detach the zone will invoke this hook again. 378 So this hook should be designed to gracefully handle the case where 379 it is run multiple times on the same zone. If this hook exits with 380 a non-zero exit status, the detach operation will fail and the zone will 381 be left in the "installed" state, otherwise the state will be changed 382 to "configured". 383 384 The following replacements are performed: 385 386 %z Name of zone 387 %R Zonepath of zone 388 Additional arguments, if any, are appended. 389 390 If no hook is provided, the internal zoneadm detach code will be used. 391 392 It has no attributes. --> <!ELEMENT detach (#PCDATA) > <!ATTLIST 393 detach> 394 395 <!-- 396 clone 397 Path to a hook that will perform any necessary processing on a zone to 398 allow it to be installed via cloning. Cloning is an alternative to 399 installing so this hook should result in the same effect for the zone. 400 The zone will be in the "incomplete" state when this hook is run. 401 402 If this hook exits with a non-zero exit status, the clone operation 403 will fail and the zone will be left in the "incomplete" state, otherwise 404 the state will be changed to "installed". 405 406 The following replacements are performed: 407 408 %z Name of zone 409 %R Zonepath of zone 410 1st arg name of source zone 411 Additional arguments, if any, are appended. 412 413 If no hook is provided, the internal zoneadm cloning code will be used. 414 --> <!ELEMENT clone (#PCDATA) > <!ATTLIST clone> 415 416 <!-- 417 preuninstall 418 419 Path to a script that will perform any necessary pre-processing on 420 a zone before it is uninstalled. The zone will be in the "installed" 421 state when this hook is run. 422 423 It is possible that if the zone fails to uninstall after invoking this 424 hook, future attempts to uninstall the zone will invoke this hook 425 again. So this hook should be designed to gracefully handle the case 426 where it is run multiple times on the same zone. If this hook exits 427 with a non-zero exit status, the uninstall operation will fail. 428 429 The following replacements are performed: 430 431 %z Name of zone 432 %R Zonepath of zone 433 Additional arguments, if any, are appended. 434 435 It has no attributes. --> <!ELEMENT preuninstall (#PCDATA) > <!ATTLIST 436 preuninstall> 437 438 <!-- 439 uninstall 440 Identifies the hook to invoke when uninstalling a zone. The zone will 441 be in the "incomplete" state when this hook is run. 442 443 If this hook exits with a non-zero exit status, the uninstall operation 444 will fail and the zone will be left in the "incomplete" state, otherwise 445 the state will be changed to "configured". 446 447 The following replacements are performed: 448 449 %z Name of zone 450 %R Zonepath of zone 451 Additional arguments, if any, are appended. 452 453 If no hook is provided, the internal zoneadm uninstall code will be used. 454 --> <!ELEMENT uninstall (#PCDATA) > <!ATTLIST uninstall> 455 456 <!-- 457 presnap 458 Identifies the hook to invoke before snapshotting a zone using the 459 built-in ZFS clone support. 460 461 If this hook exits with a non-zero exit status, the snapshot operation 462 will fail and the zfs clone operation will fail. 463 464 The following replacements are performed: 465 466 %z Name of zone 467 %R Zonepath of zone --> <!ELEMENT presnap (#PCDATA) > <!ATTLIST 468 presnap> 469 470 <!-- 471 postsnap 472 Identifies the hook to invoke after snapshotting a zone using the 473 built-in ZFS clone support. 474 475 If this hook exits with a non-zero exit status, the zfs clone operation 476 will fail. 477 478 The following replacements are performed: 479 480 %z Name of zone 481 %R Zonepath of zone --> <!ELEMENT postsnap (#PCDATA) > <!ATTLIST 482 postsnap> 483 484 <!-- 485 validatesnap 486 Identifies the hook to invoke to validate a snapshot of a zone using the 487 built-in ZFS clone support. This will validate a snapshot that was 488 explicitly specified to the clone command when the user wants to 489 re-use a snapshot from an earlier clone operation. 490 491 If this hook exits with a non-zero exit status, the snapshot validation 492 operation will fail, meaning the zfs snapshot cannot be used to install 493 the zone. 494 495 The following replacements are performed: 496 497 %z Name of zone 498 %R Zonepath of zone 499 1st arg snapshot name 500 2nd arg snapshot path --> <!ELEMENT validatesnap (#PCDATA) > 501 <!ATTLIST validatesnap> 502 503 <!-- 504 prestatechange 505 Identifies the hook to invoke before zoneadmd makes a state change. 506 If this hook exits with a non-zero exit status, the action failed 507 and no further state change activity will take place. 508 509 The following replacements are performed: 510 511 %z Name of zone 512 %R Zonepath of zone 513 1st arg integer representing current state of zone 2 - 514 installed 3 - ready 4 - running 5 - 515 shutting down 6 - down 7 - mounted 516 2nd arg integer representing transition command 0 - 517 ready 1 - boot 4 - halt 518 3rd arg Alternate root (zonepath is mounted under this root) 519 empty string if zone not mounted under alternate root --> 520 <!ELEMENT prestatechange (#PCDATA) > <!ATTLIST prestatechange> 521 522 <!-- 523 poststatechange 524 Identifies the hook to invoke after zoneadmd makes a successful state 525 change. If this hook exits with a non-zero exit status, the action failed 526 and zoneadmd treats the overall state change as failed, although 527 all of the actions up to running the hook will have taken place. 528 529 The following replacements are performed: 530 531 %z Name of zone 532 %R Zonepath of zone 533 See prestatechange comment for 1st, 2nd and 3rd argument values. --> 534 <!ELEMENT poststatechange (#PCDATA) > <!ATTLIST poststatechange> 535 536 <!-- 537 query 538 Identifies a hook which can be called to get brand-specific information 539 about the zone. There is no specific place in zones where this is called, 540 calls within the zone infrastructure can be added as needed. 541 542 One example of the use of this hook is to query the implicit ZFS datasets 543 supported by the brand. 544 545 If this hook exits with a non-zero exit status, the query failed, 546 although in general, this hook shouldn't return non-zero. 547 548 The following replacements are performed: 549 550 %z Name of zone 551 %R Zonepath of zone 552 1st arg Arbitrary string which the hook can use to determine what 553 data to return. Brands implementing this hook should be 554 tolerant of arguments they don't support and simply do 555 nothing. --> <!ELEMENT query (#PCDATA) > <!ATTLIST query> 556 557 <!-- 558 privilege 559 560 Add a privilege to the default, prohibited, or required set for all 561 zones of this brand with ip-type matched. If a privilege is added 562 to the default set all zones of this brand with ip-type matched on 563 the system will inherit this privilege unless the privilege is 564 removed via limitpriv in zonecfg(1m). If a privilege is added to 565 the prohibited set it can not be added to any zones with ip-type 566 matched via limitpriv in zonecfg(1m). If a privilege is added to 567 the required set then all zones of this brand with ip-type matched 568 on the system will inherit this privilege and it can't be removed via 569 limitpriv in zonecfg(1m). 570 571 Its attributes are 572 set The name of the set the privilege should go into. 573 name The name of the privilege. 574 ip-type Optional, indicates that adding of the privilege to the 575 set only applies to certain IP types. Can be "shared" or 576 "exclusive". If it is not specified, the default value 577 "all" will be used, which means it is applicable regardless 578 the IP type. 579 580 --> <!ELEMENT privilege (#PCDATA) > <!ATTLIST privilege set ( default | 581 prohibited | required ) #REQUIRED name CDATA #REQUIRED 582 ip-type ( shared | exclusive ) "all" > 583 584 <!-- 585 brand 586 587 The toplevel container for a brand configuration. 588 589 Its attributes are 590 591 name The name of the brand. This must match the name of the 592 directory in which the configuration file is stored. --> 593 594 <!ELEMENT brand (modname?, initname, restartinit?, 595 restartinit0?, restartinitreboot?, login_cmd, 596 forcedlogin_cmd, user_cmd, install, installopts?, 597 boot?, sysboot?, halt?, shutdown?, verify_cfg?, verify_adm?, 598 postattach?, postclone?, postinstall?, predetach?, attach?, 599 detach?, clone?, presnap?, postsnap?, validatesnap?, 600 preuninstall?, uninstall?, prestatechange?, 601 poststatechange?, query?, privilege+)> 602 603 <!ATTLIST brand name CDATA #REQUIRED> 604 605 606 607 October 25, 2021 ()