UberJS: A More Flexible Solaris JumpStart Systemby John Dickerson and Brett Trotter, Iowa State University Contents: Installing the Solaris Operating System usually comes down to a choice between using CDs or JumpStart. Nobody wants to install more than a couple of machines using CDs and a generic configuration, so most administrators use Sun's Solaris JumpStart software if they want to customize their builds.
JumpStart is a powerful tool that makes unattended Solaris installs possible with fine-grained control over machine configurations, but it has a few shortcomings. JumpStart is fairly limited in booting flexibility, but is still very capable when it comes to machine profiles. JumpStart only works if the JumpStart boot server is on the same network segment as the machine you're installing, and before you can do a network build of a machine you have to configure the JumpStart server using Sun's In the College of Engineering at Iowa State University, we wanted to make JumpStart a little easier. We install Sun boxes on many LANs where we can't afford a JumpStart server or it isn't practical to manage one. For a while we built our machines using JumpStart on an Intel laptop running Linux that we carried from building to building, but the setup time got to be a headache. We needed a solution that was portable, easy to use, and didn't require touching the JumpStart server for every new machine. We wanted to preserve JumpStart's ability to apply different build profiles from a central location, and we wanted unattended install capability. We've developed a system we call UberJS (for Uber JumpStart). We modeled it after Red Hat's Kickstart so a person can boot a machine from CD, type a simple command and walk away. With some clever hacking of the JumpStart install scripts and a CD burner, we created a bootable JumpStart CD that handles the networking initialization usually provided by a JumpStart boot server, but still allows us to access build profiles in a remote JumpStart or Flash install repository. With the UberJS CD, we can jumpstart machines even when there is no JumpStart server on the LAN. What's more, we incorporated more general configuration files that give us more flexibility and spontaneity than Sun's JumpStart provides. To understand UberJS, let's first review what happens during a typical JumpStart or Flash install. (Kevin Amorin provides an excellent summary of the process: Solaris JumpStart Automated Installation.)
When you boot a Sun box with UberJS gives us some key improvements over JumpStart:
Keep in mind that UberJS still assumes you have a JumpStart or Flashstart install repository available via NFS that includes predefined build profiles. We won't go into detail about how to set that up here. Use Kevin Amorin's page or JumpStart documentation from Sun for details. All of our scripts and methods were developed using the Solaris 9 08/03 Release. Here's a quick summary of what it takes to set up an UberJS build.
In case you want to cut to the chase, we created a script called Extracting the Slices from the CD (Creating a Work Space)Start by extracting the data from a Solaris 9 Install V1 CD. In case you're interested, you can view the layout of the CD beforehand to get a feeling for what's on the CD: # /etc/init.d/volmgt stop # prtvtoc /dev/dsk/c0t2d0s0 (or whatever your CD device is) # /etc/init.d/volmgt start This list shows the slices on the CD followed by their contents: 0 = Software packages \ (the Solaris_9 directory, which has the Product subdirectory) 1 = Generic Kernel + root directory structure \ (includes install scripts) 2 = boot for sun4c 3 = boot for sun4m 4 = boot for sun4d 5 = boot for sun4u and sun4us Copy slice 0 from the CD to a directory on your system: # mkdir -p /MySolarisCD/s0 # cd /cdrom/cdrom0/s0 # find . -print | cpio -pdm /MySolarisCD/s0 Use dd to copy slices 1 through 5:
# /etc/init.d/volmgt stop
# for SLICE in 1 2 3 4 5; \
do dd if=/dev/dsk/c0t2d0s${SLICE} \
of=/MySolarisCD/sol9.s${SLICE} bs=512; done
# cd /
# /etc/init.d/volmgt start
Note: The directory change to / is because Modifying the Images
For Solaris 9, all of the JumpStart functionality is now on slice 1. Sun moved the Solaris 9 boot tools out of slice 0, and now there's a symlink from # mkdir /mnt/slice # lofiadm -a /MySolarisCD/sol9.s1 /dev/lofi/1 # mount /dev/lofi/1 /mnt/slice
Modifying the JumpStart Scripts
The next stage of building UberJS is to modify Sun's rcS Modification
Change the following section around line 667 of if [ $USING_DHCP -eq 1 ] ; then echo "Using DHCP for network configuration information." dhcp_find_and_mount_cdrom else echo "Using RPC Bootparams for network configuration information." bootparams_find_and_mount_cdrom fi to be: if [ -f /tmp/uberjs/uberjs-exec ]; then echo "Executing UberJS script: /tmp/uberjs/uberjs-exec" /sbin/sh /tmp/uberjs/uberjs-exec else if [ $USING_DHCP -eq 1 ]; then echo "Using DHCP for network configuration information." dhcp_find_and_mount_cdrom else echo "Using RPC Bootparams for network configuration information." bootparams_find_and_mount_cdrom fi fi And change this section: # # Start the twirling dial # if [ -x /sbin/dial ]; then dial & dial_pid=$! fi to be: # # Start the twirling dial # touch /tmp/userjs/disable_dial to turn off the twirling # dial (it clutters up entering prompts). if [ -x /sbin/dial ]; then # Note: uses /.tmp_proto instead of /tmp since /tmp # isn't created until a few lines from here if [ -f /.tmp_proto/uberjs/disable_dial ]; then echo "Dial disabled" else dial & dial_pid=$! fi fi sysidfind Modification
Sun uses the
Perform the following edits to At line 342, change the following:
floppy_sysid_config
if [ $? -ne 0 ]; then
# Look for sysidcfg via DHCP only if the network is using DHCP
if [ "X${_INIT_NET_STRATEGY}" = "Xdhcp" ]; then
dhcp_sysid_config
else
bootparams_sysid_config
fi
fi
to be:
if [ -f /etc/sysidcfg ]; then
echo "Using sysidcfg already in /etc (or possibly a link from /tmp/uberjs)"
return 0
else
floppy_sysid_config
if [ $? -ne 0 ]; then
# Look for sysidcfg via DHCP only if the network is using DHCP
if [ "X${_INIT_NET_STRATEGY}" = "Xdhcp" ]; then
dhcp_sysid_config
else
bootparams_sysid_config
fi
fi
fi
uberjs-exec Script
The
Copy the
Again, the
We'll just cover the key points of what
Note that all the JumpStart scripts think we're doing a CD-based install because we booted with the command Install Configuration Files on the CD
UberJS is designed to accommodate fully unattended builds as well as more ad hoc installations. The configuration files you choose to burn on the CD determine the behavior of an install. You can put all the information you'll need onto the CDs, or just some of it. Even if all the settings are present on the CD, you have some ability to override some data at the start of the build. If you have any questions about how the configuration files are used, read through the Configuration Files for All Options
During the actual build, it is important to remember that many files are symlinks to things in Note: Creating symlinks for files that do not exist is OK, and it's sometimes a good move to save time working on the CD later when you decide to use some additional functionality. Due to the nature of symlinks, creating a link to nothing does not cause the system to think the file exists, so scripts that test the existence of files will behave properly. When the script queries the 'file', the system follows the symlink and then tries to open the referenced file. Of course, if it points to nothing, the system cannot open a file that doesn't exist and produces the same error message as if you tried to directly open the file where the link points to.
UberJS will attempt to use the DNS to resolve the client hostname. To ensure DNS works, we copy following files to
If there are any other files that you need to place in
Below, we present several types of install options, but many other variations lie between the three generalized options given. There is a wide array of configurations from completely unattended, to entering a single 'y' or 'n', filling in a few simple blanks, or inputting nearly every option. All of these provide an unattended install once Config Files Option #1 - Complete Unattended Install, No FTP Server
If you want the install process to run completely unattended and don't want to bother with placing configuration files on an FTP server, create the following files in
8:0:20:c0:ff:ee 192.168.123.456 0:0:20:c0:ff:bb DHCP (The "DHCP" keyword tells UberJS to try to configure DHCP for that host)
Note: If DHCP is used, the user will need to accept the DHCP configured address. After one keystroke, the install becomes completely unattended if everything is configured correctly. Config Files Option #2 - Minimally Attended, No FTP Server
The drawback to relying solely on the nfs_servers -- Contains a list of install, profile, and sysidcfg servers to select from. Multiple server lines are allowed. Each line is a triplet of the form:
servername:/install_path servername:/profile_path servername:/sysidcfg_path If you include multiple triplets, UberJS will present them as a numbered menu and ask you which triplet you want to use for that build.
Config Files Option #3 - Minimally Attended, With an FTP Server
If you want the ultimate in flexibility and want to reduce as much as possible the need to re-burn the CD, you can have UberJS download most of the above files at build time from an FTP or HTTP server. This option also allows you to provide multiple mirrored servers from which to download the
Note: You can obtain the
ftp://ftpserver/my-uberjs-configs/ http://webserver/your-uberjs-configs/
If UberJS detects the The UberJS sysidcfg File on the JumpStart Server
Since UberJS can determine the default route and domain name, you don't really need to have separate system_locale=en_US timezone=US/Central timeserver=123.123.123.123 terminal=sun-cmd security_policy=NONE root_password="cryptedpass" You would put this file on your JumpStart server in a location something like: my.jump.start.server:/export/jumpstart/sysidcfg-uberjs
Note: Be sure to use this as the Similarly, we put our installation media in: my.jump.start.server:/export/solaris9/jumpstart (contains Solaris_9 directory)
And we put our my.jump.start.server:/export/jumpstart Burning the CD-ROM
The final step in creating UberJS is to burn the modified contents back on to CD. When done creating the config files and editing/copying the scripts to the appropriate locations under # cd / # umount /mnt # lofiadm -d /dev/lofi/1 Mounting any other slice than s1 in this fashion produces only a file that is a boot redirector to slice 1. Creating an ISO Image
There is a single-line command that will produce an ISO of all the images. Another source mentions a way that involves several steps of cat'ing files together, which worked for Solaris 8 and earlier when everything was contained in slice 0 and you could simply remove the product directory, and then pad out the difference to the original size with zeros. A major problem we encountered was that we were changing slice 1 and making it bigger, so padding out the difference was not an option. We ended up using a solution that was posted in a discussion forum that uses Schily's # cd /MySolarisCD # mkisofs -R -d -L -l -sparc-boot sol9.s1,sol9.s2,sol9.s3,sol9.s4, \ -sol9.s5 -o sol9_boot.iso ./s0 Then, burn the ISO to CD using your favorite CD-burning software. (We copy everything to a Linux machine since we don't have a CD burner in a Sun machine.)
There are other means to create CDs with valid VTOCs. The
Finally, to use the CD, pop it into a machine you need to build, hit stop-A, then: # boot cdrom - install We have used UberJS to install Ultra 5, 10, 60, 70, and 80 workstations; Sun Blade 150 and 2050 machines; and Sun Fire V480 servers. If you try UberJS and have success (or problems) with other platforms, we'd love to hear from you.
We've also created an alternate version of UberJS that allows you to boot a machine off a CD that provides a self-contained, fully functioning JumpStart boot server. UberJS Server also implements the UberJS is fairly easy to modify. We put a lot of functionality into it that we think most people will find useful. However, if you find a better or more useful way to use it, feel free to modify it. We would appreciate hearing from you at our project email address: uberjs@iastate.edu. CreditsWhile several people contributed ideas and laid groundwork that went into UberJS, Brett Trotter did all of the scripting development and vetting of JumpStart's inner workings, plus all the web documentation. He is said to have an uncanny ability to find ingenious problem solutions, and the project could not have been done without him. Joe Mesterhazy established the initial JumpStart and Flashstart build process that we used prior to UberJS and integrated cfengine and apt/rpm into our overall process. Matt Bradshaw created our UberKS Red Hat Kickstart build CD that was the direct inspiration for UberJS. Finally, UberJS is an outgrowth from collaboration of the entire CLUE Network administration team at the College of Engineering at ISU. Thanks to them all. References
About the AuthorsJohn Dickerson is a senior UNIX systems administrator for the College of Engineering at Iowa State University. He has been working as a professional systems administrator for over 14 years in industry and academia. Working on the CLUE Network has been a highlight of his career. He may be reached at jedicker@iastate.edu. Brett Trotter is a student UNIX systems administrator for the College of Engineering at Iowa State University. He has had experience as a systems administrator for an ISP and has been toying with various UNIXes for many years and programming for most of his life in various languages. He may be reached at blt@iastate.edu.
The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource. |
| |||