⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quickinst

📁 linux 的引导程序源码The Microsoft&reg Windows&reg Software Development Kit (SDK) provides the documentation
💻
📖 第 1 页 / 共 2 页
字号:
EOF    fidoneon_second=curr_first=$firstcurr_second=$secondif echo "$boot" | grep "$second" >/dev/null; then    cat <<EOFYou have decided to put the LILO boot sector on your SECOND disk ($second).This may indicate an unusual configuration. Please indicate your futureplans by selecting one of the following choices:  keep    if you do not intend to change the disk configuration, i.e.          your current first disk stays first and your current second          disk stays second.  swap    if you intend to swap $first and $second after          installing LILO, either by physically swapping the two	  disks, or by configuring your BIOS to make them appear	  as if they had changed places. (The latter choice needs          BIOS support.)  remove  if you intend to remove your current first disk ($first)          after installing LILO and to use your current second disk          as the first disk.EOF    while true; do	get "Your choice" line keep	if echo "$line" | egrep -i '^k(|e(|ep?))$' >/dev/null; then	    break        fi        if echo "$line" | egrep -i '^r(|e(|m(|o(|ve?))))$' >/dev/null; then            on_second=remove	    first=$second	    second=	    break        fi	if echo "$line" | egrep -i '^s(|w(|ap?))$' >/dev/null; then            on_second=swap	    tmp=$first	    first=$second	    second=$tmp	    break        fi        echo "KEEP, REMOVE, or SWAP, please."    donefiif [ ! -z "$on_second" ]; then    cat <<EOFPlease note that the configuration generated in this session is onlyvalid for the current hardware configuration. If you are removing or(physically) swapping disks, you will have to update the configurationin order to reflect the changed system configuration.You can do this either by running QuickInst again or directly byediting the configuration file $CFG_FILEEOFfiif [ "$boot" = "$first" ]; then    cat <<EOFYou are about to install LILO on your MBR. If there are other operatingsystems on your hard disk, LILO will act as a boot manager for them. Youhave to specify each operating system in your LILO configuration. (Moreabout this later.)EOFfiif echo "$boot" | grep '^$first[1-4]$' >/dev/null; then    if [ "`dd if=$first bs=1 count=4 skip=2 2>/dev/null | \      tr -c 'LIO' '?'`" = "LILO" -o \      "`dd if=$first bs=1 count=4 skip=6 2>/dev/null | \      tr -c 'LIO' '?'`" = "LILO" ]; then	cat <<EOFThere appears to be a LILO boot sector on $first. Because you'reinstalling LILO's boot sector on a regular partition now, it is verylikely that the old boot sector will no longer start correctly. Unlessyou're very sure of what you're doing, you should therefore replace it bya "standard" MBR before attempting to boot from the hard disk. (E.g. useMS-DOS 5.0's FDISK /MBR.)EOF    fifidisk=`echo $boot | sed 's/[1-4]$//'`oldboot=`./activate $disk 2>/dev/null`newboot=""if [ $boot != "$oldboot" -a ! -z "`echo "$boot" | sed 's|'$dev'/[sh]d.||'`" ];  then    echo    if [ -z "$oldboot" ]; then	echo "There's no active partition on $disk"	msg="Activate $boot ?"    else	echo "Currently active partition of $disk is $oldboot"	msg="Change it to $boot ?"    fi    if yesno "$msg"; then	newboot=`echo $boot | sed 's,'$dev'/[sh]da,,'`	cat <<EOFPartition $newboot of $disk will be made active as soon as the LILOinstallation is complete.EOF    else	cat <<EOFPlease don't forget to configure the boot manager you are using to boot LILOfrom $boot.EOF    fifikernel=""for n in /vmlinuz /boot/vmlinuz /linux /boot/linux /zImage /boot/zImage; do    if [ -f $ROOT/$n ]; then	kernel=$n	break    fidonecat <<EOFPlease specify the name of the kernel image file you want to boot by default.EOFwhile true; do    get "Default kernel" inp $kernel    if [ -f "$ROOT$inp" ]; then	if echo "$inp" | grep '^/' >/dev/null; then	    kernel=$inp	    break	else	    echo "Use only absolute path names, e.g. /linux"	fi    else	echo "No such file."    fidonecat <<EOF >$CFG_FILE.tmp# LILO configuration created by QuickInst 21  `date | tr -s x ' '`boot = $bootcompactdelay = 5	# optional, for systems that boot very quicklyvga = normal	# force sane stateEOFif [ "$on_second" = swap ]; thencat <<EOF >>$CFG_FILE.tmpdisk = $curr_first	# disks will be swapped  bios = 0x81disk = $curr_second  bios = 0x80EOFfiif [ "$on_second" = remove ]; thencat <<EOF >>$CFG_FILE.tmpdisk = $curr_first	# disk will be removed  inaccessibledisk = $curr_second  bios = 0x80EOFficat <<EOF >>$CFG_FILE.tmproot = current	# use "current" root`krnltype $kernel` = $kernelEOFif [ "`echo $kernel | sed 's,/\([^/]*\)$,\1,'`" != "linux" ]; then    echo "  label = linux" >>$CFG_FILE.tmpfiechoif yesno "Define additional kernels ?" no; then    default=""    for n in $kernel.old /vmlinux.old /boot/vmlinuz.old /linux.old \      /boot/linux.old /zImage.old /boot/zImage.old; do	if [ -f $ROOT/$n ]; then	    default=$n	    break	fi    done    cat <<EOFSpecify the names of additional kernels now. Use "done" (without the quotes)to stop adding kernels.EOF    while true; do	get "Kernel" inp $default	if [ done = "$inp" ]; then	    break	fi	if echo "$inp" | grep '^/' >/dev/null; then	    echo "`krnltype $inp` = $inp" >>$CFG_FILE.tmp	    if [ ! -f $ROOT$inp ]; then		echo "File doesn't exist now. - Making entry optional."		echo "  optional" >>$CFG_FILE.tmp	    fi	else	    echo "Use only absolute path names, e.g. /linux"	fi	default="done"    donefiif [ "$boot" = "$first" ]; then    cat <<EOFIf you want to boot other operating systems than Linux from your hard disk,you should configure them now. LILO will take over the entire boot process,so any currently installed partition switchers or boot managers will stopto work. (If this scares you, just hit ^C and read the manual.)EOFfiechoif yesno "Define additional operating systems (e.g. MS-DOS) ?" no; then    cat <<EOFSpecify the names of devices that contain boot sectors of additional operatingsystems now. You might want to run  fdisk  or  efdisk  to list the partitiontable(s) of your hard disk(s) in order to obtain the device names. Use "done"(without the quotes) to stop adding operating systems.EOF    default=""    default_lbl=dos    while true; do	get "Device name" inp $default	if [ done = "$inp" ]; then	    break	fi	if echo "$inp" | grep '^'$dev'/[hs]d[ab][1-4]$' >/dev/null; then	    if probe "$inp"; then		if bootflag $inp; then		    loader=""		    if echo "$inp" | egrep "^${second}[1-4]\$" >/dev/null; then			echo "It's on your second disk. Is this ..."			if yesno "... OS/2 ?"; then			    loader="os2_d.b"			else			    if yesno "... OS using the BIOS (e.g. DOS) ?"; then				loader="any_d.b"			    fi			fi		    fi		    (			echo "other = $inp"			echo -n "  table = "			echo $inp | sed 's/[1-4]$//'			if [ ! -z "$loader" ]; then			    echo "  loader = $BOOT_DIR/$loader"			fi		    ) >>$CFG_FILE.tmp		    get "Label" inp $default_lbl		    default_lbl=""		    default="done"		    echo "  label = $inp" >>$CFG_FILE.tmp		else		    echo "$inp does not have a valid boot signature."		fi	    else		cat <<EOFNo such device exists. Type  !ls $dev/[hs]d[ab][1-4]  for a list ofpossible names.EOF	    fi	else	    echo "Expecting names like $dev/hda1, $dev/sda3, etc."	fi    done    if [ -z "$default_lbl" ]; then	cat <<EOFIn order to choose the desired kernel or operating system, hold down a shiftkey at boot time, when LILO displays "LILO", until the prompt "boot:" appears.Then enter the label name. You can get a list of available names by pressing[Tab] (at the boot prompt).EOF    fifiif [ -f $CFG_FILE ]; then    cat <<EOFAn old version of the configuration file $CFG_FILE already exists.QuickInst will proceed as follows: - rename $CFG_FILE to $CFG_FILE.old - copy the new configuration file to $CFG_FILEType  !cat $CFG_FILE.tmp  if you want to check the new configuration file.EOF    if yesno "Proceed ?" yes; then	mv $CFG_FILE $CFG_FILE.old    else	cat <<EOFLeaving the new configuration file in $CFG_FILE.tmpEOF	exit    fifimv $CFG_FILE.tmp $CFG_FILEif [ ! -z "$noinst" ]; then    cat <<EOFLILO is now configured. However, automated installation is not possible now,because you still have an incompatible $CFG_DIR/disktab file. Pleaseremove that file or specify an alternate name for the disk parameter tablein $CFG_DIR/lilo.conf before trying to run $SBIN_DIR/liloEOF    exitficat <<EOFReady to install LILO's boot sector on your hard disk.Type  !cat $CFG_FILE  if you want to check the configuration file.EOFif yesno "Test LILO installation now ?" yes; then    echo    outfile=${TMPDIR:-/tmp}/out$$    errflag=${TMPDIR:-/tmp}/err$$    if [ -f $errflag ]; then	rm $errflag    fi    (	if	    $SBIN_DIR/lilo -t 2>&1	then : ; else	    touch $errflag	fi    ) | tee $outfile    if [ -f $errflag ]; then	rm $errflag	if egrep 'geo_query_dev HDIO_|: Got bad geometry' <$outfile >/dev/null	  then	    cat <<EOFLILO is unable to obtain geometry information for your SCSI disk. Pleasecreate a DISK section in the configuration file in which the necessaryparameters are described. See also section "Disk geometry" in theaccompanying documentation.EOF	    exit	fi	cat <<EOFSomething went wrong. Verify your input and try to minimize the complexity ofthe settings, e.g. by omitting additional kernels and operating systems.EOF	exit    fi    if grep '^Warning: ' <$outfile >/dev/null; then	cat <<EOFThe following warning messages may indicate some potential problems with yourconfiguration. The boot sector has not been changed yet.EOF	grep '^Warning: ' <$outfile	echo    fi    rm $outfile    echo    if yesno "Install LILO now ?" yes; then	cat <<EOFYou see now the output of the map installer with verbose progress reportingenabled. It will list all items that are installed for booting. Additionally,if there are have been warnings, they will be repeated again.EOF        if $SBIN_DIR/lilo -v; then : ; else	    cat <<EOFSomething went wrong, sorry. Verify your input and try to minimize thecomplexity of the settings, e.g. by omitting additional kernels and operatingsystems.EOF	    exit	fi    fi    if [ ! -z "$newboot" ]; then	./activate $disk $newboot    fifiechoecho "Done."echo

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -