From bb14cfdb9d2358ec663926f080118685c629bef7 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Thu, 19 Mar 2015 14:50:08 +0000 Subject: Update various OpenWrt packages * OpenWrt (base-files): Search and replace 'export -n' with 'export' in lib/functions/preinit.sh * procd: Install the binaries in /sbin * fstools: Install the binaries in /sbin * uci, ubox, ubus, firewall3: Create the correct symlinks in /bin * Busybox: Change to a repository which includes OpenWrt patches and delete the false sed command TODO: * Complete the adding of iwinfo for rpcd * Busybox build --- strata/build-essential.morph | 6 ++--- strata/build-essential/busybox.morph | 47 +++++++++++++++++------------------- strata/cpe-wrt.morph | 30 ++++++++++++++++------- strata/cpe-wrt/base-files.morph | 17 ++++++------- strata/cpe-wrt/firewall3.morph | 15 ++++++++++++ strata/cpe-wrt/fstools.morph | 7 ++++++ strata/cpe-wrt/iwinfo.morph | 8 ++++++ strata/cpe-wrt/netifd.morph | 12 +++++++-- strata/cpe-wrt/rpcd.morph | 7 ++++++ strata/cpe-wrt/ubox.morph | 15 +++++++++++- strata/cpe-wrt/ubus.morph | 13 ++++++++++ strata/cpe-wrt/uci.morph | 12 +++++++++ 12 files changed, 140 insertions(+), 49 deletions(-) create mode 100644 strata/cpe-wrt/firewall3.morph create mode 100644 strata/cpe-wrt/iwinfo.morph create mode 100644 strata/cpe-wrt/uci.morph diff --git a/strata/build-essential.morph b/strata/build-essential.morph index 4a03fe35..ff5682a9 100644 --- a/strata/build-essential.morph +++ b/strata/build-essential.morph @@ -304,9 +304,9 @@ chunks: - name: busybox morph: strata/build-essential/busybox.morph - repo: upstream:busybox - ref: 1ecfe811fe2f70380170ef7d820e8150054e88ca - unpetrify-ref: 1_23_1 + repo: https://github.com/mossmaurice/busybox.git + ref: e7988013de531c2d17fad9412cb5ea528ed66500 + unpetrify-ref: shoinkis/openwrt build-depends: - stage2-binutils - stage2-busybox diff --git a/strata/build-essential/busybox.morph b/strata/build-essential/busybox.morph index d5f2e2f5..a906b33f 100644 --- a/strata/build-essential/busybox.morph +++ b/strata/build-essential/busybox.morph @@ -5,21 +5,21 @@ configure-commands: # Busybox's default config has everything enabled. - make defconfig -- sed -e 's|.*UDHCPC_DEFAULT_SCRIPT.*|CONFIG_UDHCPC_DEFAULT_SCRIPT="'"$PREFIX"/share/udhcpc/default.script'"|' -i .config -- sed -e 's|.*IFUPDOWN_IFSTATE_PATH.*|CONFIG_IFUPDOWN_IFSTATE_PATH="/run/ifstate"|' -i .config +#- sed -e 's|.*UDHCPC_DEFAULT_SCRIPT.*|CONFIG_UDHCPC_DEFAULT_SCRIPT="'"$PREFIX"/share/udhcpc/default.script'"|' -i .config +#- sed -e 's|.*IFUPDOWN_IFSTATE_PATH.*|CONFIG_IFUPDOWN_IFSTATE_PATH="/run/ifstate"|' -i .config # Avoid dividing applets between $PREFIX/[s]bin and $PREFIX/usr/[s]bin. - '[ "$PREFIX" = /usr ] || sed -e ''s/.*INSTALL_NO_USR.*/CONFIG_INSTALL_NO_USR=y/'' -i .config' # We have GAWK, but in GENIVI baseline we want to get rid of it -# - sed -e 's/CONFIG_AWK=y.*/# CONFIG_AWK is not set/' -i .config +- sed -e 's/CONFIG_AWK=y.*/# CONFIG_AWK is not set/' -i .config # Depends on stuff that was removed since eglibc 2.14. - sed -e 's/CONFIG_INETD=y.*/# CONFIG_INETD is not set/' -i .config # Busybox Patch is incompatible enough with GNU Patch that it can't be # used for GNULib projects built from Git. -- sed -e 's/CONFIG_PATCH=y.*/# CONFIG_PATCH is not set/' -i .config +#- sed -e 's/CONFIG_PATCH=y.*/# CONFIG_PATCH is not set/' -i .config # None of this is needed because we have kmod; and it actually breaks the # Linux build because depmod isn't compatible enough with util-linux's. @@ -31,33 +31,30 @@ configure-commands: - sed -e 's/CONFIG_RMMOD=y.*/# CONFIG_RMMOD is not set/' -i .config # General features that we don't need. -- sed -e 's/CONFIG_FEATURE_MOUNT_CIFS=y.*/# CONFIG_FEATURE_MOUNT_CIFS is not set/' -i .config -- sed -e 's/CONFIG_FEATURE_EXTRA_QUIET=y.*/# CONFIG_FEATURE_EXTRA_QUIET is not set/' -i .config -- sed -e 's/CONFIG_FEATURE_INIT_COREDUMPS=y.*/# CONFIG_FEATURE_INIT_COREDUMPS is not set/' -i .config -- sed -e 's/CONFIG_FEATURE_INIT_SCTTY=y.*/# CONFIG_FEATURE_INIT_SCTTY is not set/' -i .config -- sed -e 's/CONFIG_FEATURE_INIT_SYSLOG=y.*/# CONFIG_FEATURE_INIT_SYSLOG is not set/' -i .config -- sed -e 's/CONFIG_FEATURE_INITRD=y.*/# CONFIG_FEATURE_INITRD is not set/' -i .config -- sed -e 's/CONFIG_FEATURE_MINIX2=y.*/# CONFIG_FEATURE_MINIX2 is not set/' -i .config -- sed -e 's/CONFIG_FSCK_MINIX=y.*/# CONFIG_FSCK_MINIX is not set/' -i .config -- sed -e 's/CONFIG_LOSETUP=y.*/# CONFIG_LOSETUP is not set/' -i .config -- sed -e 's/CONFIG_LSUSB=y.*/# CONFIG_LSUSB is not set/' -i .config -- sed -e 's/CONFIG_LSPCI=y.*/# CONFIG_LSPCI is not set/' -i .config -- sed -e 's/CONFIG_LZMA=y.*/# CONFIG_LZMA is not set/' -i .config -- sed -e 's/CONFIG_MKFS_EXT2=y.*/# CONFIG_MKFS_EXT2 is not set/' -i .config -- sed -e 's/CONFIG_MKFS_MINIX=y.*/# CONFIG_MKFS_MINIX is not set/' -i .config -- sed -e 's/CONFIG_STRINGS=y.*/# CONFIG_STRINGS is not set/' -i .config -- sed -e 's/CONFIG_UNLZMA=y.*/# CONFIG_UNLZMA is not set/' -i .config -- sed -e 's/CONFIG_UNXZ=y.*/# CONFIG_UNXZ is not set/' -i .config -- sed -e 's/CONFIG_XZ=y.*/# CONFIG_XZ is not set/' -i .config +#- sed -e 's/CONFIG_FEATURE_MOUNT_CIFS=y.*/# CONFIG_FEATURE_MOUNT_CIFS is not set/' -i .config +#- sed -e 's/CONFIG_FEATURE_EXTRA_QUIET=y.*/# CONFIG_FEATURE_EXTRA_QUIET is not set/' -i .config +#- sed -e 's/CONFIG_FEATURE_INIT_COREDUMPS=y.*/# CONFIG_FEATURE_INIT_COREDUMPS is not set/' -i .config +#- sed -e 's/CONFIG_FEATURE_INIT_SCTTY=y.*/# CONFIG_FEATURE_INIT_SCTTY is not set/' -i .config +#- sed -e 's/CONFIG_FEATURE_INIT_SYSLOG=y.*/# CONFIG_FEATURE_INIT_SYSLOG is not set/' -i .config +#- sed -e 's/CONFIG_FEATURE_INITRD=y.*/# CONFIG_FEATURE_INITRD is not set/' -i .config +#- sed -e 's/CONFIG_FEATURE_MINIX2=y.*/# CONFIG_FEATURE_MINIX2 is not set/' -i .config +#- sed -e 's/CONFIG_FSCK_MINIX=y.*/# CONFIG_FSCK_MINIX is not set/' -i .config +#- sed -e 's/CONFIG_LOSETUP=y.*/# CONFIG_LOSETUP is not set/' -i .config +#- sed -e 's/CONFIG_LSUSB=y.*/# CONFIG_LSUSB is not set/' -i .config +#- sed -e 's/CONFIG_LSPCI=y.*/# CONFIG_LSPCI is not set/' -i .config +#- sed -e 's/CONFIG_LZMA=y.*/# CONFIG_LZMA is not set/' -i .config +#- sed -e 's/CONFIG_MKFS_EXT2=y.*/# CONFIG_MKFS_EXT2 is not set/' -i .config +#- sed -e 's/CONFIG_MKFS_MINIX=y.*/# CONFIG_MKFS_MINIX is not set/' -i .config +#- sed -e 's/CONFIG_STRINGS=y.*/# CONFIG_STRINGS is not set/' -i .config +#- sed -e 's/CONFIG_UNLZMA=y.*/# CONFIG_UNLZMA is not set/' -i .config +#- sed -e 's/CONFIG_UNXZ=y.*/# CONFIG_UNXZ is not set/' -i .config +#- sed -e 's/CONFIG_XZ=y.*/# CONFIG_XZ is not set/' -i .config # Now turn on some little bits we do need - sed -e 's/# CONFIG_BBCONFIG is not set/CONFIG_BBCONFIG=y/' -i .config - sed -e 's/# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set/CONFIG_FEATURE_COMPRESS_BBCONFIG=y/' -i .config - sed -e 's/# CONFIG_FEATURE_MOUNT_HELPERS is not set/CONFIG_FEATURE_MOUNT_HELPERS=y/' -i .config -# Add lock for OpenWrt -- sed -e 's/# CONFIG_FLASH_LOCK is not set/CONFIG_FLASH_LOCK=y/' -i .config - build-commands: - make diff --git a/strata/cpe-wrt.morph b/strata/cpe-wrt.morph index 3c2aac79..bf7accab 100644 --- a/strata/cpe-wrt.morph +++ b/strata/cpe-wrt.morph @@ -28,12 +28,14 @@ chunks: - json-c - lua - name: uci + morph: strata/cpe-wrt/uci.morph repo: upstream:openwrt/uci ref: 790d30606d545956a64f183c3199f472a70a6385 unpetrify-ref: build-depends: - libubox - name: ubus + morph: strata/cpe-wrt/ubus.morph repo: upstream:openwrt/ubus ref: 2d660c519d2fcff95248da9f4fd9b37d61f9eb09 unpetrify-ref: @@ -47,6 +49,7 @@ chunks: build-depends: - uci - name: ubox + morph: strata/cpe-wrt/ubox.morph repo: upstream:openwrt/ubox ref: 1dce0407268937cdf37b9c0643632e6c31f5792a unpetrify-ref: @@ -54,6 +57,7 @@ chunks: - ubus - uci - name: firewall3 + morph: strata/cpe-wrt/firewall3.morph repo: upstream:openwrt/firewall3 ref: 165029cb8c0f1545628f44143aec965e64cef021 unpetrify-ref: @@ -78,15 +82,6 @@ chunks: - libubox - uci - ubus -- name: rpcd - morph: strata/cpe-wrt/rpcd.morph - repo: upstream:openwrt/rpcd - ref: 805e8ce8918237d93baafa53413c5c4ef0380504 - unpetrify-ref: - build-depends: - - json-c - - ubus - - uci - name: mtd morph: strata/cpe-wrt/mtd.morph repo: upstream:mtd-utils @@ -108,3 +103,20 @@ chunks: build-depends: - netifd - procd +#- name: iwinfo +# morph: strata/cpe-wrt/iwinfo.morph +# repo: git://git.openwrt.org/project/iwinfo.git +# ref: HEAD +# unpetrify-ref: +# build-depends: +# - uci +#- name: rpcd +# morph: strata/cpe-wrt/rpcd.morph +# repo: upstream:openwrt/rpcd +# ref: 805e8ce8918237d93baafa53413c5c4ef0380504 +# unpetrify-ref: +# build-depends: +# - json-c +# - iwinfo +# - ubus +# - uci diff --git a/strata/cpe-wrt/base-files.morph b/strata/cpe-wrt/base-files.morph index b4ec3bb2..50ac95b8 100644 --- a/strata/cpe-wrt/base-files.morph +++ b/strata/cpe-wrt/base-files.morph @@ -1,11 +1,10 @@ name: base-files kind: chunk -#build-commands: -#- | -# export TOPDIR="../.." -# export INCLUDE_DIR="TOPDIR/include" -# cd package/base-files && make +# "export -n" is not supported + +pre-configure-commands: +- sed -i "s/export -n/export/" package/base-files/files/lib/functions/preinit.sh install-commands: # FHS directories @@ -18,17 +17,17 @@ install-commands: - install package/system/procd/files/reload_config "$DESTDIR"/sbin/ - install package/system/procd/files/procd.sh "$DESTDIR"/lib/functions/ -#netifd +# netifd - | cp -r package/network/config/netifd/files/* "$DESTDIR"/ -#ubox +# ubox - | cp -r package/system/ubox/files/* "$DESTDIR"/etc/init.d/log -#ubox +# uci - | cp -r package/system/uci/files/* "$DESTDIR"/ -#lock symlink +# lock symlink - ln -s busybox "$DESTDIR"/bin/lock diff --git a/strata/cpe-wrt/firewall3.morph b/strata/cpe-wrt/firewall3.morph new file mode 100644 index 00000000..0ef34b5a --- /dev/null +++ b/strata/cpe-wrt/firewall3.morph @@ -0,0 +1,15 @@ +name: ubox +kind: chunk + +build-commands: +- cmake -DCMAKE_INSTALL_PREFIX=$PREFIX +- make + +install-commands: +- make install + +post-install-commands: +- | + install -d "$DESTDIR/sbin" + cd "$DESTDIR/sbin" + ln -s ../usr/sbin/fw3 firewall3 diff --git a/strata/cpe-wrt/fstools.morph b/strata/cpe-wrt/fstools.morph index cf5a730a..0a455968 100644 --- a/strata/cpe-wrt/fstools.morph +++ b/strata/cpe-wrt/fstools.morph @@ -3,3 +3,10 @@ kind: chunk pre-configure-commands: - sed -i "s/-Werror//" CMakeLists.txt + +build-commands: +- cmake -DCMAKE_INSTALL_PREFIX=/ +- make + +install-commands: +- make install diff --git a/strata/cpe-wrt/iwinfo.morph b/strata/cpe-wrt/iwinfo.morph new file mode 100644 index 00000000..5040f3a5 --- /dev/null +++ b/strata/cpe-wrt/iwinfo.morph @@ -0,0 +1,8 @@ +name: iwinfo +kind: chunk + +build-commands: +- make + +install-commands: +- make install diff --git a/strata/cpe-wrt/netifd.morph b/strata/cpe-wrt/netifd.morph index 0d8c835c..20126327 100644 --- a/strata/cpe-wrt/netifd.morph +++ b/strata/cpe-wrt/netifd.morph @@ -4,5 +4,13 @@ kind: chunk pre-configure-commands: - sed -i "s/-Werror//" CMakeLists.txt - sed -i "s/netifd\s\${LIBS}/netifd \${LIBS} \${LIBNL_LIBRARIES} \${JSONC_LIBARIES}/" CMakeLists.txt -- sed -i "s/#include\s\"config.h\"/#include \"config.h\"\n#include \"bits.h\"/" handler.h -- sed -i "s/SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS \"\")/SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS \"\")\nINCLUDE(FindPkgConfig)\nPKG_CHECK_MODULES(JSONC json-c)\nIF(JSONC_FOUND)\n ADD_DEFINITIONS(-DJSONC)\n INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})\nENDIF()\n\nPKG_CHECK_MODULES(LIBNL libnl-3.0)\nINCLUDE_DIRECTORIES(${LIBNL_INCLUDE_DIRS})\n/" CMakeLists.txt +- sed -i "s/#include\s\"config.h\"/#include \"config.h\"\n#include \"json-c\/bits.h\"/" handler.h +- sed -i "s/#include