Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2441856
  • 博文数量: 328
  • 博客积分: 4302
  • 博客等级: 上校
  • 技术积分: 5486
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-01 11:14
个人简介

悲剧,绝对的悲剧,悲剧中的悲剧。

文章分类

全部博文(328)

文章存档

2017年(6)

2016年(18)

2015年(28)

2014年(73)

2013年(62)

2012年(58)

2011年(55)

2010年(28)

分类: 系统运维

2012-06-12 11:57:55

Introduction

The Solaris 10 Operating System offers an automatic installation process, Solaris JumpStart software. The Solaris JumpStart procedure enables you to install the Solaris OS automatically and configure it differently, depending on the characteristics of client systems. These identifying characteristics are used to select the correct configuration for each client system.

The following tasks are required to configure a single JumpStart server to provide basic software installation services using the JumpStart procedures:

  1. Spool the operating system image.
  2. Edit the sysidcfg file.
  3. Edit the profile and rules.
  4. Run the check script.
  5. Run the add_install_client script.
  6. Boot the client.
Step #1

To spool the Solaris 10 boot and installation images to a local disk, complete the following steps: Create a directory with at least 800 Mbytes of space available to hold the Solaris OS image. Usually the /export/install directory is used.

  1. mkdir /export/install

Insert the Solaris 10 Software 1 of 2 CD-ROM in the CD-ROM drive or the Solaris 10 DVD in the DVD drive. Change the directory to the location of the setup_install_server script.

  1. cd /cdrom/cdrom0/s0/Solaris_10/Tools

Run the setup_install_server script to copy the Solaris 10 OS installation images to the local disk.

  1. ./setup_install_server /export/install

When the setup_install_server script finishes, change the directory to root (/), and eject the CD-ROM or DVD.

  1. cd /
  2. eject cdrom

If you use CD-ROM media, insert the Solaris 10 Software 2 of 2 CD-ROM in the CD-ROM drive. Change the directory to the location of the add_to_install_server script.

  1. cd /cdrom/cdrom0/Solaris_10/Tools

Run the add_to_install_server script to copy the remainder of the installation image to the local disk.

  1. ./add_to_install_server /export/install

When add_to_install_server finishes, change the directory to root (/), and eject the CD-ROM.

  1. cd /
  2. eject cdrom
Step #2

The sysidcfg file keeps the various types of system information such as locale, time_zone, and so on, and supplies the information to the client at the booting time. Create a directory to hold the sysidcfg file. Typically the /export/config directory holds the sysidcfg file.

  1. mkdir /export/config

Change the directory to /export/config, and create a file called sysidcfg using a text editor.

  1. cd /export/config
  2. vi sysidcfg

In the sysidcfg file, add the following lines. Substitute values that are appropriate for your systems, location, and network.

network_interface=primary {protocol-ipv6=no netmask=255.255.255.0} security_policy=none name_service=none time_zone=US/Mountain system_locale=en_us Save the sysidcfg file, and exit your edit session.

Step #3
Rules

Create a directory to hold the rules file if this directory does not already exist. Usually, the /export/config directory holds the rules file.

  1. mkdir /export/config

Change the directory to /export/config, and create a file called rules using a text editor.

  1. cd /export/config
  2. vi rules
In the rules file, add the following line: hostname client_name - profile1 - For client_name, substitute the name of your JumpStart client. For example: hostname sun1 - profile - Save the rules file, and exit your edit session.

Profiles

Usually, the /export/config directory holds the profile file.

Change the directory to /export/config, and create a file called profile using a text editor.

  1. cd /export/config
  2. vi profile1
Add the following lines to the profile1 file: install_type initial_install system_type standalone partitioning explicit filesys c0t0d0s0 free / filesys c0t0d0s1 128 swap cluster SUNWCXall Save the profile1 file, and exit your edit session.

Step #4

Before a JumpStart client can use a configuration provided by a JumpStart server, you must run the check script to produce a file called rules.ok. The check script validates the syntax of the rules file and the profile files. If the validation completes successfully, the check script creates the rules.ok file. Change the directory to the location of the check script.

  1. cd /export/install/Solaris_10/Misc/JumpStart_sample

Copy the check script to the /export/config directory.

  1. cp check /export/config

Change the directory to /export/config, and run the check script.

  1. cd /export/config
  2. ./check
Validating rules... Validating profile profile1... The custom JumpStart configuration is ok.

Step #5

Add a host entry

Edit the /etc/ethers file, and add an entry for the JumpStart client.

  1. vi /etc/ethers
00-C0-26-84-34-A1 sun1 Save and exit from the ethers file.

Edit the /etc/inet/hosts file, and add an entry for the JumpStart client.

  1. vi /etc/inet/hosts
192.168.1.1 sun1 Save and exit from the hosts file.

Add a client

Change the directory to the location of the add_install_client script on the server.

  1. cd /export/install/Solaris_10/Tools

Run the add_install_client script, and specify server and client information as follows. (Note: The following line of code should all be entered on one line.)

  1. ./add_install_client -c server_name:/export/config \
-p server_name:/export/config client_name platform_group

For example:

  1. ./add-install-client -c sun:/export/config -p sun:/export/config sun1 sun4u

Edit the /etc/dfs/dfstab file to add the following line:

  1. vi /etc/dfs/dfstab

share -F nfs -o ro, anon=0 /export/install

share -F nfs -o ro, anon=0 /export/config Save and exit from the dfstab file.

Run the shareall command to share the /export/config and /export/install directories.

  1. shareall

Verify that the /export/config and /export/install directories are currently shared.

  1. share
Step #6

Booting the JumpStart Client

After the JumpStart server has been configured to provide all of the required services, you can initiate the installation process on the JumpStart client. To boot the JumpStart client, perform the following steps:

Bring the JumpStart client to run state 0
  1. init 0
Boot the client to initiate the software installation using the JumpStart procedure

ok boot net - install


点击(此处)折叠或打开

  1. Adding record 10.198.89.166/pilotsparc166/0100144F96A0F0 into DHCP table ...
  2. + Server info was added to DHCP table on jumpstart server successfully.

  3. Creating boot file /tftpboot/0100144F96A0F0 ... Done
  4. Creating cfg file /opt/jumpstart/config/Solaris-10-UGA-sparc/10.198.89.166/sysidcfg ... DONE
  5. Creating cfg-file /opt/jumpstart/config/Solaris-10-UGA-sparc/10.198.89.166/rules ...DONE
  6. Creating cfg-file /opt/jumpstart/config/Solaris-10-UGA-sparc/10.198.89.166/rules.ok ...DONE
  7. Creating cfg-file /opt/jumpstart/config/Solaris-10-UGA-sparc/10.198.89.166/finish.sh ...DONE
  8. Creating cfg-file /opt/jumpstart/config/Solaris-10-UGA-sparc/10.198.89.166/any_machine ...DONE
  9. Creating tarball /opt/jumpstart/config/Solaris-10-UGA-sparc/10.198.89.166/config.tar ... DONE
  10. + Jumpstart configuration file for your server is created successfully.

  11. + Please reboot sparc server with "init 0" (enter ok mode) and start installation with "boot net:dhcp -v - install".

any_machine

点击(此处)折叠或打开

  1. install_type initial_install
  2. system_type standalone
  3. partitioning explicit
  4. filesys any free /
  5. filesys any 8192 swap
  6. cluster SUNWCXall
  7. geo Asia
  8. locale zh
  9. locale en_US
  10. locale en_CA
  11. locale ja_JP
  12. locale zh_CN
  13. locale zh_HK
  14. locale zh_TW

finish.sh

点击(此处)折叠或打开

  1. #!/bin/sh

  2. # JumpStart finish script

  3. #Modify nfs client version
  4. echo NFS_CLIENT_VERSMAX=3 >> /a/etc/default/nfs

  5. # Modify nsswitch.conf
  6. echo "finish.sh: Changing /etc/nsswitch.conf ..."
  7. perl -i -p -0777 -e 's/hosts: files/hosts: files dns/gs' /a/etc/nsswitch.conf
  8. echo ""

  9. # Modify login for remote login
  10. echo "finish: Changing /etc/default/login file..."
  11. perl -i -p -0777 -e 's/CONSOLE=/#CONSOLE=/gs' /a/etc/default/login
  12. echo ""

  13. # Create the resolv.conf
  14. echo "finish.sh: Creating /etc/resolv.conf..."
  15. echo "domain cdc.veritas.com" > /a/etc/resolv.conf
  16. echo "nameserver 10.198.88.18" >>/a/etc/resolv.conf
  17. echo "nameserver 10.200.117.18" >>/a/etc/resolv.conf
  18. echo "search cdc.veritas.com" >>/a/etc/resolv.conf
  19. echo ""

  20. echo "finish.sh: Disabling NFSv4 domain..."
  21. touch /a/etc/.NFS4inst_state.domain
  22. ls -l /a/etc/.NFS4inst_state.domain
  23. echo ""

  24. echo "change dhcp to static ip"

  25. sed -e "s/dhcp/ hostname=pilotsparc166.cdc.veritas.com ip_address=10.198.89.166 default_route=10.198.88.1 netmask=255.255.248.0/g" /a/etc/sysidcfg > /a/etc/sysidcfg-new
  26. cp /a/etc/sysidcfg /a/etc/sysidcfg-bak
  27. cp /a/etc/sysidcfg-new /a/etc/sysidcfg

  28. BASE="/a"
  29. IFNAME="`ls ${BASE}/etc/hostname.* |sed -e \"s:^${BASE}/etc/hostname.::\"`"
  30. echo "pilotsparc166" > ${BASE}/etc/hostname.${IFNAME}
  31. echo "pilotsparc166" > ${BASE}/etc/nodename
  32. echo "10.198.88.0 255.255.248.0" >> ${BASE}/etc/netmasks
  33. echo "10.198.88.1" >> ${BASE}/etc/defaultrouter
  34. echo "10.198.89.166 pilotsparc166 loghost" >> ${BASE}/etc/hosts
  35. /bin/rm -f ${BASE}/etc/dhcp.${IFNAME}
  36. cat /etc/inet/ipnodes > ${BASE}/etc/ipnodes-bak

  37. # Disable power management
  38. echo "finish.sh: Disabling power management..."
  39. touch /a/noautoshutdown
  40. ls -l /a/noautoshutdown
  41. echo ""


  42. # embed super lab
  43. echo "
  44. #!/bin/sh
  45. useradd -g 0 -u 9876 -d /tmp labadmin
  46. perl -i -pe \"s/labadmin:\*LK\*/labadmin:JP68IF1KRujYc/\" /etc/shadow
  47. sleep 3
  48. rm -rf /etc/rc2.d/S99addlab
  49. " >/a/etc/rc2.d/S99addlab
  50. chmod +x /a/etc/rc2.d/S99addlab

  51. echo "finish.sh: DONE!"

  52. echo "Reboot the system ..."
  53. reboot



  54. exit 0

