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

(-)genkernel-3.4.9_pre10.orig/gen_cmdline.sh (-4 / +4 lines)
Lines 210-220 Link Here
210
			echo
210
			echo
211
			print_warning 1 "Please use --evms, as --evms2 is deprecated."
211
			print_warning 1 "Please use --evms, as --evms2 is deprecated."
212
			;;
212
			;;
213
		--unionfs)
213
		--aufs)
214
			CMD_UNIONFS=1
214
			CMD_AUFS=1
215
			print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
215
			print_info 2 "CMD_AUFS: ${CMD_AUFS}"
216
			echo
216
			echo
217
			print_warning 1 "WARNING: unionfs support is in active development and is not meant for general"
217
			print_warning 1 "WARNING: aufs support is in active development and is not meant for general"
218
			print_warning 1 "use."
218
			print_warning 1 "use."
219
			print_warning 1 "Bug Reports without patches/fixes will be ignored."
219
			print_warning 1 "Bug Reports without patches/fixes will be ignored."
220
			print_warning 1 "Use at your own risk as this could blow up your system."
220
			print_warning 1 "Use at your own risk as this could blow up your system."
(-)genkernel-3.4.9_pre10.orig/gen_compile.sh (-83 / +49 lines)
Lines 324-426 Link Here
324
	fi
324
	fi
