summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2013-11-27 19:30:04 +0100
committerDave Reisner <dreisner@archlinux.org>2013-11-27 21:21:13 +0100
commitcf9be93525fb393b0db85a341dfca6fafdd9fab7 (patch)
tree9ff72cb7963f0fc810db85a76fc6d14d783a430b /functions
parent9e2c16294bd6281ecbf7ab96e9b14a10154c4f01 (diff)
downloadmkinitcpio-cf9be93525fb393b0db85a341dfca6fafdd9fab7.tar.gz
mkinitcpio-cf9be93525fb393b0db85a341dfca6fafdd9fab7.tar.xz
mkinitcpio: Allow building an image without modules
The '-k none' switch prevents mkinitcpio from adding modules to the image and keeps it from bailing out when it cannot find any.
Diffstat (limited to 'functions')
-rw-r--r--functions6
1 files changed, 5 insertions, 1 deletions
diff --git a/functions b/functions
index 9a29a17..2b89c88 100644
--- a/functions
+++ b/functions
@@ -351,6 +351,8 @@ add_module() {
local module= path= deps= field= value= firmware=()
local ign_errors=0
+ [[ $KERNELVERSION == none ]] && return 0
+
if [[ $1 = *\? ]]; then
ign_errors=1
set -- "${1%?}"
@@ -661,7 +663,7 @@ initialize_buildroot() {
printf '%s' "$version" >"$buildroot/VERSION"
# kernel module dir
- install -dm755 "$buildroot/usr/lib/modules/$kernver/kernel"
+ [[ $kernver != none ]] && install -dm755 "$buildroot/usr/lib/modules/$kernver/kernel"
# mount tables
ln -s /proc/self/mounts "$buildroot/etc/mtab"
@@ -738,6 +740,8 @@ install_modules() {
local m moduledest=$BUILDROOT/lib/modules/$KERNELVERSION
local -a xz_comp gz_comp
+ [[ $KERNELVERSION == none ]] && return 0
+
if (( $# == 0 )); then
warning "No modules were added to the image. This is probably not what you want."
return 0