How to create your own bootable dvd

From Wiki-UX.info
Jump to: navigation, search

Abstract

The following document example how to create your own bootable dvd using Ignite-UX 7.2.x and later.

Create the DVD

# lvcreate -L 8000 -n image /dev/vg00
# newfs -F vxfs -o largefiles -b 8192 /dev/vg00/rimage
# mkdir /var/tmp/image
# mount -F vxfs -o largefiles /dev/vg00/image /var/tmp/image
# mkdir /var/tmp/image/archives
# mkdir /var/tmp/image/iso

Create the required golden image

# /opt/ignite/data/scripts/make_sys_image \
-s local -d /var/tmp/image/archives \
-n B.11.11_archive.gz
       * Preparing to create a system archive.
       * Testing for necessary pax patch.


 WARNING: CLEAN_LEVEL set to 2: (see -l option for make_sys_image(1M))
         While this command is executing at clean level 2, the system
         should be as quiet as possible.  The host and/or networking
         information on the system are temporarily set to newconfig
         values.  After the command is complete these files are
         returned to their previous state.

Creating keepsafe archive with file /stand/system
Creating your system file in the file /var/tmp/make_sys_image.hwsys.a06836
Appending file /.profile to keepsafe archive
.Appending file /etc/rc.config.d/hpetherconf to keepsafe archive
.Appending file /etc/rc.config.d/hpfcmsconf to keepsafe archive
.Appending file /etc/rc.config.d/netconf to keepsafe archive
.Appending file /etc/rc.config.d/netdaemons to keepsafe archive
.Appending file /etc/rc.config.d/namesvrs to keepsafe archive
.Appending file /etc/rc.config.d/mailservs to keepsafe archive
.Appending file /etc/rc.config.d/xfs to keepsafe archive
.Appending file /etc/hosts to keepsafe archive
.Appending file /etc/mail/sendmail.cw to keepsafe archive
.Appending file /etc/ntp.conf to keepsafe archive
.Appending file /etc/vue/config/Xsession.d/0070.recs to keepsafe archive
.Appending file /var/adm/sw/security/_ACL to keepsafe archive
.Appending file /var/adm/sw/security/_OWNER to keepsafe archive
.Appending file /var/adm/sw/security/_PROD_DFLT_ACL to keepsafe archive
.Appending file /var/adm/sw/security/_SOC_DFLT_ACL to keepsafe archive
.Appending file /var/adm/sw/security/secrets to keepsafe archive
.Appending file /var/adm/sw/security/secrets.pag to keepsafe archive
Appending file /var/adm/sw/security/secrets.dir to keepsafe archive

       * Archiving contents of delta via tar to
          /var/tmp/image/archives/B.11.11_archive.gz.
       * Creation of system archive complete.
       * Clean up: Do not interrupt; restoring files, kernel, and transition
         links.

Check archive size

# ll /var/tmp/image/archives/B.11.11_archive.gz
-rw-r--r--   1 root       sys        1736255712 Feb  2 16:41 /var/tmp/image/archives/B.11.11_archive.gz

Create the bootable DVD ISO image

# /opt/ignite/data/scripts/examples/make_media_install \
-r B.11.11 -o 64w -p /var/tmp/image \
-a B.11.11_archive.gz -m /var/tmp/image/iso

Step 1: Make Ignite-UX config files for golden image archive(s)

+ /opt/ignite/lbin/make_arch_config -L /var/tmp/image/archives/. -n B.11.11_archive.gz -d B.11.11_archive.gz
(B.11.11) -c /var/tmp/image/iso/cfgs/B.11.11_archive.gz.cfg.tmp -m t -C g -r pa -b 64 -i 1 -t 999
+ (modify /var/tmp/image/iso/cfgs/B.11.11_archive.gz.cfg.tmp => /var/tmp/image/iso/cfgs/B.11.11_archive.gz.cfg)

Step 2: Copy SD depot(s) and make config files for them

Step 3: Make a boot-image (LIF volume)

+ /opt/ignite/bin/make_medialif -o 64w -r B.11.11 -f /opt/ignite/data/Rel_B.11.11/config
-f /var/tmp/image/iso/cfgs/B.11.11_archive.gz.cfg -l /var/tmp/image/bootvol.lif
+ /opt/ignite/bin/instl_adm -b -F /var/tmp/image/bootvol.lif

Step 4: Make ISO media image

+ /opt/ignite/lbin/mkisofs -U -max-iso9660-filenames -R -eltorito-alt-boot -no-emul-boot
-b bootvol.lif /var/tmp/image/iso/image.iso /var/tmp/image
Warning: creating filesystem that does not conform to ISO-9660.
Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS.
Size of boot image is 135856 sectors -> No emulation
 0.57% done, estimate finish Sat Feb  2 17:20:50 2008
 1.13% done, estimate finish Sat Feb  2 17:20:50 2008
 1.70% done, estimate finish Sat Feb  2 17:20:50 2008
...
 99.21% done, estimate finish Sat Feb  2 17:22:56 2008
 99.78% done, estimate finish Sat Feb  2 17:22:56 2008