325
}
325
}
326
326
327
compile_unionfs_modules() {
327
compile_aufs_modules() {
328
	if [ ! -f "${UNIONFS_MODULES_BINCACHE}" ]
328
	if [ ! -f "${AUFS_MODULES_BINCACHE}" ]
329
	then
329
	then
330
		[ -f "${UNIONFS_SRCTAR}" ] ||
330
		[ -f "${AUFS_SRCTAR}" ] ||
331
			gen_die "Could not find unionfs source tarball: ${UNIONFS_SRCTAR}!"
331
			gen_die "Could not find aufs source tarball: ${AUFS_SRCTAR}!"
332
		cd "${TEMP}"
332
		cd "${TEMP}"
333
		rm -rf ${UNIONFS_DIR} > /dev/null
333
		rm -rf ${AUFS_DIR} > /dev/null
334
		rm -rf unionfs* > /dev/null
334
		rm -rf aufs* > /dev/null
335
		mkdir unionfs
335
		mkdir aufs
336
		/bin/tar xzpf ${UNIONFS_SRCTAR} ||
336
		/bin/tar xjpf ${AUFS_SRCTAR} ||
337
			gen_die 'Could not extract unionfs source tarball!'
337
			gen_die 'Could not extract aufs source tarball!'
338
		[ -d "${UNIONFS_DIR}" ] ||
338
		[ -d "${AUFS_DIR}" ] ||
339
			gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!'
339
			gen_die 'Unionfs directory ${AUFS_DIR} is invalid!'
340
		cd "${UNIONFS_DIR}"
340
		cd "${AUFS_DIR}"
341
		print_info 1 'unionfs modules: >> Compiling...'
341
		print_info 1 'aufs modules: >> Compiling...'
342
		echo "LINUXSRC=${KERNEL_DIR}" >> fistdev.mk
342
		make KDIR="${KERNEL_DIR}" -f local.mk aufs.ko
343
		echo 'TOPINC=-I$(LINUXSRC)/include' >> fistdev.mk
343
		print_info 1 'aufs: >> Copying to cache...'
344
		echo "MODDIR= /lib/modules/${KV}" >> fistdev.mk
345
		echo "KVERS=${KV}" >> fistdev.mk
346
		echo "KERNELVERSION=${KV}" >> fistdev.mk
347
		# Fix for hardened/selinux systems to have extened attributes
348
		# per r2d2's request.  Also add -DUNIONFS_UNSUPPORTED for 2.6.16
349
		echo "EXTRACFLAGS=-DUNIONFS_XATTR -DFIST_SETXATTR_CONSTVOID -DUNIONFS_UNSUPPORTED" \
350
			>> fistdev.mk
351
		# Here we do something really nasty and disable debugging, along with
352
		# change our default CFLAGS
353
		echo "UNIONFS_DEBUG_CFLAG=-DUNIONFS_NDEBUG" >> fistdev.mk
354
		echo "UNIONFS_OPT_CFLAG= -O2 -pipe" >> fistdev.mk
355
356
		if [ "${PAT}" -ge '6' ]
357
		then
358
			# ARCH is used by unionfs - and conflicts with genkernel
359
			ARCH_PUSH=${ARCH}
360
			unset ARCH
361
			# Compile unionfs module within the unionfs
362
			# environment not within the kernelsrc dir
363
			make unionfs.ko || gen_die 'failed to compile unionfs'
364
			ARCH=${ARCH_PUSH}
365
		else
366
			gen_die 'unionfs is only supported on 2.6 targets'
367
		fi
368
		print_info 1 'unionfs: >> Copying to cache...'
369
	
344
	
370
		mkdir -p ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs
345
		mkdir -p ${TEMP}/aufs/lib/modules/${KV}/kernel/fs/aufs
346
		cp -f fs/aufs/aufs.ko ${TEMP}/aufs/lib/modules/${KV}/kernel/fs/aufs
371
		
347
		
372
		if [ -f unionfs.ko ]
373
		then 
374
			cp -f unionfs.ko ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs
375
		else
376
			cp -f unionfs.o ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs
377
 		fi
378
	
348
	
379
		cd ${TEMP}/unionfs
349
		cd ${TEMP}/aufs
380
		/bin/tar -cjf "${UNIONFS_MODULES_BINCACHE}" . ||
350
		/bin/tar -cjf "${AUFS_MODULES_BINCACHE}" . ||
381
			gen_die 'Could not create unionfs modules binary cache'
351
			gen_die 'Could not create aufs modules binary cache'
382
	
352
	
383
		cd "${TEMP}"
353
		cd "${TEMP}"
384
		rm -rf "${UNIONFS_DIR}" > /dev/null
354
		rm -rf "${AUFS_DIR}" > /dev/null
385
		rm -rf unionfs > /dev/null
355
		rm -rf aufs > /dev/null
386
	fi
356
	fi
387
}
357
}
388
358
389
compile_unionfs_utils() {
359
compile_aufs_utils() {
390
	if [ ! -f "${UNIONFS_BINCACHE}" ]
360
	if [ ! -f "${AUFS_BINCACHE}" ]
391
	then
361
	then
392
		[ -f "${UNIONFS_SRCTAR}" ] ||
362
		[ -f "${AUFS_SRCTAR}" ] ||
393
			gen_die "Could not find unionfs source tarball: ${UNIONFS_SRCTAR}!"
363
			gen_die "Could not find aufs source tarball: ${AUFS_SRCTAR}!"
394
		cd "${TEMP}"
364
		cd "${TEMP}"
395
		rm -rf ${UNIONFS_DIR} > /dev/null
365
		rm -rf ${AUFS_DIR} > /dev/null
396
		rm -rf unionfs* > /dev/null
366
		rm -rf aufs* > /dev/null
397
		mkdir -p unionfs/sbin
367
		mkdir -p aufs/sbin
398
		/bin/tar -zxpf ${UNIONFS_SRCTAR} ||
368
		/bin/tar -jxpf ${AUFS_SRCTAR} ||
399
			gen_die 'Could not extract unionfs source tarball!'
369
			gen_die 'Could not extract aufs source tarball!'
400
		[ -d "${UNIONFS_DIR}" ] ||
370
		[ -d "${AUFS_DIR}" ] ||
401
			gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!'
371
			gen_die 'Unionfs directory ${AUFS_DIR} is invalid!'
402
		cd "${UNIONFS_DIR}"
372
		cd "${AUFS_DIR}"
403
		print_info 1 'unionfs tools: >> Compiling...'
373
		# Patching MAkefile for static compiling
404
		sed -i utils/Makefile -e 's|${CC} -o|${CC} -static -o|g'
374
		sed -i util/Makefile -e 's|-O2 -Wall|-O2 -Wall -static|g'
405
		sed -i Makefile -e 's|${CC} -o|${CC} -static -o|g'
375
406
		compile_generic utils utils
376
		print_info 1 'aufs tools: >> Compiling...'
407
377
		make -j1 -f local.mk mount.aufs auplink aulchown umount.aufs
408
		if [ ! -e "uniondbg" ]; then
378
		cd util
409
			cd utils
379
410
		fi
380
		print_info 1 'aufs: >> Copying to cache...'
411
		print_info 1 'unionfs: >> Copying to cache...'
381
		cp mount.aufs auplink aulchown umount.aufs ${TEMP}/aufs/sbin/ || 
412
		strip uniondbg unionctl
382
			gen_die 'Could not copy the aufs binary to the tmp directory'
413
		cp uniondbg ${TEMP}/unionfs/sbin/ || 
383
		cd ${TEMP}/aufs
414
			gen_die 'Could not copy the uniondbg binary to the tmp directory'
384
		/bin/tar -cjf "${AUFS_BINCACHE}" . ||
415
		cp unionctl ${TEMP}/unionfs/sbin/ ||
385
			gen_die 'Could not create aufs tools binary cache'
416
			gen_die 'Could not copy the unionctl binary to the tmp directory'
417
		cd ${TEMP}/unionfs
418
		/bin/tar -cjf "${UNIONFS_BINCACHE}" . ||
419
			gen_die 'Could not create unionfs tools binary cache'
420
		
386
		
421
		cd "${TEMP}"
387
		cd "${TEMP}"
422
		rm -rf "${UNIONFS_DIR}" > /dev/null
388
		rm -rf "${AUFS_DIR}" > /dev/null
423
		rm -rf unionfs > /dev/null
389
		rm -rf aufs > /dev/null
424
	fi
390
	fi
425
}
391
}
426
392
(-)genkernel-3.4.9_pre10.orig/gen_determineargs.sh (-6 / +6 lines)
Lines 109-115 Link Here
109
	set_config_with_override 1 OLDCONFIG            CMD_OLDCONFIG
