Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: /
Date: Sat, 01 Aug 2020 21:41:56
Message-Id: 1596314915.3cf52d4eacdde88edce23e96262d8870f65dccb8.whissi@gentoo
1 commit: 3cf52d4eacdde88edce23e96262d8870f65dccb8
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 1 18:58:14 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 1 20:48:35 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3cf52d4e
7
8 genkernel: Fail if we cannot save kernel config
9
10 Now that we check in determine_real_args() if we can write into /etc/kernels
11 or bail out early in case we cannot but --save-config was set, we can be
12 more explicit and fail now in case we failed to save kernel config.
13
14 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
15
16 genkernel | 13 +++++++++----
17 1 file changed, 9 insertions(+), 4 deletions(-)
18
19 diff --git a/genkernel b/genkernel
20 index b601eb0..efa4360 100755
21 --- a/genkernel
22 +++ b/genkernel
23 @@ -263,10 +263,15 @@ then
24 if isTrue "${SAVE_CONFIG}"
25 then
26 print_info 1 "$(get_indent 1)>> Saving config of successful build to '/etc/kernels/${GK_FILENAME_CONFIG}' ..."
27 - [ ! -e '/etc/kernels' ] && mkdir -p /etc/kernels
28 - cp "${KERNEL_OUTPUTDIR}/.config" "/etc/kernels/${GK_FILENAME_CONFIG}" || \
29 - print_warning 1 "Unable to copy the kernel configuration file; Ignoring non-fatal error ..."
30 - # Just a warning because ordinary users are not allowed to write in /etc
31 +
32 + if [ ! -d '/etc/kernels' ]
33 + then
34 + mkdir -p /etc/kernels \
35 + || gen_die "Failed to create '/etc/kernels'!"
36 + fi
37 +
38 + cp -aL "${KERNEL_OUTPUTDIR}/.config" "/etc/kernels/${GK_FILENAME_CONFIG}" \
39 + || gen_die "Failed to copy kernel configuration to '/etc/kernels'!"
40 fi
41 elif [[ -n "${KERNEL_LOCALVERSION}" && "${KERNEL_LOCALVERSION}" != "${LOV}" ]]
42 then