Total translation table size: 2048
Total rockridge attributes bytes: 1581
Total directory bytes: 10240
Path table size(bytes): 82
Max brk space used 13000
881930 extents written (1722 MB)

Step 5: Combine LIF volume and media image

+ /opt/ignite/lbin/instl_combine -C /var/tmp/image/iso/image.iso
El Torito offset for LIF volume is: 0x10000
Adjusting LIF file: ISL (Old iplstart: 4096; New iplstart: 69632)
Adjusting LIF file: AUTO
Adjusting LIF file: INDEX
Adjusting LIF file: CONFIG
Adjusting LIF file: HPUX
Adjusting LIF file: WINSTALL
Adjusting LIF file: WINSTALLFS
Adjusting LIF file: FWWKAR
Adjusting LIF file: INSTCMDS
Adjusting LIF file: SYSCMDS
Adjusting LIF file: SCRIPTS
Adjusting LIF file: PAD

Step 6: Write image file to tape/CD/DVD media

+ /opt/ignite/lbin/growisofs -Z /dev/rdsk/c0t0d0=/var/tmp/image/iso/image.iso
:-( unable to open("/dev/rscsi/c0t0l0",O_RDONLY): No such file or directory
:-! consider 'mknod /dev/rscsi/c0t0l0 c 203 0x000002; chmod 0600 /dev/rscsi/c0t0l0'
+ Error 83 /opt/ignite/lbin/growisofs failed.
/opt/ignite/data/scripts/examples/make_media_install: ERROR: /opt/ignite/lbin/growisofs failed.

The /var/tmp/image/iso/image.iso needs to be move to a system with DVD writable hardware.

  1. The final error message is normal, because the system will not burn the image directly. If you DVD burner is supported, you may run the recommended commands mknod /dev/rscsi/c#t#l# c 203 0x000002; chmod 0600 /dev/rscsi/c#t#l# using your DVD writer device special file. That will allow the image to be write directly on your server.
  2. Remember to remove the ISO image any time that your will reuse the process!!!
  3. On Integrity bases systems, the command to create the ISO image needs some modifications to create IA64 bootable media. For example, for HP-UX 11i v2 (11.23) media, you should use:
# /opt/ignite/data/scripts/examples/make_media_install \
-r B.11.23 -o IA -p /var/tmp/image \
-a B.11.23_archive.gz -m /var/tmp/image/iso

Know Issues

Unable to create 2 GB+ iso images on HP-UX 11.31

The Ignite-UX above C.6.5 offers support for archives larger that 2GB (up to around 4 GB). On Ignite-UX C.7.4.157 and below under HP-UX 11.31 there is a problem using archives larger that 2 Gigabytes. The problem is that the make_media_install script checks the existence of kernel patch PHKL_33110 and above of the CDFS filesystem. On HP-UX 11.31 this patch is not required neither exists, so the system failed to test the script. If upgrating to the latest version of Ignite-UX is not possible, as a workaround you may add the following lines to the make_media_install script to bypass the testing.

# diff make_media_install.orig make_media_install
1388a1389,1393
>               # Disable testing on HP-UX 11.31
>               OSRELEASE=`uname -r`
>               if [ $OSRELEASE = "B.11.31" ]; then
>                  break
>               fi

Example:

function CheckLargeFile
{
        typeset archive_at size

# To avoid shell math problems on a 32-bit system, get the file size in
# 1024-byte blocks, and look for >= 2^21 = 2097152 blocks:

        ((archive_at = 0)); while (((archive_at += 1) <= Archives))
        do
            size="$(du -sk ${Archive[$archive_at]} 2>/dev/null |
                    awk '{print $1}')"
            [[ -z "$size" ]]   && continue
            ((size < 2097152)) && continue

# Have a large file, so check each install kernel in $LIF_vol:
#
# Note:  Use for-loop, not pipe to while-loop, to avoid trying to Error() from
# a subshell.

            typeset file patch

            for file in $(lifls -l "$LIF_vol" |
                          awk '($1 ~ /INSTALL$/) {print $1}')
            do
                # Disable testing on HP-UX 11.31
                OSRELEASE=`uname -r`
                if [ $OSRELEASE = "B.11.31" ]; then
                   break
                fi
                patch="$(lifcp "$LIF_vol:$file" - |
                         # gzcat |  # turn on if install kernels are compressed.
                         sed -n '/cdfs_vnops.*PHKL_/s/.*PHKL_//p' |
                         cut -c1-5)"

                if [[ -z "$patch" ]] || ((patch < 33110))
                then
                    Error 32 'At least one archive file'                       \
                             "(\"${Archive[$archive_at]}\") specified with -a" \
                             'is 2 Gb (2^31) bytes or larger, and it appears'  \
                             "at least one install kernel (\"$file\") copied"  \
                             "to the LIF volume (\"$LIF_vol\") lacks cdfs"     \
                             "driver patch PHKL_33110 or higher (\"$patch\")," \
                             'which can result in failure to install/recover'  \
                             'from the media.  See script header comments for' \
                             'more on this problem.'
                fi
            done
        done # each $Archive[] file

} # CheckLargeFile()

Reference

Authors