109
	set_config_with_override 1 OLDCONFIG            CMD_OLDCONFIG
110
	set_config_with_override 1 LVM                  CMD_LVM
110
	set_config_with_override 1 LVM                  CMD_LVM
111
	set_config_with_override 1 EVMS                 CMD_EVMS
111
	set_config_with_override 1 EVMS                 CMD_EVMS
112
	set_config_with_override 1 UNIONFS              CMD_UNIONFS
112
	set_config_with_override 1 AUFS                 CMD_AUFS
113
	set_config_with_override 1 DMRAID               CMD_DMRAID
113
	set_config_with_override 1 DMRAID               CMD_DMRAID
114
	set_config_with_override 1 BUSYBOX              CMD_BUSYBOX              "yes"
114
	set_config_with_override 1 BUSYBOX              CMD_BUSYBOX              "yes"
115
	set_config_with_override 1 DEVFS                CMD_UNDEFINED_CMD        "no"
115
	set_config_with_override 1 DEVFS                CMD_UNDEFINED_CMD        "no"
Lines 128-135 Link Here
128
	DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"`
128
	DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"`
129
	LVM_BINCACHE=`cache_replace "${LVM_BINCACHE}"`
129
	LVM_BINCACHE=`cache_replace "${LVM_BINCACHE}"`
130
	DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"`
130
	DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"`
131
	UNIONFS_BINCACHE=`cache_replace "${UNIONFS_BINCACHE}"`
131
	AUFS_BINCACHE=`cache_replace "${AUFS_BINCACHE}"`
132
	UNIONFS_MODULES_BINCACHE=`cache_replace "${UNIONFS_MODULES_BINCACHE}"`
132
	AUFS_MODULES_BINCACHE=`cache_replace "${AUFS_MODULES_BINCACHE}"`
133
	BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
133
	BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
134
  
134
  
135
	DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
135
	DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
Lines 138-145 Link Here
138
	DEVICE_MAPPER_BINCACHE=`arch_replace "${DEVICE_MAPPER_BINCACHE}"`
138
	DEVICE_MAPPER_BINCACHE=`arch_replace "${DEVICE_MAPPER_BINCACHE}"`
139
	LVM_BINCACHE=`arch_replace "${LVM_BINCACHE}"`
139
	LVM_BINCACHE=`arch_replace "${LVM_BINCACHE}"`
140
	DMRAID_BINCACHE=`arch_replace "${DMRAID_BINCACHE}"`
140
	DMRAID_BINCACHE=`arch_replace "${DMRAID_BINCACHE}"`
141
	UNIONFS_BINCACHE=`arch_replace "${UNIONFS_BINCACHE}"`
141
	AUFS_BINCACHE=`arch_replace "${AUFS_BINCACHE}"`
142
	UNIONFS_MODULES_BINCACHE=`arch_replace "${UNIONFS_MODULES_BINCACHE}"`
142
	AUFS_MODULES_BINCACHE=`arch_replace "${AUFS_MODULES_BINCACHE}"`
143
	BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
143
	BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
144
	
144
	
145
145
Lines 205-209 Link Here
205
	fi
205
	fi
206
	
206
	
207
	get_KV
207
	get_KV
208
	UNIONFS_MODULES_BINCACHE=`kv_replace "${UNIONFS_MODULES_BINCACHE}"`
208
	AUFS_MODULES_BINCACHE=`kv_replace "${AUFS_MODULES_BINCACHE}"`
209
}
209
}
(-)genkernel-3.4.9_pre10.orig/gen_initramfs.sh (-23 / +23 lines)
Lines 74-107 Link Here
74
	rm -rf "${TEMP}/initramfs-blkid-temp" > /dev/null
74
	rm -rf "${TEMP}/initramfs-blkid-temp" > /dev/null
