Skip to content

Commit

Permalink
Move to using kernelrelease over kernelversion
Browse files Browse the repository at this point in the history
The names are usually the same, but are not so when there is any
localversion data. See notes in
https://github.com/sakaki-/sakaki-tools/issues/1#issuecomment-279673861
Thanks to tomegathericon for reporting this.

Version bumped to 1.0.20
  • Loading branch information
sakaki- committed Feb 14, 2017
1 parent 1837903 commit 7bd062e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
34 changes: 18 additions & 16 deletions buildkernel
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ shopt -s nullglob
# ********************** variables *********************
PROGNAME="$(basename "${0}")"
CONFFILE="/etc/${PROGNAME}.conf"
VERSION="1.0.19"
VERSION="1.0.20"
ETCPROFILE="/etc/profile"
DEFAULTEFIBOOTFILE="bootx64.efi"
EFIBOOTFILE="${DEFAULTEFIBOOTFILE}"
LINUXDIR="/usr/src/linux"
NEWVERSION="linux-$(cd "${LINUXDIR}" && make -s kernelversion)"
INITRAMFSNAME="$(echo $NEWVERSION | sed "s/linux/initramfs-genkernel-x86_64/g")"
VMLINUZNAME="$(echo $NEWVERSION | sed "s/linux/vmlinuz/g")"
NEWVERSION=""
INITRAMFSNAME=""
VMLINUZNAME=""
CURRENTVERSION="linux-$(uname -r)"
CURRENTCONFIG="/proc/config.gz"
TARGETCONFIG="${LINUXDIR}/.config"
Expand Down Expand Up @@ -263,6 +263,16 @@ read_portage_info_if_necessary() {
PORTAGEINFO="$(emerge --info)"
fi
}
extract_kernel_release_name() {
# extract the kernel release string, and setup the derived strings
# NB we now check kernelrelease, not kernelversion; it is possible that
# the kernelrelease may change during the build (e.g., by a 'clean'
# tagged release directory becoming marked 'dirty', and so having a '+'
# sign appended)
NEWVERSION="linux-$(cd "${LINUXDIR}" && make -s kernelrelease)"
INITRAMFSNAME="$(echo $NEWVERSION | sed "s/linux/initramfs-genkernel-x86_64/")"
VMLINUZNAME="$(echo $NEWVERSION | sed "s/linux/vmlinuz/")"
}
check_gcc_config_and_reset_if_necessary() {
# check if gcc-config exists with an error - if it does, then
# attempt to set one based on the current gcc version number
Expand Down Expand Up @@ -1521,17 +1531,6 @@ enter_build_directory() {
show "Proceeding - entering ${LINUXDIR}..."
cd "${LINUXDIR}"
}
check_if_deblobbing() {
# run in kernel top-level directory
local EV=$(grep "^EXTRAVERSION =" Makefile)
if grep -q "\-gnu$" <<<"${EV}"; then
# we are deblobbing - fix up the initramfs name if necessary
show "Using a deblobbed kernel"
if [[ "${INITRAMFSNAME}" != *-gnu ]]; then
INITRAMFSNAME+="-gnu"
fi
fi
}
copy_config_from_proc_if_necessary () {
if [ ! -s "${TARGETCONFIG}" ]; then
if ((ARG_ASK==1)); then
Expand Down Expand Up @@ -1717,6 +1716,9 @@ create_initramfs_using_genkernel() {
--kernel-config="${TARGETCONFIG}" --busybox \
--no-compress-initramfs ${ADDITIONALGENKERNELOPTS} \
${PLYMOUTH_OPTS} initramfs
# re-extract release details, in case these have changed
# (e.g. due to 'SCM dirty suffix' having been added (a '+' sign))
extract_kernel_release_name
cp ${VERBOSITYFLAG} "${BOOTDIR}/${INITRAMFSNAME}" "${UNCOMPRESSEDINITRAMFS}"
}
unpack_initramfs() {
Expand Down Expand Up @@ -2116,6 +2118,7 @@ process_command_line_options() {

# *************** start of script proper ***************
suppress_colour_and_alert_if_output_not_to_a_terminal
extract_kernel_release_name
check_if_booted_under_efi
find_all_usb_partitions
source_etc_conf_file
Expand All @@ -2126,7 +2129,6 @@ check_gcc_config_and_reset_if_necessary
if_option_unset "ARG_STAGEONLY" ensure_efi_partition_mounted
if ((ARG_COPYFROMSTAGING==0)); then
enter_build_directory
check_if_deblobbing
copy_config_from_proc_if_necessary
conform_config_file
allow_user_to_modify_config_graphically
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH BUILDKERNEL 8 "Version 1.0.19: February 2017"
.TH BUILDKERNEL 8 "Version 1.0.20: February 2017"
.SH NAME
buildkernel \- build secure boot kernel, save to EFI system partition
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion buildkernel.conf.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH BUILDKERNEL 5 "Version 1.0.19: February 2017"
.TH BUILDKERNEL 5 "Version 1.0.20: February 2017"
.SH NAME
buildkernel.conf \- a configuration file for \fBbuildkernel\fR(8)
.SH SYNOPSIS
Expand Down

0 comments on commit 7bd062e

Please sign in to comment.