Show Table of Contents
33.10. 前置安裝程式碼

圖形 33.13. 前置安裝程式碼
在解析 kickstart 檔案之後與開始安裝之前,您可以增加要在系統上立即執行的指令。如果您在 kickstart 檔案中有設定網路資訊,在處理這個部份之前便已經啟動網路了。如要加入一個前置安裝的程式碼,請在文字區域中將其輸入。
重要
先前 Red Hat Enterprise Linux 發行版中的 anaconda 包含了一個版本的 busybox,它在安裝前與安裝後的環境中提供了 shell 指令。Red Hat Enterprise Linux 6 中的 anaconda 已不再包含 busybox,而是使用了 GNU bash 指令來代替。
請參閱 附錄 G, busybox 之外的其它指令 以取得更多相關資訊。
欲指定一個用來執行 script 的語言,請選取「使用直譯器」選項,並在旁邊的文字方塊中輸入直譯器。例如
/usr/bin/python2.6 可用來指定一個 Python script。此選項與在您的 kickstart 檔案中使用 %pre --interpreter /usr/bin/python2.6 相同。
只有最經常使用的指令可使用於預安裝環境中:
arping, awk, basename, bash, bunzip2, bzcat, cat, chattr, chgrp, chmod, chown, chroot, chvt, clear, cp, cpio, cut, date, dd, df, dirname, dmesg, du, e2fsck, e2label, echo, egrep, eject, env, expr, false, fdisk, fgrep, find, fsck, fsck.ext2, fsck.ext3, ftp, grep, gunzip, gzip, hdparm, head, hostname, hwclock, ifconfig, insmod, ip, ipcalc, kill, killall, less, ln, load_policy, login, losetup, ls, lsattr, lsmod, lvm, md5sum, mkdir, mke2fs, mkfs.ext2, mkfs.ext3, mknod, mkswap, mktemp, modprobe, more, mount, mt, mv, nslookup, openvt, pidof, ping, ps, pwd, readlink, rm, rmdir, rmmod, route, rpm, sed, sh, sha1sum, sleep, sort, swapoff, swapon, sync, tail, tar, tee, telnet, top, touch, true, tune2fs, umount, uniq, vconfig, vi, wc, wget, xargs, zcat.
重要
請不要包括
%pre 指令。已經替您新增了這個指令。
注意
在來源資料媒體掛載與第二階段開機載入程式載入後,安裝前 script 才會執行。因此,無法在安裝前 script 下更改來源資料媒體。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.