75
}
75
}
76
76
77
append_unionfs_modules(){
77
append_aufs_modules(){
78
	if [ -d "${TEMP}/initramfs-unionfs-modules-temp" ]
78
	if [ -d "${TEMP}/initramfs-aufs-modules-temp" ]
79
	then
79
	then
80
		rm -r "${TEMP}/initramfs-unionfs-modules-temp/"
80
		rm -r "${TEMP}/initramfs-aufs-modules-temp/"
81
	fi
81
	fi
82
	print_info 1 'UNIONFS MODULES: Adding support (compiling)...'
82
	print_info 1 'AUFS MODULES: Adding support (compiling)...'
83
	compile_unionfs_modules
83
	compile_aufs_modules
84
	mkdir -p "${TEMP}/initramfs-unionfs-modules-temp/"
84
	mkdir -p "${TEMP}/initramfs-aufs-modules-temp/"
85
	/bin/tar -jxpf "${UNIONFS_MODULES_BINCACHE}" -C "${TEMP}/initramfs-unionfs-modules-temp" ||
85
	/bin/tar -jxpf "${AUFS_MODULES_BINCACHE}" -C "${TEMP}/initramfs-aufs-modules-temp" ||
86
		gen_die "Could not extract unionfs modules binary cache!";
86
		gen_die "Could not extract aufs modules binary cache!";
87
	cd "${TEMP}/initramfs-unionfs-modules-temp/"
87
	cd "${TEMP}/initramfs-aufs-modules-temp/"
88
	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
88
	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
89
	rm -r "${TEMP}/initramfs-unionfs-modules-temp/"
89
	rm -r "${TEMP}/initramfs-aufs-modules-temp/"
90
}
90
}
91
91
92
append_unionfs_tools(){
92
append_aufs_tools(){
93
	if [ -d "${TEMP}/initramfs-unionfs-tools-temp" ]
93
	if [ -d "${TEMP}/initramfs-aufs-tools-temp" ]
94
	then
94
	then
95
		rm -r "${TEMP}/initramfs-unionfs-tools-temp/"
95
		rm -r "${TEMP}/initramfs-aufs-tools-temp/"
96
	fi
96
	fi
97
	print_info 1 'UNIONFS TOOLS: Adding support (compiling)...'
97
	print_info 1 'AUFS TOOLS: Adding support (compiling)...'
98
	compile_unionfs_utils
98
	compile_aufs_utils
99
	mkdir -p "${TEMP}/initramfs-unionfs-tools-temp/bin/"
99
	mkdir -p "${TEMP}/initramfs-aufs-tools-temp/bin/"
100
	/bin/tar -jxpf "${UNIONFS_BINCACHE}" -C "${TEMP}/initramfs-unionfs-tools-temp" ||
100
	/bin/tar -jxpf "${AUFS_BINCACHE}" -C "${TEMP}/initramfs-aufs-tools-temp" ||
101
		gen_die "Could not extract unionfs tools binary cache!";
101
		gen_die "Could not extract aufs tools binary cache!";
102
	cd "${TEMP}/initramfs-unionfs-tools-temp/"
102
	cd "${TEMP}/initramfs-aufs-tools-temp/"
103
	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
103
	find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
104
	rm -r "${TEMP}/initramfs-unionfs-tools-temp/"
104
	rm -r "${TEMP}/initramfs-aufs-tools-temp/"
105
}
105
}
106
106
107
#append_suspend(){
107
#append_suspend(){
Lines 408-414 Link Here
408
			rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
408
			rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
409
			cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
409
			cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
410
			chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
410
			chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
411
		elsif is_static /sbin/cryptsetup
411
		elif is_static /sbin/cryptsetup
412
		then
412
		then
413
			print_info 1 "Including LUKS support"
413
			print_info 1 "Including LUKS support"
414
			rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
414
			rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
Lines 456-463 Link Here
456
	append_data 'auxilary'
456
	append_data 'auxilary'
457
	append_data 'busybox' "${BUSYBOX}"
457
	append_data 'busybox' "${BUSYBOX}"
458
#	append_data 'devfs' "${DEVFS}"
458
#	append_data 'devfs' "${DEVFS}"
459
	append_data 'unionfs_modules' "${UNIONFS}"
459
	append_data 'aufs_modules' "${AUFS}"
460
	append_data 'unionfs_tools' "${UNIONFS}"
460
	append_data 'aufs_tools' "${AUFS}"
461
	append_data 'lvm' "${LVM}"
461
	append_data 'lvm' "${LVM}"
462
	append_data 'dmraid' "${DMRAID}"
462
	append_data 'dmraid' "${DMRAID}"
463
	append_data 'evms' "${EVMS}"
463
	append_data 'evms' "${EVMS}"
(-)genkernel-3.4.9_pre10.orig/gen_initrd.sh (-13 / +13 lines)
Lines 92-113 Link Here
92
		chmod +x "${TEMP}/initrd-temp/bin/devfsd"
92
		chmod +x "${TEMP}/initrd-temp/bin/devfsd"
93
	fi
93
	fi
94
94
95
	#unionfs modules
95
	#aufs modules
96
	if [ "${UNIONFS}" -eq '1' ]
96
	if [ "${AUFS}" -eq '1' ]
97
	then
97
	then
98
		print_info 1 'UNIONFS MODULES: Adding support (compiling)...'
98
		print_info 1 'AUFS MODULES: Adding support (compiling)...'
99
		compile_unionfs_modules
99
		compile_aufs_modules
100
		/bin/tar -jxpf "${UNIONFS_MODULES_BINCACHE}" -C "${TEMP}/initrd-temp" ||
100
		/bin/tar -jxpf "${AUFS_MODULES_BINCACHE}" -C "${TEMP}/initrd-temp" ||
101
			gen_die "Could not extract unionfs modules binary cache!";
101
			gen_die "Could not extract aufs modules binary cache!";
102
	fi
102
	fi
103
	
103
	
104
	#unionfs utils
104
	#aufs utils
105
	if [ "${UNIONFS}" -eq '1' ]
105
	if [ "${AUFS}" -eq '1' ]
106
	then
106
	then
