summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Dale <richard.dale@codethink.co.uk>2015-06-17 09:23:00 (GMT)
committerRichard Dale <richard.dale@codethink.co.uk>2015-06-17 09:23:00 (GMT)
commitaa8a7b2a5001be799b7000fadf851ac4ee2c8dcd (patch)
treed552e2674e6de0363bdb4414a15e07dfa55e2c5c
parent4a43b7725aa0c5639c161036faf8c168fde4517f (diff)
downloaddefinitions-aa8a7b2a5001be799b7000fadf851ac4ee2c8dcd.tar.gz
Add a kmod chunk to the system
-rw-r--r--strata/bsp-x86_64-openwrt.morph7
-rw-r--r--strata/bsp-x86_64-openwrt/kmod-wrt.morph49
2 files changed, 56 insertions, 0 deletions
diff --git a/strata/bsp-x86_64-openwrt.morph b/strata/bsp-x86_64-openwrt.morph
index 0bd85da..fb3f035 100644
--- a/strata/bsp-x86_64-openwrt.morph
+++ b/strata/bsp-x86_64-openwrt.morph
@@ -5,11 +5,18 @@ description: The set of platform specific components required for booting a 64-b
build-depends:
- morph: strata/core-wrt.morph
chunks:
+- name: kmod-wrt
+ morph: strata/bsp-x86_64-openwrt/kmod-wrt.morph
+ repo: upstream:kmod
+ ref: ae58de0fcb4a6528dd365e23d383bbe2eaf2d566
+ unpetrify-ref: v18
- name: linux-x86-64-openwrt
morph: strata/bsp-x86_64-openwrt/linux-x86-64-openwrt.morph
repo: upstream:linux
ref: 39a8804455fb23f09157341d3ba7db6d7ae6ee76
unpetrify-ref: v4.0
+ build-depends:
+ - kmod-wrt
- name: nasm-wrt
morph: strata/bsp-x86_64-openwrt/nasm-wrt.morph
repo: upstream:nasm
diff --git a/strata/bsp-x86_64-openwrt/kmod-wrt.morph b/strata/bsp-x86_64-openwrt/kmod-wrt.morph
new file mode 100644
index 0000000..522a7a7
--- /dev/null
+++ b/strata/bsp-x86_64-openwrt/kmod-wrt.morph
@@ -0,0 +1,49 @@
+name: kmod-wrt
+kind: chunk
+configure-commands:
+- rm -rf libkmod/docs
+- sed -i -e'/SUBDIRS/{s/\S*doc\S*//;s/\S*man\S*//}' Makefile.am
+- sed -i -e'/AC_CONFIG_FILES(\[/,/])/{/docs/d}' configure.ac
+- autoreconf -fiv
+- |
+ ./configure --prefix="$PREFIX" --bindir="$PREFIX"/bin \
+ --libdir="$PREFIX"/lib --sysconfdir=/etc \
+ --without-xz --with-zlib \
+ --disable-manpages
+build-commands:
+- make
+install-commands:
+- make DESTDIR="$DESTDIR" pkgconfigdir="$PREFIX"/lib/pkgconfig install
+
+# WARNING with the following command:
+# if the staging area when kmod is built is sufficiently different to the
+# staging area that kmod is included in, then these symlinks may not work.
+#
+# i.e. if /sbin isn't a symlink when this is built (fhs-dirs isn't included or
+# doesn't symlink /sbin to /usr/bin) then we get symlinks in /sbin which point
+# to ../usr/bin, but if /sbin is itself a symlink to /usr/bin, then the symlinks
+# would end up in /usr/bin, which would point to ../usr/bin, which would evaluate
+# to /usr/usr/bin.
+#
+# The alternatives to this are:
+#
+# 1. Use hardlinks instead, which has the problem of ssh-rsync upgrades duplicating
+# the binary
+#
+# 2. Use an absolute path for the symlink, which makes things interesting when
+# inspecting a chroot
+#
+# 3. Use a wrapper script to invoke kmod with a different name, which isn't
+# possible in busybox ash without making a temporary directory, which means
+# you need an extra process to hang around to clean that directory up.
+- |
+ if [ -h /sbin ]; then
+ for app in modprobe lsmod rmmod insmod modinfo depmod; do
+ ln -sf kmod "$DESTDIR$PREFIX/bin/$app"
+ done
+ else
+ install -d "$DESTDIR"/sbin
+ for app in modprobe lsmod rmmod insmod modinfo depmod; do
+ ln -sf ../"$PREFIX"/bin/kmod "$DESTDIR/sbin/$app"
+ done
+ fi