« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
XML

Neat blogs

Navigation

Editing

Powered by Roller Weblogger.

statcounter.com

clustrmaps.com

Locations of visitors to this page

technorati.com

20070117 Wednesday January 17, 2007
Getting a Solaris bootable DVD for headless x86es

We are sending several build machines to Connectathon 2007 and I want to have DVDs for each architecture which are bootable images of Solaris Nevada build 55. I also want each image to have a copy of the source and also everything needed to build the source. I won't know until I get there whether the machines have heads or not, but I suspect not. They will however have SP, which will allow us to without heads.

The stock DVD images come pretty close to having everything. They lack the SUNWonbld and source bits. I'm going to find these and add them to the DVD image.

What is really neat is that this dovetails with some stuff I want to examine with my home network. I want to have a DVD which I can do an install on a headless w2100z. I know from past experiences that even though I have the console setup correctly, I need a head to do an upgrade. The reason is that the eeprom settings are really on disk and grub itself needs to know that it is running on a console and not the head. You can change that on the grub boot menu, but then it is too late.

The fix is to respin the installation DVD to setup grub to go to the console. To do that, we have to suck the bits off of the iso image, make our changes, and then make a bootable DVD image from that. We could suck the bits off of a DVD, but that does suck as far as speed goes. Oh, and it would be nice to automate all of this, which means no physical media until we do the actual upgrade.

Luckily I've done most of these steps before - see Kanigix - An experiment in packaging 4. So first lets get the ISO image mounted:

# pwd
/isos/x86/b55b
# lofiadm -a /isos/x86/b55b/solarisdvd.iso /dev/lofi/1
# mount -F hsfs -o ro /dev/lofi/1 /isos/mnt/x86
# mkdir /isos/images
# cd /isos/mnt/x86
# ls -la
total 961
dr-xr-xr-x   2 root     sys         4096 Jan 12 18:14 .
drwxr-xr-x   3 tdh      staff        512 Jan 16 15:29 ..
-r--r--r--   1 root     root        2048 Jan 12 18:16 .catalog
-r--r--r--   1 root     root          92 Dec  7 16:40 .cdtoc
dr-xr-xr-x   5 root     root        2048 Jan 12 18:14 .install
lr-xr-xr-x   1 root     root          33 Jan 12 18:12 .install_config -> ./Solaris_11/Misc/.insta
ll_config
-r--r--r--   1 root     root         419 Dec  7 16:40 .slicemapfile
-r--r--r--   1 root     root          15 Dec  7 16:40 .volume.inf
-r--r--r--   1 root     root          17 Jan 12 17:48 .volume.inf.2
-r--r--r--   1 root     root          17 Jan 12 17:49 .volume.inf.3
-r--r--r--   1 root     root          17 Jan 12 17:49 .volume.inf.4
-r--r--r--   1 root     root          17 Jan 12 17:49 .volume.inf.5
-r--r--r--   1 root     root          17 Jan 12 17:50 .volume.inf.6
-r--r--r--   1 root     root        6851 Dec 20 10:32 Copyright
dr-xr-xr-x   4 root     root        2048 Jan 12 18:16 DeveloperTools
-r--r--r--   1 root     root      459760 Dec  7 16:40 JDS-THIRDPARTYLICENSEREADME
dr-xr-xr-x   2 root     root        2048 Jan 12 18:14 License
-r--r--r--   1 root     root        1466 Jan 12 12:38 README.txt
dr-xr-xr-x   8 root     root        2048 Jan 12 18:14 Solaris_11
-r-xr-xr-x   1 root     root          50 Dec 19 15:29 autorun.inf
-r-xr-xr-x   1 root     root         322 Dec 18 22:29 autorun.sh
dr-xr-xr-x   3 root     root        2048 Jan 12 18:14 boot
-r-xr-xr-x   1 root     root         257 Jan 12 17:50 installer
# mkdir /kanigix
# mkdir /kanigix/b55b
# find . -depth -print | cpio -pudm /kanigix/b55b
7545728 blocks