107
		print_info 1 'UNIONFS TOOLS: Adding support (compiling)...'
107
		print_info 1 'AUFS TOOLS: Adding support (compiling)...'
108
		compile_unionfs_utils
108
		compile_aufs_utils
109
		/bin/tar -jxpf "${UNIONFS_BINCACHE}" -C "${TEMP}/initrd-temp" ||
109
		/bin/tar -jxpf "${AUFS_BINCACHE}" -C "${TEMP}/initrd-temp" ||
110
			gen_die "Could not extract unionfs tools binary cache!";
110
			gen_die "Could not extract aufs tools binary cache!";
111
	fi
111
	fi
112
112
113
	# DMRAID 
113
	# DMRAID 
Lines 216-222 Link Here
216
			rm -f ${TEMP}/initrd-temp/sbin/cryptsetup
216
			rm -f ${TEMP}/initrd-temp/sbin/cryptsetup
217
			cp /bin/cryptsetup ${TEMP}/initrd-temp/sbin/cryptsetup
217
			cp /bin/cryptsetup ${TEMP}/initrd-temp/sbin/cryptsetup
218
			chmod +x "${TEMP}/initrd-temp/sbin/cryptsetup"
218
			chmod +x "${TEMP}/initrd-temp/sbin/cryptsetup"
219
		elsif is_static /sbin/cryptsetup
219
		elif is_static /sbin/cryptsetup
220
		then
220
		then
221
			print_info 1 "Including LUKS support"
221
			print_info 1 "Including LUKS support"
222
			rm -f ${TEMP}/initrd-temp/sbin/cryptsetup
222
			rm -f ${TEMP}/initrd-temp/sbin/cryptsetup
(-)genkernel-3.4.9_pre10.orig/generic/initrd.scripts (-22 / +20 lines)
Lines 187-198 Link Here
187
# $2 = path to data directory
187
# $2 = path to data directory
188
#
188
#
189
union_insert_dir() {
189
union_insert_dir() {
190
	# detect branch 0 because newer unionfs doesn't support "0,1,2"
190
	mount -n -o remount,append:$2=rr aufs $1
191
	BRANCH_0="/"$(/sbin/unionctl $1 --list | cut -d/ -f2- | cut -d'(' -f1)
192
	/sbin/unionctl $1 --add --after $BRANCH_0 --mode ro $2
193
	if [ $? = '0' ]
191
	if [ $? = '0' ]
194
	then
192
	then
195
		good_msg "Addition of $2 to $1 after branch $BRANCH_0 successful"
193
		good_msg "Addition of $2 to $1 successful"
196
	fi
194
	fi
197
}
195
}
198
196
Lines 801-859 Link Here
801
	fi
799
	fi
