Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 156445 | Differences between
and this patch

Collapse All | Expand All

(-)genkernel-3.4.5/gen_cmdline.sh (+12 lines)
Lines 77-82 longusage() { Link Here
77
  echo "	--lvm2			Include LVM2 support"
77
  echo "	--lvm2			Include LVM2 support"
78
#  echo "	--unionfs		Include UNIONFS support"
78
#  echo "	--unionfs		Include UNIONFS support"
79
  echo "	--dmraid		Include DMRAID support"
79
  echo "	--dmraid		Include DMRAID support"
80
  echo "	--suspend		Include userspace suspend/resume (uswsusp) support"
80
  echo "	--slowusb		Enables extra pauses for slow USB CD boots"
81
  echo "	--slowusb		Enables extra pauses for slow USB CD boots"
81
  echo "	--bootloader=grub	Add new kernel to GRUB configuration"
82
  echo "	--bootloader=grub	Add new kernel to GRUB configuration"
82
  echo "	--linuxrc=<file>	Specifies a user created linuxrc"
83
  echo "	--linuxrc=<file>	Specifies a user created linuxrc"
Lines 226-231 parse_cmdline() { Link Here
226
		      CMD_LVM2=1
227
		      CMD_LVM2=1
227
		      print_info 2 "CMD_LVM2: $CMD_LVM2"
228
		      print_info 2 "CMD_LVM2: $CMD_LVM2"
228
	      ;;
229
	      ;;
230
	      --suspend)
231
		      if [ ! -e /etc/suspend.conf ]
232
		      then
233
			echo 'Error: --suspend requires sys-power/suspend to be installed'
234
			echo '       on the host system; try "emerge sys-power/suspend".'
235
			echo '       Once installed, configure the resume settings in /etc/suspend.conf'
236
			exit 1
237
		      fi
238
	      	      CMD_SUSPEND=1
239
		      print_info 2 "CMD_SUSPEND: $CMD_SUSPEND"
240
	      ;;
229
	      --no-busybox)
241
	      --no-busybox)
230
		      CMD_NO_BUSYBOX=1
242
		      CMD_NO_BUSYBOX=1
231
		      print_info 2 "CMD_NO_BUSYBOX: $CMD_NO_BUSYBOX"
243
		      print_info 2 "CMD_NO_BUSYBOX: $CMD_NO_BUSYBOX"
(-)genkernel-3.4.5/gen_compile.sh (-13 / +52 lines)
Lines 187-194 compile_generic() { Link Here
187
	local RET
187
	local RET
188
	[ "$#" -lt '2' ] &&
188
	[ "$#" -lt '2' ] &&
189
		gen_die 'compile_generic(): improper usage!'
189
		gen_die 'compile_generic(): improper usage!'
190
	local target=${1}
191
	local argstype=${2}
190
192
191
	if [ "${2}" = 'kernel' ] || [ "${2}" = 'runtask' ]
193
	if [ "${argstype}" = 'kernel' ] || [ "${argstype}" = 'runtask' ]
192
	then
194
	then
193
		export_kernel_args
195
		export_kernel_args
194
		MAKE=${KERNEL_MAKE}
196
		MAKE=${KERNEL_MAKE}
Lines 197-238 compile_generic() { Link Here
197
		export_utils_args
199
		export_utils_args
198
		MAKE=${UTILS_MAKE}
200
		MAKE=${UTILS_MAKE}
199
	fi
201
	fi
200
	case "$2" in
202
	case "${argstype}" in
201
		kernel) ARGS="`compile_kernel_args`" ;;
203
		kernel) ARGS="`compile_kernel_args`" ;;
202
		utils) ARGS="`compile_utils_args`" ;;
204
		utils) ARGS="`compile_utils_args`" ;;
203
		*) ARGS="" ;; # includes runtask
205
		*) ARGS="" ;; # includes runtask
204
	esac
206
	esac
205
		
207
	shift 2
208
206
209
207
	# the eval usage is needed in the next set of code
210
	# the eval usage is needed in the next set of code
208
	# as ARGS can contain spaces and quotes, eg:
211
	# as ARGS can contain spaces and quotes, eg:
209
	# ARGS='CC="ccache gcc"'
212
	# ARGS='CC="ccache gcc"'
210
	if [ "${2}" == 'runtask' ]
213
	if [ "${argstype}" == 'runtask' ]
211
	then
214
	then
212
		print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS/-j?/j1} ${ARGS} ${1}" 1 0 1
215
		print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS/-j?/j1} ${ARGS} ${target} $*" 1 0 1
