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

Collapse All | Expand All

(-)a/gen_initramfs.sh (-8 / +26 lines)
Lines 575-581 create_initramfs() { Link Here
575
	print_info 1 "initramfs: >> Initializing..."
575
	print_info 1 "initramfs: >> Initializing..."
576
576
577
	# Create empty cpio
577
	# Create empty cpio
578
	CPIO="${TMPDIR}/initramfs-${KV}"
578
	CPIO="${TMPDIR}/initramfs-${KV}.cpio"
579
	echo | cpio ${CPIO_ARGS} -F "${CPIO}" 2>/dev/null \
579
	echo | cpio ${CPIO_ARGS} -F "${CPIO}" 2>/dev/null \
580
		|| gen_die "Could not create empty cpio at ${CPIO}"
580
		|| gen_die "Could not create empty cpio at ${CPIO}"
581
581
Lines 613-628 create_initramfs() { Link Here
613
		append_data 'overlay'
613
		append_data 'overlay'
614
	fi
614
	fi
615
615
616
	gzip -9 "${CPIO}"
616
	# handle the last image
617
	mv -f "${CPIO}.gz" "${CPIO}"
618
619
	if isTrue "${INTEGRATED_INITRAMFS}"
617
	if isTrue "${INTEGRATED_INITRAMFS}"
620
	then
618
	then
621
#		cp ${TMPDIR}/initramfs-${KV} ${KERNEL_DIR}/usr/initramfs_data.cpio.gz
619
		# put in kernel, here we should put CPIO
622
		mv ${TMPDIR}/initramfs-${KV} ${TMPDIR}/initramfs-${KV}.cpio.gz
623
#		sed -i "s|^.*CONFIG_INITRAMFS_SOURCE=.*$|CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"|" ${KERNEL_DIR}/.config
624
		sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' ${KERNEL_DIR}/.config
620
		sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' ${KERNEL_DIR}/.config
625
		echo -e "CONFIG_INITRAMFS_SOURCE=\"${TMPDIR}/initramfs-${KV}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" >> ${KERNEL_DIR}/.config
621
		echo -e "CONFIG_INITRAMFS_SOURCE=\"${CPIO}\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" >> ${KERNEL_DIR}/.config
622
	else
623
		# compress using the best way
624
		print_info 1 "        >> compressing the initrd " False
625
		if `grep -q '^CONFIG_RD_LZMA=y' ${KERNEL_DIR}/.config` && test -f /usr/bin/lzma
626
		then
627
			print_info 1 "using lzma..." True False
628
			/usr/bin/lzma -z -f -9 ${CPIO}
629
			mv "${CPIO}.lzma" "${CPIO%%.cpio}"
630
		elif `grep -q '^CONFIG_RD_BZIP2=y' ${KERNEL_DIR}/.config` && test -f /bin/bzip2
631
		then
632
			print_info 1 "using bzip2..." True False
633
			/bin/bzip2 -z -f -9 ${CPIO}
634
			mv "${CPIO}.bz2" "${CPIO%%.cpio}"
635
		elif `grep -q '^CONFIG_RD_GZIP=y' ${KERNEL_DIR}/.config` && test -f /bin/gzip
636
		then
637
			print_info 1 "using gzip..." True False
638
			/bin/gzip -z -f -9 ${CPIO}
639
			mv "${CPIO}.gz" "${CPIO%%.cpio}"
640
		else
641
			print_info 1 "--not compressed!" True False
642
			mv "${CPIO}" "${CPIO%%.cpio}"
643
		fi
626
	fi
644
	fi
627
645
628
	if ! isTrue "${CMD_NOINSTALL}"
646
	if ! isTrue "${CMD_NOINSTALL}"

Return to bug 279570