[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop: [321] ipcop/trunk/lfs/stage2
From:       chepati () users ! sourceforge ! net
Date:       2007-04-30 16:56:30
Message-ID: E1HiZAs-0002IX-8J () sc8-pr-svn4 ! sourceforge ! net
[Download RAW message or body]

Revision: 321
          http://ipcop.svn.sourceforge.net/ipcop/?rev=321&view=rev
Author:   chepati
Date:     2007-04-30 09:56:29 -0700 (Mon, 30 Apr 2007)

Log Message:
-----------
Stage2 was screwing up my build tree if I rerun it.  It did so by destroying my \
/bin/bash and /usr/bin/perl.  Added an extra check to avoid this.  Made sure \
/dev/console and /dev/null exist on the final system.  /dev in the build tree is \
bound to /dev on the host system, so we have to temporarily move /tmp in the build \
tree to another mount point so as to expose the real /dev and create the necessary \
nodes there.

Modified Paths:
--------------
    ipcop/trunk/lfs/stage2

Modified: ipcop/trunk/lfs/stage2
===================================================================
--- ipcop/trunk/lfs/stage2	2007-04-30 16:52:33 UTC (rev 320)
+++ ipcop/trunk/lfs/stage2	2007-04-30 16:56:29 UTC (rev 321)
@@ -62,41 +62,52 @@
 	-mkdir -p /{root,sbin,sys,tmp,usr/local,var,opt}
 	-for dirname in /usr /usr/local; do \
 		mkdir $$dirname/{bin,include,lib,sbin,share,src}; \
-		ln -sf share/{man,doc,info} $$dirname; \
+		ln -sfn share/{man,doc,info} $$dirname; \
 		mkdir $$dirname/share/{dict,doc,info,locale,man}; \
 		mkdir $$dirname/share/{nls,misc,terminfo,zoneinfo}; \
 		mkdir $$dirname/share/man/man{1,2,3,4,5,6,7,8}; \
 	done
 
+	# Check for some important links and create them if they don't exist
+	if [ ! -e /bin/bash ]; then ln -sfn $(TOOLS_DIR)/bin/bash /bin/bash && ln -sf bash \
/bin/sh; fi +	if [ ! -e /bin/cat ]; then ln -sfn $(TOOLS_DIR)/bin/cat /bin/cat; fi
+	if [ ! -e /bin/pwd ]; then ln -sfn $(TOOLS_DIR)/bin/pwd /bin/pwd; fi
+	if [ ! -e /bin/stty ]; then ln -sfn $(TOOLS_DIR)/bin/stty /bin/stty; fi
+	if [ ! -e /lib/libgcc_s.so.1 ]; then \
+		ln -sfn $(TOOLS_DIR)/lib/libgcc_s.so.1 /lib/libgcc_s.so.1 && \
+		ln -sfn libgcc_s.so.1 /lib/libgcc_s.so; \
+	fi
+
 	-mkdir -p /var/{lock/subsys,log,mail,run,spool}
 	-mkdir -p /var/{tmp,opt,cache,lib/misc,local,empty}
 
-	# Make dev null 
-	cd /dev && rm -f null
-	cd /dev && mknod -m 0777 null c 1 3
+	# This trick is necessary in order to create two devices in the target /dev, rather \
than in the host /dev +	mkdir -p /dev1
+	mount --move /dev /dev1
 
+	# Make /dev/null and /dev/console
+	cd /dev && rm -f null console
+	cd /dev && mknod -m 0666 null c 1 3
+	cd /dev && mknod -m 0600 console c 5 1
+
+	# Now move the target /dev to point back to the host /dev
+	mount --move /dev1 /dev
+	rm -fr /dev1
+	
 	# Permissions
 	chmod 0750 /root
 	chmod 1777 /tmp /var/tmp
 	chmod 0711 /var/empty
 	
-	# Symlinks
-	-ln -sf $(TOOLS_DIR)/bin/{bash,cat,pwd,stty} /bin
-	-ln -sf $(TOOLS_DIR)/bin/perl /usr/bin
-	-ln -sf $(TOOLS_DIR)/lib/libgcc_s.so.1 /usr/lib
-	-ln -sf $(TOOLS_DIR)/lib/libgcc_s.so /usr/lib
-	-ln -sf bash /bin/sh
-
-	# Config files
-	-mkdir -p $(CONFIG_ROOT)/etc
+	# Config files (Note: /etc is bound to $(CONFIG_ROOT)/etc already)
 	for i in $(DIR_SRC)/config/etc/*; do \
-		[ -f $$i ] && cp $$i $(CONFIG_ROOT)/etc; \
+		[ -f $$i ] && cp $$i /etc; \
 	done
 
-	sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" $(CONFIG_ROOT)/etc/inittab
+	sed -i -e "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" /etc/inittab
 
-	ln -sf /proc/mounts $(CONFIG_ROOT)/etc/mtab
-	echo "$(NAME) v$(VERSION) for $(MACHINE) - $(SLOGAN)" > $(CONFIG_ROOT)/etc/issue
+	ln -sf /proc/mounts /etc/mtab
+	echo "$(NAME) v$(VERSION) for $(MACHINE) - $(SLOGAN)" > /etc/issue
 
 	# Scripts
 	for i in `find $(DIR_SRC)/src/scripts -maxdepth 1 -type f`; do \


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic