--- gen_compile.sh (revision 508) +++ gen_compile.sh (working copy) @@ -427,14 +427,16 @@ } compile_busybox() { - - # Delete cache if config is newer - if [ \ - -f "${BUSYBOX_BINCACHE}" -a \ - -f "${BUSYBOX_CONFIG}" -a \ - "${BUSYBOX_BINCACHE}" -ot "${BUSYBOX_CONFIG}" ] + # Delete cache if stored config's MD5 does not match one to be used + if [ -f "${BUSYBOX_BINCACHE}" -a -f "${BUSYBOX_CONFIG}" ] then - rm -rf "${BUSYBOX_BINCACHE}" + oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config | md5sum) + newconfig_md5=$(md5sum < "${BUSYBOX_CONFIG}") + if [ "${oldconfig_md5}" != "${newconfig_md5}" ] + then + print_info 1 "busybox: >> Removing stale cache..." + rm -rf "${BUSYBOX_BINCACHE}" + fi fi if [ ! -f "${BUSYBOX_BINCACHE}" ] @@ -461,10 +463,8 @@ gen_die 'Busybox executable does not exist!' strip "${TEMP}/${BUSYBOX_DIR}/busybox" || gen_die 'Could not strip busybox binary!' - bzip2 "${TEMP}/${BUSYBOX_DIR}/busybox" || - gen_die 'bzip2 compression of busybox failed!' - mv "${TEMP}/${BUSYBOX_DIR}/busybox.bz2" "${BUSYBOX_BINCACHE}" || - gen_die 'Could not copy the busybox binary to the package directory, does the directory exist?' + tar -cj -C "${TEMP}/${BUSYBOX_DIR}" -f "${BUSYBOX_BINCACHE}" busybox .config || + gen_die 'Could not create the busybox bincache!' cd "${TEMP}" rm -rf "${BUSYBOX_DIR}" > /dev/null --- gen_initrd.sh (revision 508) +++ gen_initrd.sh (working copy) @@ -80,10 +80,10 @@ chmod +x "${TEMP}/initrd-temp/bin/blkid" 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!' - bunzip2 "${TEMP}/initrd-temp/bin/busybox.bz2" || - gen_die 'Could not uncompress busybox!' + tar -xjf "${TEMP}/initrd-temp/bin/busybox.tar.bz2" -C "${TEMP}/initrd-temp/bin/busybox.tar.bz2" busybox || + gen_die 'Could not extract busybox bincache!' chmod +x "${TEMP}/initrd-temp/bin/busybox" if [ "${NOINITRDMODULES}" = '' ] --- genkernel.conf (revision 508) +++ genkernel.conf (working copy) @@ -75,7 +75,7 @@ BUSYBOX_VER="1.1.3+gentoo" # Busybox bin-cache location, to store pre-compiled busybox # 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 BUSYBOX_SRCTAR="${GK_SHARE}/pkg/busybox-${BUSYBOX_VER}.tar.bz2" # Directory created after busybox tarball is extracted --- gen_initramfs.sh (revision 508) +++ gen_initramfs.sh (working copy) @@ -50,10 +50,10 @@ cp "${GK_SHARE}/generic/udhcpc.scripts" ${TEMP}/initramfs-busybox-temp/bin/ 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!' - bunzip2 "${TEMP}/initramfs-busybox-temp/bin/busybox.bz2" || - gen_die 'Could not uncompress busybox!' + tar -xjf "${TEMP}/initramfs-busybox-temp/bin/busybox.tar.bz2" -C "${TEMP}/initramfs-busybox-temp/bin/busybox.tar.bz2" busybox || + gen_die 'Could not extract busybox bincache!' chmod +x "${TEMP}/initramfs-busybox-temp/bin/busybox" # down devfsd we use with dietlibc