summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/mkinitcpio.8.txt5
-rwxr-xr-xmkinitcpio8
2 files changed, 10 insertions, 3 deletions
diff --git a/man/mkinitcpio.8.txt b/man/mkinitcpio.8.txt
index 05d71c4..2f1bb84 100644
--- a/man/mkinitcpio.8.txt
+++ b/man/mkinitcpio.8.txt
@@ -49,8 +49,9 @@ Options
*-k, \--kernel* 'kernelversion'::
Use 'kernelversion', instead of the current running kernel. This may be a
- path to a kernel image, a specific kernel version or the special keyword
- 'none'. In the latter case, no kernel modules are added to the image.
+ path to a kernel image (only supported for x86-based architectures), a specific
+ kernel version or the special keyword 'none'. In the latter case, no kernel
+ modules are added to the image.
*-L, \--listhooks*::
List all available hooks.
diff --git a/mkinitcpio b/mkinitcpio
index 713c4b4..3e550d3 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -85,7 +85,7 @@ cleanup() {
}
resolve_kernver() {
- local kernel=$1 offset kver
+ local kernel=$1 arch= offset kver
if [[ -z $kernel ]]; then
uname -r
@@ -97,6 +97,12 @@ resolve_kernver() {
return 0
fi
+ arch=$(uname -m)
+ if [[ $arch != @(i686|x86_64) ]]; then
+ error "kernel version extraction from image not supported for \`%s' architecture" "$arch"
+ return 1
+ fi
+
if [[ ! -e $kernel ]]; then
error "specified kernel image does not exist: \`%s'" "$kernel"
return 1