Patch for bug #57867 adding --cachedir=<dir> by Martin Parm.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@123 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Tim Yamin 21 years ago
parent 8a77def484
commit 5a3ac05d80

@ -61,8 +61,9 @@ longusage() {
echo " --no-lvm2 Don't add in LVM2 support." echo " --no-lvm2 Don't add in LVM2 support."
echo " --bootloader=grub Add new kernel to GRUB configuration" echo " --bootloader=grub Add new kernel to GRUB configuration"
echo " Internals" echo " Internals"
echo " --tempdir=<dir> Location of Genkernel's temporary directory"
echo " --arch-override=<arch> Force to arch instead of autodetect" echo " --arch-override=<arch> Force to arch instead of autodetect"
echo " --cachedir=<dir> Override the default cache location"
echo " --tempdir=<dir> Location of Genkernel's temporary directory"
echo " Output Settings" echo " Output Settings"
echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:" echo " --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
echo " No modules outside of the initrd will be" echo " No modules outside of the initrd will be"
@ -278,6 +279,10 @@ parse_cmdline() {
CMD_INSTALL_MOD_PATH=`parse_opt "$*"` CMD_INSTALL_MOD_PATH=`parse_opt "$*"`
print_info 2 "CMD_INSTALL_MOD_PATH: $CMD_INSTALL_MOD_PATH" print_info 2 "CMD_INSTALL_MOD_PATH: $CMD_INSTALL_MOD_PATH"
;; ;;
--cachedir*)
CACHE_DIR=`parse_opt "$*"`
print_info 2 "CACHE_DIR: $CACHE_DIR"
;;
--minkernpackage*) --minkernpackage*)
CMD_MINKERNPACKAGE=`parse_opt "$*"` CMD_MINKERNPACKAGE=`parse_opt "$*"`
print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE" print_info 2 "MINKERNPACKAGE: $CMD_MINKERNPACKAGE"

@ -82,6 +82,17 @@ determine_real_args() {
UTILS_AS="${CMD_UTILS_AS}" UTILS_AS="${CMD_UTILS_AS}"
fi fi
CACHE_DIR=`arch_replace "${CACHE_DIR}"`
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
MODULE_INIT_TOOLS_BINCACHE=`cache_replace "${MODULE_INIT_TOOLS_BINCACHE}"`
MODUTILS_BINCACHE=`cache_replace "${MODUTILS_BINCACHE}"`
DIETLIBC_BINCACHE=`cache_replace "${DIETLIBC_BINCACHE}"`
DIETLIBC_BINCACHE_TEMP=`cache_replace "${DIETLIBC_BINCACHE_TEMP}"`
DEVFSD_BINCACHE=`cache_replace "${DEVFSD_BINCACHE}"`
DEVFSD_CONF_BINCACHE=`cache_replace "${DEVFSD_CONF_BINCACHE}"`
UDEV_BINCACHE=`cache_replace "${UDEV_BINCACHE}"`
DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"` BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"` BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"`

@ -170,13 +170,23 @@ print_warning()
var_replace() var_replace()
{ {
echo "${3}" | sed -e "s/%%${1}%%/${2}/g" - # Escape '\' and '.' in $2 to make it safe to use
# in the later sed expression
local SAFE_VAR
SAFE_VAR=`echo "${2}" | sed -e 's/\([\/\.]\)/\\\\\\1/g'`
echo "${3}" | sed -e "s/%%${1}%%/${SAFE_VAR}/g" -
echo "${3}" | sed -e "s/%%${1}%%/${SAFE_VAR}/g" >> /tmp/out
} }
arch_replace() { arch_replace() {
var_replace "ARCH" "${ARCH}" "${1}" var_replace "ARCH" "${ARCH}" "${1}"
} }
cache_replace() {
var_replace "CACHE" "${CACHE_DIR}" "${1}"
}
clear_log() { clear_log() {
[ -f "${DEBUGFILE}" ] && echo > "${DEBUGFILE}" [ -f "${DEBUGFILE}" ] && echo > "${DEBUGFILE}"
} }

@ -50,6 +50,7 @@ source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}"
source ${GK_SHARE}/${ARCH}/modules_load || gen_die "Could not read ${GK_SHARE}/${ARCH}/modules_load" source ${GK_SHARE}/${ARCH}/modules_load || gen_die "Could not read ${GK_SHARE}/${ARCH}/modules_load"
[ ! -f "${TEMP}" ] && mkdir -p "${TEMP}" [ ! -f "${TEMP}" ] && mkdir -p "${TEMP}"
[ ! -f "${CACHE_DIR}" ] && mkdir -p "${CACHE_DIR}"
# Based on genkernel.conf, arch-specific configs, and commandline options, # Based on genkernel.conf, arch-specific configs, and commandline options,
# get the real arguments for usage... # get the real arguments for usage...

