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

(-)/i686/usr/share/genkernel/gen_initramfs.sh (+15 lines)
Lines 317-322 Link Here
317
	done
317
	done
318
}
318
}
319
319
320
# check for static linked file with objdump
321
is_static() {
322
	objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
323
	return $?
324
}
325
320
create_initramfs_modules() {
326
create_initramfs_modules() {
321
	local group
327
	local group
322
	local group_modules
328
	local group_modules
Lines 368-373 Link Here
368
	fi
374
	fi
369
	mkdir -p "${TEMP}/initramfs-aux-temp/etc"	
375
	mkdir -p "${TEMP}/initramfs-aux-temp/etc"	
370
	mkdir -p "${TEMP}/initramfs-aux-temp/sbin"	
376
	mkdir -p "${TEMP}/initramfs-aux-temp/sbin"	
377
	mkdir -p "${TEMP}/initramfs-aux-temp/bin"
371
	if [ -f "${CMD_LINUXRC}" ]
378
	if [ -f "${CMD_LINUXRC}" ]
372
	then
379
	then
373
		cp "${CMD_LINUXRC}" "${TEMP}/initramfs-aux-temp/init"
380
		cp "${CMD_LINUXRC}" "${TEMP}/initramfs-aux-temp/init"
Lines 430-435 Link Here
430
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
437
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
431
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
438
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
432
	chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
439
	chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
440
441
	if [ "${LUKS}" = '1' ] 
442
        then 
443
            is_static /bin/cryptsetup || gen_die "LUKS support requires static cryptsetup-luks. USE=-dynamic emerge cryptsetup-luks"
444
            rm -f ${TEMP}/initramfs-aux-temp/bin/cryptsetup
445
            cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/bin/cryptsetup
446
        fi
447
433
	cd "${TEMP}/initramfs-aux-temp/"
448
	cd "${TEMP}/initramfs-aux-temp/"
434
	find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz
449
	find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz
435
	rm -r "${TEMP}/initramfs-aux-temp/"	
450
	rm -r "${TEMP}/initramfs-aux-temp/"	
(-)/i686/usr/share/genkernel/gen_initrd.sh (+14 lines)
Lines 1-5 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
2
3
# check for static linked file with objdump
4
is_static() {
5
	objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
6
	return $?
7
}
8
3
# create_initrd_loop(size)
9
# create_initrd_loop(size)
4
create_initrd_loop() {
10
create_initrd_loop() {
5
	local inodes
11
	local inodes
Lines 212-217 Link Here
212
		ln  ${TEMP}/initrd-temp/bin/busybox ${TEMP}/initrd-temp/bin/$i ||
218
		ln  ${TEMP}/initrd-temp/bin/busybox ${TEMP}/initrd-temp/bin/$i ||
213
			gen_die "Busybox error: could not link ${i}!"
219
			gen_die "Busybox error: could not link ${i}!"
214
	done
220
	done
221
222
	# LUKS
223
	if [ "${LUKS}" = '1' ] 
224
	then
225
		is_static /bin/cryptsetup || gen_die "LUKS support requires static cryptsetup-luks. USE=-dynamic emerge cryptsetup-luks"
226
		rm -f ${TEMP}/initramfs-aux-temp/bin/cryptsetup
227
		cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/bin/cryptsetup
228
	fi
215
}
229
}
216
230
217
print_list()
231
print_list()
(-)/i686/usr/share/genkernel/generic/linuxrc (+19 lines)
Lines 385-390 Link Here
385
		elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
385
		elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
386
		then
386
		then
387
			got_good_root=1
387
			got_good_root=1
388
		elif [ `echo ${REAL_ROOT} | sed -e "s/\([^:]*\):.*/\1/"` = "luks" ]
389
		then
390
		    LUKSdev=`echo ${REAL_ROOT} | sed -e "s/luks:\(.*\)/\1/"`
391
		    if [ -e /bin/cryptsetup ]
392
                    then
393
			if cryptsetup isLuks ${LUKSdev}
394
			then
395
			    echo "LUKS partition - opening $LUKSdev"
396
			    cryptsetup luksOpen ${LUKSdev} root &&
397
			    REAL_ROOT=/dev/mapper/root &&
398
			    got_good_root=1
399
			else
400
			    echo "${LUKSDEV} is not a LUKS partition"
401
			    REAL_ROOT=""
402
			fi
403
		    else
404
			echo "This initrd does not support LUKS"
405
			REAL_ROOT=""
406
		    fi
388
		else
407
		else
389
			bad_msg "Block device ${REAL_ROOT} is not a valid root device..."
408
			bad_msg "Block device ${REAL_ROOT} is not a valid root device..."
390
			REAL_ROOT=""
409
			REAL_ROOT=""
(-)/tmp/genkernel.conf (+3 lines)
Lines 33-38 Link Here
33
# Add new kernel to grub?
33
# Add new kernel to grub?
34
# BOOTLOADER="grub"
34
# BOOTLOADER="grub"
35
35
36
# Add LUKS support?
37
LUKS="1"
38
36
# Add UDEV support?
39
# Add UDEV support?
37
UDEV="1"
40
UDEV="1"
38
41

Return to bug 123305