I was wondering what options were used to create the stock Solaris ISO images. I found this in Creating a Customized Boot CD/DVD for the Solaris™ Operating System for x86 Platforms
# mkisofs -r -no-emul-boot \ -b .bootimage \ -c .catalog \ -G genboot \ -o composite.iso \ -sunx86-boot /var/tmp/my.miniroot \ /tmp/isodir/
But I know this is pre-grub. Hmm, I'm not generating my own miniroot, which is a difference.
The -sunx86-boot does generate the El-Torito magic needed. But I'm guessing that grub is replacing the miniroot.
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:
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:
And if we select the single-user mode, we can see:
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: