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: Mon, 23 Jun 2014 22:06:47
Message-Id: 1403561118.ba88b2e852c94222437dc9567d15942210ef5b6f.robbat2@gentoo
1 commit: ba88b2e852c94222437dc9567d15942210ef5b6f
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 23 21:58:31 2014 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 23 22:05:18 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=ba88b2e8
7
8 gen_package: packaged kernel/initramfs name fixes
9
10 Previous commit 76e801c8 did not actually go far enough.
11
12 The existing install from kerncache code that is normally used with
13 passing --install used a form of kernel-${KNAME}-${ARCH}-${KV}.
14
15 Instead of just the kernel-${ARCH}-${KV} we were using in commit
16 76e801c8, or kernel-${KV} that we used before that, let's use the same
17 naming per the regular path.
18
19 Also add safety checks that the kernels exist, as you could get an empty
20 tarball otherwise!
21
22 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
23
24 ---
25 gen_package.sh | 23 ++++++++++++++++++-----
26 1 file changed, 18 insertions(+), 5 deletions(-)
27
28 diff --git a/gen_package.sh b/gen_package.sh
29 index 1a9068a..9dd166b 100755
30 --- a/gen_package.sh
31 +++ b/gen_package.sh
32 @@ -8,10 +8,18 @@ gen_minkernpackage() {
33 if [ "${KERNCACHE}" != "" ]
34 then
35 /bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} kernel-${ARCH}-${KV}
36 + mv minkernpackage/{kernel-${ARCH}-${KV},kernel-${KNAME}-${ARCH}-${KV}}
37 /bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} config-${ARCH}-${KV}
38 + mv minkernpackage/{config-${ARCH}-${KV},config-${KNAME}-${ARCH}-${KV}}
39 if isTrue "${GENZIMAGE}"
40 then
41 /bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} kernelz-${ARCH}-${KV}
42 + mv minkernpackage/{kernelz-${ARCH}-${KV},kernelz-${KNAME}-${ARCH}-${KV}}
43 + fi
44 + if [ ! -f minkernpackage/kernel-${KNAME}-${ARCH}-${KV} \
45 + -o ! -f minkernpackage/config-${KNAME}-${ARCH}-${KV} ];
46 + then
47 + gen_die "Cannot locate kernel binary"
48 fi
49 else
50 local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY})
51 @@ -21,24 +29,29 @@ gen_minkernpackage() {
52 gen_die "Cannot locate kernel binary"
53 fi
54 cd "${KERNEL_OUTPUTDIR}"
55 - cp "${tmp_kernel_binary}" "${TEMP}/minkernpackage/kernel-${ARCH}-${KV}" || gen_die 'Could not the copy kernel for the min kernel package!'
56 - cp ".config" "${TEMP}/minkernpackage/config-${ARCH}-${KV}" || gen_die 'Could not the copy kernel config for the min kernel package!'
57 + cp "${tmp_kernel_binary}" "${TEMP}/minkernpackage/kernel-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not the copy kernel for the min kernel package!'
58 + cp ".config" "${TEMP}/minkernpackage/config-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not the copy kernel config for the min kernel package!'
59 if isTrue "${GENZIMAGE}"
60 then
61 - cp "${tmp_kernel_binary2}" "${TEMP}/minkernpackage/kernelz-${ARCH}-${KV}" || gen_die "Could not copy the kernelz for the min kernel package"
62 + cp "${tmp_kernel_binary2}" "${TEMP}/minkernpackage/kernelz-${KNAME}-${ARCH}-${KV}" || gen_die "Could not copy the kernelz for the min kernel package"
63 fi
64 fi
65
66 if ! isTrue "${INTEGRATED_INITRAMFS}"
67 then
68 - [ "${BUILD_RAMDISK}" != '0' ] && { cp "${TMPDIR}/initramfs-${KV}" "${TEMP}/minkernpackage/initramfs-${ARCH}-${KV}" || gen_die 'Could not copy the initramfs for the kernel package!'; }
69 + [ "${BUILD_RAMDISK}" != '0' ] && { cp "${TMPDIR}/initramfs-${KV}" "${TEMP}/minkernpackage/initramfs-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy the initramfs for the kernel package!'; }
70 fi
71
72 if [ "${KERNCACHE}" != "" ]
73 then
74 /bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} System.map-${ARCH}-${KV}
75 + mv minkernpackage/{System.map-${ARCH}-${KV},System.map-${KNAME}-${ARCH}-${KV}}
76 + if [ ! -f System.map-${KNAME}-${ARCH}-${KV} ]
77 + then
78 + gen_die 'Could not copy System.map from kerncache for the kernel package!'
79 + fi
80 else
81 - cp "${KERNEL_OUTPUTDIR}/System.map" "${TEMP}/minkernpackage/System.map-${ARCH}-${KV}" || gen_die 'Could not copy System.map for the kernel package!';
82 + cp "${KERNEL_OUTPUTDIR}/System.map" "${TEMP}/minkernpackage/System.map-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy System.map for the kernel package!';
83 fi
84
85 cd "${TEMP}/minkernpackage"