802
}
800
}
803
801
804
setup_unionfs() {
802
setup_aufs() {
805
	if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
803
	if [ "${USE_AUFS_NORMAL}" -eq '1' ]
806
	then
804
	then
807
		# Directory used for rw changes in union mount filesystem
805
		# Directory used for rw changes in union mount filesystem
808
		UNION=/union
806
		UNION=/union
809
		MEMORY=/memory
807
		MEMORY=/memory
810
		if [ -z "$UID" ]
808
		if [ -z "$UID" ]
811
		then
809
		then
812
			CHANGES=$MEMORY/unionfs_changes/default
810
			CHANGES=$MEMORY/aufs_changes/default
813
		else
811
		else
814
			CHANGES=$MEMORY/unionfs_changes/$UID
812
			CHANGES=$MEMORY/aufs_changes/$UID
815
		fi
813
		fi
816
814
817
		mkdir -p ${MEMORY}
815
		mkdir -p ${MEMORY}
818
		mkdir -p ${UNION}
816
		mkdir -p ${UNION}
819
		good_msg "Loading unionfs module"
817
		good_msg "Loading aufs module"
820
		modprobe unionfs > /dev/null 2>&1
818
		modprobe aufs > /dev/null 2>&1
821
		if [ -n "${UNIONFS}" ]
819
		if [ -n "${AUFS}" ]
822
		then
820
		then
823
			CHANGESDEV=${UNIONFS}
821
			CHANGESDEV=${AUFS}
824
			good_msg "mounting $CHANGESDEV to $MEMORY for unionfs support"
822
			good_msg "mounting $CHANGESDEV to $MEMORY for aufs support"
825
			mount -t auto $CHANGESDEV $MEMORY
823
			mount -t auto $CHANGESDEV $MEMORY
826
			# mount tmpfs only in the case when changes= boot parameter was
824
			# mount tmpfs only in the case when changes= boot parameter was
827
			# empty or we were not able to mount the storage device
825
			# empty or we were not able to mount the storage device
828
			ret=$?
826
			ret=$?
829
			if [ "${ret}" -ne 0 ]
827
			if [ "${ret}" -ne 0 ]
830
			then
828
			then
831
				bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based unionfs"
829
				bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based aufs"
832
				mount -t tmpfs tmpfs $MEMORY
830
				mount -t tmpfs tmpfs $MEMORY
833
			fi
831
			fi
834
			if [ "${CDROOT}" -eq '1' -a ! -f ${MEMORY}/livecd.unionfs  ]
832
			if [ "${CDROOT}" -eq '1' -a ! -f ${MEMORY}/livecd.aufs  ]
835
			then
833
			then
836
				umount $MEMORY
834
				umount $MEMORY
837
				bad_msg "failed to find livecd.unionfs file on $CHANGESDEV"
835
				bad_msg "failed to find livecd.aufs file on $CHANGESDEV"
838
				bad_msg "create a livecd.unionfs file on this device if you wish to use it for unionfs"
836
				bad_msg "create a livecd.aufs file on this device if you wish to use it for aufs"
839
				bad_msg "falling back to ramdisk based unionfs for safety"
837
				bad_msg "falling back to ramdisk based aufs for safety"
840
				mount -t tmpfs tmpfs $MEMORY
838
				mount -t tmpfs tmpfs $MEMORY
841
			fi
839
			fi
842
		else 
840
		else 
843
			good_msg "Mounting ramdisk to $MEMORY for unionfs support..."
841
			good_msg "Mounting ramdisk to $MEMORY for aufs support..."
844
			mount -t tmpfs tmpfs $MEMORY 
842
			mount -t tmpfs tmpfs $MEMORY 
845
		fi 
843
		fi 
846
844
847
		mkdir -p $CHANGES 
845
		mkdir -p $CHANGES 
848
		mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION}
846
		mount -t aufs -n -o br:$CHANGES=rw aufs ${UNION}
849
		ret=$?
847
		ret=$?
850
		if [ "${ret}" -ne 0 ]
848
		if [ "${ret}" -ne 0 ]
851
		then 
849
		then 
852
			bad_msg "Can't setup union ${UNION} in directory!"
850
			bad_msg "Can't setup union ${UNION} in directory!"
853
			USE_UNIONFS_NORMAL=0
851
			USE_AUFS_NORMAL=0
854
		fi
852
		fi
855
	else
853
	else
856
		USE_UNIONFS_NORMAL=0
854
		USE_AUFS_NORMAL=0
857
	fi
855
	fi
858
}
856
}
859
857
(-)genkernel-3.4.9_pre10.orig/generic/linuxrc (-25 / +25 lines)
Lines 77-106 Link Here
77
		looptype\=*)
77
		looptype\=*)
78
			LOOPTYPE=`parse_opt "${x}"`
78
			LOOPTYPE=`parse_opt "${x}"`
79
		;;
79
		;;
80
		unionfs)
80
		aufs)
81
			if [ ! -x /sbin/unionctl ]
81
			if [ ! -x /sbin/aulchown ]
82
			then
82
			then
83
				USE_UNIONFS_NORMAL=0
83
				USE_AUFS_NORMAL=0
84
				bad_msg 'Unionctl not found: aborting use of unionfs!'
84
				bad_msg 'aulchown not found: aborting use of aufs!'
85
			else
85
			else
86
				USE_UNIONFS_NORMAL=1
86
				USE_AUFS_NORMAL=1
87
			fi
87
			fi
88
		;;
88
		;;
89
		unionfs\=*)
89
		aufs\=*)
90
			if [ ! -x /sbin/unionctl ]
90
			if [ ! -x /sbin/aulchown ]
91
			then
91
			then
92
				USE_UNIONFS_NORMAL=0
92
				USE_AUFS_NORMAL=0
93
				bad_msg 'Unionctl not found: aborting use of unionfs!'
93
				bad_msg 'aulchown not found: aborting use of aufs!'
94
			else
94
			else
95
				USE_UNIONFS_NORMAL=1
95
				USE_AUFS_NORMAL=1
96
				CMD_UNIONFS=`parse_opt "${x}"`
96
				CMD_AUFS=`parse_opt "${x}"`
97
				echo ${CMD_UNIONFS}|grep , >/dev/null 2>&1
97
				echo ${CMD_AUFS}|grep , >/dev/null 2>&1
98
				if [ "$?" -eq '0' ]
98
				if [ "$?" -eq '0' ]
99
				then
99
				then
100
					UID=`echo ${CMD_UNIONFS#*,}`
100
					UID=`echo ${CMD_AUFS#*,}`
101
					UNIONFS=`echo ${CMD_UNIONFS%,*}`
101
					AUFS=`echo ${CMD_AUFS%,*}`
102
				else
102
				else
103
					UNIONFS=${CMD_UNIONFS}
103
					AUFS=${CMD_AUFS}
104
				fi
104
				fi
105
			fi
105
			fi
106
		;;
106
		;;
Lines 242-252 Link Here
242
	startLUKS
242
	startLUKS
243
fi
243
fi
244
244
245
# Set up unionfs
245
# Set up aufs
246
mkdir -p ${NEW_ROOT}
246
mkdir -p ${NEW_ROOT}
247
setup_unionfs
247
setup_aufs
248
248
249
if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
249
if [ "${USE_AUFS_NORMAL}" -eq '1' ]
250
then
250
then
251
	CHROOT=${UNION}