And now we've got a copy of the DVD in /kanigix/b55b. We need to see what is in the grub boot menu:

# cd /kanigix/b55b/boot/grub
# more menu.lst
#
#pragma ident   "@(#)install_menu       1.5     07/01/11 SMI"
#
default=0
timeout=60
title Solaris Express, Developer Edition
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,soldevx=true
        module /boot/x86.miniroot
title Solaris Express
        kernel /boot/multiboot kernel/unix -B install_media=cdrom
        module /boot/x86.miniroot
title Solaris Express Serial Console ttya
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,console=ttya
        module /boot/x86.miniroot
title Solaris Express Serial Console ttyb (for lx50, v60x and v65x)
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,console=ttyb
        module /boot/x86.miniroot

And we want to modify it to by default select the Console options. Actually, I could easily modify this to only boot to console ttya - I will never get a chance to change this from the head. Finally, I sometimes would like to use the DVD to boot up into single-use mode. I spent too long this weekend editing that on the grub boot menu. So, I change the file to this:

# more menu.lst
#
#pragma ident   "@(#)install_menu       1.5     07/01/11 SMI"
#
default=0
timeout=60
title Solaris Express, Developer Edition Serial Console ttya
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,soldevx=true,console=ttya
        module /boot/x86.miniroot
title Solaris Express Serial Console ttya
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,console=ttya
        module /boot/x86.miniroot
title Solaris Express Single User Mode Serial Console ttya
        kernel /boot/multiboot kernel/unix -s -B console=ttya
        module /boot/x86.miniroot

I'm not sure about the last, so I can check the form on my system:

#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
kernel /boot/multiboot kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------

By the way, I have no clue whether I can get to the grub boot menu in the console off of the HD boot. I should check that...

Note that I don't have a safe version of the miniroot on the DVD:

# ls -la /kanigix/b55b/boot
total 115606
dr-xr-xr-x   3 root     root         512 Jan 12 18:14 .
drwxr-xr-x   7 root     root         512 Jan 16 15:48 ..
dr-xr-xr-x   3 root     root         512 Jan 12 18:14 grub
-r-xr-xr-x   1 root     root      103648 Jan 12 17:45 multiboot
-r--r--r--   1 root     root     59027782 Jan 12 17:46 x86.miniroot

Also, I'm still not sure about mixing -s and -B. But I did find an example on GR UB and the Solaris 10 1/06 OS: The New Bootloader for x86 Platforms, so I've made the following change:

# more menu.lst
#
#pragma ident   "@(#)install_menu       1.5     07/01/11 SMI"
#
default=0
timeout=60
title Solaris Express, Developer Edition Serial Console ttya
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,soldevx=true,console=ttya
        module /boot/x86.miniroot
title Solaris Express Serial Console ttya
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,console=ttya
        module /boot/x86.miniroot
title Solaris Express Single User Mode Serial Console ttya
        kernel /boot/multiboot kernel/unix -B console=ttya -s
        module /boot/x86.miniroot

But you know, the above changes are not going to make grub come up on the console. All they are going to do is cause a timeout and have the default action take place. The net effect is that I would get a headless install, but I wouldn't be able to get into single-user mode. Hmm, the following changes will make it happen:

# more menu.lst
#
#pragma ident   "@(#)install_menu       1.5     07/01/11 SMI"
#
default=0
timeout=60
serial --unit=0 --speed=9600
terminal serial
title Solaris Express, Developer Edition Serial Console ttya
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,soldevx=true,console=ttya
        module /boot/x86.miniroot
title Solaris Express Serial Console ttya
        kernel /boot/multiboot kernel/unix -B install_media=cdrom,console=ttya
        module /boot/x86.miniroot
title Solaris Express Single User Mode Serial Console ttya
        kernel /boot/multiboot kernel/unix -B console=ttya -s
        module /boot/x86.miniroot

I could make the changes and test now, but DVDs are not cheap. I want to get as much bang for my buck as possible. Note that means I'm violating the KISS rule with respect to testing - multiple changes makes it hard to isolate problems.

