Skip to content

Commit

Permalink
Add hooks to genkernel
Browse files Browse the repository at this point in the history
  • Loading branch information
Dissonant-Tech committed Jan 20, 2018
1 parent 5a1db22 commit 9ad33df
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions genkernel
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ then
print_warning "Unable to copy the kernel configuration file."
# Just a warning because ordinary users are not allowed to write in /etc
fi

# Run post kernel build hooks
if [ -e '/etc/kernels/postbuild.d']
then
run-parts /etc/kernels/postbuild.d
fi
fi

if isTrue "${CMD_INSTALL}"
Expand All @@ -248,6 +254,12 @@ then
then
gen_kerncache_extract_kernel
fi

# Run post kernel install hooks
if [ -e '/etc/kernels/postinstall.d']
then
run-parts /etc/kernels/postinstall.d
fi
fi

if [ "${KERNCACHE}" != "" -a "${KERNCACHE_IS_VALID}" != "0" ]
Expand Down Expand Up @@ -370,10 +382,22 @@ then
fi

unset CONFGREP

# Run post initramfs hooks
if [ -e '/etc/kernels/postinitramfs.d']
then
run-parts /etc/kernels/postinitramfs.d
fi
fi

[ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}

# Run post genkernel hooks

This comment has been minimized.

Copy link
@qinq-net

qinq-net Jan 20, 2018

Why should there be a post genkernel hook? It should be easily done by genkernel all && do something or by using a wrapper to call genkernel.

This comment has been minimized.

Copy link
@Dissonant-Tech

Dissonant-Tech Jan 20, 2018

Author Contributor

You're absolutely correct, but I think it is better for completeness.

In the situation where you want both too hook into both a post genkernel hook and any other, it's simpler/cleaner to keep all the config within genkernel.

That being said, I'm not opposed to removing it as not much happens after the postinitramfs hook, though that might not be true forever...

if [ -e '/etc/kernels/postgen.d']
then
run-parts /etc/kernels/postgen.d
fi

echo
print_info 1 'Do NOT report kernel bugs as genkernel bugs unless your bug'
print_info 1 'is about the default genkernel configuration...'
Expand Down

0 comments on commit 9ad33df

Please sign in to comment.