@ -36,6 +36,7 @@ USECOLOR="yes"
# =========GENKERNEL LOCATION CONFIGURATION============ # =========GENKERNEL LOCATION CONFIGURATION============
# Variables: # Variables:
# %%ARCH%% - Final determined architecture # %%ARCH%% - Final determined architecture
# %%CACHE%% - Final determined cache location
# Default share directory location # Default share directory location
GK_SHARE="/usr/share/genkernel" GK_SHARE="/usr/share/genkernel"
@ -43,6 +44,8 @@ GK_SHARE="/usr/share/genkernel"
# Location of helper-scripts # Location of helper-scripts
#GK_BIN="${GK_SHARE}/bin" #GK_BIN="${GK_SHARE}/bin"
GK_BIN="${GK_SHARE}" GK_BIN="${GK_SHARE}"
# Location of the default cache
CACHE_DIR="${GK_SHARE}/pkg/%%ARCH%%"
# Log output file # Log output file
DEBUGFILE="/var/log/genkernel.log" DEBUGFILE="/var/log/genkernel.log"
# Debug Level # Debug Level
@ -59,7 +62,7 @@ BUSYBOX_CONFIG="${GK_SHARE}/%%ARCH%%/busy-config"
BUSYBOX_VER="1.00-pre7-losetup-crypto-alpha" BUSYBOX_VER="1.00-pre7-losetup-crypto-alpha"
# 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="${GK_SHARE}/pkg/%%ARCH%%/busybox-${BUSYBOX_VER}-%%ARCH%%.bz2" BUSYBOX_BINCACHE="%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.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
@ -68,26 +71,26 @@ BUSYBOX_DIR="busybox-${BUSYBOX_VER}"
MODULE_INIT_TOOLS_VER="0.9.15-pre4" MODULE_INIT_TOOLS_VER="0.9.15-pre4"
MODULE_INIT_TOOLS_SRCTAR="${GK_SHARE}/pkg/module-init-tools-${MODULE_INIT_TOOLS_VER}.tar.bz2" MODULE_INIT_TOOLS_SRCTAR="${GK_SHARE}/pkg/module-init-tools-${MODULE_INIT_TOOLS_VER}.tar.bz2"
MODULE_INIT_TOOLS_DIR="module-init-tools-${MODULE_INIT_TOOLS_VER}" MODULE_INIT_TOOLS_DIR="module-init-tools-${MODULE_INIT_TOOLS_VER}"
MODULE_INIT_TOOLS_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/insmod-%%ARCH%%-static-2.6.bz2" MODULE_INIT_TOOLS_BINCACHE="%%CACHE%%/insmod-%%ARCH%%-static-2.6.bz2"
MODUTILS_VER="2.4.26" MODUTILS_VER="2.4.26"
MODUTILS_SRCTAR="${GK_SHARE}/pkg/modutils-${MODUTILS_VER}.tar.bz2" MODUTILS_SRCTAR="${GK_SHARE}/pkg/modutils-${MODUTILS_VER}.tar.bz2"
MODUTILS_DIR="modutils-${MODUTILS_VER}" MODUTILS_DIR="modutils-${MODUTILS_VER}"
MODUTILS_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/insmod-%%ARCH%%-static-2.4.bz2" MODUTILS_BINCACHE="%%CACHE%%/insmod-%%ARCH%%-static-2.4.bz2"
DIETLIBC_VER="0.24" DIETLIBC_VER="0.24"
DIETLIBC_SRCTAR="${GK_SHARE}/pkg/dietlibc-${DIETLIBC_VER}.tar.bz2" DIETLIBC_SRCTAR="${GK_SHARE}/pkg/dietlibc-${DIETLIBC_VER}.tar.bz2"
DIETLIBC_DIR="dietlibc-${DIETLIBC_VER}" DIETLIBC_DIR="dietlibc-${DIETLIBC_VER}"
DIETLIBC_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%.tar.bz2" DIETLIBC_BINCACHE="%%CACHE%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%.tar.bz2"
DIETLIBC_BINCACHE_TEMP="${GK_SHARE}/pkg/%%ARCH%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%-tempdir" DIETLIBC_BINCACHE_TEMP="%%CACHE%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%-tempdir"
DEVFSD_VER="1.3.25-dietlibc-kernel25" DEVFSD_VER="1.3.25-dietlibc-kernel25"
DEVFSD_SRCTAR="${GK_SHARE}/pkg/devfsd-${DEVFSD_VER}.tar.bz2" DEVFSD_SRCTAR="${GK_SHARE}/pkg/devfsd-${DEVFSD_VER}.tar.bz2"
DEVFSD_DIR="devfsd" DEVFSD_DIR="devfsd"
DEVFSD_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2" DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2"
DEVFSD_CONF_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2" DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2"
UDEV_VER="030" UDEV_VER="030"
UDEV_DIR="udev-${UDEV_VER}" UDEV_DIR="udev-${UDEV_VER}"
UDEV_SRCTAR="${GK_SHARE}/pkg/udev-${UDEV_VER}.tar.bz2" UDEV_SRCTAR="${GK_SHARE}/pkg/udev-${UDEV_VER}.tar.bz2"
UDEV_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/udev-${UDEV_VER}-%%ARCH%%.tar.bz2" UDEV_BINCACHE="%%CACHE%%/udev-${UDEV_VER}-%%ARCH%%.tar.bz2"

Loading…
Cancel
Save