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

📄 uml-functions.sh

📁 This a good VPN source
💻 SH
📖 第 1 页 / 共 2 页
字号:
    hostroot=$POOLSPACE/$host/root    mkdir -p $hostroot    # copy (with hard links)     (cd ${BASICROOT} && find . -print | cpio -pld $hostroot 2>/dev/null )    # make private copy of /var.    rm -rf $hostroot/var    (cd ${BASICROOT} && find var -print | cpio -pd $hostroot 2>/dev/null )    # make sure that we have /dev, /tmp and /var/run    mkdir -p $hostroot/dev $hostroot/tmp $hostroot/var/run $hostroot/usr/share $hostroot/proc    # root image is debian, but FreeSWAN expects redhat    mkdir -p $hostroot/etc/rc.d    if [ ! -d $hostroot/etc/rc.d/init.d ]    then      (cd $hostroot/etc/rc.d && ln -fs ../init.d ../rc?.d . )    fi        # nuke certain other files that get in the way of booting    rm -f $hostroot/etc/mtab    rm -f $hostroot/sbin/hwclock    # set up the timezone    rm -f $hostroot/etc/localtime     # dummy out fsck.    ln -f $hostroot/bin/true $hostroot/sbin/fsck.hostfs    # force it to GMT, otherwise (RH7.1) use host's zoneinfo.    if [ -f /usr/share/zoneinfo/GMT ]     then      cp /usr/share/zoneinfo/GMT $hostroot/etc/localtime    else      cp /etc/localtime $hostroot/etc/localtime    fi    # or, you might want to force it to local    # cp /etc/localtime $hostroot/etc/localtime    # copy configuration files    ### XXX this should be done with a generated Makefile.    (cd ${TESTINGROOT}/baseconfigs/$host && tar cf - .) | (cd $hostroot && tar -x -f - --unlink-first)    # setup the mount of /usr/share    echo "none	   /usr/share		     hostfs   defaults,ro,$SHAREROOT 0 0" >>$hostroot/etc/fstab    # split Debian "interfaces" file into RH ifcfg-* file    mkdir -p $hostroot/etc/sysconfig/network-scripts    ${TESTINGROOT}/utils/interfaces2ifcfg.pl $hostroot/etc/network/interfaces $hostroot/etc/sysconfig/network-scripts    # hard link the kernel to save space.    if [ ! -f $POOLSPACE/$host/linux ]    then	rm -f $POOLSPACE/$host/linux	ln $KERNEL $POOLSPACE/$host/linux    fi    # make startup script    startscript=$POOLSPACE/$host/start.sh    if [ ! -f $startscript ]    then	echo '#!/bin/sh' >$startscript	echo ''          >>$startscript	echo '# get $net value from baseconfig'          >>$startscript	echo ". ${TESTINGROOT}/baseconfigs/net.$host.sh" >>$startscript	echo ''          >>$startscript	echo "$POOLSPACE/$host/linux ubd0=$hostroot umid=$host \$net \$UML_DEBUG_OPT \$UML_$host_OPT \$*" >>$startscript	chmod +x $startscript    fi}## $Log: uml-functions.sh,v $# Revision 1.35  2004/10/17 17:38:35  mcr# 	add /usr/local and /var/tmp mounts to /etc/fstab so that# 	they can be umount'ed/mount'ed to flush changes.## Revision 1.34  2004/09/13 02:27:42  mcr# 	install klips26 module as ipsec.o, not ipsec.ko.## Revision 1.33  2004/09/06 18:39:45  mcr# 	copy/rename the .ko file to ipsec.o.## Revision 1.32  2004/09/06 04:49:42  mcr# 	make sure to copy the right module into the UML root.## Revision 1.31  2004/08/18 02:11:08  mcr# 	kernel 2.6 changes.## Revision 1.30  2004/04/03 19:44:52  ken# FREESWANSRCDIR -> OPENSWANSRCDIR (patch by folken)## Revision 1.29  2003/10/31 02:43:34  mcr# 	pull up of port-selector tests## Revision 1.28.2.1  2003/10/29 02:11:00  mcr# 	make sure that local module makefile gets version info included.## Revision 1.28  2003/09/02 19:45:48  mcr# 	use rootfs= directive instead of ubd0= directive for# 	setting hostfs root file system.## Revision 1.27  2003/07/30 16:46:57  mcr# 	created /var/log/pluto/peer directory in UMLs.## Revision 1.26  2003/06/22 21:53:53  mcr# 	generated makefile list had $hostroot missing, put it in with# 	a more obvious way.## Revision 1.25  2003/06/22 21:41:05  mcr# 	while the file targets themselves were sanitized, the list of# 	targets was not sanitized by the same process, and so got out# 	of sync - it left in CVS backups. Now use the same process.# 	Problem discovered by DHR in week of 2003/06/17.## Revision 1.24  2002/11/11 17:07:18  mcr# 	ignore CVS backup files.## Revision 1.23  2002/10/30 05:00:35  rgb# Added missing escape to catch litteral "." followed by "/" rather than# "any char" followed by "/".## Revision 1.22  2002/10/26 15:10:39  mcr# 	make sure that all files are in the dependancy list.## Revision 1.21  2002/10/22 01:13:49  mcr# 	UML root file system will copy files from "all" config# 	and then files from specific hosts.## Revision 1.20  2002/10/17 02:39:53  mcr# 	make sure to set SUBARCH for module builds.## Revision 1.19  2002/10/02 02:18:29  mcr# 	con=pts was not a good idea - it isn't harmless for 2.4.18.## Revision 1.18  2002/09/30 16:04:29  mcr# 	include "con=pts" for 2.4.19 UMLs.## Revision 1.17  2002/09/16 18:23:58  mcr# 	make the installed UML copy of FreeSWAN depend upon# 	Makefile.ver as well.## Revision 1.16  2002/08/29 23:47:09  mcr# 	when generating UMLPOOL/Makefile, make sure that the generated# 	ipsec.o depends upon the KLIPS source code## Revision 1.15  2002/08/08 01:53:36  mcr# 	when building the UML environment, make the $OPENSWANSRCDIR# 	available as /usr/src, and the $OPENSWANSRCDIR/testing as /testing.## Revision 1.14  2002/08/05 00:17:45  mcr# 	do not install FreeSWAN for "regular hosts"## Revision 1.13  2002/08/02 22:33:06  mcr# 	create startmodule.sh that uses UMLPOOL/plain.# 	copy ipsec.o module from UMLPOOL/module.# 	build UMLPOOL/module/ipsec.o in common section.## Revision 1.12  2002/07/29 15:47:21  mcr# 	copying of BASICROOT often results in an error, which can be# 	ignored.# 	ignore CVS directories more carefully.## Revision 1.11  2002/07/29 05:58:58  mcr# 	generated UMLPOOL/Makefile now installs FreeSWAN as well.## Revision 1.10  2002/07/29 05:52:31  mcr# 	more adjusting of quoting - lost $* on end of command line.# 	this is needed so that klipstest can invoke "east single"## Revision 1.9  2002/07/29 05:46:42  mcr# 	quiet the make output with @ on every line.# 	the depends list does not get updated in a subshell, so# 	reprocess it again.# 	adjust quoting for start.sh script...## Revision 1.8  2002/07/29 02:46:58  mcr# 	make sure that the directories are made before they are used.# 	remove ./ from file names so that dependancies find the right file.## Revision 1.7  2002/07/29 01:02:20  mcr# 	instead of actually doing all the operations, build# 	a makefile in $POOLSPACE that will do it whenever necessary.## Revision 1.6  2002/07/15 09:58:14  mcr# 	removed ubd1 from /etc/fstab, and command line.# 	add /usr/share mount to /etc/fstab post-copy.## Revision 1.5  2002/04/04 00:19:02  mcr# 	when setting up root file systems, see if we built an ipsec.o# 	as part of the kernel build, and if so, copy it to /ipsec.o for# 	later use.## Revision 1.4  2002/01/12 02:50:29  mcr# 	when removing /var to make private copy, make sure that# 	-f(orce) is set.## Revision 1.3  2001/11/23 00:38:41  mcr# 	make /var private# 	make fake fsck.hostfs# 	split Debian interfaces file into RH file using script.## Revision 1.2  2001/11/07 20:10:20  mcr# 	revised setup comments after RGB consultation.# 	removed all non-variables from umlsetup-sample.sh.## Revision 1.1  2001/11/07 19:25:17  mcr# 	split out some functions from make-uml.##

⌨️ 快捷键说明

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