Thursday, March 31, 2011

SOLARIS 10 x86 Jumpstart Server on GNU/Linux

okay i know this maybe a bit late but i'll post this anyway.
i got too busy the past few months (translation: i got lazy :D).

This is how I've set my Centos box for both kickstart and jumpstart.

Centos machine is a kickstart Server for RHEL/CENTOS releases.
i'll be using the same dhcp and tftp server to serve the Solaris
installation.

Jumpstart server:
CENTOS 5.5

SOLARIS 10 u8 target machines
LX0050 - ProLiant BL460c G1 with Smart Array E200i controller
LX0130 - HP ProLiant BL45p G1 Smart Array 6i Controller

components of my JumpStart server:

DHCP server - dhcpd config
## start of /etc/dhcpd.conf
authoritative;
ddns-update-style none;
allow booting;
allow bootp;
option grubmenu code 150 = text;

subnet 10.129.6.0 netmask 255.255.255.0 {
        option routers                  10.129.6.1;
        option subnet-mask              255.255.255.0;
        option domain-name              "mydomain.org";
        option domain-name-servers      10.129.8.11;
        option ntp-servers              10.129.8.19;
        range dynamic-bootp 10.129.6.101  10.129.6.101;
        default-lease-time 21600;
        max-lease-time 43200;
        option tftp-server-name "10.129.6.125";
}

host LX0130.mydomain.org{
    next-server 10.129.6.125;
    hardware ethernet 00:16:35:C4:89:00;
    fixed-address 10.129.6.74;
    filename "/solaris/pxegrub.sol10u8";
}

host LX0050.mydomain.org{
    next-server 10.129.6.125;
    hardware ethernet 00:18:FE:30:C1:F2;
    fixed-address 10.129.6.201;
    filename "/solaris/pxegrub.sol10u8";
}

## end of /etc/dhcpd.conf

TFTP server tree
/tftpboot/
|-- solaris
|   |-- pxegrub.sol10u6
|   |-- pxegrub.sol10u8
|   |-- sol10u6.miniroot
|   |-- sol10u6.multiboot
|   |-- sol10u8.miniroot
|   `-- sol10u8.multiboot
|-- menu.lst.01001635C48900
`-- menu.lst.010018FE30C1F2

contents of /tftpboot/menu.lst.<MAC>

## menu.lst.01001635C48900
default=0
timeout=4
title Solaris_10 Jumpstart
kernel /solaris/sol10u8.multiboot kernel/unix -v -m verbose  install w nfs://10.129.6.125/tools/solaris/sol10u8/config/LX0050.tar  -B install_media=10.129.6.125:/tools/solaris/sol10u8/image
module /solaris/sol10u8.miniroot
## end of  menu.lst.01001635C48900

## menu.lst.010018FE30C1F2
default=0
timeout=4
title Solaris_10 Jumpstart
kernel /solaris/sol10u8.multiboot kernel/unix -v -m verbose  install w nfs://10.129.6.125/tools/solaris/sol10u8/config/LX0050.tar  -B install_media=10.129.6.125:/tools/solaris/sol10u8/image
module /solaris/sol10u8.miniroot
## end of menu.lst.010018FE30C1F2

- 01001635C48900 and 010018FE30C1F2 are MAC addresses of the first
network interface for the machines i'm install with solaris:


- the *.miniroot and *.miniboot are from the image/boot of the Solaris 10 image.

NOTE: installation for the HP proliant blades I use  require a modified miniroot files.
I included the CPQary3 modules for the HP SMART Arrays. more details. pls follow these links:

Solaris installation guide for HP proliant servers

for the smart array driver i use

NFS (hosting Solaris installation image and installation scripts)
here's an overview of the nfs tree i use for solaris:
/tools/solaris/sol10u8/
|-- config
|   |-- LX0050.tar
|   |-- LX0130.tar
|   `-- LXISAP0140.tar
|-- image
|   |-- Copyright
|   |-- JDS-THIRDPARTYLICENSEREADME
|   |-- License
|   |-- Solaris_10
|   |-- boot
|   `-- installer
`-- share
    |-- CPQary3
    `-- CPQary3.pkg