213
		eval ${MAKE} -s ${MAKEOPTS/-j?/-j1} "${ARGS}" ${1}
216
		eval ${MAKE} -s ${MAKEOPTS/-j?/-j1} "${ARGS}" ${target} $*
214
		RET=$?
217
		RET=$?
215
	elif [ "${DEBUGLEVEL}" -gt "1" ]
218
	elif [ "${DEBUGLEVEL}" -gt "1" ]
216
	then
219
	then
217
		# Output to stdout and debugfile
220
		# Output to stdout and debugfile
218
		print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1}" 1 0 1
221
		print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1
219
		eval ${MAKE} ${MAKEOPTS} ${ARGS} ${1} 2>&1 | tee -a ${DEBUGFILE}
222
		eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${DEBUGFILE}
220
		RET=${PIPESTATUS[0]}
223
		RET=${PIPESTATUS[0]}
221
	else
224
	else
222
		# Output to debugfile only
225
		# Output to debugfile only
223
		print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1}" 1 0 1
226
		print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1} $*" 1 0 1
224
		eval ${MAKE} ${MAKEOPTS} ${ARGS} ${1} >> ${DEBUGFILE} 2>&1
227
		eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${DEBUGFILE} 2>&1
225
		RET=$?
228
		RET=$?
226
	fi
229
	fi
227
	[ "${RET}" -ne '0' ] &&
230
	[ "${RET}" -ne '0' ] &&
228
		gen_die "Failed to compile the \"${1}\" target..."
231
		gen_die "Failed to compile the \"${target}\" target..."
229
232
230
	unset MAKE
233
	unset MAKE
231
	unset ARGS
234
	unset ARGS
232
	if [ "${2}" = 'kernel' ]
235
	if [ "${argstype}" = 'kernel' ]
233
	then
236
	then
234
		unset_kernel_args
237
		unset_kernel_args
235
	elif [ "${2}" = 'utils' ]
238
	elif [ "${argstype}" = 'utils' ]
236
	then
239
	then
237
		unset_utils_args
240
		unset_utils_args
238
	fi
241
	fi
Lines 529-534 compile_dmraid() { Link Here
529
	fi
532
	fi
530
}
533
}
531
534
535
compile_suspend() {
536
	[ -f "${SUSPEND_BINCACHE}" ] && return
537
	[ -f "${SUSPEND_SRCTAR}" ] ||
538
		gen_die "Could not find SUSPEND source tarball: ${SUSPEND_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
539
	cd ${TEMP}
540
	rm -rf ${SUSPEND_DIR} > /dev/null
541
	/bin/tar -zxpf ${SUSPEND_SRCTAR} ||
542
		gen_die 'Could not extract SUSPEND source tarball!'
543
	[ -d "${SUSPEND_DIR}" ] ||
544
		gen_die "SUSPEND directory ${DMRAID_DIR} is invalid!"
545
546
	cd "${SUSPEND_DIR}"
547
	if [ -f "${GK_SHARE}/pkg/suspend-0.5-Makefile.patch" ]
548
	then
549
		patch -p1 -i \
550
			${GK_SHARE}/pkg/suspend-0.5-Makefile.patch \
551
			|| gen_die "Failed patching suspend"
552
	fi
553
554
	print_info 1 'suspend: >> Compiling...'
555
	compile_generic '' utils CC_FLAGS= LD_FLAGS=
556
557
	print_info 1 '         >> Copying to bincache...'
558
	mkdir -p "${TEMP}/bincache/etc"
559
	mkdir -p "${TEMP}/bincache/sbin"
560
	cp -f /etc/suspend.conf "${TEMP}/bincache/etc" ||
561
		gen_die 'Could not copy suspend.conf'
562
	cp -f resume "${TEMP}/bincache/sbin" ||
563
		gen_die 'Could not copy resume binary'
564
	cd "${TEMP}/bincache"
565
	/bin/tar -cjf "${SUSPEND_BINCACHE}" * ||
566
		gen_die 'Could not create suspend binary cache'
567
	cd "${TEMP}"
568
	rm -rf bincache suspend-0.5
569
}
570
532
compile_modutils() {
571
compile_modutils() {
533
	# I've disabled dietlibc support for the time being since the
572
	# I've disabled dietlibc support for the time being since the
534
	# version we use misses a few needed system calls.
573
	# version we use misses a few needed system calls.
(-)genkernel-3.4.5/gen_configkernel.sh (+7 lines)
Lines 120-123 config_kernel() { Link Here
120
	then
120
	then
121
		sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g'
121
		sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_FB_SPLASH is.*/CONFIG_FB_SPLASH=y/g'
122
	fi
122
	fi
123
124
	# This check isn't complete: SOFTWARE_SUSPEND has extra deps on some systems such as CPU hotplug
125
	if isTrue ${CMD_SUSPEND}
126
	then
127
		sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_SOFTWARE_SUSPEND is.*/CONFIG_SOFTWARE_SUSPEND=y/g'
128
	fi
129
123
}
130
}
(-)genkernel-3.4.5/gen_determineargs.sh (+9 lines)
Lines 212-217 determine_real_args() { Link Here
212
	UNIONFS_BINCACHE=`cache_replace "${UNIONFS_BINCACHE}"`
212
	UNIONFS_BINCACHE=`cache_replace "${UNIONFS_BINCACHE}"`
213
	UNIONFS_MODULES_BINCACHE=`cache_replace "${UNIONFS_MODULES_BINCACHE}"`
213
	UNIONFS_MODULES_BINCACHE=`cache_replace "${UNIONFS_MODULES_BINCACHE}"`
214
	BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
214
	BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
215
	SUSPEND_BINCACHE=`cache_replace "${SUSPEND_BINCACHE}"`
215
  
216
  
216
	DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
217
	DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
217
	BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
218
	BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
Lines 230-235 determine_real_args() { Link Here
230
	UNIONFS_BINCACHE=`arch_replace "${UNIONFS_BINCACHE}"`
231
	UNIONFS_BINCACHE=`arch_replace "${UNIONFS_BINCACHE}"`
231
	UNIONFS_MODULES_BINCACHE=`arch_replace "${UNIONFS_MODULES_BINCACHE}"`
232
	UNIONFS_MODULES_BINCACHE=`arch_replace "${UNIONFS_MODULES_BINCACHE}"`
232
	BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
233
	BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
234
	SUSPEND_BINCACHE=`arch_replace "${SUSPEND_BINCACHE}"`
233
	
235
	
234
	if [ "${CMD_BOOTSPLASH}" != '' ]
236
	if [ "${CMD_BOOTSPLASH}" != '' ]
235
	then
237
	then
Lines 423-428 determine_real_args() { Link Here
423
	else
425
	else
424
		LVM2=0
426
		LVM2=0
425
	fi
427
	fi
428
429
	if isTrue "${CMD_SUSPEND}"
430
	then
431
		SUSPEND=1
432
	else
433
		SUSPEND=0
434
	fi
426
	
435
	
427
	if isTrue "${CMD_EVMS2}"
436
	if isTrue "${CMD_EVMS2}"
428
	then
437
	then
(-)genkernel-3.4.5/generic/initrd.scripts (+12 lines)
Lines 743-748 setup_unionfs() { Link Here
743
	fi
743
	fi
744
}
744
}
745
745
746
suspend_resume() {
747
	[ -x /sbin/resume ] || return 0
748
	/sbin/resume
749
	local ret=$?
750
751
	if [ "${ret}" -eq 0 ]; then
752
		exit 0
753
	fi
754
755
	return 0
756
}
757
746
suspend2_resume() {
758
suspend2_resume() {
747
	if [ -d /proc/suspend2 ] || [ -d /sys/power/suspend2 ]; then
759
	if [ -d /proc/suspend2 ] || [ -d /sys/power/suspend2 ]; then
748
		local splash_theme
760
		local splash_theme
(-)genkernel-3.4.5/generic/linuxrc (+1 lines)
Lines 250-255 fi Link Here
250
# Run debug shell if requested
250
# Run debug shell if requested
251
rundebugshell
251
rundebugshell
252
252
253
suspend_resume
253
suspend2_resume
254
suspend2_resume
254
255
255
if [ "${CDROOT}" -eq '1' ]
256
if [ "${CDROOT}" -eq '1' ]
(-)genkernel-3.4.5/genkernel.conf (+6 lines)
Lines 142-144 E2FSPROGS_VER="VERSION_E2FSPROGS" Link Here
142
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
142
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
143
E2FSPROGS_SRCTAR="${GK_SHARE}/pkg/e2fsprogs-${E2FSPROGS_VER}.tar.gz"
143
E2FSPROGS_SRCTAR="${GK_SHARE}/pkg/e2fsprogs-${E2FSPROGS_VER}.tar.gz"
144
BLKID_BINCACHE="%%CACHE%%/blkid-${E2FSPROGS_VER}-%%ARCH%%.bz2"
144
BLKID_BINCACHE="%%CACHE%%/blkid-${E2FSPROGS_VER}-%%ARCH%%.bz2"
145
146
SUSPEND_VER="VERSION_SUSPEND"
147
SUSPEND_DIR="suspend-${SUSPEND_VER}"
148
SUSPEND_SRCTAR="${GK_SHARE}/pkg/suspend-${SUSPEND_VER}.tar.gz"
149
SUSPEND_BINCACHE="%%CACHE%%/suspend-${SUSPEND_VER}-%%ARCH%%.tar.bz2"
150
(-)genkernel-3.4.5/gen_initramfs.sh (+26 lines)
Lines 173-178 create_unionfs_tools_cpio(){ Link Here
173
	fi										        
173
	fi										        
174
}
174
}
175
175
176
create_suspend_cpio(){
177
	[ "${SUSPEND}" = '1' ] || return
178
179
	if [ -d "${TEMP}/initramfs-suspend-temp" ];
180
	then
181
		rm -r "${TEMP}/initramfs-suspend-temp/"
182
	fi
183
	print_info 1 'SUSPEND: Adding support (compiling binaries)...'
184
	compile_suspend
185
	mkdir -p "${TEMP}/initramfs-suspend-temp/"
186
	/bin/tar -jxpf "${SUSPEND_BINCACHE}" -C "${TEMP}/initramfs-suspend-temp" ||
187
		gen_die "Could not extract suspend binary cache!"
188
	cd "${TEMP}/initramfs-suspend-temp/"
189
	find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_CPIO_DIR}/initramfs-suspend-${SUSPEND_VER}.cpio.gz
190
}
191
176
create_dmraid_cpio(){
192
create_dmraid_cpio(){
177
	# DMRAID
193
	# DMRAID
178
	if [ "${DMRAID}" = '1' ]
194
	if [ "${DMRAID}" = '1' ]
Lines 510-515 merge_initramfs_cpio_archives(){ Link Here
510
	then
526
	then
511
		MERGE_LIST="${MERGE_LIST} initramfs-unionfs-${UNIONFS_VER}-modules-${KV}.cpio.gz"
527
		MERGE_LIST="${MERGE_LIST} initramfs-unionfs-${UNIONFS_VER}-modules-${KV}.cpio.gz"
512
	fi
528
	fi
529
	if [ "${SUSPEND}" -eq '1' -a -e "${CACHE_CPIO_DIR}/initramfs-suspend-${SUSPEND_VER}.cpio.gz" ]
530
	then
531
		MERGE_LIST="${MERGE_LIST} initramfs-suspend-${SUSPEND_VER}.cpio.gz"
532
	fi
513
	if [ "${EVMS2}" -eq '1' -a -e "${CACHE_CPIO_DIR}/initramfs-evms2.cpio.gz" ]
533
	if [ "${EVMS2}" -eq '1' -a -e "${CACHE_CPIO_DIR}/initramfs-evms2.cpio.gz" ]
514
	then
534
	then
515
		MERGE_LIST="${MERGE_LIST} initramfs-evms2.cpio.gz"
535
		MERGE_LIST="${MERGE_LIST} initramfs-evms2.cpio.gz"
Lines 616-621 create_initramfs() { Link Here
616
	    print_info 1 "        >> Creating unionfs tools cpio archive..."
636
	    print_info 1 "        >> Creating unionfs tools cpio archive..."
617
	    create_unionfs_tools_cpio
637
	    create_unionfs_tools_cpio
618
	fi
638
	fi
639
640
	if [ "${SUSPEND}" -eq '1' ]
641
	then
642
	    print_info 1 "        >> Creating suspend cpio archive..."
643
	    create_suspend_cpio
644
	fi
619
	
645
	
620
	if [ "${LVM2}" -eq '1' ]
646
	if [ "${LVM2}" -eq '1' ]
621
	then
647
	then
(-)genkernel-3.4.5/genkernel.8 (+7 lines)
Lines 186-191 Add in LVM2 support from static binaries Link Here
186
or compile static LVM2 binaries if static ones do not exist.
186
or compile static LVM2 binaries if static ones do not exist.
187
.RE
187
.RE
188
.TP
188
.TP
189
\fB\-\-suspend\fR
190
.RS
191
Add support for userspace suspend/resume (uswsusp). This option requires
192
Linux 2.6.17 or newer, \fBsys-power/suspend\fR installed on the host system,
193
and resume configured in \fB/etc/suspend.conf\fR.
194
.RE
195
.TP
189
\fB\-\-no-udev\fR
196
\fB\-\-no-udev\fR
190
Force devfs on 2.6 series kernels. Not recommended or supported.
197
Force devfs on 2.6 series kernels. Not recommended or supported.
191
.TP
198
.TP

Return to bug 156445