251
	CHROOT=${UNION}
252
else
252
else
Lines 260-266 Link Here
260
260
261
if [ "${CDROOT}" -eq '1' ]
261
if [ "${CDROOT}" -eq '1' ]
262
then
262
then
263
	if [ ! "${USE_UNIONFS_NORMAL}" -eq '1' ]
263
	if [ ! "${USE_AUFS_NORMAL}" -eq '1' ]
264
	then
264
	then
265
		good_msg "Making tmpfs for ${NEW_ROOT}"
265
		good_msg "Making tmpfs for ${NEW_ROOT}"
266
		mount -t tmpfs tmpfs ${NEW_ROOT}
266
		mount -t tmpfs tmpfs ${NEW_ROOT}
Lines 601-611 Link Here
601
# End cdrom looptype determination and mounting if necessary
601
# End cdrom looptype determination and mounting if necessary
602
#
602
#
603
603
604
	if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
604
	if [ "${USE_AUFS_NORMAL}" -eq '1' ]
605
	then
605
	then
606
		union_insert_dir ${UNION} ${NEW_ROOT}/${FS_LOCATION}
606
		union_insert_dir ${UNION} ${NEW_ROOT}/${FS_LOCATION}
607
		
607
		
608
		# Make sure fstab notes livecd is mounted ro.  Makes system skip remount which fails on unionfs dirs.
608
		# Make sure fstab notes livecd is mounted ro.  Makes system skip remount which fails on aufs dirs.
609
		sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' /${UNION}/etc/fstab > /${UNION}/etc/fstab.new
609
		sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' /${UNION}/etc/fstab > /${UNION}/etc/fstab.new
610
		mv /${UNION}/etc/fstab.new /${UNION}/etc/fstab
610
		mv /${UNION}/etc/fstab.new /${UNION}/etc/fstab
611
	fi
611
	fi
Lines 627-633 Link Here
627
	fi
627
	fi
628
628
629
	
629
	
630
	if [ ! "${USE_UNIONFS_NORMAL}" -eq '1' ]
630
	if [ ! "${USE_AUFS_NORMAL}" -eq '1' ]
631
	then
631
	then
632
		good_msg "Copying read-write image contents to tmpfs"
632
		good_msg "Copying read-write image contents to tmpfs"
633
		# Copy over stuff that should be writable
633
		# Copy over stuff that should be writable
Lines 695-701 Link Here
695
		sleep 10
695
		sleep 10
696
	fi
696
	fi
697
else
697
else
698
	if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
698
	if [ "${USE_AUFS_NORMAL}" -eq '1' ]
699
	then
699
	then
700
		union_insert_dir ${UNION} ${NEW_ROOT}
700
		union_insert_dir ${UNION} ${NEW_ROOT}
701
		mkdir -p ${UNION}/tmp/.initrd
701
		mkdir -p ${UNION}/tmp/.initrd
Lines 717-726 Link Here
717
# init scripts will be able to unmount it properly at next reboot
717
# init scripts will be able to unmount it properly at next reboot
718
#
718
#
719
# Eventually, all "unions over /" mounts should go in that /.unions/
719
# Eventually, all "unions over /" mounts should go in that /.unions/
720
if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
720
if [ "${USE_AUFS_NORMAL}" -eq '1' ]
721
then
721
then
722
	mkdir -p /${CHROOT}/.unions/memory 2>/dev/null
722
	mkdir -p /${CHROOT}/.unions/memory 2>/dev/null
723
	mount -o move /memory /${CHROOT}/.unions/memory || echo '*: Failed to move unionfs /memory into the system root!'
723
	mount -o move /memory /${CHROOT}/.unions/memory || echo '*: Failed to move aufs /memory into the system root!'
724
fi
724
fi
725
725
726
if [ "$0" = '/linuxrc' ] || [ "$0" = 'linuxrc' ]
726
if [ "$0" = '/linuxrc' ] || [ "$0" = 'linuxrc' ]
(-)genkernel-3.4.9_pre10.orig/genkernel (-2 / +2 lines)
Lines 395-402 Link Here
395
	[ "${EVMS}" -eq '1' ] && print_info 1 'add "doevms" for evms support'
395
	[ "${EVMS}" -eq '1' ] && print_info 1 'add "doevms" for evms support'
396
	[ "${DMRAID}" -eq '1' ] && print_info 1 'add "dodmraid" for dmraid support'
396
	[ "${DMRAID}" -eq '1' ] && print_info 1 'add "dodmraid" for dmraid support'
397
	[ "${DMRAID}" -eq '1' ] && print_info 1 '	or "dodmraid=<additional options>"'
397
	[ "${DMRAID}" -eq '1' ] && print_info 1 '	or "dodmraid=<additional options>"'
398
	[ "${UNIONFS}" -eq '1' ] && print_info 1 'add "unionfs" for unionfs support'
398
	[ "${AUFS}" -eq '1' ] && print_info 1 'add "aufs" for aufs support'