contents for /tools/solaris/sol10u8/image

creating the solaris installation tree:

create a  "/bin/bar" symlink to "/bin/tar"

ln -s /bin/tar /bin/bar
ln -s /bin/sed /usr/bin/sed
ln -s /usr/bin/gdb /usr/bin/adb

and for the "mach" script:

echo "#!/bin/bash" > /bin/mach
echo "uname -p" >> /bin/mach
chmod +x /bin/mach

from the downloaded solaris x86 ISO:


sudo mount -o loop sol-10-u8-ga-x86-dvd.iso /mnt/iso
ls -ltr /mnt/iso
total 490
-r--r--r-- 1 root root 487593 Aug 22  2009 JDS-THIRDPARTYLICENSEREADME
-r--r--r-- 1 root root   6582 Aug 22  2009 Copyright
-r-xr-xr-x 1 root root    257 Sep 17  2009 installer
dr-xr-xr-x 2 root root   2048 Sep 17  2009 License
dr-xr-xr-x 7 root root   2048 Sep 17  2009 Solaris_10
dr-xr-xr-x 5 root root   2048 Sep 17  2009 boot


cd /mnt/iso/Solaris_10/Tools

sudo ./setup_install_server /tools/solaris/sol10u8/image
Verifying target directory...
Calculating the required disk space for the Solaris_10 product
|\b\c
/\b\c
-\b\c
\ \b\b\c
...
...

and wait for it to finish.

my installation source tree looks like this:
/tools/solaris/sol10u8/image
|-- Copyright
|-- JDS-THIRDPARTYLICENSEREADME
|-- License
|   `-- 819-0764-10_SLA_Multi.pdf
|-- Solaris_10
|   |-- Docs
|   |-- Misc
|   |-- Patches
|   |-- Product
|   `-- Tools
|-- boot
|   |-- amd64
|   |-- grub
|   |-- multiboot
|   |-- platform
|   `-- x86.miniroot
`-- installer

contents for /tools/solaris/sol10u8/config/
this serves the tar files of the automation files needed for the
jumpstart installation:

LX0050.tar
LX0130.tar
LXISAP0140.tar

LX0050.tar has the following contents:

tar tf LX0050.tar

LX0050
LX0050_post.sh
rules
rules.ok
sysidcfg

ff are the contents of the files.
## LX0050
install_type    initial_install
system_type     standalone
partitioning    explicit
filesys c1t0d0s0 8192 /
filesys c1t0d0s1 4096 /tmp
filesys c1t0d0s4 8192 swap
filesys c1t0d0s5 3000 /var
filesys c1t0d0s6 5000 /usr
filesys c1t0d0s7 4096 /u01
# the packages here include those needed
# for an oracle instllation
#cluster SUNWCall
cluster SUNWCrnet
cluster SUNWCssh add
package SUNWbash add
package SUNWgss  add
package SUNWarc add
package SUNWbtool add
package SUNWhea add
package SUNWlibm add
package SUNWlibms  add
package UNWsprot add
package SUNWtoo add
package SUNWi1of add
package SUNWi1cs add
package SUNWi15cs add
package SUNWxwfnt add
package SUNWman add
package SUNWdoc add
package SUNWnfscr add
package SUNWnfscu add
package SUNWnfsckr add
package SUNWdtrp add
package SUNWdtrc add
# tcp/ip tools
package SUNWbip add
# needed by Veritas SF
package SUNWscpr add
package SUNWscpu add
package SUNWrcmdc add
package SUNWtftp add
package SUNWtnetc add
package SUNWpool add
package SUNWntpu add
## end of LX0050

## LX0050_post.sh
#!/bin/sh
#

# Add packages
BASE=/a
MNT=/a/mnt
ADMIN_FILE=/a/tmp/admin

mkdir ${MNT}
mount -f nfs 10.129.y.d:/tools/solaris/sol10u8/share/ ${MNT}
cat >${ADMIN_FILE} <<DONT_ASK
mail=root
instance=overwrite
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=ask
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default
DONT_ASK

/usr/sbin/pkgadd -a ${ADMIN_FILE} -d ${MNT} -R ${BASE} CPQary3
umount ${MNT}
rmdir ${MNT}

# Customize root's environment
#
echo "***adding customizations in /.cshrc"
test -f /a/.cshrc || {
cat >> /a/.cshrc <<EOF
set history=100 savehist=200 filec ignoreeof prompt="\$user@`uname -n`> "
alias cp cp -i
alias mv mv -i
alias rm rm -i
alias ls ls -FC
alias h history
alias c clear
unset autologout
EOF
}

echo "***adding customizations in /etc/profile"
test -f /a/.cshrc || {
cat >> /a/.cshrc <<EOF
set history=100 savehist=200 filec ignoreeof prompt="\$user@`uname -n`> "
alias cp cp -i
alias mv mv -i
alias rm rm -i
alias ls ls -FC
alias h history
alias c clear
unset autologout
EOF
}


### NET related
echo "***adding network customizations..."
# resolv.conf
cat > /a/etc/resolv.conf << EOF
nameserver 10.129.x.a
nameserver 10.129.x.b
nameserver 10.129.x.3
search mydomain.org
EOF

# motd and issue/.net
cat > /a/etc/motd << EOF
----------------------------------
Access to this system is strictly for authorized personnel only.
If you are not authorized, please disconnect now!
Any unauthorized access attempts shall be prosecuted.
-----------------------------------

EOF
cat > /a/etc/issue << EOF
----------------------------------
Access to this system is strictly for authorized personnel only.
If you are not authorized, please disconnect now!
Any unauthorized access attempts shall be prosecuted.
-----------------------------------

EOF

# ssh
/usr/bin/ed <<EOT /a/etc/ssh/sshd_config
/^PermitRootLogin
s/no/yes
.
w
q
EOT

#this sets the second interface
cat > /a/etc/hostname.bge1 << EOF
192.168.100.130
EOF

cat >> /a/etc/hosts << EOF
192.168.100.50  node01
192.168.100.130 node02
EOF

cat >> /a/etc/system << EOF
set lwp_default_stksize=0x6000
set rpcmod:svc_default_stksize=0x6000
EOF
### end of NET related

## end of LX0050_post.sh

## rules
hostname        LX0050 -       LX0050 LX0050_post.sh
any              -               -      any_machine LX0050_post.sh
# version=2 checksum=num
## end of rules

# rules.ok = rules - this basically make sure
# rules file is correct
## rules.ok
hostname        LX0050 -       LX0050 LX0050_post.sh
any              -               -      any_machine LX0050_post.sh
# version=2 checksum=num
## end of rules.ok


# this automates most the basic stuff

## sysidcfg
system_locale=en_US
keyboard=US-English
terminal=xterms
network_interface=PRIMARY
        {hostname=LX0050
        ip_address=10.129.x.201
        default_route=10.129.x.1
        netmask=255.255.255.0
        protocol_ipv6=no}
security_policy=none
name_service=DNS{ domain_name=mydomain.org
        name_server=10.129.8.11
        search=mydomain.org}
nfs4_domain=dynamic
timezone=Singapore
timeserver=localhost
root_password=$1$8op9W$5kF3KWEmEJ8Du0fL/MIo31
#keyboard=us101 {kbdfile=us101.kbd}
## end of sysid cfg
once done with the automation files, put them in the tar file named LX0050.tar. add the ff to /etc/sysconfig/nfs:
RPCNFSDARGS="--no-tcp --no-nfs-version 4"
and to /etc/exports:
/tools/solaris LX0130(ro,no_root_squash) LX0050(ro,no_root_squash)
start the services:
sudo /sbin/service dhcpd restart
sudo /sbin/chkconfig tftp on
sudo /sbin/service nfs restart
installation images:

1 comments:

  1. Hello roderick,

    Beware the file
    image/Solaris_10/Tools/Boot is bad because adb (gdb) place the banner.

    Best regards,

    Pascal

    ReplyDelete