Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: /
Date: Sun, 03 Sep 2017 05:19:46
Message-Id: 1504415972.03753887d6ea4d9cc7c511d36ff74876a70c0dba.robbat2@gentoo
1 commit: 03753887d6ea4d9cc7c511d36ff74876a70c0dba
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 3 05:19:32 2017 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 3 05:19:32 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=03753887
7
8 bincache: use genkernel version as cache key, to ensure rebuilding initramfs parts on new GK versions.
9
10 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
11
12 gen_determineargs.sh | 37 +++++++++++++++----------------------
13 gen_funcs.sh | 6 +++---
14 2 files changed, 18 insertions(+), 25 deletions(-)
15
16 diff --git a/gen_determineargs.sh b/gen_determineargs.sh
17 index 41fbe63..fe9f85b 100755
18 --- a/gen_determineargs.sh
19 +++ b/gen_determineargs.sh
20 @@ -152,28 +152,21 @@ determine_real_args() {
21 BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
22 MODPROBEDIR=${MODPROBEDIR%/} # Remove any trailing slash
23
24 - CACHE_DIR=`arch_replace "${CACHE_DIR}"`
25 - BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
26 - LVM_BINCACHE=`cache_replace "${LVM_BINCACHE}"`
27 - MDADM_BINCACHE=`cache_replace "${MDADM_BINCACHE}"`
28 - DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"`
29 - ISCSI_BINCACHE=`cache_replace "${ISCSI_BINCACHE}"`
30 - BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
31 - FUSE_BINCACHE=`cache_replace "${FUSE_BINCACHE}"`
32 - UNIONFS_FUSE_BINCACHE=`cache_replace "${UNIONFS_FUSE_BINCACHE}"`
33 - GPG_BINCACHE=`cache_replace "${GPG_BINCACHE}"`
34 -
35 - DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
36 - BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
37 - BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"`
38 - LVM_BINCACHE=`arch_replace "${LVM_BINCACHE}"`
39 - MDADM_BINCACHE=`arch_replace "${MDADM_BINCACHE}"`
40 - DMRAID_BINCACHE=`arch_replace "${DMRAID_BINCACHE}"`
41 - ISCSI_BINCACHE=`arch_replace "${ISCSI_BINCACHE}"`
42 - BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
43 - FUSE_BINCACHE=`arch_replace "${FUSE_BINCACHE}"`
44 - UNIONFS_FUSE_BINCACHE=`arch_replace "${UNIONFS_FUSE_BINCACHE}"`
45 - GPG_BINCACHE=`arch_replace "${GPG_BINCACHE}"`
46 + __VARS_BINCACHE=(
47 + BLKID_BINCACHE
48 + BUSYBOX_BINCACHE
49 + DMRAID_BINCACHE
50 + FUSE_BINCACHE
51 + GPG_BINCACHE
52 + ISCSI_BINCACHE
53 + LVM_BINCACHE
54 + MDADM_BINCACHE
55 + UNIONFS_FUSE_BINCACHE
56 + )
57 + for v in CACHE_DIR BUSYBOX_CONFIG DEFAULT_KERNEL_CONFIG "${__VARS_BINCACHE[@]}"; do
58 + eval "$v='$(arch_replace "${!v}")'"
59 + eval "$v='$(cache_replace "${!v}")'"
60 + done
61
62 if [ -n "${CMD_BOOTLOADER}" ]
63 then
64
65 diff --git a/gen_funcs.sh b/gen_funcs.sh
66 index 6234189..9c9d3d6 100755
67 --- a/gen_funcs.sh
68 +++ b/gen_funcs.sh
69 @@ -184,7 +184,7 @@ arch_replace() {
70 }
71
72 cache_replace() {
73 - var_replace "CACHE" "${CACHE_DIR}" "${1}"
74 + var_replace "CACHE" "${CACHE_DIR}/${GK_V}" "${1}"
75 }
76
77 clear_log() {
78 @@ -239,7 +239,7 @@ isBootRO()
79 setup_cache_dir()
80 {
81
82 -[ ! -d "${CACHE_DIR}" ] && mkdir -p "${CACHE_DIR}"
83 +[ ! -d "${CACHE_DIR}" ] && mkdir -p "${CACHE_DIR}/${GK_V}"
84
85 if [ "${CLEAR_CACHE_DIR}" == 'yes' ]
86 then
87 @@ -248,7 +248,7 @@ then
88 do
89 print_info 1 " >> removing ${i}"
90 rm "${i}"
91 - done < <(find "${CACHE_DIR}" -maxdepth 1 -type f -name '*.tar.*' -o -name '*.bz2')
92 + done < <(find "${CACHE_DIR}" -maxdepth 2 -type f -name '*.tar.*' -o -name '*.bz2')
93 fi
94
95 }