aboutsummaryrefslogtreecommitdiff
path: root/bin/kbuild
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-07-01 10:07:25 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-07-01 15:37:24 +0200
commit314ba5c8986fac39f5c291faf393cc805b1a6583 (patch)
tree2a2ad37b0509541d935bc8c114a460f4aff9728d /bin/kbuild
parent55410fe96acc421796279595be18cff20005f079 (diff)
downloaddotfiles-314ba5c8986fac39f5c291faf393cc805b1a6583.tar.gz
dotfiles-314ba5c8986fac39f5c291faf393cc805b1a6583.zip
kbuild: add the '--list-profiles' option
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'bin/kbuild')
-rwxr-xr-xbin/kbuild30
1 files changed, 15 insertions, 15 deletions
diff --git a/bin/kbuild b/bin/kbuild
index 7253d5f..481abad 100755
--- a/bin/kbuild
+++ b/bin/kbuild
@@ -24,14 +24,8 @@
# 4. Copy into a tarball the resulting image, modules, dtbs, and headers. Two
# scripts are bundled in: install.sh and uninstall.sh.
#
-# You can also pass some options:
-# 1. `--skip-config`: tell to skip the call to `defconfig` and/or
-# `menuconfig`. This is useful if you are just developing over the same
-# `.config` file again and again.
-# 2. `--skip-install`: don't generate the install/uninstall files.
-# 3. `-p/--profile`: the kind of machine you are building the kernel for.
-# 4. `-l/--local`: this is a local build, just generate install/uninstall scripts.
-# 5. `-h/--help`: show the help message.
+# You can also pass some additional options, check the -h/--help message to read
+# more about them.
#
# After that just send the resulting tarball to the machine where you want to
# install this kernel. In there you just need to untar the given bundle and then
@@ -47,6 +41,14 @@
set -e
+KBUILD_CONFIG_PATH="$HOME/.config/kbuild"
+
+# Helper function to list the available profiles in the system.
+list_available_profiles() {
+ dirs="$(find $KBUILD_CONFIG_PATH/ -mindepth 1 -maxdepth 1 -type d -printf '%P\n' | sort | awk '{printf "%s%s", (NR==1?"":", "), $0} END {print ""}')"
+ echo "kbuild (info): available profiles: $dirs."
+}
+
##
# Arguments that can be passed.
@@ -73,6 +75,10 @@ while [[ $# -gt 0 ]]; do
IS_LOCAL=1
shift
;;
+ --list-profiles)
+ list_available_profiles
+ exit 0
+ ;;
-h | --help)
SHOW_HELP=1
shift
@@ -99,6 +105,7 @@ following options:
-h, --help Show this message.
-p, --profile The profile to be picked up.
-l, --local This is a local build, just generate install/uninstall files.
+ --list-profiles List the profiles that are available on the system.
--skip-install Don't generate the install/uninstall files.
--skip-config Skip the configuration step.
HERE
@@ -108,19 +115,12 @@ fi
##
# Profile select.
-KBUILD_CONFIG_PATH="$HOME/.config/kbuild"
-
# If the configuration directory doesn't exist, create it now.
if [ ! -d "$KBUILD_CONFIG_PATH" ]; then
echo "kbuild (info): creating the '$KBUILD_CONFIG_PATH' directory."
mkdir -p $KBUILD_CONFIG_PATH
fi
-list_available_profiles() {
- dirs="$(find $KBUILD_CONFIG_PATH/ -mindepth 1 -maxdepth 1 -type d -printf '%P\n' | sort | awk '{printf "%s%s", (NR==1?"":", "), $0} END {print ""}')"
- echo "kbuild (info): available profiles: $dirs."
-}
-
if [ -z "$PROFILE" ]; then
echo "kbuild (error): you have to provide a profile."
list_available_profiles