Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 150351
Collapse All | Expand All

(-)catalyst-2.0/modules/generic_stage_target.py (-4 / +14 lines)
Lines 163-176 class generic_stage_target(generic_targe Link Here
163
		
163
		
164
		# setup our mount points
164
		# setup our mount points
165
		if self.settings.has_key("SNAPCACHE"):
165
		if self.settings.has_key("SNAPCACHE"):
166
			self.mounts=[ "/proc","/dev","/dev/pts","/usr/portage","/usr/portage/distfiles" ]
166
			self.mounts=[ "/proc","/dev","/usr/portage","/usr/portage/distfiles" ]
167
			self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
167
			self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
168
				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
168
				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
169
				"/usr/portage/distfiles":self.settings["distdir"]}
169
				"/usr/portage/distfiles":self.settings["distdir"]}
170
		else:
170
		else:
171
			self.mounts=[ "/proc","/dev","/dev/pts","/usr/portage/distfiles" ]
171
			self.mounts=[ "/proc","/dev","/usr/portage/distfiles" ]
172
			self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
172
			self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\
173
				"/usr/portage/distfiles":self.settings["distdir"]}
173
				"/usr/portage/distfiles":self.settings["distdir"]}
174
		if os.uname()[0] == "Linux":
175
			self.mounts.append("/dev/pts")
174
176
175
		self.set_mounts()
177
		self.set_mounts()
176
178
Lines 768-774 class generic_stage_target(generic_targe Link Here
768
			src=self.mountmap[x]
770
			src=self.mountmap[x]
769
			if self.settings.has_key("SNAPCACHE") and x == "/usr/portage":
771
			if self.settings.has_key("SNAPCACHE") and x == "/usr/portage":
770
				self.snapshot_lock_object.read_lock()
772
				self.snapshot_lock_object.read_lock()
771
			retval=os.system("mount --bind "+src+" "+self.settings["chroot_path"]+x)
773
			if os.uname()[0] == "FreeBSD":
774
				if src == "/dev":
775
					retval=os.system("mount -t devfs none "+self.settings["chroot_path"]+x)
776
				else:
777
					retval=os.system("mount_nullfs "+src+" "+self.settings["chroot_path"]+x)
778
			else:
779
				retval=os.system("mount --bind "+src+" "+self.settings["chroot_path"]+x)
772
			if retval!=0:
780
			if retval!=0:
773
				self.unbind()
781
				self.unbind()
774
				raise CatalystError,"Couldn't bind mount "+src
782
				raise CatalystError,"Couldn't bind mount "+src
Lines 788-794 class generic_stage_target(generic_targe Link Here
788
				# it's not mounted, continue
796
				# it's not mounted, continue
789
				continue
797
				continue
790
			
798
			
791
			retval=os.system("umount "+mypath+x)
799
			retval=os.system("umount "+os.path.join(mypath,x.lstrip(os.path.sep)))
792
			
800
			
793
			if retval!=0:
801
			if retval!=0:
794
				warn("First attempt to unmount: "+mypath+x+" failed.")
802
				warn("First attempt to unmount: "+mypath+x+" failed.")
Lines 1278-1283 class generic_stage_target(generic_targe Link Here
1278
		    # the proper perms and ownership
1286
		    # the proper perms and ownership
1279
		    mystat=os.stat(myemp)
1287
		    mystat=os.stat(myemp)
1280
		    #cmd("rm -rf "+myemp, "Could not remove existing file: "+myemp,env=self.env)
1288
		    #cmd("rm -rf "+myemp, "Could not remove existing file: "+myemp,env=self.env)
1289
		    if os.uname()[0] == "FreeBSD": # There's no easy way to change flags recursively in python
1290
			    os.system("chflags -R noschg "+myemp)
1281
		    shutil.rmtree(myemp)
1291
		    shutil.rmtree(myemp)
1282
		    os.makedirs(myemp,0755)
1292
		    os.makedirs(myemp,0755)
1283
		    os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
1293
		    os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
(-)catalyst-2.0/targets/stage1/stage1-controller.sh (-2 / +2 lines)
Lines 57-66 case $1 in Link Here
57
		# Clean out man, info and doc files
57
		# Clean out man, info and doc files
58
		rm -rf usr/share/{man,doc,info}/*
58
		rm -rf usr/share/{man,doc,info}/*
59
		# Zap all .pyc and .pyo files
59
		# Zap all .pyc and .pyo files
60
		find -iname "*.py[co]" -exec rm -f {} \;
60
		find . -iname "*.py[co]" -exec rm -f {} \;
61
		# Cleanup all .a files except libgcc.a, *_nonshared.a and
61
		# Cleanup all .a files except libgcc.a, *_nonshared.a and
62
		# /usr/lib/portage/bin/*.a
62
		# /usr/lib/portage/bin/*.a
63
		find -type f -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' \
63
		find . -type f -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' \
64
			| grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs \
64
			| grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs \
65
			rm -f
65
			rm -f
66
	;;
66
	;;
(-)catalyst-2.0/targets/support/chroot-functions.sh (-1 / +5 lines)
Lines 215-221 function copy_symlink() { Link Here
215
	[ ! -e ${clst_root_path}/${1} ] && \
215
	[ ! -e ${clst_root_path}/${1} ] && \
216
		cp -vfdp ${1} ${clst_root_path}/${1}
216
		cp -vfdp ${1} ${clst_root_path}/${1}
217
	
217
	
218
	TARGET=`readlink -f ${1}`
218
	if [[ -n $(type -p realpath) ]]; then
219
	    TARGET=`realpath ${1}`
220
	else
221
	    TARGET=`readlink -f ${1}`
222
	fi
219
	if [ -h ${TARGET} ]
223
	if [ -h ${TARGET} ]
220
	then
224
	then
221
		copy_symlink ${TARGET} ${STACK}
225
		copy_symlink ${TARGET} ${STACK}

Return to bug 150351