rules

点击(此处)折叠或打开

  1. #
  2. # @(#)rules 1.12 94/07/27 SMI
  3. #
  4. # The rules file is a text file used to create the rules.ok file for
  5. # a custom JumpStart installation. The rules file is a lookup table
  6. # consisting of one or more rules that define matches between system
  7. # attributes and profiles.
  8. #
  9. # This example rules file contains:
  10. # o syntax of a rule used in the rules file
  11. # o rule_keyword and rule_value descriptions
  12. # o rule examples
  13. #
  14. # See the installation manual for a complete description of the rules file.
  15. #
  16. #
  17. #############################################################################
  18. #
  19. # RULE SYNTAX:
  20. #
  21. # [!]rule_keyword rule_value [&& [!]rule_keyword rule_value]... begin profile finish
  22. #
  23. # "[ ]" indicates an optional expression or field
  24. # "..." indicates the preceding expression may be repeated
  25. # "&&" used to "logically AND" rule_keyword and rule_value pairs together
  26. # "!" indicates negation of the following rule_keyword
  27. #
  28. # rule_keyword a predefined keyword that describes a general system
  29. # attribute. It is used with the rule_value to match a
  30. # system with the same attribute to a profile.
  31. #
  32. # rule_value a value that provides the specific system attribute
  33. # for the corresponding rule_keyword. A rule_value can
  34. # be text or a range of values (NN-MM).
  35. # To match a range of values, a system's value must be
  36. # greater than or equal to NN and less than or equal to MM.
  37. #
  38. # begin a file name of an optional Bourne shell script
  39. # that will be executed before the installation begins.
  40. # If no begin script exists, you must enter a minus sign (-)
  41. # in this field.
  42. #
  43. # profile a file name of a text file used as a template by the
  44. # custom JumpStart installation software that defines how
  45. # to install Solaris on a system.
  46. #
  47. # finish a file name of an optional Bourne shell script
  48. # that will be executed after the installation completes.
  49. # If no finish script exists, you must enter a minus sign (-)
  50. # in this field.
  51. #
  52. # Notes:
  53. # 1. You can add comments after the pound sign (#) anywhere on a line.
  54. # 2. Rules are matched in descending order: first rule through the last rule.
  55. # 3. Rules can be continued to a new line by using the backslash (\) before
  56. # the carriage return.
  57. # 4. Don't use the "*" character or other shell wildcards, because the rules
  58. # file is interpreted by a Bourne shell script.
  59. #
  60. #
  61. #############################################################################
  62. #
  63. # RULE_KEYWORD AND RULE_VALUE DESCRIPTIONS
  64. #
  65. #
  66. # rule_keyword rule_value Type rule_value Description
  67. # ------------ --------------- ----------------------
  68. # any minus sign (-) always matches
  69. # arch text system's architecture type
  70. # domainname text system's domain name
  71. # disksize text range system's disk size
  72. # disk device name (text)
  73. # disk size (MBytes range)
  74. # hostname text system's host name
  75. # installed text text system's installed version of Solaris
  76. # disk device name (text)
  77. # OS release (text)
  78. # karch text system's kernel architecture
  79. # memsize range system's memory size (MBytes range)
  80. # model 'text' system's model number
  81. # network text system's IP address
  82. # totaldisk range system's total disk size (MBytes range)
  83. #
  84. #
  85. ############################################################################
  86. #
  87. # RULE EXAMPLES
  88. #
  89. # The following rule matches only one system:
  90. #

  91. # arch i386 begin.sh x86-class finish.sh
  92. # arch sparc - sparc_profile -
  93. any - - any_machine finish.sh

rules.ok

  1. any - - any_machine finish.sh
  2. # version=2 checksum=3506

sysidcfg

点击(此处)折叠或打开

  1. terminal=xterm
  2. system_locale=C
  3. security_policy=NONE
  4. name_service=NONE
  5. auto_reg=disable
  6. nfs4_domain=dynamic
  7. network_interface=primary { dhcp protocol_ipv6=no }
  8. root_password=TQJIWs6nKujsw
  9. timezone=PRC
  10. timeserver=localhost


Related White Papers and Webcasts




Related Content

(Wiki) (Groups)

转载自–_Solaris_10


阅读(1809) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~