|
|

楼主 |
发表于 2006-6-1 09:27:08
|
显示全部楼层
原先的环境包括initrd.gz 都是德国的程序员帮我们做的,应该不是随便拷的,我是新手,非常感谢您不厌其烦地解答
我把initrd.gz解压加载了,现在把linuxrc发上来麻烦您帮我看看
- #!/bin/sh
- echo "==============================================================================="
- echo "Running /linuxrc"
- echo "Mounting /proc"
- mount -t proc /proc /proc
- # exec /bin/sh
- #
- # dhcpcd runs as a daemon. Once it acquires the info from the
- # server, it will automatically configure the interface. A script called
- # /etc/dhcpc/dhcpcd.exe is used to perform additional configuration.
- #
- DPORT=67
- echo "Running dhcpcd on port ${DPORT}"
- /bin/dhcpcd -p ${DPORT} eth0 >/tmp/dhcpcd.out 2>&1
- if [ $? -ne 0 ]; then
- echo
- cat /tmp/dhcpcd.out
- echo
- echo "ERROR! dhcpcd failed!"
- echo
- exit 1
- fi
- #
- # The dhcpcd program deposited a bunch of important
- # information in the /etc/dhcpc/dhcpcd-eth0.info file.
- # Sourcing the file will set a bunch of environment variables.
- #
- #
- # On a slow machine, the dhclient program might fork and return
- # control to the /linuxrc script, before the info file gets written.
- #
- COUNT=5
- while [ $COUNT -gt 0 -a ! -f /etc/dhcpc/dhcpcd-eth0.info ]; do
- sleep 1
- COUNT=`expr $COUNT - 1`
- done
- if [ ! -f /etc/dhcpc/dhcpcd-eth0.info ]; then
- echo
- echo "ERROR! No dhcpcd-eth0.info file."
- echo " This usually indicates that dhcpcd did not get"
- echo " a response from the DHCP server, or the NIC driver"
- echo " isn't working properly with the network card"
- echo
- exit 1
- fi
- . /etc/dhcpc/dhcpcd-eth0.info
- #
- # Check for a root-path from the dhcp server
- #
- if [ -z "${ROOTPATH}" ]; then
- echo
- echo "ERROR! No root-path. Check your DHCP configuration, to make"
- echo " sure that the 'option root-path' is specified"
- echo
- exit 1
- fi
- NFS_IP=` echo ${ROOTPATH} | cut -d : -f 1`
- NFS_DIR=`echo ${ROOTPATH} | cut -d : -f 2`
- if [ "${NFS_IP}" = "${NFS_DIR}" ]; then
- #
- # Only the root directory is specified, then we have to use the
- # default IP address. For now, we'll use the DHCP server address
- #
- NFS_IP=${DHCPSERVER}
- fi
- echo "Mounting root filesystem: ${NFS_DIR} from: ${NFS_IP}"
- mount -n -o nolock,ro ${NFS_IP}:${NFS_DIR} /mnt
- if [ $? -ne 0 ]; then
- echo
- echo "ERROR! Failed to mount the root directory via NFS!"
- echo " Possible reasons include:"
- echo
- echo " 1) NFS services may not be running on the server"
- echo " 2) Workstation IP does not map to a hostname, either"
- echo " in /etc/hosts, or in DNS"
- echo " 3) Wrong address for NFS server in the DHCP config file"
- echo " 4) Wrong pathname for root directory in the DHCP config file"
- echo
- exit 1
- fi
- umount /proc
- echo "Doing the pivot_root"
- cd /mnt
- /sbin/pivot_root . oldroot
- cd /
- echo "Running /sbin/init"
- exec /sbin/init
复制代码 |
|