你可以添加系统在解析 kickstart 文件后,安装开始前要运行的命令。如果你在 kickstart 文件中配置了网络,联网在这部分被处理前会被启用。如果你想包括一个预安装脚本,在文本区域内输入它。
要指定执行脚本的脚本语言,选中「使用解释器」选项并在文本框里输入解释器。例如,对于 Python 脚本可以指定 /usr/bin/python2.4
。这个选项相当于在 kickstart 文件里使用 %pre --interpreter /usr/bin/python2.4
。
在预安装环境里可用的很多命令都由 busybox 的一个叫 busybox-anaconda 的版本提供。Busybox 提供的命令只提供最常有的功能,而不是全部。下面的列表包括了 busybox 提供的命令:
addgroup
, adduser
, adjtimex
, ar
, arping
, ash
, awk
, basename
, bbconfig
, bunzip2
, busybox
, bzcat
, cal
, cat
, catv
, chattr
, chgrp
, chmod
, chown
, chroot
, chvt
, cksum
, clear
, cmp
, comm
, cp
, cpio
, crond
, crontab
, cut
, date
, dc
, dd
, deallocvt
, delgroup
, deluser
, devfsd
, df
, diff
, dirname
, dmesg
, dnsd
, dos2unix
, dpkg
, dpkg-deb
, du
, dumpkmap
, dumpleases
, e2fsck
, e2label
, echo
, ed
, egrep
, eject
, env
, ether-wake
, expr
, fakeidentd
, false
, fbset
, fdflush
, fdformat
, fdisk
, fgrep
, find
, findfs
, fold
, free
, freeramdisk
, fsck
, fsck.ext2
, fsck.ext3
, fsck.ext4
, fsck.minix
, ftpget
, ftpput
, fuser
, getopt
, getty
, grep
, gunzip
, gzip
, hdparm
, head
, hexdump
, hostid
, hostname
, httpd
, hush
, hwclock
, id
, ifconfig
, ifdown
, ifup
, inetd
, insmod
, install
, ip
, ipaddr
, ipcalc
, ipcrm
, ipcs
, iplink
, iproute
, iptunnel
, kill
, killall
, lash
, last
, length
, less
, linux32
, linux64
, ln
, load_policy
, loadfont
, loadkmap
, login
, logname
, losetup
, ls
, lsattr
, lsmod
, lzmacat
, makedevs
, md5sum
, mdev
, mesg
, mkdir
, mke2fs
, mkfifo
, mkfs.ext2
, mkfs.ext3
, mkfs.ext4
, mkfs.minix
, mknod
, mkswap
, mktemp
, modprobe
, more
, mount
, mountpoint
, msh
, mt
, mv
, nameif
, nc
, netstat
, nice
, nohup
, nslookup
, od
, openvt
, passwd
, patch
, pidof
, ping
, ping6
, pipe_progress
, pivot_root
, printenv
, printf
, ps
, pwd
, rdate
, readlink
, readprofile
, realpath
, renice
, reset
, rm
, rmdir
, rmmod
, route
, rpm
, rpm2cpio
, run-parts
, runlevel
, rx
, sed
, seq
, setarch
, setconsole
, setkeycodes
, setlogcons
, setsid
, sh
, sha1sum
, sleep
, sort
, start-stop-daemon
, stat
, strings
, stty
, su
, sulogin
, sum
, swapoff
, swapon
, switch_root
, sync
, sysctl
, tail
, tar
, tee
, telnet
, telnetd
, test
, tftp
, time
, top
, touch
, tr
, traceroute
, true
, tty
, tune2fs
, udhcpc
, udhcpd
, umount
, uname
, uncompress
, uniq
, unix2dos
, unlzma
, unzip
, uptime
, usleep
, uudecode
, uuencode
, vconfig
, vi
, vlock
, watch
, watchdog
, wc
, wget
, which
, who
, whoami
, xargs
, yes
, zcat
, zcip
For a description of any of these commands, run:
busybox command
--help
In addition to the aforementioned commands, the following commands are provided in their full featured versions:
anaconda
, bash
, bzip2
, jmacs
, ftp
, head
, joe
, kudzu-probe
, list-harddrives
, loadkeys
, mtools
, mbchk
, mtools
, mini-wm
, mtools
, jpico
, pump
, python
, python2.4
, raidstart
, raidstop
, rcp
, rlogin
, rsync
, setxkbmap
, sftp
, shred
, ssh
, syslinux
, syslogd
, tac
, termidx
, vncconfig
, vncpasswd
, xkbcomp
, Xorg
, Xvnc
, zcat
Warning
不要输入“%pre
”,系统会为你自动添加。
注意
预安装脚本是在挂载安装介质以及装载第二阶段引导装载程序后运行的。因此,不可能在预安装脚本里改变安装介质。