I want to put in my own splash screen. Evidently it needs to be a gzipped xpm with only 14 colors.

# mv splash.xpm.gz stock.xpm.gz
# cp /export/zfs/tdh/gw_splash.xpm.gz splash.xpm.gz
# ls -la splash.xpm.gz
-rw-r--r--   1 root     root       17668 Jan 16 21:42 splash.xpm.gz
#

I chose the image I'm using as the logo for kanigix:

Not shown

Okay, time to create the ISO.

First we create a .mkisofsrc file with some defaults. We want to be able to add in our own information.

# more .mkisofsrc
ABST=abstract.txt
APPI=Kanigix OpenSolaris System Install
BIBL=biblio.txt
COPY=copyright.txt
PUBL=Kanigix Publications
PREP=Tom Haynes, tdh@sun.com
SYSI=Kanigix v0.2
VOLI=Kanigix_x86
VOLS=Kanigix Volset 1

All of the files sit in the root of the image and just state that they are that file.

We then convert the directory to an ISO:

# mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -R -L -r -D -U -joliet-lon
g -max-iso9660-filenames -boot-info-table -o /isos/kanigix.iso /kanigix/b55b

Total translation table size: 2048
Total rockridge attributes bytes: 10724370
Total directory bytes: 89163776
Path table size(bytes): 644208
Max brk space used 60a0000
1927513 extents written (3764 MB)

Hmm, should be about the same size:

# ls -la /isos/x86/b55b/solarisdvd.iso /isos/kanigix.iso
-rw-r--r--   1 root     root     3947546624 Jan 16 22:17 /isos/kanigix.iso
-rw-r--r--   1 tdh      staff    3857448960 Jan 16 15:32 /isos/x86/b55b/solarisdvd.iso

It is not and we should not see that much expansion. But I don't know how Sun is building that image. Yes, I know it sounds weird, I work for Sun, but it is a big company!

I need to mount the new image and write a script to go down through it and the old to find differences.

A quick test shows the image booting up directly to the console:

Not shown

And if we select the single-user mode, we can see:

Not shown

I didn't get to test the splash screen and I didn't bother to do the install. I've done the install in the past to both x86 and sparc. I need to:

  1. Find out how the solarisdvd.iso is built in the first place.
  2. Write a script to detect differences in the two different isos.
  3. Test the splash with a new copy of the image.
  4. Get additional content added and installed after the normal Solaris install.

Orginally posted on Kool Aid Served Daily
Copyright (C) 2007, Kool Aid Served Daily

Trackback URL: http://blogs.sun.com/tdh/entry/getting_a_solaris_bootable_dvd
Comments:

Source and tools ? Surely your first port of call would be OpenSolaris. Or do you want to let loose any closed source bits (i.e. source not public since Sun doesn't own it ?).

Posted by Sean on January 17, 2007 at 02:56 PM CST #

Maybe that comment sounds a little wrong. Would have liked to be at connectathon though, really interested in any CIFS stuff with solaris.

Posted by Sean on January 17, 2007 at 03:00 PM CST #

Sean,

You raise a good point and I had no plans on letting anyone get their hands on these DVDs. Right now I'm building a DVD for Connectathon and not to release. As such, I am grabbing internal images and not ones released on the OpenSolaris Download Center.

The only way to get a copy of these DVDs is to get into my house. Probably not as hard as I expect, but if you can do that much, the source might be sitting on one of my work machines. I also use the internal bits because I don't have to log into some web site to do the downloads.

Once I get the Connectathon stuff built, I plan to turn my attention to only using the public bits, which means I will also have to add on-closed-bins-DATE.PLATFORM.tar.bz2 to the mix.

CIFS wise, I know we will be testing a native port of it at connectathon. If you are local to the Bay Area, there is an open house and you could talk to those developers.

Thanks,
Tom

Posted by Tom Haynes on January 17, 2007 at 04:16 PM CST #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed