Patch to actually use busybox bincache. Thanks to Pat Double

<gentoo@patdouble.com> on bug #180211

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@519 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Andrew Gaffney 18 years ago
parent 4ccd40b121
commit f10cd4ee6a

@ -2,6 +2,11 @@
# Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2 # Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2
# $Header: $ # $Header: $
26 Jul 2007; Andrew Gaffney <agaffney@gentoo.org> gen_compile.sh,
gen_initramfs.sh, gen_initrd.sh, genkernel.conf:
Patch to actually use busybox bincache. Thanks to Pat Double
<gentoo@patdouble.com> on bug #180211
21 Jun 2007; Chris Gianelloni <wolf31o2@gentoo.org> gen_initrd.sh: 21 Jun 2007; Chris Gianelloni <wolf31o2@gentoo.org> gen_initrd.sh:
Fixed lvm/evms code for initrd generation. Thanks to Vinny Fixed lvm/evms code for initrd generation. Thanks to Vinny
<vfuria@gmail.com> on bug #179480 for pointing it out. <vfuria@gmail.com> on bug #179480 for pointing it out.

@ -427,18 +427,6 @@ compile_unionfs_utils() {
} }
compile_busybox() { compile_busybox() {
# Delete cache if config is newer
if [ \
-f "${BUSYBOX_BINCACHE}" -a \
-f "${BUSYBOX_CONFIG}" -a \
"${BUSYBOX_BINCACHE}" -ot "${BUSYBOX_CONFIG}" ]
then
rm -rf "${BUSYBOX_BINCACHE}"
fi
if [ ! -f "${BUSYBOX_BINCACHE}" ]
then
[ -f "${BUSYBOX_SRCTAR}" ] || [ -f "${BUSYBOX_SRCTAR}" ] ||
gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!" gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!"
[ -f "${BUSYBOX_CONFIG}" ] || [ -f "${BUSYBOX_CONFIG}" ] ||
@ -454,6 +442,23 @@ compile_busybox() {
cd "${BUSYBOX_DIR}" cd "${BUSYBOX_DIR}"
print_info 1 'busybox: >> Configuring...' print_info 1 'busybox: >> Configuring...'
yes '' 2>/dev/null | compile_generic oldconfig utils yes '' 2>/dev/null | compile_generic oldconfig utils
# Delete cache if stored config's MD5 does not match one to be used
if [ -f "${BUSYBOX_BINCACHE}" -a -f "${BUSYBOX_CONFIG}" ]
then
oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config | md5sum)
newconfig_md5=$(md5sum < .config)
if [ "${oldconfig_md5}" != "${newconfig_md5}" ]
then
print_info 1 "busybox: >> Removing stale cache..."
rm -rf "${BUSYBOX_BINCACHE}"
else
print_info 1 "busybox: >> Using cache"
fi
fi
if [ ! -f "${BUSYBOX_BINCACHE}" ]
then
print_info 1 'busybox: >> Compiling...' print_info 1 'busybox: >> Compiling...'
compile_generic all utils compile_generic all utils
print_info 1 'busybox: >> Copying to cache...' print_info 1 'busybox: >> Copying to cache...'
@ -461,14 +466,12 @@ compile_busybox() {
gen_die 'Busybox executable does not exist!' gen_die 'Busybox executable does not exist!'
strip "${TEMP}/${BUSYBOX_DIR}/busybox" || strip "${TEMP}/${BUSYBOX_DIR}/busybox" ||
gen_die 'Could not strip busybox binary!' gen_die 'Could not strip busybox binary!'
bzip2 "${TEMP}/${BUSYBOX_DIR}/busybox" || tar -cj -C "${TEMP}/${BUSYBOX_DIR}" -f "${BUSYBOX_BINCACHE}" busybox .config ||
gen_die 'bzip2 compression of busybox failed!' gen_die 'Could not create the busybox bincache!'
mv "${TEMP}/${BUSYBOX_DIR}/busybox.bz2" "${BUSYBOX_BINCACHE}" || fi
gen_die 'Could not copy the busybox binary to the package directory, does the directory exist?'
cd "${TEMP}" cd "${TEMP}"
rm -rf "${BUSYBOX_DIR}" > /dev/null rm -rf "${BUSYBOX_DIR}" > /dev/null
fi
} }
compile_lvm2() { compile_lvm2() {

@ -50,10 +50,10 @@ append_busybox() {
cp "${GK_SHARE}/generic/udhcpc.scripts" ${TEMP}/initramfs-busybox-temp/bin/ cp "${GK_SHARE}/generic/udhcpc.scripts" ${TEMP}/initramfs-busybox-temp/bin/
chmod +x "${TEMP}/initramfs-busybox-temp/bin/udhcpc.scripts" chmod +x "${TEMP}/initramfs-busybox-temp/bin/udhcpc.scripts"
cp "${BUSYBOX_BINCACHE}" "${TEMP}/initramfs-busybox-temp/bin/busybox.bz2" || cp "${BUSYBOX_BINCACHE}" "${TEMP}/initramfs-busybox-temp/bin/busybox.tar.bz2" ||
gen_die 'Could not copy busybox from bincache!' gen_die 'Could not copy busybox from bincache!'
bunzip2 "${TEMP}/initramfs-busybox-temp/bin/busybox.bz2" || tar -xjf "${TEMP}/initramfs-busybox-temp/bin/busybox.tar.bz2" -C "${TEMP}/initramfs-busybox-temp/bin" busybox ||
gen_die 'Could not uncompress busybox!' gen_die 'Could not extract busybox bincache!'
chmod +x "${TEMP}/initramfs-busybox-temp/bin/busybox" chmod +x "${TEMP}/initramfs-busybox-temp/bin/busybox"
# down devfsd we use with dietlibc # down devfsd we use with dietlibc

@ -80,10 +80,10 @@ create_base_initrd_sys() {
chmod +x "${TEMP}/initrd-temp/bin/blkid" chmod +x "${TEMP}/initrd-temp/bin/blkid"
fi fi
cp "${BUSYBOX_BINCACHE}" "${TEMP}/initrd-temp/bin/busybox.bz2" || cp "${BUSYBOX_BINCACHE}" "${TEMP}/initrd-temp/bin/busybox.tar.bz2" ||
gen_die 'Could not copy busybox from bincache!' gen_die 'Could not copy busybox from bincache!'
bunzip2 "${TEMP}/initrd-temp/bin/busybox.bz2" || tar -xjf "${TEMP}/initrd-temp/bin/busybox.tar.bz2" -C "${TEMP}/initrd-temp/bin" busybox ||
gen_die 'Could not uncompress busybox!' gen_die 'Could not extract busybox bincache!'
chmod +x "${TEMP}/initrd-temp/bin/busybox" chmod +x "${TEMP}/initrd-temp/bin/busybox"
if [ "${NOINITRDMODULES}" = '' ] if [ "${NOINITRDMODULES}" = '' ]

@ -86,7 +86,7 @@ BUSYBOX_CONFIG="${GK_SHARE}/%%ARCH%%/busy-config"
BUSYBOX_VER="1.1.3+gentoo" BUSYBOX_VER="1.1.3+gentoo"
# Busybox bin-cache location, to store pre-compiled busybox # Busybox bin-cache location, to store pre-compiled busybox
# binary is just a bzip2 busybox executable # binary is just a bzip2 busybox executable
BUSYBOX_BINCACHE="%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.bz2" BUSYBOX_BINCACHE="%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2"
# Location of BusyBox source tarball # Location of BusyBox source tarball
BUSYBOX_SRCTAR="${GK_SHARE}/pkg/busybox-${BUSYBOX_VER}.tar.bz2" BUSYBOX_SRCTAR="${GK_SHARE}/pkg/busybox-${BUSYBOX_VER}.tar.bz2"
# Directory created after busybox tarball is extracted # Directory created after busybox tarball is extracted

Loading…
Cancel
Save