This section covers some of the options when running the svc-create-first-boot command to create a first-boot service and package. For these examples, all changes are handled by command line options. No manual editing is needed.
Example 4 Creating a First-boot Service and Package in Command Line ModeIn the following example, a service is created using the first-boot-script.sh script. Any executable script can be used. The archive will be stored in myp5p.p5p.
$ /usr/sbin/svc-create-first-boot -s first-boot-script.sh -d myp5p.p5pExample 5 Creating a First-boot Service and Package in Command Line Mode With Customizations
In the following example, a service is created using the first-boot-script.sh script. The network milestone is added as a dependency. The archive will be stored in myp5p.p5p.
$ /usr/sbin/svc-create-first-boot -s first-boot-script.sh -o service-dependency=milestone/network -d myp5p.p5pExample 6 Shell Script to Use in a First-boot Service
The contents of the script that is included in the first-boot service can be any regular executable script. For instance, to configure two interfaces, you could use a script like the following:
!/bin/ksh # Create and configure addresses on two IP interfaces /usr/sbin/ipadm create-ip net0 /usr/sbin/ipadm create-ip net1 /usr/bin/ipadm create-addr -a 10.153.125.222/24 net0 /usr/bin/ipadm create-addr -a 10.169.254.182.77/24 net1