399
	[ "${UNIONFS}" -eq '1' ] && print_info 1 '	or "unionfs=<block_device>"'
399
	[ "${AUFS}" -eq '1' ] && print_info 1 '	or "aufs=<block_device>"'
400
fi
400
fi
401
401
402
[ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}
402
[ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}
(-)genkernel-3.4.9_pre10.orig/genkernel.conf (-13 / +11 lines)
Lines 61-69 Link Here
61
# should run "emerge evms" first.
61
# should run "emerge evms" first.
62
# EVMS="no"
62
# EVMS="no"
63
63
64
# UnionFS support.  Under active development.  Do not use unless you are working
64
# AUFS support.  Under active development.  Do not use unless you are working
65
# on developing this feature.
65
# on developing this feature.
66
# UNIONFS="no"
66
# AUFS="no"
67
67
68
# Add DMRAID support.
68
# Add DMRAID support.
69
# DMRAID="no"
69
# DMRAID="no"
Lines 149-178 Link Here
149
DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2"
149
DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2"
150
DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2"
150
DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2"
151
151
152
DEVICE_MAPPER_VER="VERSION_DMAP"
152
DEVICE_MAPPER_VER="1.02.22"
153
DEVICE_MAPPER_DIR="device-mapper.${DEVICE_MAPPER_VER}"
153
DEVICE_MAPPER_DIR="device-mapper.${DEVICE_MAPPER_VER}"
154
DEVICE_MAPPER_SRCTAR="${GK_SHARE}/pkg/device-mapper.${DEVICE_MAPPER_VER}.tgz"
154
DEVICE_MAPPER_SRCTAR="${GK_SHARE}/pkg/device-mapper.${DEVICE_MAPPER_VER}.tgz"
155
DEVICE_MAPPER_BINCACHE="%%CACHE%%/device-mapper-${DEVICE_MAPPER_VER}-%%ARCH%%.tar.bz2"
155
DEVICE_MAPPER_BINCACHE="%%CACHE%%/device-mapper-${DEVICE_MAPPER_VER}-%%ARCH%%.tar.bz2"
156
156
157
LVM_VER="VERSION_LVM"
157
LVM_VER="2.02.28"
158
LVM_DIR="LVM2.${LVM_VER}"
158
LVM_DIR="LVM2.${LVM_VER}"
159
LVM_SRCTAR="${GK_SHARE}/pkg/LVM2.${LVM_VER}.tgz"
159
LVM_SRCTAR="${GK_SHARE}/pkg/LVM2.${LVM_VER}.tgz"
160
LVM_BINCACHE="%%CACHE%%/LVM2.${LVM_VER}-%%ARCH%%.tar.bz2"
160
LVM_BINCACHE="%%CACHE%%/LVM2.${LVM_VER}-%%ARCH%%.tar.bz2"
161
161
162
DMRAID_VER="VERSION_DMRAID"
162
DMRAID_VER="1.0.0.rc14"
163
DMRAID_DIR="dmraid/${DMRAID_VER}"
163
DMRAID_DIR="dmraid/${DMRAID_VER}"
164
DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2"
164
DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2"
165
DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2"
165
DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2"
166
166
167
# Kernel Version Compatibility
167
AUFS_VER="20071126"
168
# (from http://www.am-utils.org/project-unionfs.html)
168
AUFS_DIR="aufs"
169
UNIONFS_VER="VERSION_UNIONFS"
169
AUFS_SRCTAR="${GK_SHARE}/pkg/aufs-${AUFS_VER}.tar.bz2"
170
UNIONFS_DIR="unionfs-${UNIONFS_VER}"
170
AUFS_BINCACHE="%%CACHE%%/aufs-${AUFS_VER}-tools-%%ARCH%%.tar.bz2"
171
UNIONFS_SRCTAR="${GK_SHARE}/pkg/unionfs-${UNIONFS_VER}.tar.gz"
171
AUFS_MODULES_BINCACHE="%%CACHE%%/aufs-${AUFS_VER}-modules-%%KV%%-%%ARCH%%.tar.bz2"
172
UNIONFS_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-tools-%%ARCH%%.tar.bz2"
173
UNIONFS_MODULES_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-modules-%%KV%%-%%ARCH%%.tar.bz2"
174
172
175
E2FSPROGS_VER="VERSION_E2FSPROGS"
173
E2FSPROGS_VER="1.39"
176
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
174
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
177
E2FSPROGS_SRCTAR="${GK_SHARE}/pkg/e2fsprogs-${E2FSPROGS_VER}.tar.gz"
175
E2FSPROGS_SRCTAR="${GK_SHARE}/pkg/e2fsprogs-${E2FSPROGS_VER}.tar.gz"
178
BLKID_BINCACHE="%%CACHE%%/blkid-${E2FSPROGS_VER}-%%ARCH%%.bz2"
176
BLKID_BINCACHE="%%CACHE%%/blkid-${E2FSPROGS_VER}-%%ARCH%%.bz2"

Return to bug 201038