home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Enter 1999 June / enter_06_1999.iso / doc / README.ks next >
Text File  |  1998-10-05  |  18KB  |  479 lines

  1.  
  2. Kickstart
  3. =========
  4.  
  5.  
  6. Due to the need for automated installation, Red Hat has created the
  7. "kickstart" installation method.  With this method a system administrator
  8. can create a single file that defines the answers to the questions that
  9. one would normally be asked in a regular Red Hat install.  This procedure
  10. is powerful enough that often times one kickstart configuration file can
  11. actually be used for multiple machines.
  12.  
  13. The general procedure to use kickstart is to create the kickstart file
  14. and then place that file somewhere the install can find it.  That is 
  15. on the boot media (floppy) or on the network.  The network is the most
  16. common use since kickstart is usually used on networks of machines anyway.
  17.  
  18. Kickstart is only available for the CD-ROM and NFS install methods.  You
  19. can not do FTP, local hard disk, or SMB installs with kickstart.  For
  20. a detailed kickstart config file, see doc/sample.ks on the Red Hat
  21. CD-ROM or on the FTP site.
  22.  
  23. Where to put your kickstart file
  24. --------------------------------
  25.  
  26. From Floppy
  27.  
  28. To begin a kickstart install, you must include the "ks" option at the boot
  29. prompt.  If you want to get your kickstart file from the floppy, the
  30. boot prompt command would be "boot: linux ks=floppy".  If you want to get
  31. your kickstart file from the network, you would simply do "boot: linux ks".
  32.  
  33. In the case of the floppy, the kickstart file must be named "ks.cfg" and
  34. must reside in the top level directory of the boot floppy.  The Red Hat
  35. boot floppy images are in MS-DOS format, so you should be able to easily
  36. copy the file there under Linux using the mtools 'mcopy' command.  The
  37. floppy method is most commonly used for CD-ROM kickstart installs.
  38.  
  39.  
  40. From the Network
  41.  
  42. Network installs using kickstart are common because administrators can
  43. easily automate the install of large amounts of machines in a network
  44. environment quickly and painlessly.  The general topology would be for
  45. the administrator to have a BOOTP/DHCP server as well as an NFS server
  46. on the local network.  The BOOTP/DHCP server would be used to give the
  47. client it's networking information and the NFS server would be used to
  48. hold the installation media.  These servers can be the same physical
  49. machine, but they don't need to be. 
  50.  
  51. To do an NFS kickstart install, you must have a BOOTP/DHCP server on 
  52. your network and it must have configuration information setup in it for
  53. the machine you are attempting to install.  The BOOTP/DHCP server will
  54. be used to give the client it's networking information and can also be
  55. used to specify the location of the kickstart configuration file.  If
  56. a file is specified by the BOOTP/DHCP server, the client will attempt
  57. an NFS mount of the file path and will copy the specified file to the
  58. client and use it as the kickstart configuration file.  The strings
  59. you need to set vary based on the BOOTP/DHCP server you use, but in
  60. the DHCP server shipped with Red Hat you want to use "filename" for
  61. the filename and "next-server" to set the NFS server name.
  62.  
  63. If the filename returned by the BOOTP/DHCP server ends in a "/" then
  64. it is interpreted as a path only.  That path is mounted and a file
  65. by the default filename is copied from there.  That default filename
  66. is <ip-addr>-kickstart, where <ip-addr> is the client's IP address
  67. in dotted decimal notation (for example, a filename for a machine
  68. with IP 10.10.0.1 would be "10.10.0.1-kickstart").
  69.  
  70. If you don't specify a server name, then the install will default to
  71. the server that answered the BOOTP/DHCP request.  If you don't specify
  72. a path or filename then it will default to trying to mount "/kickstart"
  73. from the BOOTP/DHCP server and then it will try to grab the file using
  74. the default filename (described above as <ip-addr>.kickstart).
  75.  
  76.  
  77. The kickstart file
  78. ------------------
  79.  
  80. First, items must be specified *in order*.  It is not a good idea to
  81. try to change the order of the required items.  Items that aren't
  82. required can be omitted.  Of the items that go in the kickstart
  83. file (specified later in this document), the only ones that matter
  84. to *upgrades* are language, installation method, device specification,
  85. keyboard setup, the "upgrade" keyword, and the LILO configuration.
  86. Specifying anything additional in an *upgrade* will be ignored
  87. (including package selection).  Omitting any required step, however,
  88. will simply result in the kickstart process stopping to ask for
  89. an answer to that question as if the install were running normally.
  90. Once the answer is given, the kickstart install will continue 
  91. normally (unless it hits another unanswered question).
  92.  
  93. The kickstart file is a simple text file.  You can create it by
  94. editing the sample.ks file found in the doc/ directory of a
  95. Red Hat CD image, or you can create it from scratch.  You should
  96. be able to edit it with any text editor or word processor that
  97. can save as ASCII text.
  98.  
  99. Language
  100.  
  101. The first item that must appear is the language setting.  You must
  102. specify a language for the install to run in and setup your system
  103. for.  This must be a two letter ISO language code, such as 
  104. "en" for English, "de" for German, "fr" for French, etc.  The variable
  105. you must set is "lang".  An example for setting this to English would
  106. be:
  107.  
  108. lang en
  109.  
  110.  
  111. Networking
  112.  
  113. The next item you need to set in the kickstart file is the networking
  114. information.  You must tell the system how it is going to setup 
  115. networking for itself.  This item is optional and if omitted the
  116. machine will be configured for stand alone operation.
  117.  
  118. You may specify networking one of three major ways, static, DHCP,
  119. or BOOTP.  Static means that you are going to tell the machine all
  120. the networking information it needs and it will keep that.  DHCP
  121. and BOOTP specify that you are going to have the machine use each
  122. of those protocols, respectively, at each boot to get it's networking
  123. information.  
  124.  
  125. To setup a machine to use DHCP to get it's networking, you would 
  126. put the following in the kickstart configuration file:
  127.  
  128. network --bootproto dhcp
  129.  
  130. To setup a machine to use BOOTP to get it's networking, you would 
  131. put the following in the kickstart configuration file:
  132.  
  133. network --bootproto bootp
  134.  
  135. For static networking, you have to give the machine several items.
  136. Those are the IP address, netmask, gateway IP, and nameserver IP.
  137. An example of how to do this would be:
  138.  
  139. network --bootproto static --ip 10.0.2.15 --netmask 255.255.255.0 --gateway 10.0.2.254 --nameserver 10.0.2.1
  140.  
  141. Note that there are some restrictions on this.  You must do this all
  142. on *one* line; you cannot wrap lines using a backslash, for example.
  143. Also, you can only specify one nameserver here.  You could use the
  144. %post section (described later) to add more nameservers if you need
  145. to.
  146.  
  147. Installation Method
  148.  
  149. The next item you need to setup is the installation method.  This is
  150. a required field.  You have two choices, NFS or CD-ROM.  For NFS
  151. you must also pass the server name and directory to mount as arguments.
  152. To do an NFS install, you would do something like:
  153.  
  154. nfs --server hostname.of.server --dir /path/to/RH/CD/image
  155.  
  156. If you are doing this via CD-ROM, you would simply give it the line
  157. "cdrom" like so:
  158.  
  159. cdrom
  160.  
  161.  
  162. Optional Hardware
  163.  
  164. The next item in the kickstart configuration is optional hardware
  165. information.  For most PCI hardware you can omit this step as it
  166. will be autoprobed (IDE hard disks and common PCI cards all fit
  167. this criteria).  For other items, you may need to specify it here.
  168.  
  169. To specify a device, start with the "device" keyword, followed by the
  170. type of device:
  171.  
  172. ethernet -- for ethernet cards.
  173.  
  174. scsi -- for scsi cards.
  175.  
  176. cdrom -- for non-scsi, non-ide cdrom cards (eg., sound cards with
  177. proprietary CDROM interfaces).
  178.  
  179. Optional parameters that are required by a device can also be specified
  180. by using the --opts option.  Enclose the paratmeters in quotes after
  181. --opts.
  182.  
  183. Note that you can specify multiple types of devices.  For example, if you
  184. know the machines you'll be kickstart-installing have either an Adaptec
  185. 1542 or a Buslogic card, you can enter both in the kickstart file.  But
  186. be aware that the install uses only the first card found, so order the
  187. device entries appropriately...
  188.  
  189. An example for an ISA 3com ethernet card would be:
  190.  
  191. device ethernet 3c509 --opts "io=0x330, irq=7"
  192.  
  193. An example of a Adaptec 1542 would be:
  194.  
  195. device scsi aha154x
  196.  
  197. An example of a SoundBlaster CD-ROM would be:
  198.  
  199. device cdrom --opts "io=0x240"
  200.  
  201.  
  202. Keyboard
  203.  
  204. The next item you need to specify is the correct code for your
  205. keyboard type.  For US keyboards, the type is "us".  For the others,
  206. please see the output of the kbdconfig program (or just set it to
  207. "us" and run kbdconfig on the installed system and set it properly 
  208. after the install).
  209.  
  210. An example of this would be:
  211.  
  212. keyboard us
  213.  
  214.  
  215. Partitioning
  216.  
  217. The hard disk in the machine must be partitioned before an install
  218. can take place.  In this phase we will describe how to specify how
  219. to partition a disk using kickstart.
  220.  
  221. First, if you are installing to new machines, you will want to use
  222. the "zerombr" command to clear the current partition information
  223. because it is usually bogus.  So, you would add:
  224.  
  225. zerombr yes
  226.  
  227. in that case.  If you are installing to machines that have partition
  228. information that you want to leave -or- that you want to change (even
  229. if you want to completely change it) you would do:
  230.  
  231. zerombr no
  232.  
  233. The next command is completely optional but handy.  If you want to
  234. remove all partitions or simply remove all Linux related partitions,
  235. you can use "clearpart".  For example, to clear all "Linux native"
  236. and "Linux swap" partitions, you could do:
  237.  
  238. clearpart --linux
  239.  
  240. To clear *all* partitions from a disk, you would do:
  241.  
  242. clearpart --all
  243.  
  244. The only options clearpart supports currently are --linux and --all.
  245.  
  246. The next step is to specify the partitions you want to create.  These
  247. will only be created using the free space (ie if the machine had FAT
  248. or FAT32 partitions and you had done "clearpart --linux" your FAT
  249. partitions would remain untouched).  You need to enter one partition
  250. per line using the following format:
  251.  
  252. part <mntpt> --size <size in megs> [--grow] [--maxsize <size in megs>]
  253.  
  254. <mntpt> is the location you are going to mount that partition in your
  255. installed system (for example, you must at least have a "/" partition).
  256. <size in megs> is the size of the partition in megabytes.  You can
  257. optionally specify that the partition be "growable" using --grow. 
  258. Making a partition "growable" does *not* mean that you can later 
  259. increase it's size (that isn't supported by the ext2 filesystem at
  260. this time).  What it means is that when you specify partitions you
  261. are doing so using the "free space".  Since that can vary and you 
  262. probably want to use it all, you can tag partitions as "growable"
  263. and the install code will automatically increase the size of the
  264. partitions tagged as growable to use that space.  If you have 
  265. multiple partitions tagged as "growable" then the extra space is
  266. split evenly among them.  You can limit the size of some partitions
  267. with the optional --maxsize argument, too.
  268.  
  269. For example, let's say you know your smallest disk is 1G out of a 
  270. set of machines you plan to install using the same kickstart config
  271. file.  You could use a partitioning scheme like the following:
  272.  
  273. zerombr no
  274. clearpart --all
  275. part / --size 250
  276. part swap --size 50
  277. part /usr --size 500 --grow --maxsize 800
  278. part /tmp --size 100 --grow
  279.  
  280. This will clear all partitions.  It then sets up a 250M root filesystem.
  281. The next item creates a 50M swap partition.  The next item will setup a
  282. 500M *minimum* /usr that could grow to a maximum of 800M.  The next
  283. item will setup a 100M *minumum* /tmp.  So, for 1G of total disk space,
  284. you would end up with a 250 root, 550M /usr, and 150M /tmp.  If your
  285. machine had 2G of total space, you would get a 250M root, 800M /usr,
  286. and 900M /tmp.
  287.  
  288.  
  289. Install/Upgrade Selection
  290.  
  291. The next item to specify is whether you are doing an install or an
  292. upgrade of an existing install.  For a fresh install, use:
  293.  
  294. install
  295.  
  296. For an upgrade of an existing system, use:
  297.  
  298. upgrade
  299.  
  300. Note again that for upgrades, the only items that matter are installation
  301. media (CD-ROM or NFS), device specification (if necessary), keyboard
  302. setup, install/updgrade specification (of course!), and LILO configuration.
  303.  
  304.  
  305. Mouse
  306.  
  307. You need to set the "mouse" variable to the type of mouse you have.
  308. To find out a list of usable options, run 'mouseconfig --help'.
  309.  
  310. The default device is correctly set for bus mice.  /dev/cua0 is the
  311. default for serial mice, but that can be overridden with the "--device"
  312. option.  Follow simply with the device name, like "cua1".  If three
  313. button emulation is required, specify "--emulthree".
  314.  
  315. For example, for a three button PS/2 mouse, you would use:
  316.  
  317. mouse --kickstart generic3ps/2
  318.  
  319. For a two button PS/2 mouse, use:
  320.  
  321. mouse --kickstart genericps/2
  322.  
  323. For a two button Microsoft mouse on your second serial port, use:
  324.  
  325. mouse --kickstart microsoft --device cua1
  326.  
  327.  
  328. Timezone
  329.  
  330. You need to specify the timezone that your machine will live in.  You
  331. do this with the "timezone" command.  You can run /usr/sbin/timeconfig
  332. on a RH machine to see what all the valid options are.  If you use
  333. GMT/UTC on your system clock, add the --utc option.  An example of
  334. the US Eastern with GMT for the system clock would be:
  335.  
  336. timezone --utc US/Eastern
  337.  
  338.  
  339. X Window Setup
  340.  
  341. The next item is the X Window setup area.  The installation program
  342. will normally find common PCI video hardware and will know which 
  343. X server to install.  The command for X configuration is "xconfig".
  344. If your card isn't probed properly, you can use --card to specify
  345. the card.  You can use "Xconfigurator --help" on a running Red Hat
  346. system to get a list of supported cards to choose from.  You must
  347. use one of those settings.
  348.  
  349. If your card isn't in the list but *is* supported by one of the
  350. existing servers, you can simply install the proper server by using
  351. the "--server" option to "xconfig".  Again, use "Xconfigurator --help"
  352. to find a list of server names.
  353.  
  354. You also need to specify a monitor type.  If you don't, the installation
  355. will assume 640x480@60hz.  Use the --monitor option to specify something
  356. else.  Again, "Xconfigurator --help" will list all valid monitor types.
  357.  
  358. If your monitor isn't listed, you can also list the actual monitor
  359. data using the --hsync and --vsync options for horizontal and vertical
  360. sync rates, respectively.  The rates may be single numbers (representing
  361. kilohertz and megahertz, as appropriate), groups of numbers separated by
  362. commas, or two numbers separated by a dash (signifying a range).  For
  363. example: --hsync "31.5,35.5,50-65" --vsync "50-70"
  364.  
  365. An example for a machine where the video card is probed properly would
  366. be:
  367.  
  368. xconfig --monitor "tatung cm14uhe"
  369.  
  370. An example for a machine where nothing is probed and the monitor isn't
  371. in the list might be:
  372.  
  373. xconfig --server "Mach64" --hsync "31.5,35.5,50-65" --vsync "50-70"
  374.  
  375.  
  376. Root Password
  377.  
  378. You can put the root passwd in the kickstart file in the clear (in which
  379. case it would go over the network in the clear on an NFS install) or
  380. you can specify an encrypted password to be used.  To specify an actual
  381. password in the kickstart file, you would do something like:
  382.  
  383. rootpw mypasswd
  384.  
  385. If you wanted to use an encrypted password, grab it out of /etc/passwd
  386. (or somewhere else, if necessary) and use:
  387.  
  388. rootpw --iscrypted encryptedpasswdstring
  389.  
  390.  
  391. LILO Configuration
  392.  
  393. For machines that use LILO (Intels), you can specify the LILO configuration
  394. using the "lilo" keyword.  By default you can just use:
  395.  
  396. lilo
  397.  
  398. and have LILO installed on the MBR and automatically configured to boot
  399. your Linux install as well as a DOS or Windows install if you have one.
  400.  
  401. If you want to change the default location, you can do so with the
  402. --location switch.  It will take three options:
  403.  
  404. mbr - put LILO on the master boot record (default)
  405. partition - put LILO on the beginning of the root partition
  406. none - don't install LILO at all (you need your own method of booting)
  407.  
  408. You can also use the --append switch to add an "append=" line to 
  409. the Linux section if you need to do things like set memory sizes,
  410. etc.  For example, to set LILO up on the MBR on a machine with
  411. memory size 128M, you could do:
  412.  
  413. lilo --append "mem=128M" --location mbr
  414.  
  415. Also note that the mem option *shouldn't* be necessary as of Red Hat
  416. 5.2.
  417.  
  418.  
  419. Package Selection
  420.  
  421. You can use the "%packages" keyword to start the beginning of the
  422. section that lists the packages you want to install (this is for
  423. *install* only because the upgrade only upgrades the packages that
  424. exist).
  425.  
  426. Packages can be specified by entire components or by individual
  427. package names.  See the RedHat/base/comps file on any Red Hat
  428. CD image for a list of those.  The components are the lines
  429. with a number and space in front of them and each of their packages
  430. follows.  The individual packages have nothing in front of them.
  431. Most folks will only need to list the components that they wish
  432. to have installed.  Also, the "base" component is always selected
  433. by default, so you don't need to specify it.
  434.  
  435. An example would be:
  436.  
  437. %packages
  438. @ Networked Workstation
  439. @ C Development
  440. @ Web Server
  441. @ X Window System
  442. bsd-games
  443.  
  444. New for 5.2 and later releases is the option to specify "Server" 
  445. or "Workstation".  This installs the same package set as the 
  446. normal mode install for those two options. ### ED: Reference your
  447. package description tags here.  
  448.  
  449. An example would be:
  450.  
  451. %packages
  452. @ Workstation
  453.  
  454. As you can see, specify components with an "@" symbol followed by
  455. a space and then the full name as given in the "comps" file.  Specify
  456. individual packages with no additional characters (just like "bsd-games"
  457. above).
  458.  
  459.  
  460. Post Installation Configuration
  461.  
  462. You have the option of adding commands to be run on the installed
  463. system after the install is complete.  This section must be last
  464. in the kickstart file and starts with "%post".  
  465.  
  466. You can access the network in a %post if it was previously configured,
  467. but you don't have access to nameservice.  So use IP addresses only.
  468.  
  469. An example of a post install script would be:
  470.  
  471. %post
  472.  
  473. # add comment to /etc/motd
  474. echo "Kickstart-installed Red Hat Linux `/bin/date`" > /etc/motd
  475.  
  476. # add another nameserver
  477. echo "nameserver 10.10.0.2" >> /etc/resolv.conf
  478.  
  479.