Building Kernel Modules for the Omega2



  • @Maximilian-Gerhardt you sorta out did even yourself with this post šŸ™‚
    thank you. it will be very helpful.



  • @Maximilian-Gerhardt Awesome! Thank you so much for putting this together!



  • @Maximilian-Gerhardt Outstanding work!



  • Great series, and great tutorial!

    I am trying speed up make by just compiling the hello-world module, using the command:

    make package/hello-world/compile -j4

    However, I get the following error (when running with "-j1 V=s" for additional output):

    make[1]: Entering directory '/root/source'
    make[1]: *** No rule to make target 'package/hello-world/compile'. Stop.

    I have successfully done a full build and installed this module on my Omega2+, but I am stuck at this point.

    Thanks again for all the great work!



  • @Jackson-Wilson Thanks for the feedback! Unfortunately I cannot reproduce that.

    My full build log with -j1 V=s, when the package was previously compiled:

    max@max-VirtualBox:~/source$ make package/hello-world/compile -j1 V=s
    make[1]: Entering directory '/home/max/source'
    make[2]: Entering directory '/home/max/omega2_kmods/hello-world'
    if [ -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install.clean ]; then rm -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install.clean; fi
    make[2]: Leaving directory '/home/max/omega2_kmods/hello-world'
    make[1]: Leaving directory '/home/max/source'
    

    And I execute make package/hello-world/clean and then compile (with code from the "Read Hardware Register" Section):

    max@max-VirtualBox:~/source$ make package/hello-world/compile -j1 V=s
    make[1]: Entering directory '/home/max/source'
    make[2]: Entering directory '/home/max/omega2_kmods/hello-world'
    if [ -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install.clean ]; then rm -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install.clean; fi
    make[2]: Leaving directory '/home/max/omega2_kmods/hello-world'
    make[1]: Leaving directory '/home/max/source'
    max@max-VirtualBox:~/source$ make -C package/hello-world compile -j1 V=s
    make: *** package/hello-world: No such file or directory.  Stop.
    max@max-VirtualBox:~/source$ make -C /home/max/omega2_kmods/hello-world compile -j1 V=s
    make: Entering directory '/home/max/omega2_kmods/hello-world'
    Makefile:6: /rules.mk: No such file or directory
    Makefile:7: /kernel.mk: No such file or directory
    Makefile:19: /package.mk: No such file or directory
    make: *** No rule to make target '/package.mk'.  Stop.
    make: Leaving directory '/home/max/omega2_kmods/hello-world'
    max@max-VirtualBox:~/source$ make package/hello-world/clean -j1 V=s
    make[1]: Entering directory '/home/max/source'
    make[2]: Entering directory '/home/max/omega2_kmods/hello-world'
    rm -f /home/max/source/bin/targets/ramips/mt7688/packages/kmod-hello-world_4.4.74+1.1-4_mipsel_24kc.ipk
    rm -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.hello-world_installed
    rm -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/packages/hello-world.list /home/max/source/staging_dir/host/packages/hello-world.list
    rm -rf /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world
    make[2]: Leaving directory '/home/max/omega2_kmods/hello-world'
    make[1]: Leaving directory '/home/max/source'
    max@max-VirtualBox:~/source$ make package/hello-world/compile -j1 V=s
    make[1]: Entering directory '/home/max/source'
    make[2]: Entering directory '/home/max/omega2_kmods/hello-world'
    mkdir -p /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world
    cp -fpR ./src/* /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/
    touch /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/.prepared_80ddc19575c0da8a918fdc92694a93eb
    rm -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.hello-world_installed
    (cd /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/./; if [ -x ./configure ]; then find /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ -name config.guess | xargs -r chmod u+w; find /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ -name config.guess | xargs -r -n1 cp --remove-destination /home/max/source/scripts/config.guess; find /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ -name config.sub | xargs -r chmod u+w; find /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ -name config.sub | xargs -r -n1 cp --remove-destination /home/max/source/scripts/config.sub; AR="mipsel-openwrt-linux-musl-gcc-ar" AS="mipsel-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world:hello-world -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=mipsel-openwrt-linux-musl-ld NM="mipsel-openwrt-linux-musl-gcc-nm" CC="mipsel-openwrt-linux-musl-gcc" GCC="mipsel-openwrt-linux-musl-gcc" CXX="mipsel-openwrt-linux-musl-g++" RANLIB="mipsel-openwrt-linux-musl-gcc-ranlib" STRIP=mipsel-openwrt-linux-musl-strip OBJCOPY=mipsel-openwrt-linux-musl-objcopy OBJDUMP=mipsel-openwrt-linux-musl-objdump SIZE=mipsel-openwrt-linux-musl-size CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world:hello-world -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world:hello-world -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CPPFLAGS="-I/home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/usr/include -I/home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/include -I/home/max/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/usr/include -I/home/max/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/fortify -I/home/max/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include " LDFLAGS="-L/home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/usr/lib -L/home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/lib -L/home/max/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/usr/lib -L/home/max/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/lib -znow -zrelro "   ./configure --target=mipsel-openwrt-linux --host=mipsel-openwrt-linux --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls   ; fi; )
    rm -f /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/.configured_*
    touch /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/.configured_yyyy
    make -C "/home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/linux-4.4.74" ARCH="mips" CROSS_COMPILE="mipsel-openwrt-linux-musl-" SUBDIRS="/home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world" modules
    make[3]: Entering directory '/home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/linux-4.4.74'
      CC [M]  /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/hello-world.o
    /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/hello-world.c: In function 'ReadReg32':
    /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/hello-world.c:21:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      unsigned int val = ioread32(virtualMem);
      ^
    /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/hello-world.c: In function 'hello_2_init':
    /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/hello-world.c:33:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
      unsigned int chipid0_3 = ReadReg32(MT7688_SYSCTL_BASE + MT7688_SYSCTL_CHIPID0_3);
      ^
      Building modules, stage 2.
      MODPOST 1 modules
      CC      /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/hello-world.mod.o
      LD [M]  /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/hello-world.ko
    make[3]: Leaving directory '/home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/linux-4.4.74'
    touch /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/.built
    mkdir -p /home/max/source/bin/targets/ramips/mt7688/packages /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo
    . /home/max/source/include/shell.sh; export modules=; probe_module() { local mods="$1"; local boot="$2"; local mod; shift 2; for mod in $mods; do mkdir -p /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules.d; echo "$mod" >> /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules.d/hello-world; done; if [ -e /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules.d/hello-world ]; then if [ "$boot" = "1" -a ! -e /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules-boot.d/hello-world ]; then mkdir -p /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules-boot.d; ln -s ../modules.d/hello-world /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules-boot.d/; fi; modules="${modules:+$modules }$mods"; fi; }; add_module() { local priority="$1"; local mods="$2"; local boot="$3"; local mod; shift 3; for mod in $mods; do mkdir -p /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules.d; echo "$mod" >> /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules.d/$priority-hello-world; done; if [ -e /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules.d/$priority-hello-world ]; then if [ "$boot" = "1" -a ! -e /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules-boot.d/$priority-hello-world ]; then mkdir -p /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules-boot.d; ln -s ../modules.d/$priority-hello-world /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules-boot.d/; fi; modules="${modules:+$modules }$priority-hello-world"; fi; };  if [ -n "$modules" ]; then modules="$(echo "$modules" | tr ' ' '\n' | sort | uniq | paste -s -d' ' -)"; mkdir -p /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/etc/modules.d; mkdir -p /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL; echo "#!/bin/sh" > /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL/postinst-pkg; echo "[ -z \"\$IPKG_INSTROOT\" ] || exit 0" >> /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL/postinst-pkg; echo ". /lib/functions.sh" >> /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL/postinst-pkg; echo "insert_modules $modules" >> /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL/postinst-pkg; chmod 0755 /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL/postinst-pkg; fi
    find /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
    export CROSS="mipsel-openwrt-linux-musl-"  NO_RENAME=1 ; NM="mipsel-openwrt-linux-musl-nm" STRIP="/home/max/source/staging_dir/host/bin/sstrip" STRIP_KMOD="/home/max/source/scripts/strip-kmod.sh" PATCHELF="/home/max/source/staging_dir/host/bin/patchelf" /home/max/source/scripts/rstrip.sh /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world
    rstrip.sh: /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/lib/modules/4.4.74/hello-world.ko: relocatable
    (cd /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world/CONTROL; ( echo "$CONTROL"; printf "Description: "; echo "$DESCRIPTION" | sed -e 's,^[[:space:]]*, ,g'; ) > control; chmod 644 control; ( echo "#!/bin/sh"; echo "[ \"\${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; echo "[ -x "\${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; echo ". \${IPKG_INSTROOT}/lib/functions.sh"; echo "default_postinst \$0 \$@"; ) > postinst; ( echo "#!/bin/sh"; echo "[ -x "\${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; echo ". \${IPKG_INSTROOT}/lib/functions.sh"; echo "default_prerm \$0 \$@"; ) > prerm; chmod 0755 postinst prerm;  )
    install -d -m0755 /home/max/source/bin/targets/ramips/mt7688/packages
    /home/max/source/scripts/ipkg-build -c -o 0 -g 0 /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world /home/max/source/bin/targets/ramips/mt7688/packages
    Packaged contents of /home/max/source/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_mt7688/hello-world/ipkg-mipsel_24kc/kmod-hello-world into /home/max/source/bin/targets/ramips/mt7688/packages/kmod-hello-world_4.4.74+1.1-4_mipsel_24kc.ipk
    rm -rf /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world
    mkdir -p /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/stamp /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world
    . /home/max/source/include/shell.sh; export modules=; probe_module() { local mods="$1"; local boot="$2"; local mod; shift 2; for mod in $mods; do mkdir -p /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules.d; echo "$mod" >> /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules.d/hello-world; done; if [ -e /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules.d/hello-world ]; then if [ "$boot" = "1" -a ! -e /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules-boot.d/hello-world ]; then mkdir -p /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules-boot.d; ln -s ../modules.d/hello-world /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules-boot.d/; fi; modules="${modules:+$modules }$mods"; fi; }; add_module() { local priority="$1"; local mods="$2"; local boot="$3"; local mod; shift 3; for mod in $mods; do mkdir -p /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules.d; echo "$mod" >> /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules.d/$priority-hello-world; done; if [ -e /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules.d/$priority-hello-world ]; then if [ "$boot" = "1" -a ! -e /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules-boot.d/$priority-hello-world ]; then mkdir -p /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules-boot.d; ln -s ../modules.d/$priority-hello-world /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules-boot.d/; fi; modules="${modules:+$modules }$priority-hello-world"; fi; };  if [ -n "$modules" ]; then modules="$(echo "$modules" | tr ' ' '\n' | sort | uniq | paste -s -d' ' -)"; mkdir -p /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/etc/modules.d; mkdir -p /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/CONTROL; echo "#!/bin/sh" > /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/CONTROL/postinst-pkg; echo "[ -z \"\$IPKG_INSTROOT\" ] || exit 0" >> /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/CONTROL/postinst-pkg; echo ". /lib/functions.sh" >> /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/CONTROL/postinst-pkg; echo "insert_modules $modules" >> /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/CONTROL/postinst-pkg; chmod 0755 /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/CONTROL/postinst-pkg; fi
    SHELL= flock /home/max/source/tmp/.root-copy.flock -c 'cp -fpR /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world/. /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/'
    rm -rf /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/tmp-kmod-hello-world
    touch /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/root-ramips/stamp/.kmod-hello-world_installed
    if [ -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install.clean ]; then rm -f /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install /home/max/source/staging_dir/target-mipsel_24kc_musl-1.1.16/pkginfo/hello-world.default.install.clean; fi
    make[2]: Leaving directory '/home/max/omega2_kmods/hello-world'
    make[1]: Leaving directory '/home/max/source'
    

    Could it be that you set-up the paths the wrong way (src-link)? Are you executing the command from the from the right path (top-level in source)? Very weird that normal make -j4 works but this doesn't.. Any differences to the OnionIoT's source repository setup or the package folder structure here? What does make package/hello-world/prepare -j1 V=s do?



  • @Jackson-Wilson

    I found the issue. The following command works:

    make omega2_kmods/hello_world -j4

    However, when I make a change to the source file, and try to re-build, make says the package is "up to date."

    Maybe someone more savvy with the innards of the build system can tell me how to get a quick re-build of this package as I make changes along with this guide.

    Thanks!



  • @Maximilian-Gerhardt

    Hi!

    I suspect the src-link, since I get different output when I issue make package/hello-world/compile -j1 V=s:

    root@1fbc8ce194c0:~/source# make package/hello-world/clean -j1 V=s
    make[1]: Entering directory '/root/source'
    make[1]: *** No rule to make target 'package/hello-world/clean'. Stop.

    My added line to feeds.conf is:

    src-link omega2_kmods /root/source/omega2_kmods

    I'll mess around with this for a bit...



  • Good that you figured out another way. The only difference I see is that I placed my omega2_kmods folder outside of source in some other directory (/home/max/).



  • Well, my work-around doesn't allow me to clean and rebuild this single package, so I'm still struggling to get this to work. I have tried to replicate the structure you describe in this guide.

    I get the same "No rule..." error for /clean and /prepare commands as well.



  • Got it! I just had to get my directories and paths right. I was rushing a bit, and things were not lined up exactly correctly. I think it builds for the entire project because the recursive make found my package on its own, but I wasn't specifying it exactly right when I tried to build it individually.

    Great fun!



  • @Maximilian-Gerhardt I believe we both Geophoenixed in the early 2000's. Thanks for the article, it helped me migrate a water heater control unit to a newer linux kernel (with MMU)



Looks like your connection to Community was lost, please wait while we try to reconnect.