Bläddra i källkod

Merge branch 'starfive-kirkstone' into 'starfive-kirkstone'

JH8100 Kirkstone

See merge request starfive-tech/meta-starfive!37
Rebecca Chang 8 månader sedan
förälder
incheckning
2fc83fdd41
73 ändrade filer med 4594 tillägg och 24 borttagningar
  1. 70 0
      conf/machine/starfive-jh8100.conf
  2. 0 0
      dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/dubhe_olimex-openocd_s5.cfg
  3. 0 0
      dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/dubhe_olimex_flash_write.cfg
  4. 87 0
      dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_0150_f1.cfg
  5. 87 0
      dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_0150_f2.cfg
  6. 42 0
      dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_jrc.cfg
  7. 13 6
      dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd_riscv.bbappend
  8. 4 1
      recipes-bsp/opensbi/opensbi_%.bbappend
  9. 30 7
      recipes-bsp/u-boot/u-boot-starfive.bb
  10. 151 0
      recipes-connectivity/dhcp/dhcp.inc
  11. 27 0
      recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch
  12. 62 0
      recipes-connectivity/dhcp/dhcp/0001-workaround-busybox-limitation-in-linux-dhclient-script.patch
  13. 114 0
      recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch
  14. 35 0
      recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch
  15. 157 0
      recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch
  16. 33 0
      recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch
  17. 62 0
      recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch
  18. 25 0
      recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch
  19. 223 0
      recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch
  20. 64 0
      recipes-connectivity/dhcp/dhcp/0013-fixup_use_libbind.patch
  21. 93 0
      recipes-connectivity/dhcp/dhcp/0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch
  22. 14 0
      recipes-connectivity/dhcp/dhcp/add-riscv-support.patch
  23. BIN
      recipes-connectivity/dhcp/dhcp/bind.tar.gz
  24. 26 0
      recipes-connectivity/dhcp/dhcp_%.bbappend
  25. 39 0
      recipes-connectivity/dhcp/dhcp_4.4.3.bb
  26. 12 0
      recipes-connectivity/dhcp/files/default-relay
  27. 7 0
      recipes-connectivity/dhcp/files/default-server
  28. 39 0
      recipes-connectivity/dhcp/files/dhclient-systemd-wrapper
  29. 50 0
      recipes-connectivity/dhcp/files/dhclient.conf
  30. 13 0
      recipes-connectivity/dhcp/files/dhclient.service
  31. 349 0
      recipes-connectivity/dhcp/files/dhcp-CLOEXEC.patch
  32. 108 0
      recipes-connectivity/dhcp/files/dhcpd.conf
  33. 15 0
      recipes-connectivity/dhcp/files/dhcpd.service
  34. 15 0
      recipes-connectivity/dhcp/files/dhcpd6.service
  35. 10 0
      recipes-connectivity/dhcp/files/dhcrelay.service
  36. 44 0
      recipes-connectivity/dhcp/files/init-relay
  37. 44 0
      recipes-connectivity/dhcp/files/init-server
  38. 4 2
      recipes-core/images/core-image-minimal.bbappend
  39. 39 0
      recipes-core/images/core-image-starfive-extra.bb
  40. 8 0
      recipes-core/images/sd-image.inc
  41. 83 0
      recipes-core/packagegroups/packagegroup-starfive-c.bb
  42. 31 0
      recipes-devtools/luajit/luajit-riscv/0001-Do-not-strip-automatically-this-leaves-the-stripping.patch
  43. 22 0
      recipes-devtools/luajit/luajit-riscv/0002-original-patch-riscv-cross-compile-support.patch.patch
  44. 19 0
      recipes-devtools/luajit/luajit-riscv/clang.patch
  45. 13 0
      recipes-devtools/luajit/luajit-riscv/riscv-cross-compile-support.patch
  46. 104 0
      recipes-devtools/luajit/luajit-riscv_git.bb
  47. 77 0
      recipes-devtools/nodejs/nodejs-oe-cache-18.0/oe-npm-cache
  48. 21 0
      recipes-devtools/nodejs/nodejs-oe-cache-native_18.0.bb
  49. 46 0
      recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps.patch
  50. 77 0
      recipes-devtools/nodejs/nodejs/0001-Using-native-binaries.patch
  51. 85 0
      recipes-devtools/nodejs/nodejs/0001-liftoff-Correct-function-signatures.patch
  52. 34 0
      recipes-devtools/nodejs/nodejs/0001-mips-Use-32bit-cast-for-operand-on-mips32.patch
  53. 23 0
      recipes-devtools/nodejs/nodejs/0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch
  54. 102 0
      recipes-devtools/nodejs/nodejs/0004-v8-don-t-override-ARM-CFLAGS.patch
  55. 18 0
      recipes-devtools/nodejs/nodejs/big-endian.patch
  56. 21 0
      recipes-devtools/nodejs/nodejs/libatomic.patch
  57. 37 0
      recipes-devtools/nodejs/nodejs/mips-less-memory.patch
  58. 3 0
      recipes-devtools/nodejs/nodejs/run-ptest
  59. 24 0
      recipes-devtools/nodejs/nodejs/system-c-ares.patch
  60. 178 0
      recipes-devtools/nodejs/nodejs_18.0.0.bb
  61. 1134 0
      recipes-extended/ivykis/ivykis/Makefile
  62. 9 0
      recipes-extended/ivykis/ivykis/run-ptest
  63. 29 0
      recipes-extended/ivykis/ivykis_0.42.4.bb
  64. 4 0
      recipes-extended/lua-cjson/lua-cjson/run-ptest
  65. 48 0
      recipes-extended/lua-cjson/lua-cjson_2.1.0.11.bb
  66. 3 0
      recipes-extended/mnn/mnn/run-ptest
  67. 26 0
      recipes-extended/mnn/mnn_2.6.0.bb
  68. 3 0
      recipes-extended/muparser/muparser/run-ptest
  69. 25 0
      recipes-extended/muparser/muparser_2.3.2.bb
  70. 9 0
      recipes-httpd/nginx/nginx_%.bbappend
  71. 10 1
      recipes-kernel/linux/linux-starfive-dev_6.1.20.bb
  72. 51 7
      setup.sh
  73. 10 0
      wic/starfive-jh8100.wks

+ 70 - 0
conf/machine/starfive-jh8100.conf

@@ -0,0 +1,70 @@
+#@TYPE: Machine
+#@NAME: starfive-jh8100
+#@SOC: JH8100
+#@DESCRIPTION: Machine configuration for the JH8100 default config
+
+require conf/machine/include/riscv/tune-riscv.inc
+
+EXTRA_IMAGEDEPENDS:append = " qemu-helper-native:do_addto_recipe_sysroot"
+IMAGE_CLASSES += " qemuboot "
+QB_MACHINE = "-machine virt"
+QB_DEFAULT_KERNEL = "Image-starfive-jh8100.bin"
+QB_CPU = "-cpu rv64"
+QB_MEM = "-m 8G"
+QB_DEFAULT_FSTYPE = "ext4"
+SERIAL_CONSOLES = "115200;ttyS0"
+QB_SYSTEM_NAME = "qemu-system-riscv64"
+QB_ROOTFS_OPT = "-drive file=@ROOTFS@,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
+
+MACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-starfive-dev"
+PREFERRED_PROVIDER_virtual/bootloader = "u-boot-starfive"
+
+LLVMVERSION = "14.0.0"
+GLIBCVERSION = "2.36"
+BINUVERSION = "2.39"
+GCCVERSION = "12.2.0"
+QEMUVERSION = "7.2.0"
+PREFERRED_VERSION_opensbi ?= "1.2"
+PREFERRED_VERSION_xserver-xorg = "1.20.13"
+PREFERRED_VERSION_mbedtls = "3.4.0"
+PREFERRED_PROVIDER_dhcp-relay = "dhcp"
+PREFERRED_PROVIDER_nodejs = "18.0.0"
+
+RISCV_SBI_PLAT = "generic"
+#RISCV_SBI_PAYLOAD = "u-boot.bin"
+#RISCV_SBI_FDT = "jh8100-fpga.dtb"
+
+IMAGE_FSTYPES += " ext4 wic.gz wic.bmap cpio cpio.gz"
+
+KERNEL_DEVICETREE ?= "starfive/jh8100-fpga.dtb"
+KERNEL_IMAGETYPE = "Image"
+
+FIT_KERNEL_COMP_ALG = "none"
+
+EXTRA_IMAGEDEPENDS += " u-boot-starfive openocd-native"
+
+UBOOT_ENV ?= "boot"
+UBOOT_ENV_SUFFIX = "scr.uimg"
+
+UBOOT_MACHINE = "starfive_jh8100_defconfig"
+UBOOT_DTB_BINARY = "jh8100-fpga.dtb"
+
+SPL_BINARY = "spl/u-boot-spl.bin"
+SPL_NORMAL_BINARY = "u-boot-spl.bin.normal.out"
+
+## Do not update fstab file when using wic images
+WIC_CREATE_EXTRA_ARGS ?=  "--no-fstab-update"
+
+WKS_FILE_DEPENDS ?= " \
+	opensbi \
+	bmap-tools-native \
+"
+IMAGE_BOOT_FILES ?= " \
+        jh8100-fpga.dtb \
+	Image \
+"
+WKS_FILE ?= "starfive-jh8100.wks"

+ 0 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/olimex-openocd_s5.cfg → dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/dubhe_olimex-openocd_s5.cfg


+ 0 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/olimex_flash_write.cfg → dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/dubhe_olimex_flash_write.cfg


+ 87 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_0150_f1.cfg

@@ -0,0 +1,87 @@
+# _MULTI_TARGETS:
+#   0 - for debug single CPU. Start openocd locally.
+#   1 - for debug multiple CPUs. Start openocd (need version >= 0.11.0 for e24) before and set "Remote Target" port.
+set _MULTI_TARGETS	0
+set _JLINK		0
+set _CHIPNAME		JH8100
+
+# "adapter_khz" is DEPRECATED in openocd v0.11.0, replace with "adapter speed" if not available
+#adapter_khz   4000
+adapter speed   2000
+# listen on all interfaces for incoming TCP/IP connections, useful for multiple targets (_MULTI_TARGETS == 1)
+bindto 0.0.0.0
+
+if { $_JLINK } {
+	#interface jlink
+	adapter driver jlink
+	# Select a specific device if more than one connected
+	#jlink serial 4294967295
+} else {
+	#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
+	#source olimex-arm-usb-tiny-h.cfg
+	# Select a specific device if more than one connected
+	interface ftdi
+	ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
+	ftdi_vid_pid 0x15ba 0x002a
+
+	ftdi_serial "OL3EBABB"
+
+	ftdi_layout_init 0x0808 0x0a1b
+	ftdi_layout_signal nSRST -oe 0x0200
+	ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100
+	ftdi_layout_signal LED -data 0x0800
+}
+
+
+transport select jtag
+
+#set remote interrupt-on-connect off
+## Follow chain order
+jtag newtap RV64ABCDFHIMSU cpu -irlen 5 -expected-id 0x08100cfd -disable
+jtag newtap RV32ACFIMUX cpu -irlen 5 -expected-id 0x08100cfd -disable
+
+source [find jrc.cfg]
+
+target create RV32ACFIMUX.hart0 riscv -chain-position RV32ACFIMUX.cpu -coreid 0 -gdb-port 3334
+target create RV64ABCDFHIMSU.core0 riscv -chain-position RV64ABCDFHIMSU.cpu -coreid 2 -rtos hwthread -gdb-port 3333
+
+init
+
+RV32ACFIMUX.hart0 configure -event gdb-detach {
+    jtag tapdisable RV32ACFIMUX.cpu
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    shutdown
+}
+
+RV64ABCDFHIMSU.core0 configure -event gdb-detach {
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    jtag tapdisable RV32ACFIMUX.cpu
+    shutdown
+}
+
+halt
+scan_chain
+
+#echo "load U-Boot SPL .................."
+#fast_load_image u-boot-spl.bin 0xb000000
+#fast_load
+
+#echo "load U-Boot itb images .................."
+#fast_load_image u-boot.itb 0xa0000000
+#fast_load
+
+#echo "load Linux kernel image .................."
+#fast_load_image Image_165.gz 0x47000000
+#fast_load
+
+#echo "load Linux dtb image .................."
+#fast_load_image jh8100-fpga_165.dtb 0x46000000
+#fast_load
+
+#echo "load rootfs image .................."
+#fast_load_image rootfs_165.cpio 0x59000000
+#fast_load
+
+echo "Finish loading images.................."
+
+echo "Ready for Remote Connections"

+ 87 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_0150_f2.cfg

@@ -0,0 +1,87 @@
+# _MULTI_TARGETS:
+#   0 - for debug single CPU. Start openocd locally.
+#   1 - for debug multiple CPUs. Start openocd (need version >= 0.11.0 for e24) before and set "Remote Target" port.
+set _MULTI_TARGETS	0
+set _JLINK		0
+set _CHIPNAME		JH8100
+
+# "adapter_khz" is DEPRECATED in openocd v0.11.0, replace with "adapter speed" if not available
+#adapter_khz   4000
+adapter speed   2000
+# listen on all interfaces for incoming TCP/IP connections, useful for multiple targets (_MULTI_TARGETS == 1)
+bindto 0.0.0.0
+
+if { $_JLINK } {
+	#interface jlink
+	adapter driver jlink
+	# Select a specific device if more than one connected
+	#jlink serial 4294967295
+} else {
+	#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
+	#source olimex-arm-usb-tiny-h.cfg
+	# Select a specific device if more than one connected
+	interface ftdi
+	ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
+	ftdi_vid_pid 0x15ba 0x002a
+
+	ftdi_serial "OL570962"
+
+	ftdi_layout_init 0x0808 0x0a1b
+	ftdi_layout_signal nSRST -oe 0x0200
+	ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100
+	ftdi_layout_signal LED -data 0x0800
+}
+
+
+transport select jtag
+
+#set remote interrupt-on-connect off
+## Follow chain order
+jtag newtap RV64ABCDFHIMSU cpu -irlen 5 -expected-id 0x08100cfd -disable
+jtag newtap RV32ACFIMUX cpu -irlen 5 -expected-id 0x08100cfd -disable
+
+source [find jrc.cfg]
+
+target create RV32ACFIMUX.hart0 riscv -chain-position RV32ACFIMUX.cpu -coreid 0 -gdb-port 3341
+target create RV64ABCDFHIMSU.core0 riscv -chain-position RV64ABCDFHIMSU.cpu -coreid 2 -rtos hwthread -gdb-port 3340
+
+init
+
+RV32ACFIMUX.hart0 configure -event gdb-detach {
+    jtag tapdisable RV32ACFIMUX.cpu
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    shutdown
+}
+
+RV64ABCDFHIMSU.core0 configure -event gdb-detach {
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    jtag tapdisable RV32ACFIMUX.cpu
+    shutdown
+}
+
+halt
+scan_chain
+
+#echo "load U-Boot SPL .................."
+#fast_load_image u-boot-spl.bin 0xb000000
+#fast_load
+
+#echo "load U-Boot itb images .................."
+#fast_load_image u-boot.itb 0xa0000000
+#fast_load
+
+# echo "load Linux kernel image .................."
+# fast_load_image Image_165.gz 0x47000000
+# fast_load
+
+# echo "load Linux dtb image .................."
+# fast_load_image jh8100-fpga_165.dtb 0x46000000
+# fast_load
+
+# echo "load rootfs image .................."
+# fast_load_image rootfs_165.cpio 0x59000000
+# fast_load
+
+echo "Finish loading images.................."
+
+echo "Ready for Remote Connections"

+ 42 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_jrc.cfg

@@ -0,0 +1,42 @@
+jtag newtap CHIP jrc -irlen 4 -expected-id 0x08100cfd -enable
+
+## E24 enable handler
+jtag configure RV32ACFIMUX.cpu -event tap-enable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE 
+    drscan CHIP.jrc 16 0x4102 -endstate RUN/IDLE 
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE 
+    runtest 10
+}
+
+## E24 disable handler 
+jtag configure RV32ACFIMUX.cpu -event tap-disable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE
+    drscan CHIP.jrc 16 0x4100 -endstate RUN/IDLE
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE 
+}
+
+## BC enable handler 
+jtag configure RV64ABCDFHIMSU.cpu -event tap-enable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE 
+    drscan CHIP.jrc 16 0x4402 -endstate RUN/IDLE 
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE
+}
+
+## BC disable handler 
+jtag configure RV64ABCDFHIMSU.cpu -event tap-disable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE 
+    drscan CHIP.jrc 16 0x4400 -endstate RUN/IDLE 
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE 
+}
+
+jtag configure CHIP.jrc -event post-reset "runtest 20"
+jtag configure CHIP.jrc -event setup "jtag tapenable RV64ABCDFHIMSU.cpu"
+#"jtag tapenable RV64ABCDFHIMSU.cpu; jtag tapenable RV32ACFIMUX.cpu"

+ 13 - 6
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd_riscv.bbappend

@@ -9,10 +9,13 @@ SRC_URI = " \
     git://repo.or.cz/r/git2cl.git;protocol=http;destsuffix=tools/git2cl;name=git2cl;branch=master \
     git://github.com/msteveb/jimtcl.git;protocol=https;branch=master;name=jimtcl;destsuffix=git/jimtcl \
     git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=git/src/jtag/drivers/libjaylink;name=libjaylink;branch=master \
-    file://Dubhe_FPGA_openocd.patch \
-    file://olimex-openocd_s5.cfg \
-    file://olimex_flash_write.cfg \
     file://0001-autosetup-cc-check-tools-check-only-the-name.patch \
+    file://Dubhe_FPGA_openocd.patch \
+    file://dubhe_olimex-openocd_s5.cfg \
+    file://dubhe_olimex_flash_write.cfg \
+    file://jh8100_0150_f1.cfg \
+    file://jh8100_0150_f2.cfg \
+    file://jh8100_jrc.cfg \
 "
 
 SRCREV_openocd = "a037b20f2e015859327ab37588792386c4fc942f"
@@ -21,9 +24,13 @@ SRCREV_jimtcl = "70b007b63669a709b0e8aef34a22658047815cc2"
 EXTRA_OECONF = "--enable-ftdi"
 
 inherit deploy
-do_deploy(){
-	install -m 755 ${WORKDIR}/olimex-openocd_s5.cfg ${DEPLOYDIR}/
-	install -m 755 ${WORKDIR}/olimex_flash_write.cfg ${DEPLOYDIR}/
+
+do_deploy() {
+	install -m 755 ${WORKDIR}/dubhe_olimex-openocd_s5.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/dubhe_olimex_flash_write.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/jh8100_0150_f1.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/jh8100_0150_f2.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/jh8100_jrc.cfg ${DEPLOYDIR}/
 }
 
 addtask deploy before do_build after do_install

+ 4 - 1
recipes-bsp/opensbi/opensbi_%.bbappend

@@ -3,7 +3,11 @@ SRC_URI:starfive-visionfive2 = "git://github.com/starfive-tech/opensbi.git;proto
                                 file://visionfive2-uboot-fit-image.its \
                                "
 
+SRCREV:starfive-jh8100 = "06c3d05b7f5f1e0aa24141e4de487313b620cea9"
+SRC_URI:starfive-jh8100 = "git://git@192.168.110.45/starfive-tech/opensbi.git;protocol=ssh;branch=fpga-starfive-v1.2-jh8100"
+
 EXTRA_OEMAKE:starfive-visionfive2 += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= FW_TEXT_START=0x40000000"
+EXTRA_OEMAKE:starfive-jh8100 += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= FW_OPTIONS=0 FW_TEXT_START=0x40000000 PLATFORM_DEFCONFIG=starfive_defconfig"
 
 DEPENDS:starfive-visionfive2:append = " u-boot-tools-native dtc-native"
 
@@ -12,4 +16,3 @@ do_deploy:append:starfive-visionfive2() {
         cd ${DEPLOYDIR}
         mkimage -f visionfive2-uboot-fit-image.its -A riscv -O u-boot -T firmware visionfive2_fw_payload.img
 }
-

+ 30 - 7
recipes-bsp/u-boot/u-boot-starfive.bb

@@ -3,13 +3,18 @@ require recipes-bsp/u-boot/u-boot.inc
 
 inherit uboot-extlinux-config
 
+LIC_FILES_CHKSUM:starfive-visionfive2 = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025"
+LIC_FILES_CHKSUM:starfive-jh8100 = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
+
 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
 
-FORK = "starfive-tech"
-BRANCH = "JH7110_VisionFive2_devel"
-SRCREV = "b6e2b0e85c774a18ae668223a6e5f7d335895243"
+FORK:starfive-visionfive2 = "starfive-tech"
+BRANCH:starfive-visionfive2 = "JH7110_VisionFive2_devel"
+
+FORK:starfive-jh8100 = "starfive-tech"
+BRANCH:starfive-jh8100 = "jh8100_fpga_dev_v2023.01_bmc"
 
-SRC_URI = "git://github.com/${FORK}/u-boot.git;protocol=https;branch=${BRANCH} \
+SRC_URI:starfive-visionfive2 = "git://github.com/${FORK}/u-boot.git;protocol=ssh;branch=${BRANCH} \
            file://vf2_uEnv.txt \
 	   file://vf2_nvme_uEnv.txt \
 	   file://tftp-mmc-boot.txt \
@@ -17,7 +22,15 @@ SRC_URI = "git://github.com/${FORK}/u-boot.git;protocol=https;branch=${BRANCH} \
 	   file://uboot_disable_logo.patch \
           "
 
-DEPENDS:append = " u-boot-tools-native starfive-tool-native"
+SRC_URI:starfive-jh8100 = "git://git@192.168.110.45/${FORK}/u-boot.git;protocol=ssh;branch=${BRANCH} \
+	 file://tftp-mmc-boot.txt \
+	"
+
+SRCREV:starfive-visionfive2 = "b6e2b0e85c774a18ae668223a6e5f7d335895243"
+SRCREV:starfive-jh8100 = "163e8d28c905711d76cbd5d78dafbd6e24b3f21d"
+
+DEPENDS:append:starfive-visionfive2 = " u-boot-tools-native starfive-tool-native"
+DEPENDS:append:starfive-jh8100 = " u-boot-tools-native bmap-tools-native opensbi"
 
 # Overwrite this for your server
 TFTP_SERVER_IP ?= "127.0.0.1"
@@ -25,7 +38,12 @@ TFTP_SERVER_IP ?= "127.0.0.1"
 do_configure:prepend() {
     sed -i -e 's,@SERVERIP@,${TFTP_SERVER_IP},g' ${WORKDIR}/tftp-mmc-boot.txt
     mkimage -O linux -T script -C none -n "U-Boot boot script" \
-        -d ${WORKDIR}/tftp-mmc-boot.txt ${WORKDIR}/${UBOOT_ENV_BINARY}
+	-d ${WORKDIR}/tftp-mmc-boot.txt ${WORKDIR}/${UBOOT_ENV_BINARY}
+}
+
+do_configure:prepend:starfive-jh8100() {
+    cp ${DEPLOY_DIR_IMAGE}/fw_dynamic.bin ${WORKDIR}/build/fw_dynamic.bin
+    export OPENSBI=${WORKDIR}/build/fw_dynamic.bin
 }
 
 do_deploy:append:starfive-visionfive2() {
@@ -37,7 +55,12 @@ do_deploy:append:starfive-visionfive2() {
     ln -sf ${SPL_IMAGE}.normal.out ${DEPLOYDIR}/${SPL_SYMLINK}.normal.out
 }
 
+do_deploy:append:starfive-jh8100() {
+    install -m 644 ${WORKDIR}/build/u-boot.itb ${DEPLOYDIR}/u-boot.itb
+    rm ${WORKDIR}/build/fw_dynamic.bin
+}
+
 TOOLCHAIN = "gcc"
 
-COMPATIBLE_MACHINE = "(starfive-visionfive2)"
+COMPATIBLE_MACHINE = "(starfive-visionfive2|starfive-jh8100)"
 

+ 151 - 0
recipes-connectivity/dhcp/dhcp.inc

@@ -0,0 +1,151 @@
+SECTION = "console/network"
+SUMMARY = "Internet Software Consortium DHCP package"
+DESCRIPTION = "DHCP (Dynamic Host Configuration Protocol) is a protocol \
+which allows individual devices on an IP network to get their own \
+network configuration information from a server.  DHCP helps make it \
+easier to administer devices."
+
+HOMEPAGE = "http://www.isc.org/"
+
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=613211e713c4ffc489ec370e1caceabb"
+
+DEPENDS = "openssl bind"
+
+SRC_URI = "http://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
+           file://init-relay file://default-relay \
+           file://init-server file://default-server \
+           file://dhclient.conf file://dhcpd.conf \
+           file://dhclient-systemd-wrapper \
+           file://dhclient.service \
+           file://dhcpd.service file://dhcrelay.service \
+           file://dhcpd6.service \
+           "
+UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
+
+inherit autotools-brokensep systemd useradd update-rc.d
+
+USERADD_PACKAGES = "${PN}-server"
+USERADD_PARAM:${PN}-server = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}"
+
+SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay ${PN}-client"
+SYSTEMD_SERVICE:${PN}-server = "dhcpd.service dhcpd6.service"
+SYSTEMD_AUTO_ENABLE:${PN}-server = "disable"
+
+SYSTEMD_SERVICE:${PN}-relay = "dhcrelay.service"
+SYSTEMD_AUTO_ENABLE:${PN}-relay = "disable"
+
+SYSTEMD_SERVICE:${PN}-client = "dhclient.service"
+SYSTEMD_AUTO_ENABLE:${PN}-client = "disable"
+
+INITSCRIPT_PACKAGES = "dhcp-server"
+INITSCRIPT_NAME:dhcp-server = "dhcp-server"
+INITSCRIPT_PARAMS:dhcp-server = "defaults"
+
+CFLAGS += "-D_GNU_SOURCE"
+EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
+                --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
+                --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
+                --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \
+                --enable-paranoia --disable-static \
+                --with-randomdev=/dev/random \
+                 \
+		--enable-libtool \
+               "
+
+PACKAGECONFIG[system-libbind] = "--with-libbind=${STAGING_DIR_HOST},--without-libbind,bind"
+
+#Enable shared libs per dhcp README
+do_configure:prepend () {
+	cp configure.ac+lt configure.ac
+}
+
+do_install:append () {
+	install -d ${D}${sysconfdir}/init.d
+	install -d ${D}${sysconfdir}/default
+	install -d ${D}${sysconfdir}/dhcp
+	install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
+	install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
+	install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
+	install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
+
+	rm -f ${D}${sysconfdir}/dhclient.conf*
+	rm -f ${D}${sysconfdir}/dhcpd.conf*
+	install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
+	install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
+
+	install -d ${D}${base_sbindir}/
+	if [ "${sbindir}" != "${base_sbindir}" ]; then
+		mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
+	fi
+	install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
+
+	# Install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcpd6.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service ${D}${systemd_unitdir}/system/dhcrelay.service
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+	sed -i -e 's,@base_bindir@,${base_bindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+	sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
+
+	install -d ${D}${base_sbindir}
+	install -m 0755 ${WORKDIR}/dhclient-systemd-wrapper ${D}${base_sbindir}/dhclient-systemd-wrapper
+	install -m 0644 ${WORKDIR}/dhclient.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhclient.service
+	sed -i -e 's,@BASE_SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/dhclient.service
+}
+
+PACKAGES += "dhcp-libs dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
+
+PACKAGES:remove = "${PN}"
+RDEPENDS:${PN}-client += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'iproute2', '', d)}"
+RDEPENDS:${PN}-dev = ""
+RDEPENDS:${PN}-staticdev = ""
+FILES:${PN}-libs = "${libdir}/libdhcpctl.so.0* ${libdir}/libomapi.so.0* ${libdir}/libdhcp.so.0*"
+
+FILES:${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server"
+RRECOMMENDS:${PN}-server = "dhcp-server-config"
+
+FILES:${PN}-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
+
+FILES:${PN}-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
+
+FILES:${PN}-client = "${base_sbindir}/dhclient \
+                      ${base_sbindir}/dhclient-script \
+                      ${sysconfdir}/dhcp/dhclient.conf \
+                      ${base_sbindir}/dhclient-systemd-wrapper \
+                     "
+
+FILES:${PN}-omshell = "${bindir}/omshell"
+
+pkg_postinst:dhcp-server() {
+    mkdir -p $D/${localstatedir}/lib/dhcp
+    touch $D/${localstatedir}/lib/dhcp/dhcpd.leases
+    touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases
+}
+
+pkg_postinst:dhcp-client() {
+    mkdir -p $D/${localstatedir}/lib/dhcp
+}
+
+pkg_postrm:dhcp-server() {
+    rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases
+    rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases
+
+    if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
+        echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
+    fi
+}
+
+pkg_postrm:dhcp-client() {
+    rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases
+    rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases
+
+    if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
+        echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
+    fi
+}

+ 27 - 0
recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch

@@ -0,0 +1,27 @@
+From 7cc29144535a622fc671dc86eb1da65b0473a7c4 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 16:14:22 +0800
+Subject: [PATCH 01/11] define macro _PATH_DHCPD_CONF and _PATH_DHCLIENT_CONF
+
+Upstream-Status: Inappropriate [OE specific]
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ includes/site.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: dhcp-4.4.3/includes/site.h
+===================================================================
+--- dhcp-4.4.3.orig/includes/site.h
++++ dhcp-4.4.3/includes/site.h
+@@ -148,7 +148,8 @@
+ /* Define this if you want the dhcpd.conf file to go somewhere other than
+    the default location.   By default, it goes in /etc/dhcpd.conf. */
+ 
+-/* #define _PATH_DHCPD_CONF	"/etc/dhcpd.conf" */
++#define _PATH_DHCPD_CONF	"/etc/dhcp/dhcpd.conf"
++#define _PATH_DHCLIENT_CONF	"/etc/dhcp/dhclient.conf"
+ 
+ /* Network API definitions.   You do not need to choose one of these - if
+    you don't choose, one will be chosen for you in your system's config

+ 62 - 0
recipes-connectivity/dhcp/dhcp/0001-workaround-busybox-limitation-in-linux-dhclient-script.patch

@@ -0,0 +1,62 @@
+From eec0503cfc36f63d777f5cb3f2719cecedcb8468 Mon Sep 17 00:00:00 2001
+From: Haris Okanovic <haris.okanovic@ni.com>
+Date: Mon, 7 Jan 2019 13:22:09 -0600
+Subject: [PATCH] Workaround busybox limitation in Linux dhclient-script
+
+Busybox is a lightweight implementation of coreutils commonly used on
+space-constrained embedded Linux distributions. It's implementation of
+chown and chmod doesn't provide a "--reference" option added to
+client/scripts/linux as of commit 9261cb14. This change works around
+that limitation by using stat to read ownership and permissions flags
+and simple chown/chmod calls supported in both coreutils and busybox.
+
+    modified:   client/scripts/linux
+
+Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
+Upstream-Status: Pending [ISC-Bugs #48771]
+---
+ client/scripts/linux | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+Index: dhcp-4.4.3/client/scripts/linux
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/linux
++++ dhcp-4.4.3/client/scripts/linux
+@@ -32,6 +32,17 @@
+ # if your system holds ip tool in a non-standard location.
+ ip=/sbin/ip
+ 
++chown_chmod_by_reference() {
++    local reference_file="$1"
++    local target_file="$2"
++
++    local owner=$(stat -c "%u:%g" "$reference_file")
++    local perm=$(stat -c "%a" "$reference_file")
++
++    chown "$owner" "$target_file"
++    chmod "$perm" "$target_file"
++}
++
+ # update /etc/resolv.conf based on received values
+ # This updated version mostly follows Debian script by Andrew Pollock et al.
+ make_resolv_conf() {
+@@ -74,8 +85,7 @@ make_resolv_conf() {
+         fi
+ 
+ 	if [ -f /etc/resolv.conf ]; then
+-	    chown --reference=/etc/resolv.conf $new_resolv_conf
+-	    chmod --reference=/etc/resolv.conf $new_resolv_conf
++	    chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf
+ 	fi
+         mv -f $new_resolv_conf /etc/resolv.conf
+     # DHCPv6
+@@ -101,8 +111,7 @@ make_resolv_conf() {
+         fi
+ 
+ 	if [ -f /etc/resolv.conf ]; then
+-            chown --reference=/etc/resolv.conf $new_resolv_conf
+-            chmod --reference=/etc/resolv.conf $new_resolv_conf
++	    chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf
+ 	fi
+         mv -f $new_resolv_conf /etc/resolv.conf
+     fi

+ 114 - 0
recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch

@@ -0,0 +1,114 @@
+From be7540d31c356e80ee02e90e8bf162b7ac6e5ba5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 14:56:56 +0800
+Subject: [PATCH 02/11] dhclient dbus
+
+Upstream-Status: Inappropriate [distribution]
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/bsdos   | 5 +++++
+ client/scripts/freebsd | 5 +++++
+ client/scripts/linux   | 5 +++++
+ client/scripts/netbsd  | 5 +++++
+ client/scripts/openbsd | 5 +++++
+ client/scripts/solaris | 5 +++++
+ 6 files changed, 30 insertions(+)
+
+Index: dhcp-4.4.3/client/scripts/bsdos
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/bsdos
++++ dhcp-4.4.3/client/scripts/bsdos
+@@ -45,6 +45,11 @@ exit_with_hooks() {
+     . /etc/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+Index: dhcp-4.4.3/client/scripts/freebsd
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/freebsd
++++ dhcp-4.4.3/client/scripts/freebsd
+@@ -89,6 +89,11 @@ exit_with_hooks() {
+     . /etc/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+Index: dhcp-4.4.3/client/scripts/linux
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/linux
++++ dhcp-4.4.3/client/scripts/linux
+@@ -174,6 +174,11 @@ exit_with_hooks() {
+         exit_status=$?
+     fi
+ 
++    if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++        dbus-send --system --dest=com.redhat.dhcp \
++           --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++           'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++    fi
+     exit $exit_status
+ }
+ 
+Index: dhcp-4.4.3/client/scripts/netbsd
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/netbsd
++++ dhcp-4.4.3/client/scripts/netbsd
+@@ -45,6 +45,11 @@ exit_with_hooks() {
+     . /etc/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+Index: dhcp-4.4.3/client/scripts/openbsd
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/openbsd
++++ dhcp-4.4.3/client/scripts/openbsd
+@@ -45,6 +45,11 @@ exit_with_hooks() {
+     . /etc/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+Index: dhcp-4.4.3/client/scripts/solaris
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/solaris
++++ dhcp-4.4.3/client/scripts/solaris
+@@ -26,6 +26,11 @@ exit_with_hooks() {
+     . /etc/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 

+ 35 - 0
recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch

@@ -0,0 +1,35 @@
+From d80bd792323dbd56269309f85b4506eb6b1b60e9 Mon Sep 17 00:00:00 2001
+From: Andrei Gherzan <andrei@gherzan.ro>
+Date: Tue, 15 Aug 2017 15:05:47 +0800
+Subject: [PATCH 03/11] link with lcrypto
+
+From 4.2.0 final release, -lcrypto check was removed and we compile
+static libraries
+from bind that are linked to libcrypto. This is why i added a patch in
+order to add
+-lcrypto to LIBS.
+
+Upstream-Status: Pending
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: dhcp-4.4.3/configure.ac
+===================================================================
+--- dhcp-4.4.3.orig/configure.ac
++++ dhcp-4.4.3/configure.ac
+@@ -603,6 +603,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
+ # Look for optional headers.
+ AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+ 
++# find an MD5 library
++AC_SEARCH_LIBS(MD5_Init, [crypto])
++AC_SEARCH_LIBS(MD5Init, [crypto])
++
+ # Solaris needs some libraries for functions
+ AC_SEARCH_LIBS(socket, [socket])
+ AC_SEARCH_LIBS(inet_ntoa, [nsl])

+ 157 - 0
recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch

@@ -0,0 +1,157 @@
+From cccec0344d68dac4100b6f260ee24e7c2da9dfda Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 15:08:22 +0800
+Subject: [PATCH 04/11] Fix out of tree builds
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Rebase to 4.3.6
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/Makefile.am  | 4 ++--
+ common/Makefile.am  | 3 ++-
+ dhcpctl/Makefile.am | 2 ++
+ omapip/Makefile.am  | 1 +
+ relay/Makefile.am   | 2 +-
+ server/Makefile.am  | 2 +-
+ 6 files changed, 9 insertions(+), 5 deletions(-)
+
+Index: dhcp-4.4.3/common/Makefile.am
+===================================================================
+--- dhcp-4.4.3.orig/common/Makefile.am
++++ dhcp-4.4.3/common/Makefile.am
+@@ -1,8 +1,8 @@
+ AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
+ AM_CFLAGS = $(LDAP_CFLAGS)
+ 
+-lib_LIBRARIES = libdhcp.a
+-libdhcp_a_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c dhcp4o6.c \
++lib_LTLIBRARIES = libdhcp.la
++libdhcp_la_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c dhcp4o6.c \
+ 		      discover.c dispatch.c dlpi.c dns.c ethernet.c execute.c \
+ 		      fddi.c icmp.c inet.c lpf.c memory.c nit.c ns_name.c \
+ 		      options.c packet.c parse.c print.c raw.c resolv.c \
+Index: dhcp-4.4.3/dhcpctl/Makefile.am
+===================================================================
+--- dhcp-4.4.3.orig/dhcpctl/Makefile.am
++++ dhcp-4.4.3/dhcpctl/Makefile.am
+@@ -4,30 +4,30 @@ BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
+ BINDLIBISCDIR=@BINDLIBISCDIR@
+ 
+ bin_PROGRAMS = omshell
+-lib_LIBRARIES = libdhcpctl.a
++lib_LTLIBRARIES = libdhcpctl.la
+ noinst_PROGRAMS = cltest cltest2
+ man_MANS = omshell.1 dhcpctl.3
+ EXTRA_DIST = $(man_MANS)
+ 
+ omshell_SOURCES = omshell.c
+-omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+-		$(BINDLIBIRSDIR)/libirs.a \
+-		$(BINDLIBDNSDIR)/libdns.a \
+-	        $(BINDLIBISCCFGDIR)/libisccfg.a \
+-		$(BINDLIBISCDIR)/libisc.a
++omshell_LDADD = libdhcpctl.la ../common/libdhcp.la ../omapip/libomapi.la \
++		$(BINDLIBIRSDIR)/libirs.la \
++		$(BINDLIBDNSDIR)/libdns.la \
++	        $(BINDLIBISCCFGDIR)/libisccfg.la \
++		$(BINDLIBISCDIR)/libisc.la
+ 
+-libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
++libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c
+ 
+ cltest_SOURCES = cltest.c
+-cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+-	       $(BINDLIBIRSDIR)/libirs.a \
+-	       $(BINDLIBDNSDIR)/libdns.a \
+-	       $(BINDLIBISCCFGDIR)/libisccfg.a \
+-	       $(BINDLIBISCDIR)/libisc.a
++cltest_LDADD = libdhcpctl.la ../common/libdhcp.la ../omapip/libomapi.la \
++	       $(BINDLIBIRSDIR)/libirs.la \
++	       $(BINDLIBDNSDIR)/libdns.la \
++	       $(BINDLIBISCCFGDIR)/libisccfg.la \
++	       $(BINDLIBISCDIR)/libisc.la
+ 
+ cltest2_SOURCES = cltest2.c
+-cltest2_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+-	       $(BINDLIBIRSDIR)/libirs.a \
+-	       $(BINDLIBDNSDIR)/libdns.a \
+-	       $(BINDLIBISCCFGDIR)/libisccfg.a \
+-	       $(BINDLIBISCDIR)/libisc.a
++cltest2_LDADD = libdhcpctl.la ../common/libdhcp.la ../omapip/libomapi.la \
++	       $(BINDLIBIRSDIR)/libirs.la \
++	       $(BINDLIBDNSDIR)/libdns.la \
++	       $(BINDLIBISCCFGDIR)/libisccfg.la \
++	       $(BINDLIBISCDIR)/libisc.la
+Index: dhcp-4.4.3/server/Makefile.am
+===================================================================
+--- dhcp-4.4.3.orig/server/Makefile.am
++++ dhcp-4.4.3/server/Makefile.am
+@@ -4,7 +4,7 @@
+ # production code. Sadly, we are not there yet.
+ SUBDIRS = . tests
+ 
+-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+ 
+ dist_sysconf_DATA = dhcpd.conf.example
+ sbin_PROGRAMS = dhcpd
+Index: dhcp-4.4.3/client/Makefile.am
+===================================================================
+--- dhcp-4.4.3.orig/client/Makefile.am
++++ dhcp-4.4.3/client/Makefile.am
+@@ -5,7 +5,7 @@
+ SUBDIRS = . tests
+ 
+ AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"'
+-AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"'
++AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"' -I$(top_srcdir)/includes
+ 
+ dist_sysconf_DATA = dhclient.conf.example
+ sbin_PROGRAMS = dhclient
+Index: dhcp-4.4.3/omapip/Makefile.am
+===================================================================
+--- dhcp-4.4.3.orig/omapip/Makefile.am
++++ dhcp-4.4.3/omapip/Makefile.am
+@@ -3,10 +3,10 @@ BINDLIBDNSDIR=@BINDLIBDNSDIR@
+ BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
+ BINDLIBISCDIR=@BINDLIBISCDIR@
+ 
+-lib_LIBRARIES = libomapi.a
++lib_LTLIBRARIES = libomapi.la
+ noinst_PROGRAMS = svtest
+ 
+-libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
++libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
+ 		       errwarn.c listener.c dispatch.c generic.c support.c \
+ 		       handle.c message.c convert.c hash.c auth.c inet_addr.c \
+ 		       array.c trace.c toisc.c iscprint.c isclib.c
+@@ -15,8 +15,8 @@ man_MANS = omapi.3
+ EXTRA_DIST = $(man_MANS)
+ 
+ svtest_SOURCES = test.c
+-svtest_LDADD = libomapi.a \
+-	       $(BINDLIBIRSDIR)/libirs.a \
+-	       $(BINDLIBDNSDIR)/libdns.a \
+-	       $(BINDLIBISCCFGDIR)/libisccfg.a \
+-	       $(BINDLIBISCDIR)/libisc.a
++svtest_LDADD = libomapi.la \
++	       $(BINDLIBIRSDIR)/libirs.la \
++	       $(BINDLIBDNSDIR)/libdns.la \
++	       $(BINDLIBISCCFGDIR)/libisccfg.la \
++	       $(BINDLIBISCDIR)/libisc.la
+Index: dhcp-4.4.3/relay/Makefile.am
+===================================================================
+--- dhcp-4.4.3.orig/relay/Makefile.am
++++ dhcp-4.4.3/relay/Makefile.am
+@@ -1,6 +1,6 @@
+ SUBDIRS = . tests
+ 
+-AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+ 
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c

+ 33 - 0
recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch

@@ -0,0 +1,33 @@
+From 2e8ff0e4f6d39e346ea86b8c514ab4ccc78fa359 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 15:24:14 +0800
+Subject: [PATCH 05/11] dhcp-client: fix invoke dhclient-script failed on
+ Read-only file system
+
+In read-only file system, '/etc' is on the readonly partition,
+and '/etc/resolv.conf' is symlinked to a separate writable
+partition.
+
+In this situation, we create temp files 'resolv.conf.dhclient-new'
+in /tmp dir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: dhcp-4.4.3/client/scripts/linux
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/linux
++++ dhcp-4.4.3/client/scripts/linux
+@@ -40,7 +40,7 @@ make_resolv_conf() {
+     # DHCPv4
+     if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
+        [ -n "$new_domain_name_servers" ]; then
+-        new_resolv_conf=/etc/resolv.conf.dhclient-new
++        new_resolv_conf=/tmp/resolv.conf.dhclient-new
+         rm -f $new_resolv_conf
+ 
+         if [ -n "$new_domain_name" ]; then

+ 62 - 0
recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch

@@ -0,0 +1,62 @@
+From 7107511fd209f08f9a96f8938041ae48f3295895 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 15 Aug 2017 16:17:49 +0800
+Subject: [PATCH 07/11] Add configure argument to make the libxml2 dependency
+ explicit and determinisitic.
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+Rebase to 4.3.6
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+Index: dhcp-4.4.3/configure.ac
+===================================================================
+--- dhcp-4.4.3.orig/configure.ac
++++ dhcp-4.4.3/configure.ac
+@@ -633,6 +633,17 @@ if test "$have_nanosleep" = "rt"; then
+ 	LIBS="-lrt $LIBS"
+ fi
+ 
++AC_ARG_WITH(libxml2,
++	AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
++	with_libxml2="$withval", with_libxml2="no")
++
++if test x$with_libxml2 != xno; then
++	AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
++		[if test x$with_libxml2 != xauto; then
++			AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
++		fi])
++fi
++
+ # check for /dev/random (declares ISC_PATH_RANDOMDEV)
+ AC_MSG_CHECKING(for random device)
+ AC_ARG_WITH(randomdev,
+Index: dhcp-4.4.3/configure.ac+lt
+===================================================================
+--- dhcp-4.4.3.orig/configure.ac+lt
++++ dhcp-4.4.3/configure.ac+lt
+@@ -900,6 +900,18 @@ elif test "$want_libtool" = "yes" -a "$u
+ fi
+ AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
+ 
++AC_ARG_WITH(libxml2,
++	AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
++	with_libxml2="$withval", with_libxml2="no")
++
++if test x$with_libxml2 != xno; then
++	AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
++		[if test x$with_libxml2 != xauto; then
++			AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
++		fi])
++fi
++
++
+ # OpenLDAP support.
+ AC_ARG_WITH(ldap,
+     AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),

+ 25 - 0
recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch

@@ -0,0 +1,25 @@
+From f3f8b7726e50e24ef3edf5fa5a17e31d39118d7e Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 15 Aug 2017 15:49:31 +0800
+Subject: [PATCH 09/11] remove dhclient-script bash dependency
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: dhcp-4.4.3/client/scripts/linux
+===================================================================
+--- dhcp-4.4.3.orig/client/scripts/linux
++++ dhcp-4.4.3/client/scripts/linux
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # dhclient-script for Linux. Dan Halbert, March, 1997.
+ # Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
+ # No guarantees about this. I'm a novice at the details of Linux

+ 223 - 0
recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch

@@ -0,0 +1,223 @@
+From 501543b3ef715488a142e3d301ff2733aa33eec7 Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Wed, 25 Oct 2017 21:00:05 +0500
+Subject: [PATCH] dhcp: correct the intention for xml2 lib search
+
+A missing case breaks the build when libxml2 is
+required and found appropriately. The third argument
+to the function AC_SEARCH_LIB is action-if-found which
+was mistakenly been used for the case where the library
+is not found and hence breaks the configure phase
+where it shoud actually pass.
+We now pass on silently when action-if-found is
+executed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: dhcp-4.4.3/configure.ac
+===================================================================
+--- dhcp-4.4.3.orig/configure.ac
++++ dhcp-4.4.3/configure.ac
+@@ -1,5 +1,7 @@
+ AC_INIT([DHCP],[4.4.3],[dhcp-users@isc.org])
+ 
++# for libtool
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ # we specify "foreign" to avoid having to have the GNU mandated files,
+ # like AUTHORS, COPYING, and such
+@@ -60,7 +62,6 @@ AC_SUBST(BINDCONFIG)
+ # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+ AC_USE_SYSTEM_EXTENSIONS
+ 
+-AC_PROG_RANLIB
+ 
+ AC_PATH_PROG(AR, ar)
+ AC_SUBST(AR)
+@@ -603,10 +604,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
+ # Look for optional headers.
+ AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+ 
+-# find an MD5 library
+-AC_SEARCH_LIBS(MD5_Init, [crypto])
+-AC_SEARCH_LIBS(MD5Init, [crypto])
+-
+ # Solaris needs some libraries for functions
+ AC_SEARCH_LIBS(socket, [socket])
+ AC_SEARCH_LIBS(inet_ntoa, [nsl])
+@@ -633,17 +630,6 @@ if test "$have_nanosleep" = "rt"; then
+ 	LIBS="-lrt $LIBS"
+ fi
+ 
+-AC_ARG_WITH(libxml2,
+-	AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
+-	with_libxml2="$withval", with_libxml2="no")
+-
+-if test x$with_libxml2 != xno; then
+-	AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
+-		[if test x$with_libxml2 != xauto; then
+-			AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
+-		fi])
+-fi
+-
+ # check for /dev/random (declares ISC_PATH_RANDOMDEV)
+ AC_MSG_CHECKING(for random device)
+ AC_ARG_WITH(randomdev,
+@@ -806,22 +792,22 @@ no)
+ 	if test ! -d "$use_libbind"; then
+ 		AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
+ 	fi
+-	if test ! -d "$use_libbind/include" -o \
+-	        ! -f "$use_libbind/include/isc/buffer.h"
++	if test ! -d "$use_libbind/$includedir" -o \
++	        ! -f "$use_libbind/$includedir/isc/buffer.h"
+ 	then
+-		AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
++		AC_MSG_ERROR([Cannot find bind includes at $use_libbind/$includedir])
+ 	fi
+-	if test	! -d "$use_libbind/lib" -o \
+-	        \( ! -f "$use_libbind/lib/libisc.a" -a \
+-		   ! -f	"$use_libbind/lib/libisc.la" \)
++	if test	! -d "$use_libbind/$libdir" -o \
++	        \( ! -f "$use_libbind/$libdir/libisc.a" -a \
++		   ! -f	"$use_libbind/$libdir/libisc.la" \)
+ 	then
+-		AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
++		AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/$libdir])
+ 	fi
+ 	BINDDIR="$use_libbind"
+-	BINDLIBIRSDIR="$BINDDIR/lib"
+-	BINDLIBDNSDIR="$BINDDIR/lib"
+-	BINDLIBISCCFGDIR="$BINDDIR/lib"
+-	BINDLIBISCDIR="$BINDDIR/lib"
++	BINDLIBIRSDIR="$BINDDIR/$libdir"
++	BINDLIBDNSDIR="$BINDDIR/$libdir"
++	BINDLIBISCCFGDIR="$BINDDIR/$libdir"
++	BINDLIBISCDIR="$BINDDIR/$libdir"
+ 	DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
+ 	;;
+ esac
+@@ -849,39 +835,38 @@ case "$build_os" in
+ esac
+ 
+ want_libtool="no"
++LT_INIT
++want_libtool="yes"
+ 
+ BINDLT=
+ DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
+ AC_ARG_ENABLE(libtool,
+ 	AS_HELP_STRING([--enable-libtool],
+-[use GNU libtool for dynamic shared libraries (default is no).]),
++[use GNU libtool for dynamic shared libraries (default is yes).]),
+ 	want_libtool="$enableval")
+ 
+ if test "$use_libbind" != "no"; then
+ 	if test "$want_libtool" = "yes" -a \
+-	        ! -f "$use_libbind/lib/libisc.la"
++	        ! -f "$use_libbind/$libdir/libisc.la"
+ 	then
+-		AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
++		AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/$libdir])
+ 	fi
+ 	if test "$want_libtool" = "no" -a \
+-	        ! -f "$use_libbind/lib/libisc.a"
++	        ! -f "$use_libbind/$libdir/libisc.a"
+ 	then
+-		AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
++		AC_MSG_ERROR([Cannot find static libraries at $use_libbind/$libdir])
+ 	fi
+ fi
+ 
+-
+-if test "$want_libtool" = "yes"; then
+-	AC_MSG_WARN([legacy configure is used but libtool is enabled. Trying to recover...])
+-	# expand $ac_configure_args
+-	eval "set my_configure_args $ac_configure_args"
+-	shift
+-	cd $srcdir; exec ./config+lt "$@"
+-	AC_MSG_ERROR([Recovering failed])
++if test "$want_libtool" = "no"; then
++	AC_MSG_ERROR([libtool configure is used but libtool is disabled?])
+ fi
+ 
+-DHLIBS=LIBRARIES
+-A=a
++DHLIBS=LTLIBRARIES
++A=la
++BINDLT="--with-libtool --disable-symtable"
++DISTCHECK_LIBTOOL_CONFIGURE_FLAG="--enable-libtool"
++
+ 
+ AC_SUBST(DHLIBS)
+ AC_SUBST(A)
+@@ -895,6 +880,7 @@ AC_SUBST(Q)
+ # install bind includes and libraries
+ 
+ want_install_bind="no"
++want_install_bind="yes"
+ if test "$want_libtool" = "yes"; then
+ 	want_install_bind="yes"
+ fi
+@@ -903,7 +889,7 @@ if test "$use_libbind" != "no"; then
+ fi
+ AC_ARG_ENABLE(bind_install,
+ 	AS_HELP_STRING([--enable-bind-install],
+-[install bind includes and libraries (default is no).]),
++[install bind includes and libraries.]),
+ 	want_install_bind="$enableval")
+ if test "$want_install_bind" = "yes"; then
+         if test "$use_libbind" != "no"; then
+@@ -914,6 +900,18 @@ elif test "$want_libtool" = "yes" -a "$u
+ fi
+ AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
+ 
++AC_ARG_WITH(libxml2,
++	AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
++	with_libxml2="$withval", with_libxml2="no")
++
++if test x$with_libxml2 != xno; then
++	AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
++		[if test x$with_libxml2 != xauto; then
++			AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
++		fi])
++fi
++
++
+ # OpenLDAP support.
+ AC_ARG_WITH(ldap,
+     AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
+@@ -985,6 +983,17 @@ if test x$ldap = xyes || test x$ldapcryp
+     AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
+ fi
+ 
++AC_ARG_WITH(systemd,
++        AC_HELP_STRING([--with-systemd],
++                       [enable sending status notifications to systemd daemon (default is no)]),
++        [systemd=$withval],
++        [systemd=no])
++
++if test x$systemd = xyes ; then
++   AC_CHECK_LIB(systemd, sd_notifyf, ,
++                AC_MSG_FAILURE([*** systemd library not present - do you need to install systemd-libs package?]))
++fi
++
+ # Append selected warning levels to CFLAGS before substitution (but after
+ # AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
+ CFLAGS="$CFLAGS $STD_CWARNINGS"
+@@ -1029,6 +1038,10 @@ AC_CONFIG_FILES([
+ ])
+ AC_OUTPUT
+ 
++AC_MSG_NOTICE([postconfig: run automake in $srcdir])
++(cd $srcdir; automake)
++AC_MSG_NOTICE([postconfig: rerun config.status])
++sh ./config.status
+ 
+ if test "$enable_dhcpv4o6" = "yes"; then
+ 	DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"

+ 64 - 0
recipes-connectivity/dhcp/dhcp/0013-fixup_use_libbind.patch

@@ -0,0 +1,64 @@
+lib and include path is hardcoded for use_libbind 
+
+use libdir and includedir vars
+
+Upstream-Status: Pending
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: dhcp-4.4.3/configure.ac+lt
+===================================================================
+--- dhcp-4.4.3.orig/configure.ac+lt
++++ dhcp-4.4.3/configure.ac+lt
+@@ -792,22 +792,22 @@ no)
+ 	if test ! -d "$use_libbind"; then
+ 		AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
+ 	fi
+-	if test ! -d "$use_libbind/include" -o \
+-	        ! -f "$use_libbind/include/isc/buffer.h"
++	if test ! -d "$use_libbind/$includedir" -o \
++	        ! -f "$use_libbind/$includedir/isc/buffer.h"
+ 	then
+-		AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
++		AC_MSG_ERROR([Cannot find bind includes at $use_libbind/$includedir])
+ 	fi
+-	if test	! -d "$use_libbind/lib" -o \
+-	        \( ! -f "$use_libbind/lib/libisc.a" -a \
+-		   ! -f	"$use_libbind/lib/libisc.la" \)
++	if test	! -d "$use_libbind/$libdir" -o \
++	        \( ! -f "$use_libbind/$libdir/libisc.a" -a \
++		   ! -f	"$use_libbind/$libdir/libisc.la" \)
+ 	then
+-		AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
++		AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/$libdir])
+ 	fi
+ 	BINDDIR="$use_libbind"
+-	BINDLIBIRSDIR="$BINDDIR/lib"
+-	BINDLIBDNSDIR="$BINDDIR/lib"
+-	BINDLIBISCCFGDIR="$BINDDIR/lib"
+-	BINDLIBISCDIR="$BINDDIR/lib"
++	BINDLIBIRSDIR="$BINDDIR/$libdir"
++	BINDLIBDNSDIR="$BINDDIR/$libdir"
++	BINDLIBISCCFGDIR="$BINDDIR/$libdir"
++	BINDLIBISCDIR="$BINDDIR/$libdir"
+ 	DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
+ 	;;
+ esac
+@@ -847,14 +847,14 @@ AC_ARG_ENABLE(libtool,
+ 
+ if test "$use_libbind" != "no"; then
+ 	if test "$want_libtool" = "yes" -a \
+-	        ! -f "$use_libbind/lib/libisc.la"
++	        ! -f "$use_libbind/$libdir/libisc.la"
+ 	then
+-		AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
++		AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/$libdir])
+ 	fi
+ 	if test "$want_libtool" = "no" -a \
+-	        ! -f "$use_libbind/lib/libisc.a"
++	        ! -f "$use_libbind/$libdir/libisc.a"
+ 	then
+-		AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
++		AC_MSG_ERROR([Cannot find static libraries at $use_libbind/$libdir])
+ 	fi
+ fi
+ 

+ 93 - 0
recipes-connectivity/dhcp/dhcp/0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch

@@ -0,0 +1,93 @@
+From d1b1f91a7982be28acdfb580996c93aafcc76cc2 Mon Sep 17 00:00:00 2001
+From: Pavel Zhukov <pzhukov@redhat.com>
+Date: Thu, 7 Nov 2019 14:47:45 +0100
+Subject: [PATCH 27/28] Add missed sd notify patch to manage dhcpd with systemd
+
+---
+ configure.ac     | 11 +++++++++++
+ relay/dhcrelay.c | 12 ++++++++++++
+ server/dhcpd.c   | 12 ++++++++++++
+ 3 files changed, 35 insertions(+)
+
+Index: dhcp-4.4.3/configure.ac+lt
+===================================================================
+--- dhcp-4.4.3.orig/configure.ac+lt
++++ dhcp-4.4.3/configure.ac+lt
+@@ -983,6 +983,17 @@ if test x$ldap = xyes || test x$ldapcryp
+     AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
+ fi
+ 
++AC_ARG_WITH(systemd,
++        AC_HELP_STRING([--with-systemd],
++                       [enable sending status notifications to systemd daemon (default is no)]),
++        [systemd=$withval],
++        [systemd=no])
++
++if test x$systemd = xyes ; then
++   AC_CHECK_LIB(systemd, sd_notifyf, ,
++                AC_MSG_FAILURE([*** systemd library not present - do you need to install systemd-libs package?]))
++fi
++
+ # Append selected warning levels to CFLAGS before substitution (but after
+ # AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
+ CFLAGS="$CFLAGS $STD_CWARNINGS"
+Index: dhcp-4.4.3/relay/dhcrelay.c
+===================================================================
+--- dhcp-4.4.3.orig/relay/dhcrelay.c
++++ dhcp-4.4.3/relay/dhcrelay.c
+@@ -32,6 +32,10 @@
+ #include <sys/time.h>
+ #include <isc/file.h>
+ 
++#ifdef HAVE_LIBSYSTEMD
++#include <systemd/sd-daemon.h>
++#endif
++
+ TIME default_lease_time = 43200; /* 12 hours... */
+ TIME max_lease_time = 86400; /* 24 hours... */
+ struct tree_cache *global_options[256];
+@@ -840,6 +844,14 @@ main(int argc, char **argv) {
+ 	signal(SIGTERM, dhcp_signal_handler);  /* kill */
+ #endif
+ 
++#ifdef HAVE_LIBSYSTEMD
++        /* We are ready to process incomming packets. Let's notify systemd */
++        sd_notifyf(0, "READY=1\n"
++                   "STATUS=Dispatching packets...\n"
++                   "MAINPID=%lu",
++                   (unsigned long) getpid());
++#endif
++
+ 	/* Start dispatching packets and timeouts... */
+ 	dispatch();
+ 
+Index: dhcp-4.4.3/server/dhcpd.c
+===================================================================
+--- dhcp-4.4.3.orig/server/dhcpd.c
++++ dhcp-4.4.3/server/dhcpd.c
+@@ -60,6 +60,10 @@ gid_t set_gid = 0;
+ struct class unknown_class;
+ struct class known_class;
+ 
++#ifdef HAVE_LIBSYSTEMD
++#include <systemd/sd-daemon.h>
++#endif
++
+ struct iaddr server_identifier;
+ int server_identifier_matched;
+ 
+@@ -1057,6 +1061,14 @@ main(int argc, char **argv) {
+ 	/* Log that we are about to start working */
+ 	log_info("Server starting service.");
+ 
++#ifdef HAVE_LIBSYSTEMD
++        /* We are ready to process incomming packets. Let's notify systemd */
++        sd_notifyf(0, "READY=1\n"
++                   "STATUS=Dispatching packets...\n"
++                   "MAINPID=%lu",
++                   (unsigned long) getpid());
++#endif
++
+ 	/*
+ 	 * Receive packets and dispatch them...
+ 	 * dispatch() will never return.

+ 14 - 0
recipes-connectivity/dhcp/dhcp/add-riscv-support.patch

@@ -0,0 +1,14 @@
+diff --git a/bind/bind-9.11.36/config.sub b/bind/bind-9.11.36/config2.sub
+index 61cb4bc..145abd0 100644
+--- a/bind/bind-9.11.36/config.sub
++++ b/bind/bind-9.11.36/config.sub
+@@ -301,7 +301,7 @@ case $basic_machine in
+        | pdp10 | pdp11 | pj | pjl \
+        | powerpc | powerpc64 | powerpc64le | powerpcle \
+        | pyramid \
+-       | rl78 | rx \
++       | riscv64 | rl78 | rx \
+        | score \
+        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+        | sh64 | sh64le \
+

BIN
recipes-connectivity/dhcp/dhcp/bind.tar.gz


+ 26 - 0
recipes-connectivity/dhcp/dhcp_%.bbappend

@@ -0,0 +1,26 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI += "\
+    file://dhcp-CLOEXEC.patch \
+    file://0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch \
+    file://bind.tar.gz;unpack=0 \
+"
+
+do_configure:prepend () {
+	#Replace bind.tar.gz without riscv64 with our patched one
+	rm -f ${S}/bind/bind.tar.gz
+	install ${S}/../bind.tar.gz ${S}/bind/
+}
+
+do_install:append() {
+	rm ${D}/usr/include/irs/resconf.h
+	rm -rf ${D}/usr/include/dns/
+	rm -rf ${D}/usr/include/isc/
+	rm -rf ${D}/usr/include/isccfg/
+	rm -f ${D}/usr/include/dst/dst.h
+	rm -f ${D}/usr/include/dst/gssapi.h
+	rm -f ${D}/usr/lib/libdns.so
+	rm -f ${D}/usr/lib/libirs.so
+	rm -f ${D}/usr/lib/libisccfg.so
+	rm -f ${D}/usr/lib/libisc.so
+}

+ 39 - 0
recipes-connectivity/dhcp/dhcp_4.4.3.bb

@@ -0,0 +1,39 @@
+require dhcp.inc
+
+SRC_URI += "file://0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch \
+            file://0002-dhclient-dbus.patch \
+            file://0003-link-with-lcrypto.patch \
+            file://0004-Fix-out-of-tree-builds.patch \
+            file://0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch \
+            file://0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch \
+            file://0009-remove-dhclient-script-bash-dependency.patch \
+            file://0012-dhcp-correct-the-intention-for-xml2-lib-search.patch \
+            file://0013-fixup_use_libbind.patch \
+            file://0001-workaround-busybox-limitation-in-linux-dhclient-script.patch \
+"
+
+SRC_URI[md5sum] = "9076af4cc1293dde5a7c6cae7de6ab45"
+SRC_URI[sha256sum] = "0e3ec6b4c2a05ec0148874bcd999a66d05518378d77421f607fb0bc9d0135818"
+
+LDFLAGS:append = " -pthread"
+
+PACKAGECONFIG ?= "systemd"
+PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2"
+PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
+
+CFLAGS += "-fcommon"
+
+python dhcp_split_compat() {
+    do_split_packages(d,
+                      root = '${libdir}',
+                      file_regex = r'^lib(.*)\.so\..*',
+                      output_pattern = '${PN}-lib%s',
+                      description = 'dhcp %s library',
+                      extra_depends = '',
+                      allow_links = True)
+}
+
+PACKAGES:remove = "dhcp-libs"
+PACKAGES_DYNAMIC = "^${PN}-lib.*"
+
+PACKAGE_PREPROCESS_FUNCS += "dhcp_split_compat"

+ 12 - 0
recipes-connectivity/dhcp/files/default-relay

@@ -0,0 +1,12 @@
+# Defaults for dhcp-relay initscript
+# sourced by /etc/init.d/dhcp-relay
+
+# What servers should the DHCP relay forward requests to?
+# e.g: SERVERS="192.168.0.1"
+SERVERS=""
+
+# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
+INTERFACES=""
+
+# Additional options that are passed to the DHCP relay daemon?
+OPTIONS=""

+ 7 - 0
recipes-connectivity/dhcp/files/default-server

@@ -0,0 +1,7 @@
+# Defaults for dhcp initscript
+# sourced by /etc/init.d/dhcp-server
+# installed at /etc/default/dhcp-server by the maintainer scripts
+
+# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
+#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
+INTERFACES=""

+ 39 - 0
recipes-connectivity/dhcp/files/dhclient-systemd-wrapper

@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# In case the interface is used for nfs, skip it.
+nfsroot=0
+interfaces=""
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+    if test $mtpt = "/" ; then
+        case $fstype in
+            nfs | nfs4)
+                nfsroot=1
+                nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
+                break
+                ;;
+            *)
+                ;;
+        esac
+    fi
+done
+exec 0<&9 9<&-
+
+if [ $nfsroot -eq 0 ]; then
+    interfaces="$INTERFACES"
+else
+    if [ -x /bin/ip -o -x /sbin/ip ] ; then
+	nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
+    fi
+    for i in $INTERFACES; do
+	if test "x$i" = "x$nfs_iface"; then
+            echo "dhclient skipping nfsroot interface $i"
+	else
+	    interfaces="$interfaces $i"
+	fi
+    done
+fi
+
+if test "x$interfaces" != "x"; then
+    /sbin/dhclient -d -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $interfaces
+fi

+ 50 - 0
recipes-connectivity/dhcp/files/dhclient.conf

@@ -0,0 +1,50 @@
+# Configuration file for /sbin/dhclient, which is included in Debian's
+#	dhcp3-client package.
+#
+# This is a sample configuration file for dhclient. See dhclient.conf's
+#	man page for more information about the syntax of this file
+#	and a more comprehensive list of the parameters understood by
+#	dhclient.
+#
+# Normally, if the DHCP server provides reasonable information and does
+#	not leave anything out (like the domain name, for example), then
+#	few changes must be made to this file, if any.
+#
+
+#send host-name "andare.fugue.com";
+#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
+#send dhcp-lease-time 3600;
+#supersede domain-name "fugue.com home.vix.com";
+#prepend domain-name-servers 127.0.0.1;
+request subnet-mask, broadcast-address, time-offset, routers,
+	domain-name, domain-name-servers, host-name,
+	netbios-name-servers, netbios-scope;
+#require subnet-mask, domain-name-servers;
+#timeout 60;
+#retry 60;
+#reboot 10;
+#select-timeout 5;
+#initial-interval 2;
+#script "/etc/dhcp3/dhclient-script";
+#media "-link0 -link1 -link2", "link0 link1";
+#reject 192.33.137.209;
+
+#alias {
+#  interface "eth0";
+#  fixed-address 192.5.5.213;
+#  option subnet-mask 255.255.255.255;
+#}
+
+#lease {
+#  interface "eth0";
+#  fixed-address 192.33.137.200;
+#  medium "link0 link1";
+#  option host-name "andare.swiftmedia.com";
+#  option subnet-mask 255.255.255.0;
+#  option broadcast-address 192.33.137.255;
+#  option routers 192.33.137.250;
+#  option domain-name-servers 127.0.0.1;
+#  renew 2 2000/1/12 00:00:01;
+#  rebind 2 2000/1/12 00:00:01;
+#  expire 2 2000/1/12 00:00:01;
+#}

+ 13 - 0
recipes-connectivity/dhcp/files/dhclient.service

@@ -0,0 +1,13 @@
+[Unit]
+Description=Dynamic Host Configuration Protocol (DHCP)
+Wants=network.target
+Before=network.target
+After=systemd-udevd.service
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/default/dhcp-client
+ExecStart=@BASE_SBINDIR@/dhclient-systemd-wrapper
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target

+ 349 - 0
recipes-connectivity/dhcp/files/dhcp-CLOEXEC.patch

@@ -0,0 +1,349 @@
+Index: dhcp-4.4.3/client/clparse.c
+===================================================================
+--- dhcp-4.4.3.orig/client/clparse.c
++++ dhcp-4.4.3/client/clparse.c
+@@ -265,7 +265,7 @@ int read_client_conf_file (const char *n
+ 	int token;
+ 	isc_result_t status;
+ 
+-	if ((file = open (name, O_RDONLY)) < 0)
++	if ((file = open (name, O_RDONLY | O_CLOEXEC)) < 0)
+ 		return uerr2isc (errno);
+ 
+ 	cfile = NULL;
+@@ -341,7 +341,7 @@ void read_client_leases ()
+ 
+ 	/* Open the lease file.   If we can't open it, just return -
+ 	   we can safely trust the server to remember our state. */
+-	if ((file = open (path_dhclient_db, O_RDONLY)) < 0)
++	if ((file = open (path_dhclient_db, O_RDONLY | O_CLOEXEC)) < 0)
+ 		return;
+ 
+ 	cfile = NULL;
+Index: dhcp-4.4.3/client/dhclient.c
+===================================================================
+--- dhcp-4.4.3.orig/client/dhclient.c
++++ dhcp-4.4.3/client/dhclient.c
+@@ -255,11 +255,11 @@ main(int argc, char **argv) {
+ 	/* Make sure that file descriptors 0 (stdin), 1, (stdout), and
+ 	   2 (stderr) are open. To do this, we assume that when we
+ 	   open a file the lowest available file descriptor is used. */
+-	fd = open("/dev/null", O_RDWR);
++	fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+ 	if (fd == 0)
+-		fd = open("/dev/null", O_RDWR);
++		fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+ 	if (fd == 1)
+-		fd = open("/dev/null", O_RDWR);
++		fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+ 	if (fd == 2)
+ 		log_perror = 0; /* No sense logging to /dev/null. */
+ 	else if (fd != -1)
+@@ -664,7 +664,7 @@ main(int argc, char **argv) {
+ 		long temp;
+ 		int e;
+ 
+-		if ((pidfd = fopen(path_dhclient_pid, "r")) != NULL) {
++		if ((pidfd = fopen(path_dhclient_pid, "re")) != NULL) {
+ 			e = fscanf(pidfd, "%ld\n", &temp);
+ 			oldpid = (pid_t)temp;
+ 
+@@ -3721,7 +3721,7 @@ void rewrite_client_leases ()
+ 
+ 	if (leaseFile != NULL)
+ 		fclose (leaseFile);
+-	leaseFile = fopen (path_dhclient_db, "w");
++	leaseFile = fopen (path_dhclient_db, "we");
+ 	if (leaseFile == NULL) {
+ 		log_error ("can't create %s: %m", path_dhclient_db);
+ 		return;
+@@ -3916,7 +3916,7 @@ write_duid(struct data_string *duid)
+ 		return DHCP_R_INVALIDARG;
+ 
+ 	if (leaseFile == NULL) {	/* XXX? */
+-		leaseFile = fopen(path_dhclient_db, "w");
++		leaseFile = fopen(path_dhclient_db, "we");
+ 		if (leaseFile == NULL) {
+ 			log_error("can't create %s: %m", path_dhclient_db);
+ 			return ISC_R_IOERROR;
+@@ -3961,7 +3961,7 @@ write_client6_lease(struct client_state
+ 		return DHCP_R_INVALIDARG;
+ 
+ 	if (leaseFile == NULL) {	/* XXX? */
+-		leaseFile = fopen(path_dhclient_db, "w");
++		leaseFile = fopen(path_dhclient_db, "we");
+ 		if (leaseFile == NULL) {
+ 			log_error("can't create %s: %m", path_dhclient_db);
+ 			return ISC_R_IOERROR;
+@@ -4120,7 +4120,7 @@ int write_client_lease (client, lease, r
+ 		return 1;
+ 
+ 	if (leaseFile == NULL) {	/* XXX */
+-		leaseFile = fopen (path_dhclient_db, "w");
++		leaseFile = fopen (path_dhclient_db, "we");
+ 		if (leaseFile == NULL) {
+ 			log_error ("can't create %s: %m", path_dhclient_db);
+ 			return 0;
+@@ -4706,9 +4706,9 @@ void detach ()
+ 	(void) close(2);
+ 
+ 	/* Reopen them on /dev/null. */
+-	(void) open("/dev/null", O_RDWR);
+-	(void) open("/dev/null", O_RDWR);
+-	(void) open("/dev/null", O_RDWR);
++	(void) open("/dev/null", O_RDWR | O_CLOEXEC);
++	(void) open("/dev/null", O_RDWR | O_CLOEXEC);
++	(void) open("/dev/null", O_RDWR | O_CLOEXEC);
+ 
+ 	write_client_pid_file ();
+ 
+@@ -4726,14 +4726,14 @@ void write_client_pid_file ()
+ 		return;
+ 	}
+ 
+-	pfdesc = open (path_dhclient_pid, O_CREAT | O_TRUNC | O_WRONLY, 0644);
++	pfdesc = open (path_dhclient_pid, O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC, 0644);
+ 
+ 	if (pfdesc < 0) {
+ 		log_error ("Can't create %s: %m", path_dhclient_pid);
+ 		return;
+ 	}
+ 
+-	pf = fdopen (pfdesc, "w");
++	pf = fdopen (pfdesc, "we");
+ 	if (!pf) {
+ 		close(pfdesc);
+ 		log_error ("Can't fdopen %s: %m", path_dhclient_pid);
+Index: dhcp-4.4.3/common/bpf.c
+===================================================================
+--- dhcp-4.4.3.orig/common/bpf.c
++++ dhcp-4.4.3/common/bpf.c
+@@ -94,7 +94,7 @@ int if_register_bpf (info)
+ 	for (b = 0; 1; b++) {
+ 		/* %Audit% 31 bytes max. %2004.06.17,Safe% */
+ 		sprintf(filename, BPF_FORMAT, b);
+-		sock = open (filename, O_RDWR, 0);
++		sock = open (filename, O_RDWR | O_CLOEXEC, 0);
+ 		if (sock < 0) {
+ 			if (errno == EBUSY) {
+ 				continue;
+Index: dhcp-4.4.3/common/dlpi.c
+===================================================================
+--- dhcp-4.4.3.orig/common/dlpi.c
++++ dhcp-4.4.3/common/dlpi.c
+@@ -817,7 +817,7 @@ dlpiopen(const char *ifname) {
+ 	}
+ 	*dp = '\0';
+ 
+-	return open (devname, O_RDWR, 0);
++	return open (devname, O_RDWR | O_CLOEXEC, 0);
+ }
+ 
+ /*
+Index: dhcp-4.4.3/common/nit.c
+===================================================================
+--- dhcp-4.4.3.orig/common/nit.c
++++ dhcp-4.4.3/common/nit.c
+@@ -75,7 +75,7 @@ int if_register_nit (info)
+ 	struct strioctl sio;
+ 
+ 	/* Open a NIT device */
+-	sock = open ("/dev/nit", O_RDWR);
++	sock = open ("/dev/nit", O_RDWR | O_CLOEXEC);
+ 	if (sock < 0)
+ 		log_fatal ("Can't open NIT device for %s: %m", info -> name);
+ 
+Index: dhcp-4.4.3/common/resolv.c
+===================================================================
+--- dhcp-4.4.3.orig/common/resolv.c
++++ dhcp-4.4.3/common/resolv.c
+@@ -43,7 +43,7 @@ void read_resolv_conf (parse_time)
+ 	struct domain_search_list *dp, *dl, *nd;
+ 	isc_result_t status;
+ 
+-	if ((file = open (path_resolv_conf, O_RDONLY)) < 0) {
++	if ((file = open (path_resolv_conf, O_RDONLY | O_CLOEXEC)) < 0) {
+ 		log_error ("Can't open %s: %m", path_resolv_conf);
+ 		return;
+ 	}
+Index: dhcp-4.4.3/common/upf.c
+===================================================================
+--- dhcp-4.4.3.orig/common/upf.c
++++ dhcp-4.4.3/common/upf.c
+@@ -71,7 +71,7 @@ int if_register_upf (info)
+ 		/* %Audit% Cannot exceed 36 bytes. %2004.06.17,Safe% */
+ 		sprintf(filename, "/dev/pf/pfilt%d", b);
+ 
+-		sock = open (filename, O_RDWR, 0);
++		sock = open (filename, O_RDWR | O_CLOEXEC, 0);
+ 		if (sock < 0) {
+ 			if (errno == EBUSY) {
+ 				continue;
+Index: dhcp-4.4.3/omapip/trace.c
+===================================================================
+--- dhcp-4.4.3.orig/omapip/trace.c
++++ dhcp-4.4.3/omapip/trace.c
+@@ -136,10 +136,10 @@ isc_result_t trace_begin (const char *fi
+ 		return DHCP_R_INVALIDARG;
+ 	}
+ 
+-	traceoutfile = open (filename, O_CREAT | O_WRONLY | O_EXCL, 0600);
++	traceoutfile = open (filename, O_CREAT | O_WRONLY | O_EXCL | O_CLOEXEC, 0600);
+ 	if (traceoutfile < 0 && errno == EEXIST) {
+ 		log_error ("WARNING: Overwriting trace file \"%s\"", filename);
+-		traceoutfile = open (filename, O_WRONLY | O_EXCL | O_TRUNC,
++		traceoutfile = open (filename, O_WRONLY | O_EXCL | O_TRUNC | O_CLOEXEC,
+ 				     0600);
+ 	}
+ 
+@@ -427,7 +427,7 @@ void trace_file_replay (const char *file
+ 	isc_result_t result;
+ 	int len;
+ 
+-	traceinfile = fopen (filename, "r");
++	traceinfile = fopen (filename, "re");
+ 	if (!traceinfile) {
+ 		log_error("Can't open tracefile %s: %m", filename);
+ 		return;
+Index: dhcp-4.4.3/relay/dhcrelay.c
+===================================================================
+--- dhcp-4.4.3.orig/relay/dhcrelay.c
++++ dhcp-4.4.3/relay/dhcrelay.c
+@@ -305,11 +305,11 @@ main(int argc, char **argv) {
+ 	/* Make sure that file descriptors 0(stdin), 1,(stdout), and
+ 	   2(stderr) are open. To do this, we assume that when we
+ 	   open a file the lowest available file descriptor is used. */
+-	fd = open("/dev/null", O_RDWR);
++	fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+ 	if (fd == 0)
+-		fd = open("/dev/null", O_RDWR);
++		fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+ 	if (fd == 1)
+-		fd = open("/dev/null", O_RDWR);
++		fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+ 	if (fd == 2)
+ 		log_perror = 0; /* No sense logging to /dev/null. */
+ 	else if (fd != -1)
+@@ -800,13 +800,13 @@ main(int argc, char **argv) {
+ 		/* Create the pid file. */
+ 		if (no_pid_file == ISC_FALSE) {
+ 			pfdesc = open(path_dhcrelay_pid,
+-				      O_CREAT | O_TRUNC | O_WRONLY, 0644);
++				      O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC, 0644);
+ 
+ 			if (pfdesc < 0) {
+ 				log_error("Can't create %s: %m",
+ 					  path_dhcrelay_pid);
+ 			} else {
+-				pf = fdopen(pfdesc, "w");
++				pf = fdopen(pfdesc, "we");
+ 				if (!pf)
+ 					log_error("Can't fdopen %s: %m",
+ 						  path_dhcrelay_pid);
+Index: dhcp-4.4.3/server/confpars.c
+===================================================================
+--- dhcp-4.4.3.orig/server/confpars.c
++++ dhcp-4.4.3/server/confpars.c
+@@ -118,7 +118,7 @@ isc_result_t read_conf_file (const char
+ 	}
+ #endif
+ 
+-	if ((file = open (filename, O_RDONLY)) < 0) {
++	if ((file = open (filename, O_RDONLY | O_CLOEXEC)) < 0) {
+ 		if (leasep) {
+ 			log_error ("Can't open lease database %s: %m --",
+ 				   path_dhcpd_db);
+Index: dhcp-4.4.3/server/db.c
+===================================================================
+--- dhcp-4.4.3.orig/server/db.c
++++ dhcp-4.4.3/server/db.c
+@@ -1105,7 +1105,7 @@ void db_startup (int test_mode)
+ 	* Therefore, in test mode we need to point db_file to a disposable
+ 	* file to protect the original lease file. */
+ 	current_db_path = (test_mode ? "/dev/null" : path_dhcpd_db);
+-	db_file = fopen (current_db_path, "a");
++	db_file = fopen (current_db_path, "ae");
+ 	if (!db_file) {
+ 		log_fatal ("Can't open %s for append.", current_db_path);
+ 	}
+@@ -1154,7 +1154,7 @@ int new_lease_file (int test_mode)
+ 		     path_dhcpd_db, (int)t) >= sizeof newfname)
+ 		log_fatal("new_lease_file: lease file path too long");
+ 
+-	db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT, 0664);
++	db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, 0664);
+ 	if (db_fd < 0) {
+ 		log_error ("Can't create new lease file: %m");
+ 		return 0;
+@@ -1175,7 +1175,7 @@ int new_lease_file (int test_mode)
+ 	}
+ #endif /* PARANOIA */
+ 
+-	if ((new_db_file = fdopen(db_fd, "w")) == NULL) {
++	if ((new_db_file = fdopen(db_fd, "we")) == NULL) {
+ 		log_error("Can't fdopen new lease file: %m");
+ 		close(db_fd);
+ 		goto fdfail;
+Index: dhcp-4.4.3/server/dhcpd.c
+===================================================================
+--- dhcp-4.4.3.orig/server/dhcpd.c
++++ dhcp-4.4.3/server/dhcpd.c
+@@ -300,11 +300,11 @@ main(int argc, char **argv) {
+         /* Make sure that file descriptors 0 (stdin), 1, (stdout), and
+            2 (stderr) are open. To do this, we assume that when we
+            open a file the lowest available file descriptor is used. */
+-        fd = open("/dev/null", O_RDWR);
++        fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+         if (fd == 0)
+-                fd = open("/dev/null", O_RDWR);
++                fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+         if (fd == 1)
+-                fd = open("/dev/null", O_RDWR);
++                fd = open("/dev/null", O_RDWR | O_CLOEXEC);
+         if (fd == 2)
+                 log_perror = 0; /* No sense logging to /dev/null. */
+         else if (fd != -1)
+@@ -865,7 +865,7 @@ main(int argc, char **argv) {
+ 	 */
+ 	if ((lftest == 0) && (no_pid_file == ISC_FALSE)) {
+ 		/*Read previous pid file. */
+-		if ((i = open(path_dhcpd_pid, O_RDONLY)) >= 0) {
++		if ((i = open(path_dhcpd_pid, O_RDONLY|O_CLOEXEC)) >= 0) {
+ 			status = read(i, pbuf, (sizeof pbuf) - 1);
+ 			close(i);
+ 			if (status > 0) {
+@@ -975,7 +975,7 @@ main(int argc, char **argv) {
+ 	 * appropriate.
+ 	 */
+ 	if (no_pid_file == ISC_FALSE) {
+-		i = open(path_dhcpd_pid, O_WRONLY|O_CREAT|O_TRUNC, 0644);
++		i = open(path_dhcpd_pid, O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644);
+ 		if (i >= 0) {
+ 			sprintf(pbuf, "%d\n", (int) getpid());
+ 			IGNORE_RET(write(i, pbuf, strlen(pbuf)));
+@@ -1028,9 +1028,9 @@ main(int argc, char **argv) {
+                 (void) close(2);
+ 
+                 /* Reopen them on /dev/null. */
+-                (void) open("/dev/null", O_RDWR);
+-                (void) open("/dev/null", O_RDWR);
+-                (void) open("/dev/null", O_RDWR);
++                (void) open("/dev/null", O_RDWR | O_CLOEXEC);
++                (void) open("/dev/null", O_RDWR | O_CLOEXEC);
++                (void) open("/dev/null", O_RDWR | O_CLOEXEC);
+                 log_perror = 0; /* No sense logging to /dev/null. */
+ 
+        		IGNORE_RET (chdir("/"));
+Index: dhcp-4.4.3/server/ldap.c
+===================================================================
+--- dhcp-4.4.3.orig/server/ldap.c
++++ dhcp-4.4.3/server/ldap.c
+@@ -1447,7 +1447,7 @@ ldap_start (void)
+ 
+   if (ldap_debug_file != NULL && ldap_debug_fd == -1)
+     {
+-      if ((ldap_debug_fd = open (ldap_debug_file, O_CREAT | O_TRUNC | O_WRONLY,
++      if ((ldap_debug_fd = open (ldap_debug_file, O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC,
+                                  S_IRUSR | S_IWUSR)) < 0)
+         log_error ("Error opening debug LDAP log file %s: %s", ldap_debug_file,
+                    strerror (errno));

+ 108 - 0
recipes-connectivity/dhcp/files/dhcpd.conf

@@ -0,0 +1,108 @@
+#
+# Sample configuration file for ISC dhcpd for Debian
+#
+# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
+#
+
+# The ddns-updates-style parameter controls whether or not the server will
+# attempt to do a DNS update when a lease is confirmed. We default to the
+# behavior of the version 2 packages ('none', since DHCP v2 didn't
+# have support for DDNS.)
+ddns-update-style none;
+
+# option definitions common to all supported networks...
+option domain-name "example.org";
+option domain-name-servers ns1.example.org, ns2.example.org;
+
+default-lease-time 600;
+max-lease-time 7200;
+
+# If this DHCP server is the official DHCP server for the local
+# network, the authoritative directive should be uncommented.
+#authoritative;
+
+# Use this to send dhcp log messages to a different log file (you also
+# have to hack syslog.conf to complete the redirection).
+log-facility local7;
+
+# No service will be given on this subnet, but declaring it helps the 
+# DHCP server to understand the network topology.
+
+#subnet 10.152.187.0 netmask 255.255.255.0 {
+#}
+
+# This is a very basic subnet declaration.
+
+#subnet 10.254.239.0 netmask 255.255.255.224 {
+#  range 10.254.239.10 10.254.239.20;
+#  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
+#}
+
+# This declaration allows BOOTP clients to get dynamic addresses,
+# which we don't really recommend.
+
+#subnet 10.254.239.32 netmask 255.255.255.224 {
+#  range dynamic-bootp 10.254.239.40 10.254.239.60;
+#  option broadcast-address 10.254.239.31;
+#  option routers rtr-239-32-1.example.org;
+#}
+
+# A slightly different configuration for an internal subnet.
+#subnet 10.5.5.0 netmask 255.255.255.224 {
+#  range 10.5.5.26 10.5.5.30;
+#  option domain-name-servers ns1.internal.example.org;
+#  option domain-name "internal.example.org";
+#  option routers 10.5.5.1;
+#  option broadcast-address 10.5.5.31;
+#  default-lease-time 600;
+#  max-lease-time 7200;
+#}
+
+# Hosts which require special configuration options can be listed in
+# host statements.   If no address is specified, the address will be
+# allocated dynamically (if possible), but the host-specific information
+# will still come from the host declaration.
+
+#host passacaglia {
+#  hardware ethernet 0:0:c0:5d:bd:95;
+#  filename "vmunix.passacaglia";
+#  server-name "toccata.fugue.com";
+#}
+
+# Fixed IP addresses can also be specified for hosts.   These addresses
+# should not also be listed as being available for dynamic assignment.
+# Hosts for which fixed IP addresses have been specified can boot using
+# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
+# be booted with DHCP, unless there is an address range on the subnet
+# to which a BOOTP client is connected which has the dynamic-bootp flag
+# set.
+#host fantasia {
+#  hardware ethernet 08:00:07:26:c0:a5;
+#  fixed-address fantasia.fugue.com;
+#}
+
+# You can declare a class of clients and then do address allocation
+# based on that.   The example below shows a case where all clients
+# in a certain class get addresses on the 10.17.224/24 subnet, and all
+# other clients get addresses on the 10.0.29/24 subnet.
+
+#class "foo" {
+#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
+#}
+
+#shared-network 224-29 {
+#  subnet 10.17.224.0 netmask 255.255.255.0 {
+#    option routers rtr-224.example.org;
+#  }
+#  subnet 10.0.29.0 netmask 255.255.255.0 {
+#    option routers rtr-29.example.org;
+#  }
+#  pool {
+#    allow members of "foo";
+#    range 10.17.224.10 10.17.224.250;
+#  }
+#  pool {
+#    deny members of "foo";
+#    range 10.0.29.10 10.0.29.230;
+#  }
+#}

+ 15 - 0
recipes-connectivity/dhcp/files/dhcpd.service

@@ -0,0 +1,15 @@
+[Unit]
+Description=DHCPv4 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+PIDFile=/run/dhcpd.pid
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server
+ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases
+ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf /run/dhcpd.pid $DHCPDARGS -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target

+ 15 - 0
recipes-connectivity/dhcp/files/dhcpd6.service

@@ -0,0 +1,15 @@
+[Unit]
+Description=DHCPv6 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+PIDFile=/run/dhcpd6.pid
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcpd6
+ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd6.leases
+ExecStart=@SBINDIR@/dhcpd -f -6 -cf @SYSCONFDIR@/dhcp/dhcpd6.conf -pf /run/dhcpd6.pid $DHCPDARGS -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target

+ 10 - 0
recipes-connectivity/dhcp/files/dhcrelay.service

@@ -0,0 +1,10 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+After=network.target
+
+[Service]
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-relay
+ExecStart=@SBINDIR@/dhcrelay -d --no-pid -q $SERVERS
+
+[Install]
+WantedBy=multi-user.target

+ 44 - 0
recipes-connectivity/dhcp/files/init-relay

@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
+#
+
+# It is not safe to start if we don't have a default configuration...
+if [ ! -f /etc/default/dhcp-relay ]; then
+	echo "/etc/default/dhcp-relay does not exist! - Aborting..."
+	echo "create this file to fix the problem."
+	exit 1
+fi
+
+# Read init script configuration (interfaces the daemon should listen on
+# and the DHCP server we should forward requests to.)
+. /etc/default/dhcp-relay
+
+# Build command line for interfaces (will be passed to dhrelay below.)
+IFCMD=""
+if test "$INTERFACES" != ""; then
+	for I in $INTERFACES; do
+		IFCMD=${IFCMD}"-i "${I}" "
+	done
+fi
+
+DHCRELAYPID=/run/dhcrelay.pid
+
+case "$1" in
+	start)
+		start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
+		;;
+	stop)
+		start-stop-daemon -K -x /usr/sbin/dhcrelay
+		;;
+	restart | force-reload)
+		$0 stop
+		sleep 2
+		$0 start
+		;;
+	*)
+		echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
+		exit 1 
+esac
+
+exit 0

+ 44 - 0
recipes-connectivity/dhcp/files/init-server

@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
+#
+
+test -f /usr/sbin/dhcpd || exit 0
+
+# It is not safe to start if we don't have a default configuration...
+if [ ! -f /etc/default/dhcp-server ]; then
+	echo "/etc/default/dhcp-server does not exist! - Aborting..."
+	exit 0
+fi
+
+# Read init script configuration (so far only interfaces the daemon
+# should listen on.)
+. /etc/default/dhcp-server
+
+case "$1" in
+	start)
+		echo -n "Starting DHCP server: "
+		test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
+		test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases	
+		start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES -user dhcp -group dhcp
+		echo "."
+		;;
+	stop)
+		echo -n "Stopping DHCP server: dhcpd3"
+		start-stop-daemon -K -x /usr/sbin/dhcpd
+		echo "."
+		;;
+	restart | force-reload)
+		$0 stop
+		sleep 2
+		$0 start
+		if [ "$?" != "0" ]; then
+			exit 1
+		fi
+		;;
+	*)
+		echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
+		exit 1 
+esac
+
+exit 0

+ 4 - 2
recipes-core/images/core-image-minimal.bbappend

@@ -1,6 +1,8 @@
 require sd-image.inc
 
-DEPENDS += " opensbi starfive-tool-native u-boot-tools-native dtc-native"
+DEPENDS:starfive-visionfive2 += " opensbi starfive-tool-native"
+
+IMAGE_FEATURES += " allow-empty-password empty-root-password"
 
 IMAGE_INSTALL += " \
 	helloworld \
@@ -17,4 +19,4 @@ IMAGE_INSTALL += " \
 	e2fsprogs-resize2fs \
 	"
 
-EXTRA_IMAGEDEPENDS += " alsa-lib libgpiod i2c-tools"
+EXTRA_IMAGEDEPENDS:starfive-visionfive2 += " alsa-lib libgpiod i2c-tools"

+ 39 - 0
recipes-core/images/core-image-starfive-extra.bb

@@ -0,0 +1,39 @@
+SUMMARY = "A StarFive image with additional packages."
+
+require sd-image.inc
+
+DEPENDS += " opensbi u-boot-tools-native dtc-native"
+
+IMAGE_INSTALL = "packagegroup-core-boot \
+		${CORE_IMAGE_EXTRA_INSTALL} \
+		helloworld \
+        	coremark \
+        	dhrystone \
+        	perf \
+        	gdb \
+        	gdbserver \
+        	util-linux \
+        	ethtool \
+        	bmap-tools \
+        	systemd-analyze \
+        	openssh \
+        	e2fsprogs-resize2fs \
+		ldd \
+		file \
+		git \
+		texinfo \
+		libcheck \
+		packagegroup-core-buildessential \
+		packagegroup-starfive-c \
+		nodejs \
+        	nodejs-npm \
+		"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE ?= "8192"
+IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}"

+ 8 - 0
recipes-core/images/sd-image.inc

@@ -1,10 +1,18 @@
 # Generate SD Card image and eMMC image
 # - Using spl_tool to fix img header to boot from eMMC
 
+DEPENDS += " u-boot-tools-native dtc-native"
+
 do_vf2_sd (){
         cd ${IMGDEPLOYDIR}
         bmaptool copy ${PN}-${MACHINE}.wic.gz ${DEPLOY_DIR_IMAGE}/${MACHINE}-${PN}.img
         spl_tool -i -f ${DEPLOY_DIR_IMAGE}/${MACHINE}-${PN}.img
 }
 
+do_jh8100_fpga_image (){
+        cd ${IMGDEPLOYDIR}
+        bmaptool copy ${PN}-${MACHINE}.wic.gz ${DEPLOY_DIR_IMAGE}/${MACHINE}-${PN}.img
+}
+
 IMAGE_POSTPROCESS_COMMAND:starfive-visionfive2 += "do_vf2_sd;"
+IMAGE_POSTPROCESS_COMMAND:starfive-jh8100 += "do_jh8100_fpga_image;"

+ 83 - 0
recipes-core/packagegroups/packagegroup-starfive-c.bb

@@ -0,0 +1,83 @@
+SUMMARY = "Additional C/C++ Packages for StarFive"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = "\
+    acl \
+    attr \
+    audit \
+    auditd \
+    boost \
+    bzip2 \
+    cifs-utils \
+    cracklib \
+    cronie \
+    curl \
+    cyrus-sasl \
+    dosfstools \
+    e2fsprogs \
+    libedit \
+    elfutils \
+    ethtool \
+    expat \
+    flatbuffers \
+    glib-2.0 \
+    protobuf \
+    gzip \
+    iproute2 \
+    iptables \
+    bind \
+    ivykis \
+    ivykis-dev \
+    json-c \
+    krb5 \
+    kmod \
+    less \
+    libcap \
+    libcap-ng \
+    libffi \
+    libjpeg-turbo \
+    libnl \
+    libpcap \
+    libssh2 \
+    libtirpc \
+    libusb1 \
+    libxml2 \
+    lldpd \
+    logrotate \
+    lvm2 \
+    lua-cjson \
+    luajit-riscv \
+    luajit-riscv-dev \
+    mbedtls \
+    mnn \
+    mtd-utils \
+    muparser \
+    ncurses \
+    netbase \
+    net-snmp \
+    nfs-utils \
+    nginx \
+    ntp \
+    openldap \
+    openssh \
+    openssl \
+    libpam \
+    libpcre \
+    popt \
+    procps \
+    shadow \
+    sqlite3 \
+    syslog-ng \
+    systemd \
+    tzdata \
+    libupnp \
+    liburing \
+    dhcp-server \
+    dhcp-server-config \
+    dhcp-client \
+    dhcp-relay \
+    dhcp-omshell \
+    "

+ 31 - 0
recipes-devtools/luajit/luajit-riscv/0001-Do-not-strip-automatically-this-leaves-the-stripping.patch

@@ -0,0 +1,31 @@
+From 6ab806a3d6ab11828918b94d407c9dcd99272a5a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 10 May 2013 10:42:45 -0700
+Subject: [PATCH] Do not strip automatically, this leaves the stripping busines
+ to OE
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ src/Makefile | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 108825e4..dcaf6c30 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -730,12 +730,10 @@ $(LUAJIT_A): $(LJVMCORE_O)
+ $(LUAJIT_SO): $(LJVMCORE_O)
+ 	$(E) "DYNLINK   $@"
+ 	$(Q)$(TARGET_LD) $(TARGET_ASHLDFLAGS) -o $@ $(LJVMCORE_DYNO) $(TARGET_ALIBS)
+-	$(Q)$(TARGET_STRIP) $@
+ 
+ $(LUAJIT_T): $(TARGET_O) $(LUAJIT_O) $(TARGET_DEP)
+ 	$(E) "LINK      $@"
+ 	$(Q)$(TARGET_LD) $(TARGET_ALDFLAGS) -o $@ $(LUAJIT_O) $(TARGET_O) $(TARGET_ALIBS)
+-	$(Q)$(TARGET_STRIP) $@
+ 	$(E) "OK        Successfully built LuaJIT"
+ 
+ ##############################################################################

+ 22 - 0
recipes-devtools/luajit/luajit-riscv/0002-original-patch-riscv-cross-compile-support.patch.patch

@@ -0,0 +1,22 @@
+From 8ec291a9b65e5503952b502fc7e8eb4ad07ceeca Mon Sep 17 00:00:00 2001
+From: OpenEmbedded <oe.patch@oe>
+Date: Wed, 23 Aug 2023 05:37:49 +0000
+Subject: [PATCH] %% original patch: riscv-cross-compile-support.patch
+
+---
+ src/lj_arch.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lj_arch.h b/src/lj_arch.h
+index 453414f3..09284829 100644
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -447,7 +447,7 @@
+ #error "No support for RISC-V 32"
+ 
+ #elif LUAJIT_TARGET == LUAJIT_ARCH_RISCV64
+-#if defined(__riscv_float_abi_double)
++#if defined(__riscv_float_abi_double) | 1
+ 
+ #define LJ_ARCH_NAME		"riscv64"
+ #define LJ_ARCH_BITS		64

+ 19 - 0
recipes-devtools/luajit/luajit-riscv/clang.patch

@@ -0,0 +1,19 @@
+clang pretends to be gcc 4.2.0 which is a big lie when it comes
+to features, its same as latest gcc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: LuaJIT-2.0.5/src/lj_arch.h
+===================================================================
+--- LuaJIT-2.0.5.orig/src/lj_arch.h
++++ LuaJIT-2.0.5/src/lj_arch.h
+@@ -436,7 +436,7 @@
+ #endif
+ #endif
+ #elif !LJ_TARGET_PS3
+-#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
++#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3) && !defined(__clang__)
+ #error "Need at least GCC 4.3 or newer"
+ #endif
+ #endif

+ 13 - 0
recipes-devtools/luajit/luajit-riscv/riscv-cross-compile-support.patch

@@ -0,0 +1,13 @@
+diff --git a/src/lj_arch.h b/src/lj_arch.h
+index 453414f3..09284829 100644
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -447,7 +447,7 @@
+ #error "No support for RISC-V 32"
+
+ #elif LUAJIT_TARGET == LUAJIT_ARCH_RISCV64
+-#if defined(__riscv_float_abi_double)
++#if defined(__riscv_float_abi_double) | 1
+
+ #define LJ_ARCH_NAME           "riscv64"
+ #define LJ_ARCH_BITS           64

+ 104 - 0
recipes-devtools/luajit/luajit-riscv_git.bb

@@ -0,0 +1,104 @@
+SUMMARY = "Just-In-Time Compiler for Lua"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=23d6278200de9b48fd1439f80507cba8"
+HOMEPAGE = "http://luajit.org"
+
+SRC_URI = "git://github.com/infiWang/LuaJIT.git;protocol=https;branch=riscv \
+           file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \
+           file://riscv-cross-compile-support.patch \
+           "
+
+# Set PV to a version tag and date (YYMMDD) associated with SRCREV if it is later.
+PV = "2.1.0~beta3-210112"
+SRCREV = "e65b5fe899d88d898ab1176c93a89d313cc6fcfd"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig binconfig siteinfo
+
+BBCLASSEXTEND = "native"
+
+# http://luajit.org/install.html#cross
+# Host luajit needs to be compiled with the same pointer size
+# If you want to cross-compile to any 32 bit target on an x64 OS,
+# you need to install the multilib development package (e.g.
+# libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
+# (HOST_CC="gcc -m32").
+BUILD_CC_ARCH:append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"
+
+# The lua makefiles expect the TARGET_SYS to be from uname -s
+# Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
+LUA_TARGET_OS = "Unknown"
+LUA_TARGET_OS:darwin = "Darwin"
+LUA_TARGET_OS:linux = "Linux"
+LUA_TARGET_OS:linux-gnueabi = "Linux"
+LUA_TARGET_OS:mingw32 = "Windows"
+
+# We don't want the lua buildsystem's compiler optimizations, or its
+# stripping, and we don't want it to pick up CFLAGS or LDFLAGS, as those apply
+# to both host and target compiles
+EXTRA_OEMAKE = "\
+    Q= E='@:' \
+    \
+    CCOPT= CCOPT_x86= CFLAGS= LDFLAGS= TARGET_STRIP='@:' \
+    \
+    'TARGET_SYS=${LUA_TARGET_OS}' \
+    \
+    'CC=${CC}' \
+    'TARGET_AR=${AR} rcus' \
+    'TARGET_CFLAGS=${CFLAGS}' \
+    'TARGET_LDFLAGS=${LDFLAGS}' \
+    'TARGET_SHLDFLAGS=${LDFLAGS}' \
+    'HOST_CC=${BUILD_CC}' \
+    'HOST_CFLAGS=${BUILD_CFLAGS}' \
+    \
+    'PREFIX=${prefix}' \
+    'MULTILIB=${baselib}' \
+    'LDCONFIG=:' \
+"
+
+do_compile () {
+    oe_runmake
+}
+
+# There's INSTALL_LIB and INSTALL_SHARE also, but the lua binary hardcodes the
+# '/share' and '/' + LUA_MULTILIB paths, so we don't want to break those
+# expectations.
+EXTRA_OEMAKEINST = "\
+    'DESTDIR=${D}' \
+    'INSTALL_BIN=${D}${bindir}' \
+    'INSTALL_INC=${D}${includedir}/luajit-$(MAJVER).$(MINVER)' \
+    'INSTALL_MAN=${D}${mandir}/man1' \
+"
+do_install () {
+    oe_runmake ${EXTRA_OEMAKEINST} install
+    rmdir ${D}${datadir}/lua/5.* \
+          ${D}${datadir}/lua \
+          ${D}${libdir}/lua/5.* \
+          ${D}${libdir}/lua
+    cd ${D}/usr/bin
+    ln -sf ./luajit-2.1.0-beta3 luajit
+}
+
+PACKAGES += 'luajit-common'
+
+# See the comment for EXTRA_OEMAKEINST. This is needed to ensure the hardcoded
+# paths are packaged regardless of what the libdir and datadir paths are.
+FILES:${PN} += "${prefix}/${baselib} ${prefix}/share"
+FILES:${PN} += "${libdir}/libluajit-5.1.so.2 \
+    ${libdir}/libluajit-5.1.so.${PV} \
+"
+FILES:${PN}-dev += "${libdir}/libluajit-5.1.a \
+    ${libdir}/libluajit-5.1.so \
+    ${libdir}/pkgconfig/luajit.pc \
+"
+FILES:luajit-common = "${datadir}/${BPN}-${PV}"
+
+# mips64/ppc/ppc64/riscv64/riscv32 is not supported in this release
+COMPATIBLE_HOST:mipsarchn32 = "null"
+COMPATIBLE_HOST:mipsarchn64 = "null"
+COMPATIBLE_HOST:powerpc = "null"
+COMPATIBLE_HOST:powerpc64 = "null"
+COMPATIBLE_HOST:powerpc64le = "null"
+COMPATIBLE_HOST:riscv64 = "riscv.*"
+COMPATIBLE_HOST:riscv32 = "null"

+ 77 - 0
recipes-devtools/nodejs/nodejs-oe-cache-18.0/oe-npm-cache

@@ -0,0 +1,77 @@
+#!/usr/bin/env node
+
+/// Usage: oe-npm-cache <cache-dir> <type> <key> <file-name>
+///    <type> ... meta - metainformation about package
+///               tgz  - tarball
+
+const process = require("node:process");
+
+module.paths.unshift("@@libdir@@/node_modules/npm/node_modules");
+
+const cacache = require('cacache')
+const fs = require('fs')
+
+// argv[0] is 'node', argv[1] is this script
+const cache_dir = process.argv[2]
+const type      = process.argv[3]
+const key       = process.argv[4]
+const file      = process.argv[5]
+
+const data = fs.readFileSync(file)
+
+// metadata content is highly nodejs dependent; when cache entries are not
+// found, place debug statements in 'make-fetch-happen/lib/cache/policy.js'
+// (CachePolicy::satisfies())
+const xlate = {
+    'meta': {
+	'key_prefix': 'make-fetch-happen:request-cache:',
+	'metadata': function() {
+	    return {
+		time: Date.now(),
+		url:  key,
+		reqHeaders: {
+		    'accept': 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
+		},
+		resHeaders: {
+		    "content-type": "application/json",
+		    "status": 200,
+		},
+		options: {
+		    compress: true,
+		}
+	    };
+	},
+    },
+
+    'tgz': {
+	'key_prefix': 'make-fetch-happen:request-cache:',
+	'metadata': function() {
+	    return {
+		time: Date.now(),
+		url:  key,
+		reqHeaders: {
+		    'accept': '*/*',
+		},
+		resHeaders: {
+		    "content-type": "application/octet-stream",
+		    "status": 200,
+		},
+		options: {
+		    compress: true,
+		},
+	    };
+	},
+    },
+};
+
+const info = xlate[type];
+let opts = {}
+
+if (info.metadata) {
+    opts['metadata'] = info.metadata();
+}
+
+cacache.put(cache_dir, info.key_prefix + key, data, opts)
+    .then(integrity => {
+	console.log(`Saved content of ${key} (${file}).`);
+})

+ 21 - 0
recipes-devtools/nodejs/nodejs-oe-cache-native_18.0.bb

@@ -0,0 +1,21 @@
+DESCRIPTION = "OE helper for manipulating npm cache"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+SRC_URI = "\
+    file://oe-npm-cache \
+"
+
+inherit native
+
+B = "${WORKDIR}/build"
+
+do_configure() {
+    sed -e 's!@@libdir@@!${libdir}!g' < '${WORKDIR}/oe-npm-cache' > '${B}/oe-npm-cache'
+}
+
+do_install() {
+    install -D -p -m 0755 ${B}/oe-npm-cache ${D}${bindir}/oe-npm-cache
+}
+
+RDEPENDS:${PN} = "nodejs-native"

+ 46 - 0
recipes-devtools/nodejs/nodejs/0001-Disable-running-gyp-files-for-bundled-deps.patch

@@ -0,0 +1,46 @@
+From 7d94bfe53beeb2d25eb5f2ff6b1d509df7e6ab80 Mon Sep 17 00:00:00 2001
+From: Zuzana Svetlikova <zsvetlik@redhat.com>
+Date: Thu, 27 Apr 2017 14:25:42 +0200
+Subject: [PATCH] Disable running gyp on shared deps
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Probably imported from:
+https://src.fedoraproject.org/rpms/nodejs/c/41af04f2a3c050fb44628e91ac65fd225b927acb?branch=22609d8c1bfeaa21fe0057645af20b3a2ccc7f53
+which is probably based on dont-run-gyp-files-for-bundled-deps.patch added in:
+https://github.com/alpinelinux/aports/commit/6662eb3199902e8451fb20dce82554ad96f796bb
+
+We also explicitly prune some dependencies from source in the bitbake recipe:
+
+python prune_sources() {
+    import shutil
+
+    shutil.rmtree(d.getVar('S') + '/deps/openssl')
+    if 'ares' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/cares')
+    if 'brotli' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/brotli')
+    if 'libuv' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/uv')
+    if 'nghttp2' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/nghttp2')
+    if 'zlib' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/zlib')
+}
+do_unpack[postfuncs] += "prune_sources"
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -147,7 +147,7 @@ with-code-cache test-code-cache:
+ 	$(warning '$@' target is a noop)
+ 
+ out/Makefile: config.gypi common.gypi node.gyp \
+-	deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
++	deps/llhttp/llhttp.gyp \
+ 	tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
+ 	tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
+	$(PYTHON) tools/gyp_node.py -f make

+ 77 - 0
recipes-devtools/nodejs/nodejs/0001-Using-native-binaries.patch

@@ -0,0 +1,77 @@
+From 6c3ac20477a4bac643088f24df3c042e627fafa9 Mon Sep 17 00:00:00 2001
+From: Guillaume Burel <guillaume.burel@stormshield.eu>
+Date: Fri, 3 Jan 2020 11:25:54 +0100
+Subject: [PATCH] Using native binaries
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Originally added in:
+https://git.openembedded.org/meta-openembedded/commit/?id=1c8e4a679ae382f953b2e5c7a4966a4646314f3e
+later extended and renamed in:
+https://git.openembedded.org/meta-openembedded/commit/?id=feeb172d1a8bf010490d22b8df9448b20d9d2aed
+
+Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
+---
+ node.gyp                 | 1 +
+ tools/v8_gypfiles/v8.gyp | 5 +++++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/node.gyp b/node.gyp
+index e8e1d9f9..e60ccc10 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -320,6 +320,7 @@
+                   'action_name': 'node_mksnapshot',
+                   'process_outputs_as_sources': 1,
+                   'inputs': [
++                    '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
+                     '<(node_mksnapshot_exec)',
+                     '<(node_snapshot_main)',
+                   ],
+diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
+index 42e26cd9..bc721991 100644
+--- a/tools/v8_gypfiles/v8.gyp
++++ b/tools/v8_gypfiles/v8.gyp
+@@ -68,6 +68,7 @@
+         {
+           'action_name': 'run_torque_action',
+           'inputs': [  # Order matters.
++            '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
+             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+             '<@(torque_files)',
+           ],
+@@ -99,6 +100,7 @@
+             '<@(torque_outputs_inc)',
+           ],
+           'action': [
++            '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
+             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
+             '-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated',
+             '-v8-root', '<(V8_ROOT)',
+@@ -211,6 +213,7 @@
+         {
+           'action_name': 'generate_bytecode_builtins_list_action',
+           'inputs': [
++            '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
+             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
+           ],
+           'outputs': [
+@@ -400,6 +403,7 @@
+             ],
+           },
+           'inputs': [
++            '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
+             '<(mksnapshot_exec)',
+           ],
+           'outputs': [
+@@ -1539,6 +1543,7 @@
+         {
+           'action_name': 'run_gen-regexp-special-case_action',
+           'inputs': [
++            '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
+             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
+           ],
+           'outputs': [
+-- 
+2.34.1
+

+ 85 - 0
recipes-devtools/nodejs/nodejs/0001-liftoff-Correct-function-signatures.patch

@@ -0,0 +1,85 @@
+From dc3652c0abcdf8573fd044907b19d8eda7ca1124 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 20 Oct 2021 12:49:58 -0700
+Subject: [PATCH] [liftoff] Correct function signatures
+
+Fixes builds on mips where clang reports an error
+../deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h:661:5: error: no matching member function for call to 'Move'
+    Move(tmp, src, type.value_type());
+    ^~~~
+
+Upstream-Status: Submitted [https://chromium-review.googlesource.com/c/v8/v8/+/3235674]
+
+Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
+---
+ deps/v8/src/wasm/baseline/liftoff-assembler.h               | 6 +++---
+ deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h     | 2 +-
+ deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h | 2 +-
+ .../src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h   | 2 +-
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/deps/v8/src/wasm/baseline/liftoff-assembler.h b/deps/v8/src/wasm/baseline/liftoff-assembler.h
+index 22c7f73a..db4cb168 100644
+--- a/deps/v8/src/wasm/baseline/liftoff-assembler.h
++++ b/deps/v8/src/wasm/baseline/liftoff-assembler.h
+@@ -646,7 +646,7 @@ class LiftoffAssembler : public TurboAssembler {
+   void FinishCall(const ValueKindSig*, compiler::CallDescriptor*);
+ 
+   // Move {src} into {dst}. {src} and {dst} must be different.
+-  void Move(LiftoffRegister dst, LiftoffRegister src, ValueKind);
++  void Move(LiftoffRegister dst, LiftoffRegister src, ValueKind kind);
+ 
+   // Parallel register move: For a list of tuples <dst, src, kind>, move the
+   // {src} register of kind {kind} into {dst}. If {src} equals {dst}, ignore
+@@ -795,8 +795,8 @@ class LiftoffAssembler : public TurboAssembler {
+   inline void MoveStackValue(uint32_t dst_offset, uint32_t src_offset,
+                              ValueKind);
+ 
+-  inline void Move(Register dst, Register src, ValueKind);
+-  inline void Move(DoubleRegister dst, DoubleRegister src, ValueKind);
++  inline void Move(Register dst, Register src, ValueKind kind);
++  inline void Move(DoubleRegister dst, DoubleRegister src, ValueKind kind);
+ 
+   inline void Spill(int offset, LiftoffRegister, ValueKind);
+   inline void Spill(int offset, WasmValue);
+diff --git a/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h b/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h
+index c76fd2f4..0fffe231 100644
+--- a/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h
++++ b/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h
+@@ -661,7 +661,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
+     pinned = pinned | LiftoffRegList{dst_op.rm(), src};
+     LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
+     // Save original value.
+-    Move(tmp, src, type.value_type());
++    Move(tmp, src, type.value_type().kind());
+ 
+     src = tmp;
+     pinned.set(tmp);
+diff --git a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
+index 36413545..48207337 100644
+--- a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
++++ b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
+@@ -593,7 +593,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
+     pinned.set(dst_op.rm());
+     LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
+     // Save original value.
+-    Move(tmp, src, type.value_type());
++    Move(tmp, src, type.value_type().kind());
+ 
+     src = tmp;
+     pinned.set(tmp);
+diff --git a/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h b/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h
+index 642a7d2a..56ffcc2a 100644
+--- a/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h
++++ b/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h
+@@ -589,7 +589,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
+     pinned.set(dst_op.rm());
+     LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
+     // Save original value.
+-    Move(tmp, src, type.value_type());
++    Move(tmp, src, type.value_type().kind());
+ 
+     src = tmp;
+     pinned.set(tmp);
+--
+2.34.1

+ 34 - 0
recipes-devtools/nodejs/nodejs/0001-mips-Use-32bit-cast-for-operand-on-mips32.patch

@@ -0,0 +1,34 @@
+From e65dde8db17da5acddeef7eb9316199c4e5e0811 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 19 Apr 2022 12:40:25 -0700
+Subject: [PATCH] mips: Use 32bit cast for operand on mips32
+
+Fixes
+deps/v8/src/compiler/backend/mips/code-generator-mips.cc: In member function 'void v8::internal::compiler::CodeGenerator::AssembleReturn(v8::internal::compiler::InstructionOperand*)':
+../deps/v8/src/compiler/backend/mips/code-generator-mips.cc:4233:48: error: call of overloaded 'Operand(int64_t)' is ambiguous
+ 4233 |                 Operand(static_cast<int64_t>(0)));
+      |                                                ^
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ deps/v8/src/compiler/backend/mips/code-generator-mips.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/deps/v8/src/compiler/backend/mips/code-generator-mips.cc b/deps/v8/src/compiler/backend/mips/code-generator-mips.cc
+index 2b8197e..b226140 100644
+--- a/deps/v8/src/compiler/backend/mips/code-generator-mips.cc
++++ b/deps/v8/src/compiler/backend/mips/code-generator-mips.cc
+@@ -4230,7 +4230,7 @@ void CodeGenerator::AssembleReturn(InstructionOperand* additional_pop_count) {
+     } else if (FLAG_debug_code) {
+       __ Assert(eq, AbortReason::kUnexpectedAdditionalPopValue,
+                 g.ToRegister(additional_pop_count),
+-                Operand(static_cast<int64_t>(0)));
++                Operand(static_cast<int32_t>(0)));
+     }
+   }
+   // Functions with JS linkage have at least one parameter (the receiver).
+-- 
+2.36.0
+

+ 23 - 0
recipes-devtools/nodejs/nodejs/0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch

@@ -0,0 +1,23 @@
+From 0976af0f3b328436ea44a74a406f311adb2ab211 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Jun 2021 19:01:31 -0700
+Subject: [PATCH] ppc64: Do not use -mminimal-toc with clang
+
+clang does not support this option
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ common.gypi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/common.gypi
++++ b/common.gypi
+@@ -417,7 +417,7 @@
+             'ldflags': [ '-m32' ],
+           }],
+           [ 'target_arch=="ppc64" and OS!="aix"', {
+-            'cflags': [ '-m64', '-mminimal-toc' ],
++            'cflags': [ '-m64' ],
+             'ldflags': [ '-m64' ],
+           }],
+           [ 'target_arch=="s390x"', {

+ 102 - 0
recipes-devtools/nodejs/nodejs/0004-v8-don-t-override-ARM-CFLAGS.patch

@@ -0,0 +1,102 @@
+From 47ee5cc5501289205d3e8e9f27ea9daf18cebac1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Sat, 9 Nov 2019 14:45:30 +0000
+Subject: [PATCH] v8: don't override ARM CFLAGS
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This overrides yocto-provided build flags with its own, e.g we get
+    arm-poky-linux-musleabi-g++  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 \
+                                 ... \
+                                  -march=armv7-a -mfpu=neon -mfloat-abi=hard -marm
+
+Causing the latter to override the former, and compiler warnings:
+    cc1plus: warning: switch '-mcpu=cortex-a7' conflicts with '-march=armv7-a' switch
+
+Patch this out, so that yocto-provided flags take precedence.
+Note that in reality the same should probably be done for all the other
+supported architectures, too.
+
+Note that this also switches to Thumb(2) mode (in my case). No obvious
+problems have been noted during compilation or runtime.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ tools/v8_gypfiles/toolchain.gypi | 52 ++------------------------------
+ 1 file changed, 2 insertions(+), 50 deletions(-)
+
+diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi
+index 264b3e478e..0b41848145 100644
+--- a/tools/v8_gypfiles/toolchain.gypi
++++ b/tools/v8_gypfiles/toolchain.gypi
+@@ -211,31 +211,7 @@
+         'target_conditions': [
+           ['_toolset=="host"', {
+             'conditions': [
+-              ['v8_target_arch==host_arch', {
+-                # Host built with an Arm CXX compiler.
+-                'conditions': [
+-                  [ 'arm_version==7', {
+-                    'cflags': ['-march=armv7-a',],
+-                  }],
+-                  [ 'arm_version==7 or arm_version=="default"', {
+-                    'conditions': [
+-                      [ 'arm_fpu!="default"', {
+-                        'cflags': ['-mfpu=<(arm_fpu)',],
+-                      }],
+-                    ],
+-                  }],
+-                  [ 'arm_float_abi!="default"', {
+-                    'cflags': ['-mfloat-abi=<(arm_float_abi)',],
+-                  }],
+-                  [ 'arm_thumb==1', {
+-                    'cflags': ['-mthumb',],
+-                  }],
+-                  [ 'arm_thumb==0', {
+-                    'cflags': ['-marm',],
+-                  }],
+-                ],
+-              }, {
+-                # 'v8_target_arch!=host_arch'
++              ['v8_target_arch!=host_arch', {
+                 # Host not built with an Arm CXX compiler (simulator build).
+                 'conditions': [
+                   [ 'arm_float_abi=="hard"', {
+@@ -254,31 +230,7 @@
+           }],  # _toolset=="host"
+           ['_toolset=="target"', {
+             'conditions': [
+-              ['v8_target_arch==target_arch', {
+-                # Target built with an Arm CXX compiler.
+-                'conditions': [
+-                  [ 'arm_version==7', {
+-                    'cflags': ['-march=armv7-a',],
+-                  }],
+-                  [ 'arm_version==7 or arm_version=="default"', {
+-                    'conditions': [
+-                      [ 'arm_fpu!="default"', {
+-                        'cflags': ['-mfpu=<(arm_fpu)',],
+-                      }],
+-                    ],
+-                  }],
+-                  [ 'arm_float_abi!="default"', {
+-                    'cflags': ['-mfloat-abi=<(arm_float_abi)',],
+-                  }],
+-                  [ 'arm_thumb==1', {
+-                    'cflags': ['-mthumb',],
+-                  }],
+-                  [ 'arm_thumb==0', {
+-                    'cflags': ['-marm',],
+-                  }],
+-                ],
+-              }, {
+-                # 'v8_target_arch!=target_arch'
++              ['v8_target_arch!=target_arch', {
+                 # Target not built with an Arm CXX compiler (simulator build).
+                 'conditions': [
+                   [ 'arm_float_abi=="hard"', {
+-- 
+2.20.1
+

+ 18 - 0
recipes-devtools/nodejs/nodejs/big-endian.patch

@@ -0,0 +1,18 @@
+
+https://github.com/v8/v8/commit/878ccb33bd3cf0e6dc018ff8d15843f585ac07be
+
+did some automated cleanups but it missed big-endian code.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/deps/v8/src/runtime/runtime-utils.h
++++ b/deps/v8/src/runtime/runtime-utils.h
+@@ -126,7 +126,7 @@ static inline ObjectPair MakePair(Object
+ #if defined(V8_TARGET_LITTLE_ENDIAN)
+   return x.ptr() | (static_cast<ObjectPair>(y.ptr()) << 32);
+ #elif defined(V8_TARGET_BIG_ENDIAN)
+-  return y->ptr() | (static_cast<ObjectPair>(x->ptr()) << 32);
++  return y.ptr() | (static_cast<ObjectPair>(x.ptr()) << 32);
+ #else
+ #error Unknown endianness
+ #endif

+ 21 - 0
recipes-devtools/nodejs/nodejs/libatomic.patch

@@ -0,0 +1,21 @@
+Link mksnapshot with libatomic on x86
+
+Clang-12 on x86 emits atomic builtins
+
+Fixes
+| module-compiler.cc:(.text._ZN2v88internal4wasm12_GLOBAL__N_123ExecuteCompilationUnitsERKSt10shared_ptrINS2_22BackgroundCompileTokenEEPNS0_8CountersEiNS2_19CompileBaselineOnlyE+0x558): un
+defined reference to `__atomic_load'
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/tools/v8_gypfiles/v8.gyp
++++ b/tools/v8_gypfiles/v8.gyp
+@@ -1436,6 +1436,7 @@
+     {
+       'target_name': 'mksnapshot',
+       'type': 'executable',
++      'libraries': [ '-latomic' ],
+       'dependencies': [
+         'v8_base_without_compiler',
+         'v8_compiler_for_mksnapshot',

+ 37 - 0
recipes-devtools/nodejs/nodejs/mips-less-memory.patch

@@ -0,0 +1,37 @@
+Description: mksnapshot uses too much memory on 32-bit mipsel
+Author: Jérémy Lal <kapouer@melix.org>
+Last-Update: 2020-06-03
+Forwarded: https://bugs.chromium.org/p/v8/issues/detail?id=10586
+
+This ensures that we reserve 500M instead of 2G range for codegen
+ensures that qemu-mips can allocate such large ranges
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Imported from debian https://salsa.debian.org/js-team/nodejs/-/blob/master-12.x/debian/patches/mips-less-memory.patch
+https://buildd.debian.org/status/fetch.php?pkg=nodejs&arch=mipsel&ver=12.17.0~dfsg-2&stamp=1591050388&raw=0
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/deps/v8/src/common/globals.h
++++ b/deps/v8/src/common/globals.h
+@@ -224,7 +224,7 @@ constexpr size_t kMinimumCodeRangeSize =
+ constexpr size_t kMinExpectedOSPageSize = 64 * KB;  // OS page on PPC Linux
+ #elif V8_TARGET_ARCH_MIPS
+ constexpr bool kPlatformRequiresCodeRange = false;
+-constexpr size_t kMaximalCodeRangeSize = 2048LL * MB;
++constexpr size_t kMaximalCodeRangeSize = 512 * MB;
+ constexpr size_t kMinimumCodeRangeSize = 0 * MB;
+ constexpr size_t kMinExpectedOSPageSize = 4 * KB;  // OS page.
+ #else
+--- a/deps/v8/src/codegen/mips/constants-mips.h
++++ b/deps/v8/src/codegen/mips/constants-mips.h
+@@ -140,7 +140,7 @@ const uint32_t kLeastSignificantByteInIn
+ namespace v8 {
+ namespace internal {
+ 
+-constexpr size_t kMaxPCRelativeCodeRangeInMB = 4096;
++constexpr size_t kMaxPCRelativeCodeRangeInMB = 1024;
+ 
+ // -----------------------------------------------------------------------------
+ // Registers and FPURegisters.

+ 3 - 0
recipes-devtools/nodejs/nodejs/run-ptest

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./cctest

+ 24 - 0
recipes-devtools/nodejs/nodejs/system-c-ares.patch

@@ -0,0 +1,24 @@
+keep nodejs compatible with c-ares 1.17.1
+
+Upstream-Status: Inappropriate [c-ares specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/src/cares_wrap.h
++++ b/src/cares_wrap.h
+@@ -22,7 +22,15 @@
+ # include <netdb.h>
+ #endif  // __POSIX__
+ 
+-# include <ares_nameser.h>
++#if defined(__ANDROID__) || \
++    defined(__MINGW32__) || \
++    defined(__OpenBSD__) || \
++    defined(_MSC_VER)
++
++# include <nameser.h>
++#else
++# include <arpa/nameser.h>
++#endif
+ 
+ namespace node {
+ namespace cares_wrap {

+ 178 - 0
recipes-devtools/nodejs/nodejs_18.0.0.bb

@@ -0,0 +1,178 @@
+DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
+HOMEPAGE = "http://nodejs.org"
+LICENSE = "MIT & ISC & BSD-2-Clause & BSD-3-Clause & Artistic-2.0 & Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9b5cf99a5928240bc6524cccd2c2da6a"
+
+CVE_PRODUCT = "nodejs node.js"
+
+DEPENDS = "openssl file-replacement-native"
+DEPENDS:append:class-target = " qemu-native"
+DEPENDS:append:class-native = " c-ares-native"
+
+inherit pkgconfig python3native qemu ptest
+
+COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*"
+COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*"
+COMPATIBLE_MACHINE:mips64 = "(!.*mips64).*"
+
+COMPATIBLE_HOST:riscv64 = "riscv64.*"
+COMPATIBLE_HOST:riscv32 = "null"
+COMPATIBLE_HOST:powerpc = "null"
+
+SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
+           file://0001-Disable-running-gyp-files-for-bundled-deps.patch \
+           file://0004-v8-don-t-override-ARM-CFLAGS.patch \
+           file://system-c-ares.patch \
+           file://run-ptest \
+           "
+
+SRC_URI:append:class-target = " \
+           file://0001-Using-native-binaries.patch \
+           "
+SRC_URI:append:toolchain-clang:x86 = " \
+           file://libatomic.patch \
+           "
+SRC_URI:append:toolchain-clang:powerpc64le = " \
+           file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \
+           "
+SRC_URI[sha256sum] = "344d0e6540b524c69a979ff5c3e78cda7254fd72c03699926beb0b8558b8ce75"
+
+S = "${WORKDIR}/node-v${PV}"
+
+# v8 errors out if you have set CCACHE
+CCACHE = ""
+
+def map_nodejs_arch(a, d):
+    import re
+
+    if   re.match('i.86$', a): return 'ia32'
+    elif re.match('x86_64$', a): return 'x64'
+    elif re.match('aarch64$', a): return 'arm64'
+    elif re.match('(powerpc64|powerpc64le|ppc64le)$', a): return 'ppc64'
+    elif re.match('powerpc$', a): return 'ppc'
+    return a
+
+ARCHFLAGS:arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \
+                 ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \
+                    bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \
+                    bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \
+                    '--with-arm-fpu=vfp', d), d), d)}"
+ARCHFLAGS:append:mips = " --v8-lite-mode"
+ARCHFLAGS:append:mipsel = " --v8-lite-mode"
+ARCHFLAGS ?= ""
+
+PACKAGECONFIG ??= "ares brotli icu zlib"
+
+PACKAGECONFIG[ares] = "--shared-cares,,c-ares"
+PACKAGECONFIG[brotli] = "--shared-brotli,,brotli"
+PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu"
+PACKAGECONFIG[libuv] = "--shared-libuv,,libuv"
+PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2"
+PACKAGECONFIG[shared] = "--shared"
+PACKAGECONFIG[zlib] = "--shared-zlib,,zlib"
+
+# We don't want to cross-compile during target compile,
+# and we need to use the right flags during host compile,
+# too.
+EXTRA_OEMAKE = "\
+    CC.host='${CC}' \
+    CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \
+    CXX.host='${CXX}' \
+    CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \
+    LDFLAGS.host='${LDFLAGS}' \
+    AR.host='${AR}' \
+    \
+    builddir_name=./ \
+"
+
+EXTRANATIVEPATH += "file-native"
+
+python prune_sources() {
+    import shutil
+
+    #shutil.rmtree(d.getVar('S') + '/deps/openssl')
+    if 'ares' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/cares')
+    if 'brotli' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/brotli')
+    if 'libuv' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/uv')
+    if 'nghttp2' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/nghttp2')
+    if 'zlib' in d.getVar('PACKAGECONFIG'):
+        shutil.rmtree(d.getVar('S') + '/deps/zlib')
+}
+do_unpack[postfuncs] += "prune_sources"
+
+# V8's JIT infrastructure requires binaries such as mksnapshot and
+# mkpeephole to be run in the host during the build. However, these
+# binaries must have the same bit-width as the target (e.g. a x86_64
+# host targeting ARMv6 needs to produce a 32-bit binary). Instead of
+# depending on a third Yocto toolchain, we just build those binaries
+# for the target and run them on the host with QEMU.
+python do_create_v8_qemu_wrapper () {
+    """Creates a small wrapper that invokes QEMU to run some target V8 binaries
+    on the host."""
+    qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'),
+                    d.expand('${STAGING_DIR_HOST}${base_libdir}')]
+    qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'),
+                                    qemu_libdirs)
+    wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh')
+    with open(wrapper_path, 'w') as wrapper_file:
+        wrapper_file.write("""#!/bin/sh
+
+# This file has been generated automatically.
+# It invokes QEMU to run binaries built for the target in the host during the
+# build process.
+
+%s "$@"
+""" % qemu_cmd)
+    os.chmod(wrapper_path, 0o755)
+}
+
+do_create_v8_qemu_wrapper[dirs] = "${B}"
+addtask create_v8_qemu_wrapper after do_configure before do_compile
+
+LDFLAGS:append:x86 = " -latomic"
+
+CROSS_FLAGS = "--cross-compiling"
+CROSS_FLAGS:class-native = "--no-cross-compiling"
+
+# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
+do_configure () {
+    GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
+    # $TARGET_ARCH settings don't match --dest-cpu settings
+    python3 configure.py --verbose --prefix=${prefix} \
+               --openssl-no-asm \
+               --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \
+               --dest-os=linux \
+               ${CROSS_FLAGS} \
+               ${ARCHFLAGS} \
+               ${PACKAGECONFIG_CONFARGS}
+}
+
+do_compile () {
+    install -D ${RECIPE_SYSROOT_NATIVE}/etc/ssl/openssl.cnf ${B}/deps/openssl/nodejs-openssl.cnf
+    install -D ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh
+    oe_runmake BUILDTYPE=Release
+}
+
+do_install () {
+    oe_runmake install DESTDIR=${D}
+}
+
+do_install_ptest () {
+    cp -r  ${B}/out/Release/cctest ${D}${PTEST_PATH}/
+    cp -r ${B}/test ${D}${PTEST_PATH}
+    chown -R root:root ${D}${PTEST_PATH}
+}
+
+PACKAGES =+ "${PN}-npm"
+FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx ${bindir}/corepack"
+RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \
+    python3-misc python3-multiprocessing"
+
+PACKAGES =+ "${PN}-systemtap"
+FILES:${PN}-systemtap = "${datadir}/systemtap"
+
+BBCLASSEXTEND = "native"

+ 1134 - 0
recipes-extended/ivykis/ivykis/Makefile

@@ -0,0 +1,1134 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# test/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+VPATH = .
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/ivykis
+pkgincludedir = $(includedir)/ivykis
+pkglibdir = $(libdir)/ivykis
+pkglibexecdir = $(libexecdir)/ivykis
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-pc-linux-gnu
+host_triplet = riscv64-poky-linux-gnu
+TESTS = avl$(EXEEXT) event_unregister_bug$(EXEEXT) \
+	iv_event_raw_test$(EXEEXT) struct_sizes$(EXEEXT) \
+	timer$(EXEEXT) timer_fairness$(EXEEXT) \
+	timer_fairness_bug$(EXEEXT) timer_order$(EXEEXT) \
+	timer_past$(EXEEXT) timer_zero$(EXEEXT) $(am__EXEEXT_4)
+am__append_1 = client			\
+			   connectfail			\
+			   connectreset			\
+			   iv_event_raw_bench_signal	\
+			   iv_fd_pump_discard		\
+			   iv_fd_pump_echo		\
+			   iv_popen_test		\
+			   iv_signal_bench_signal	\
+			   iv_signal_bench_timer	\
+			   iv_signal_child_test		\
+			   null
+
+am__append_2 = iv_inotify_test
+am__append_3 = iv_signal_test
+noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_5)
+subdir = test
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 = client$(EXEEXT) connectfail$(EXEEXT) \
+	connectreset$(EXEEXT) \
+	iv_event_raw_bench_signal$(EXEEXT) \
+	iv_fd_pump_discard$(EXEEXT) \
+	iv_fd_pump_echo$(EXEEXT) \
+	iv_popen_test$(EXEEXT) \
+	iv_signal_bench_signal$(EXEEXT) \
+	iv_signal_bench_timer$(EXEEXT) \
+	iv_signal_child_test$(EXEEXT) null$(EXEEXT)
+am__EXEEXT_2 =  \
+	iv_inotify_test$(EXEEXT)
+am__EXEEXT_3 = iv_event_raw_bench_timer$(EXEEXT) $(am__EXEEXT_1) \
+	$(am__EXEEXT_2)
+am__EXEEXT_4 = iv_signal_test$(EXEEXT)
+am__EXEEXT_5 = avl$(EXEEXT) event_unregister_bug$(EXEEXT) \
+	iv_event_raw_test$(EXEEXT) struct_sizes$(EXEEXT) \
+	timer$(EXEEXT) timer_fairness$(EXEEXT) \
+	timer_fairness_bug$(EXEEXT) timer_order$(EXEEXT) \
+	timer_past$(EXEEXT) timer_zero$(EXEEXT) $(am__EXEEXT_4)
+PROGRAMS = $(noinst_PROGRAMS)
+am_avl_OBJECTS = avl.$(OBJEXT)
+avl_OBJECTS = $(am_avl_OBJECTS)
+avl_LDADD = $(LDADD)
+avl_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+am_client_OBJECTS = client.$(OBJEXT)
+client_OBJECTS = $(am_client_OBJECTS)
+client_LDADD = $(LDADD)
+client_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_connectfail_OBJECTS = connectfail.$(OBJEXT)
+connectfail_OBJECTS = $(am_connectfail_OBJECTS)
+connectfail_LDADD = $(LDADD)
+connectfail_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_connectreset_OBJECTS = connectreset.$(OBJEXT)
+connectreset_OBJECTS = $(am_connectreset_OBJECTS)
+connectreset_LDADD = $(LDADD)
+connectreset_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+event_unregister_bug_SOURCES = event_unregister_bug.c
+event_unregister_bug_OBJECTS = event_unregister_bug.$(OBJEXT)
+event_unregister_bug_LDADD = $(LDADD)
+event_unregister_bug_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_iv_event_raw_bench_signal_OBJECTS =  \
+	iv_event_raw_bench_signal-iv_event_raw_bench.$(OBJEXT)
+iv_event_raw_bench_signal_OBJECTS =  \
+	$(am_iv_event_raw_bench_signal_OBJECTS)
+iv_event_raw_bench_signal_LDADD = $(LDADD)
+iv_event_raw_bench_signal_DEPENDENCIES =  \
+	$(top_builddir)/src/libivykis.la
+am_iv_event_raw_bench_timer_OBJECTS = iv_event_raw_bench.$(OBJEXT)
+iv_event_raw_bench_timer_OBJECTS =  \
+	$(am_iv_event_raw_bench_timer_OBJECTS)
+iv_event_raw_bench_timer_LDADD = $(LDADD)
+iv_event_raw_bench_timer_DEPENDENCIES =  \
+	$(top_builddir)/src/libivykis.la
+am_iv_event_raw_test_OBJECTS = iv_event_raw_test.$(OBJEXT)
+iv_event_raw_test_OBJECTS = $(am_iv_event_raw_test_OBJECTS)
+iv_event_raw_test_LDADD = $(LDADD)
+iv_event_raw_test_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_iv_fd_pump_discard_OBJECTS = iv_fd_pump_discard.$(OBJEXT)
+iv_fd_pump_discard_OBJECTS = $(am_iv_fd_pump_discard_OBJECTS)
+iv_fd_pump_discard_LDADD = $(LDADD)
+iv_fd_pump_discard_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_iv_fd_pump_echo_OBJECTS = iv_fd_pump_echo.$(OBJEXT)
+iv_fd_pump_echo_OBJECTS = $(am_iv_fd_pump_echo_OBJECTS)
+iv_fd_pump_echo_LDADD = $(LDADD)
+iv_fd_pump_echo_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+iv_inotify_test_SOURCES = iv_inotify_test.c
+iv_inotify_test_OBJECTS = iv_inotify_test.$(OBJEXT)
+iv_inotify_test_LDADD = $(LDADD)
+iv_inotify_test_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_iv_popen_test_OBJECTS = iv_popen_test.$(OBJEXT)
+iv_popen_test_OBJECTS = $(am_iv_popen_test_OBJECTS)
+iv_popen_test_LDADD = $(LDADD)
+iv_popen_test_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_iv_signal_bench_signal_OBJECTS =  \
+	iv_signal_bench_signal-iv_signal_bench.$(OBJEXT)
+iv_signal_bench_signal_OBJECTS = $(am_iv_signal_bench_signal_OBJECTS)
+iv_signal_bench_signal_LDADD = $(LDADD)
+iv_signal_bench_signal_DEPENDENCIES =  \
+	$(top_builddir)/src/libivykis.la
+am_iv_signal_bench_timer_OBJECTS = iv_signal_bench.$(OBJEXT)
+iv_signal_bench_timer_OBJECTS = $(am_iv_signal_bench_timer_OBJECTS)
+iv_signal_bench_timer_LDADD = $(LDADD)
+iv_signal_bench_timer_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_iv_signal_child_test_OBJECTS = iv_signal_child_test.$(OBJEXT)
+iv_signal_child_test_OBJECTS = $(am_iv_signal_child_test_OBJECTS)
+iv_signal_child_test_LDADD = $(LDADD)
+iv_signal_child_test_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_iv_signal_test_OBJECTS = iv_signal_test.$(OBJEXT)
+iv_signal_test_OBJECTS = $(am_iv_signal_test_OBJECTS)
+iv_signal_test_LDADD = $(LDADD)
+iv_signal_test_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_null_OBJECTS = null.$(OBJEXT)
+null_OBJECTS = $(am_null_OBJECTS)
+null_LDADD = $(LDADD)
+null_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_struct_sizes_OBJECTS = struct_sizes.$(OBJEXT)
+struct_sizes_OBJECTS = $(am_struct_sizes_OBJECTS)
+struct_sizes_LDADD = $(LDADD)
+struct_sizes_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_timer_OBJECTS = timer.$(OBJEXT)
+timer_OBJECTS = $(am_timer_OBJECTS)
+timer_LDADD = $(LDADD)
+timer_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_timer_fairness_OBJECTS = timer_fairness.$(OBJEXT)
+timer_fairness_OBJECTS = $(am_timer_fairness_OBJECTS)
+timer_fairness_LDADD = $(LDADD)
+timer_fairness_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+timer_fairness_bug_SOURCES = timer_fairness_bug.c
+timer_fairness_bug_OBJECTS = timer_fairness_bug.$(OBJEXT)
+timer_fairness_bug_LDADD = $(LDADD)
+timer_fairness_bug_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_timer_order_OBJECTS = timer_order.$(OBJEXT)
+timer_order_OBJECTS = $(am_timer_order_OBJECTS)
+timer_order_LDADD = $(LDADD)
+timer_order_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+am_timer_past_OBJECTS = timer_past.$(OBJEXT)
+timer_past_OBJECTS = $(am_timer_past_OBJECTS)
+timer_past_LDADD = $(LDADD)
+timer_past_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+timer_zero_SOURCES = timer_zero.c
+timer_zero_OBJECTS = timer_zero.$(OBJEXT)
+timer_zero_LDADD = $(LDADD)
+timer_zero_DEPENDENCIES = $(top_builddir)/src/libivykis.la
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/avl.Po ./$(DEPDIR)/client.Po \
+	./$(DEPDIR)/connectfail.Po ./$(DEPDIR)/connectreset.Po \
+	./$(DEPDIR)/event_unregister_bug.Po \
+	./$(DEPDIR)/iv_event_raw_bench.Po \
+	./$(DEPDIR)/iv_event_raw_bench_signal-iv_event_raw_bench.Po \
+	./$(DEPDIR)/iv_event_raw_test.Po \
+	./$(DEPDIR)/iv_fd_pump_discard.Po \
+	./$(DEPDIR)/iv_fd_pump_echo.Po ./$(DEPDIR)/iv_inotify_test.Po \
+	./$(DEPDIR)/iv_popen_test.Po ./$(DEPDIR)/iv_signal_bench.Po \
+	./$(DEPDIR)/iv_signal_bench_signal-iv_signal_bench.Po \
+	./$(DEPDIR)/iv_signal_child_test.Po \
+	./$(DEPDIR)/iv_signal_test.Po ./$(DEPDIR)/null.Po \
+	./$(DEPDIR)/struct_sizes.Po ./$(DEPDIR)/timer.Po \
+	./$(DEPDIR)/timer_fairness.Po \
+	./$(DEPDIR)/timer_fairness_bug.Po ./$(DEPDIR)/timer_order.Po \
+	./$(DEPDIR)/timer_past.Po ./$(DEPDIR)/timer_zero.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(avl_SOURCES) $(client_SOURCES) $(connectfail_SOURCES) \
+	$(connectreset_SOURCES) event_unregister_bug.c \
+	$(iv_event_raw_bench_signal_SOURCES) \
+	$(iv_event_raw_bench_timer_SOURCES) \
+	$(iv_event_raw_test_SOURCES) $(iv_fd_pump_discard_SOURCES) \
+	$(iv_fd_pump_echo_SOURCES) iv_inotify_test.c \
+	$(iv_popen_test_SOURCES) $(iv_signal_bench_signal_SOURCES) \
+	$(iv_signal_bench_timer_SOURCES) \
+	$(iv_signal_child_test_SOURCES) $(iv_signal_test_SOURCES) \
+	$(null_SOURCES) $(struct_sizes_SOURCES) $(timer_SOURCES) \
+	$(timer_fairness_SOURCES) timer_fairness_bug.c \
+	$(timer_order_SOURCES) $(timer_past_SOURCES) timer_zero.c
+DIST_SOURCES = $(avl_SOURCES) $(client_SOURCES) $(connectfail_SOURCES) \
+	$(connectreset_SOURCES) event_unregister_bug.c \
+	$(iv_event_raw_bench_signal_SOURCES) \
+	$(iv_event_raw_bench_timer_SOURCES) \
+	$(iv_event_raw_test_SOURCES) $(iv_fd_pump_discard_SOURCES) \
+	$(iv_fd_pump_echo_SOURCES) iv_inotify_test.c \
+	$(iv_popen_test_SOURCES) $(iv_signal_bench_signal_SOURCES) \
+	$(iv_signal_bench_timer_SOURCES) \
+	$(iv_signal_child_test_SOURCES) $(iv_signal_test_SOURCES) \
+	$(null_SOURCES) $(struct_sizes_SOURCES) $(timer_SOURCES) \
+	$(timer_fairness_SOURCES) timer_fairness_bug.c \
+	$(timer_order_SOURCES) $(timer_past_SOURCES) timer_zero.c
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[ 	]*:recheck:[ 	]*
+am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
+am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+	    recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[ 	]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);					\
+$(am__vpath_adj_setup) $(am__vpath_adj)			\
+$(am__tty_colors);					\
+srcdir=$(srcdir); export srcdir;			\
+case "$@" in						\
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
+    *) am__odir=.;; 					\
+esac;							\
+test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
+  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
+if test -f "./$$f"; then dir=./;			\
+elif test -f "$$f"; then dir=;				\
+else dir="$(srcdir)/"; fi;				\
+tst=$$dir$$f; log='$@'; 				\
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
+  am__enable_hard_errors=no; 				\
+else							\
+  am__enable_hard_errors=yes; 				\
+fi; 							\
+case " $(XFAIL_TESTS) " in				\
+  *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
+    am__expect_failure=yes;;				\
+  *)							\
+    am__expect_failure=no;;				\
+esac; 							\
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS =  .test
+LOG_DRIVER = $(SHELL) $(top_builddir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_builddir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+	$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} 'git/missing' aclocal-1.16
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AR = riscv64-poky-linux-gcc-ar
+AS = riscv64-poky-linux-as 
+AUTOCONF = ${SHELL} 'git/missing' autoconf
+AUTOHEADER = ${SHELL} 'git/missing' autoheader
+AUTOMAKE = ${SHELL} 'git/missing' automake-1.16
+AWK = gawk
+CC = gcc    -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
+CCDEPMODE = depmode=none
+CFLAGS =  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=.=/usr/src/debug/ivykis/0.42.4-r0                      -fdebug-prefix-map=.=/usr/src/debug/ivykis/0.42.4-r0                      -fdebug-prefix-map=recipe-sysroot=                      -fdebug-prefix-map=recipe-sysroot-native=  -Wall
+CPPFLAGS = 
+CSCOPE = cscope
+CTAGS = ctags
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = false
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = grep -E
+ETAGS = etags
+EXEEXT = 
+FGREP = grep -F
+FILECMD = file
+GREP = grep
+INSTALL = install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = riscv64-poky-linux-ld --sysroot=recipe-sysroot 
+LDFLAGS = -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=.=/usr/src/debug/ivykis/0.42.4-r0                      -fdebug-prefix-map=.=/usr/src/debug/ivykis/0.42.4-r0                      -fdebug-prefix-map=recipe-sysroot=                      -fdebug-prefix-map=recipe-sysroot-native=  -Wl,-z,relro,-z,now
+LIBOBJS = 
+LIBS = 
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+LT_SYS_LIBRARY_PATH = 
+MAKEINFO = ${SHELL} 'git/missing' makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = mkdir -p
+NM = riscv64-poky-linux-gcc-nm
+NMEDIT = 
+OBJDUMP = riscv64-poky-linux-objdump
+OBJEXT = o
+OTOOL = 
+OTOOL64 = 
+PACKAGE = ivykis
+PACKAGE_BUGREPORT = libivykis-discuss@lists.sourceforge.net
+PACKAGE_NAME = ivykis
+PACKAGE_STRING = ivykis 0.42.4
+PACKAGE_TARNAME = ivykis
+PACKAGE_URL = 
+PACKAGE_VERSION = 0.42.4
+PATH_SEPARATOR = :
+RANLIB = riscv64-poky-linux-gcc-ranlib
+SED = sed
+SET_MAKE = 
+SHELL = /bin/bash
+STRIP = riscv64-poky-linux-strip
+VERSION = 0.42.4
+abs_builddir = build/test
+abs_srcdir = build/../git/test
+abs_top_builddir = build
+abs_top_srcdir = build/../git
+ac_ct_AR = 
+ac_ct_CC = 
+ac_ct_DUMPBIN = 
+ac_cv_timespec_hdr = sys/time.h
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = /usr/bin
+build = x86_64-pc-linux-gnu
+build_alias = x86_64-linux
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = pc
+builddir = .
+datadir = /usr/share
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = /usr
+host = riscv64-poky-linux-gnu
+host_alias = riscv64-poky-linux
+host_cpu = riscv64
+host_os = linux-gnu
+host_vendor = poky
+htmldir = ${docdir}
+includedir = /usr/include
+infodir = /usr/share/info
+install_sh = ${SHELL} git/install-sh
+libdir = /usr/lib
+libexecdir = /usr/libexec
+localedir = ${datarootdir}/locale
+localstatedir = /var
+mandir = /usr/share/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr
+program_transform_name = s,x,x,
+psdir = ${docdir}
+runstatedir = ${localstatedir}/run
+sbindir = /usr/sbin
+sharedstatedir = /com
+srcdir = .
+subdirs =  test.mt
+sysconfdir = /etc
+target_alias = riscv64-poky-linux
+top_build_prefix = ../
+top_builddir = ..
+top_srcdir = .
+AM_CPPFLAGS = -D_GNU_SOURCE			\
+			  -I$(top_srcdir)/src/include	\
+			  -I$(top_builddir)/src/include
+
+LDADD = $(top_builddir)/src/libivykis.la
+PROGS = iv_event_raw_bench_timer $(am__append_1) $(am__append_2)
+avl_SOURCES = avl.c
+client_SOURCES = client.c
+connectfail_SOURCES = connectfail.c
+connectreset_SOURCES = connectreset.c
+iv_event_raw_test_SOURCES = iv_event_raw_test.c
+iv_fd_pump_discard_SOURCES = iv_fd_pump_discard.c
+iv_fd_pump_echo_SOURCES = iv_fd_pump_echo.c
+iv_popen_test_SOURCES = iv_popen_test.c
+iv_signal_child_test_SOURCES = iv_signal_child_test.c
+iv_signal_test_SOURCES = iv_signal_test.c
+null_SOURCES = null.c
+struct_sizes_SOURCES = struct_sizes.c
+timer_SOURCES = timer.c
+timer_fairness_SOURCES = timer_fairness.c
+timer_order_SOURCES = timer_order.c
+timer_past_SOURCES = timer_past.c
+iv_event_raw_bench_signal_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_SIGNAL
+iv_event_raw_bench_signal_SOURCES = iv_event_raw_bench.c
+iv_event_raw_bench_timer_SOURCES = iv_event_raw_bench.c
+iv_signal_bench_signal_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_SIGNAL
+iv_signal_bench_signal_SOURCES = iv_signal_bench.c
+iv_signal_bench_timer_SOURCES = iv_signal_bench.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+	@$(am__set_TESTS_bases); \
+	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+	redo_bases=`for i in $$bases; do \
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+	            done`; \
+	if test -n "$$redo_bases"; then \
+	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+	  if $(am__make_dryrun); then :; else \
+	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+	  fi; \
+	fi; \
+	if test -n "$$am__remaking_logs"; then \
+	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+	       "recursion detected" >&2; \
+	elif test -n "$$redo_logs"; then \
+	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+	fi; \
+	if $(am__make_dryrun); then :; else \
+	  st=0;  \
+	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+	  for i in $$redo_bases; do \
+	    test -f $$i.trs && test -r $$i.trs \
+	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+	    test -f $$i.log && test -r $$i.log \
+	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+	  done; \
+	  test $$st -eq 0 || exit 1; \
+	fi
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
+	    else \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+	    fi; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
+	    else \
+	      color_start= color_end=; \
+	    fi; \
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for b in $$bases; do echo $$b; done				\
+	    | $(am__create_global_log);					\
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
+	  fi;								\
+	  echo "$$col$$br$$std";					\
+	fi;								\
+	$$success || exit 1
+
+check-TESTS: 
+	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+	exit $$?;
+recheck: all 
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	bases=`for i in $$bases; do echo $$i; done \
+	         | $(am__list_recheck_tests)` || exit 1; \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	log_list=`echo $$log_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+	        am__force_recheck=am--force-recheck \
+	        TEST_LOGS="$$log_list"; \
+	exit $$?
+avl.log: avl$(EXEEXT)
+	@p='avl$(EXEEXT)'; \
+	b='avl'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+event_unregister_bug.log: event_unregister_bug$(EXEEXT)
+	@p='event_unregister_bug$(EXEEXT)'; \
+	b='event_unregister_bug'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+iv_event_raw_test.log: iv_event_raw_test$(EXEEXT)
+	@p='iv_event_raw_test$(EXEEXT)'; \
+	b='iv_event_raw_test'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+struct_sizes.log: struct_sizes$(EXEEXT)
+	@p='struct_sizes$(EXEEXT)'; \
+	b='struct_sizes'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+timer.log: timer$(EXEEXT)
+	@p='timer$(EXEEXT)'; \
+	b='timer'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+timer_fairness.log: timer_fairness$(EXEEXT)
+	@p='timer_fairness$(EXEEXT)'; \
+	b='timer_fairness'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+timer_fairness_bug.log: timer_fairness_bug$(EXEEXT)
+	@p='timer_fairness_bug$(EXEEXT)'; \
+	b='timer_fairness_bug'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+timer_order.log: timer_order$(EXEEXT)
+	@p='timer_order$(EXEEXT)'; \
+	b='timer_order'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+timer_past.log: timer_past$(EXEEXT)
+	@p='timer_past$(EXEEXT)'; \
+	b='timer_past'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+timer_zero.log: timer_zero$(EXEEXT)
+	@p='timer_zero$(EXEEXT)'; \
+	b='timer_zero'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+iv_signal_test.log: iv_signal_test$(EXEEXT)
+	@p='iv_signal_test$(EXEEXT)'; \
+	b='iv_signal_test'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+	@p='$<'; \
+	$(am__set_b); \
+	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+#.test$(EXEEXT).log:
+#	@p='$<'; \
+#	$(am__set_b); \
+#	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+#	--log-file $$b.log --trs-file $$b.trs \
+#	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+#	"$$tst" $(AM_TESTS_FD_REDIRECT)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+		-rm -f ./$(DEPDIR)/avl.Po
+	-rm -f ./$(DEPDIR)/client.Po
+	-rm -f ./$(DEPDIR)/connectfail.Po
+	-rm -f ./$(DEPDIR)/connectreset.Po
+	-rm -f ./$(DEPDIR)/event_unregister_bug.Po
+	-rm -f ./$(DEPDIR)/iv_event_raw_bench.Po
+	-rm -f ./$(DEPDIR)/iv_event_raw_bench_signal-iv_event_raw_bench.Po
+	-rm -f ./$(DEPDIR)/iv_event_raw_test.Po
+	-rm -f ./$(DEPDIR)/iv_fd_pump_discard.Po
+	-rm -f ./$(DEPDIR)/iv_fd_pump_echo.Po
+	-rm -f ./$(DEPDIR)/iv_inotify_test.Po
+	-rm -f ./$(DEPDIR)/iv_popen_test.Po
+	-rm -f ./$(DEPDIR)/iv_signal_bench.Po
+	-rm -f ./$(DEPDIR)/iv_signal_bench_signal-iv_signal_bench.Po
+	-rm -f ./$(DEPDIR)/iv_signal_child_test.Po
+	-rm -f ./$(DEPDIR)/iv_signal_test.Po
+	-rm -f ./$(DEPDIR)/null.Po
+	-rm -f ./$(DEPDIR)/struct_sizes.Po
+	-rm -f ./$(DEPDIR)/timer.Po
+	-rm -f ./$(DEPDIR)/timer_fairness.Po
+	-rm -f ./$(DEPDIR)/timer_fairness_bug.Po
+	-rm -f ./$(DEPDIR)/timer_order.Po
+	-rm -f ./$(DEPDIR)/timer_past.Po
+	-rm -f ./$(DEPDIR)/timer_zero.Po
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+		-rm -f ./$(DEPDIR)/avl.Po
+	-rm -f ./$(DEPDIR)/client.Po
+	-rm -f ./$(DEPDIR)/connectfail.Po
+	-rm -f ./$(DEPDIR)/connectreset.Po
+	-rm -f ./$(DEPDIR)/event_unregister_bug.Po
+	-rm -f ./$(DEPDIR)/iv_event_raw_bench.Po
+	-rm -f ./$(DEPDIR)/iv_event_raw_bench_signal-iv_event_raw_bench.Po
+	-rm -f ./$(DEPDIR)/iv_event_raw_test.Po
+	-rm -f ./$(DEPDIR)/iv_fd_pump_discard.Po
+	-rm -f ./$(DEPDIR)/iv_fd_pump_echo.Po
+	-rm -f ./$(DEPDIR)/iv_inotify_test.Po
+	-rm -f ./$(DEPDIR)/iv_popen_test.Po
+	-rm -f ./$(DEPDIR)/iv_signal_bench.Po
+	-rm -f ./$(DEPDIR)/iv_signal_bench_signal-iv_signal_bench.Po
+	-rm -f ./$(DEPDIR)/iv_signal_child_test.Po
+	-rm -f ./$(DEPDIR)/iv_signal_test.Po
+	-rm -f ./$(DEPDIR)/null.Po
+	-rm -f ./$(DEPDIR)/struct_sizes.Po
+	-rm -f ./$(DEPDIR)/timer.Po
+	-rm -f ./$(DEPDIR)/timer_fairness.Po
+	-rm -f ./$(DEPDIR)/timer_fairness_bug.Po
+	-rm -f ./$(DEPDIR)/timer_order.Po
+	-rm -f ./$(DEPDIR)/timer_past.Po
+	-rm -f ./$(DEPDIR)/timer_zero.Po
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles buildtest-TESTS check \
+	check-TESTS check-am clean clean-generic clean-libtool \
+	clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am recheck runtest-TESTS tags tags-am \
+	uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

+ 9 - 0
recipes-extended/ivykis/ivykis/run-ptest

@@ -0,0 +1,9 @@
+#! /bin/sh
+
+rm -rf src/.libs
+mkdir -p src/.libs
+cd src/.libs
+ln -sf /usr/lib/libivykis.so libivykis.so
+cd ../..
+cd test
+make check

+ 29 - 0
recipes-extended/ivykis/ivykis_0.42.4.bb

@@ -0,0 +1,29 @@
+DESCRIPTION = "ivykis is a library for asynchronous I/O readiness notification."
+LICENSE = "LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+inherit autotools
+
+SRC_URI = " \
+	git://github.com/buytenh/ivykis.git;branch=master;protocol=https \
+	file://Makefile \
+	file://run-ptest \
+	"
+
+SRCREV = "f1b14555fb0b5d9acfbcfaf35b1313bb28d858c2"
+
+S = "${WORKDIR}/git"
+
+inherit ptest
+
+do_install_ptest() {
+	mkdir ${D}${PTEST_PATH}/test
+	cp -r ${B}/test/.libs/* ${D}${PTEST_PATH}/test
+	install ${B}/../Makefile ${D}${PTEST_PATH}/test
+        install ${S}/test-driver ${D}${PTEST_PATH}
+}
+
+RDEPENDS:${PN}-ptest = " \
+	bash \
+	ivykis \
+	"

+ 4 - 0
recipes-extended/lua-cjson/lua-cjson/run-ptest

@@ -0,0 +1,4 @@
+#! /bin/sh
+
+cd tests
+luajit test.lua

+ 48 - 0
recipes-extended/lua-cjson/lua-cjson_2.1.0.11.bb

@@ -0,0 +1,48 @@
+DESCRIPTION = "Lua CJSON is a fast JSON encoding/parsing module for Lua"
+LICENSE = "MIT"
+HOMEPAGE = "https://github.com/mpx/lua-cjson"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b1fee3afe4f4a4b26c13016123b2d08a"
+
+DEPENDS += "luajit-native luajit-riscv"
+RDEPENDS:${PN} += "luajit-riscv"
+
+SRC_URI = "git://github.com/openresty/lua-cjson.git;branch=master;protocol=https \
+	   file://run-ptest \
+          "
+
+SRCREV = "91c3363e7dc86263a379719e5508fc0979df84d3"
+S = "${WORKDIR}/git"
+LUA_VERSION = "5.1"
+
+EXTRA_OEMAKE = "LUA_V=${LUA_VERSION} PREFIX=${D}/usr LUA_INCLUDE_DIR=${STAGING_INCDIR}/luajit-2.1"
+
+do_compile() {
+    cd ${S}
+    oe_runmake all
+}
+
+
+do_install() {
+    cd ${S}
+    oe_runmake install
+}
+
+FILES:${PN} = " \
+	${datadir}/lua/${LUA_VERSION}/ \
+	${libdir}/lua/${LUA_VERSION}/ \
+"
+
+inherit ptest
+
+do_compile_ptest() {
+	cd ${S}/tests
+	./genutf8.pl
+}
+
+do_install_ptest() {
+	mkdir -p ${D}${PTEST_PATH}/tests
+	install ${S}/tests/test.lua ${D}${PTEST_PATH}/tests
+	install ${S}/tests/octets-escaped.dat ${D}${PTEST_PATH}/tests
+	install ${S}/tests/utf8.dat ${D}${PTEST_PATH}/tests
+	cp -r ${S}/lua/cjson ${D}${PTEST_PATH}/tests
+}

+ 3 - 0
recipes-extended/mnn/mnn/run-ptest

@@ -0,0 +1,3 @@
+#! /bin/sh
+
+./run_test.out

+ 26 - 0
recipes-extended/mnn/mnn_2.6.0.bb

@@ -0,0 +1,26 @@
+DESCRIPTION = "MNN is a blazing fast, lightweight deep learning framework, battle-tested by business-critical use cases in Alibaba"
+HOMEPAGE = "www.mnn.zone"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://README.md;startline=124;endline=125;md5=49af4a1302656dc01a1c983ee77b8227"
+
+SRC_URI = " \
+    git://github.com/alibaba/MNN.git;branch=master;protocol=https \
+    file://run-ptest \
+"
+SRCREV = "c293f9eeab0a2983aa260ca81c751b09a389b16d"
+S = "${WORKDIR}/git"
+
+inherit cmake ptest
+
+EXTRA_OECMAKE = "-DMNN_BUILD_TEST=1"
+
+FILES:${PN} += "${libdir}/MNN*"
+
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+RDEPENDS:${PN} += "libstdc++"
+
+do_install_ptest() {
+        install ${B}/run_test.out ${D}${PTEST_PATH}
+}

+ 3 - 0
recipes-extended/muparser/muparser/run-ptest

@@ -0,0 +1,3 @@
+#! /bin/sh
+
+./t_ParserTest

+ 25 - 0
recipes-extended/muparser/muparser_2.3.2.bb

@@ -0,0 +1,25 @@
+SUMMARY = "Fast Math Parser Library"
+HOMEPAGE = "http://beltoforion.de/article.php?a=muparser"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://License.txt;md5=98f3ad1a0193387fc84b0101833605c8"
+
+SRC_URI = " \
+	git://github.com/beltoforion/muparser.git;branch=master;protocol=https \
+	file://run-ptest \
+	"
+SRCREV = "207d5b77c05c9111ff51ab91082701221220c477"
+PV = "2.3.2"
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig ptest
+
+EXTRA_OECMAKE = "-DENABLE_SAMPLES=OFF"
+
+do_install_ptest() {
+        cp -rf ${B}/t_ParserTest ${D}${PTEST_PATH}
+}
+
+RDEPENDS:${PN}-ptest += " \
+        cmake \
+"
+

+ 9 - 0
recipes-httpd/nginx/nginx_%.bbappend

@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRCREV = "2f67cde5a0aaf7cffd43a71f5c4b443698909f4a"
+
+SRC_URI += " \
+    git://github.com/fdintino/nginx-upload-module.git;branch=master;destsuffix=nginx-upload-module;protocol=ssh \
+"
+
+EXTRA_OECONF += "--add-module=${WORKDIR}/nginx-upload-module "

+ 10 - 1
recipes-kernel/linux/linux-starfive-dev_6.1.20.bb

@@ -12,8 +12,14 @@ FORK:starfive-dubhe = "starfive-tech"
 BRANCH:starfive-dubhe = "starfive-6.1-dubhe"
 SRCREV:starfive-dubhe = "0a9c9aa4208378d4da0cf13c6c5a3a92da370b26"
 
+FORK:starfive-jh8100 = "starfive-tech"
+BRANCH:starfive-jh8100 = "starfive-6.1-dev-jh8100-bmc"
+SRCREV:starfive-jh8100 ="602adfee5440add362c13535b9f7d4d2647e2526"
+
 LINUX_VERSION ?= "6.1.20"
 LINUX_VERSION:starfive-dubhe = "6.1.20"
+LINUX_VERSION:starfive-jh8100 = "6.1.20"
+
 LINUX_VERSION_EXTENSTION:append:starfive-dubhe = "-starlight"
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
@@ -25,13 +31,16 @@ SRC_URI:starfive-dubhe = " \
         ${@oe.utils.conditional('ENABLE_UBI','1','file://ubi.patch','',d)} \
         ${@oe.utils.conditional('ENABLE_NFS','1','file://nfs.patch','',d)} \
         "
+SRC_URI:starfive-jh8100 = "git://git@192.168.110.45/${FORK}/linux.git;protocol=ssh;branch=${BRANCH}"
+
 
 INITRAMFS_IMAGE_BUNDLE:starfive-dubhe = "${@oe.utils.conditional('ENABLE_INIT','1','1','',d)}"
 INITRAMFS_IMAGE:starfive-dubhe = "${@oe.utils.conditional('ENABLE_INIT','1','dubhe-image-initramfs','',d)}"
 
 KBUILD_DEFCONFIG:starfive-dubhe = "starfive_dubhe_defconfig"
+KBUILD_DEFCONFIG:starfive-jh8100 = "jh8100_defconfig"
 
-COMPATIBLE_MACHINE = "(starfive-dubhe)"
+COMPATIBLE_MACHINE = "(starfive-dubhe|starfive-jh8100)"
 
 FILES:${KERNEL_PACKAGE_NAME}-base += "/usr/*"
 

+ 51 - 7
setup.sh

@@ -50,6 +50,7 @@ bitbake-layers add-layer ../meta-openembedded/meta-filesystems
 bitbake-layers add-layer ../meta-openembedded/meta-networking
 bitbake-layers add-layer ../meta-openembedded/meta-gnome
 bitbake-layers add-layer ../meta-openembedded/meta-xfce
+bitbake-layers add-layer ../meta-openembedded/meta-webserver
 bitbake-layers add-layer ../meta-riscv
 bitbake-layers add-layer ../meta-starfive
 bitbake-layers add-layer ../meta-clang
@@ -76,7 +77,7 @@ USER_CLASSES ?= "buildstats buildhistory buildstats-summary"
 
 INHERIT += "uninative"
 
-DISTRO_FEATURES:append = " largefile opengl ptest multiarch wayland pam  systemd "
+DISTRO_FEATURES:append = " largefile opengl ptest multiarch wayland pam systemd "
 #DISTRO_FEATURES:append = " largefile opengl ptest multiarch wayland pam "
 DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
 VIRTUAL-RUNTIME_init_manager = "systemd"
@@ -178,9 +179,9 @@ echo "";
 PS3="Select your action : "
 options=("Build qspi-image" "Build dubhe-image-minimal" "Build qspi-ubifs-image" "Build qspi-nfs-image" "Quit")
 
-select opt in "${options[@]}" 
+select opt in "${options[@]}"
 do
-    case $opt in 
+    case $opt in
         "Build qspi-image")
 #            cd ../build || { echo "Run setup.sh before building images."; cd meta-starfive; break; };
 	    updatecfg ENABLE_INIT;
@@ -290,6 +291,48 @@ do
 done
 }
 
+jh8100(){
+# Menu script
+echo ""
+echo -e "${PURPLE}*******************************************************************"
+echo "*                                                                 *"
+echo "*                 StarFive JH8100 Build Menu                      *"
+echo "*                                                                 *"
+echo -e "*******************************************************************${NC}"
+echo "";
+echo -e "${YELLOW}Description : ";
+echo "";
+echo "This build script can build two types of image.";
+echo "";
+echo "1) core-image-minimal";
+echo "   - Minimal image with ext4 support.";
+echo "   - Generated output : ";
+echo "     starfive-jh8100-core-image-minimal.img";
+echo -e "2) Quit${NC}";
+echo "";
+
+PS3="Select your action : "
+options=("Build core-image-minimal" "Quit")
+
+select opt in "${options[@]}"
+do
+    case $opt in
+        "Build core-image-minimal")
+                cur_ter=$(tty);
+                output_min=$(MACHINE=starfive-jh8100 bitbake core-image-minimal | tee $cur_ter);
+                if [[ $output_min != *"ERROR"* ]]; then
+                        echo -e "\U0002705 ${GREEN}Build Complete${NC}"
+                else echo -e "\U000274C ${RED}Build Failed${NC}"
+                fi;;
+        "Quit")
+            break;;
+        *)
+            echo "Invalid option $REPLY. Kindly select choice between menu range."
+    esac
+    REPLY=
+done
+}
+
 # Menu script
 echo ""
 echo -e "${PURPLE}*******************************************************************"
@@ -300,18 +343,20 @@ echo -e "*******************************************************************${NC
 echo "";
 echo -e "${YELLOW}List below shows machine supported : ";
 echo "1) StarFive Dubhe";
-echo -e "2) Quit${NC}";
+echo "2) StarFive JH8100";
+echo -e "3) Quit${NC}";
 echo "";
 
 PS3="Select machine : "
-options=("StarFive Dubhe" "Quit")
-
+options=("StarFive Dubhe" "StarFive JH8100" "Quit")
 
 select opt in "${options[@]}"
 do
     case $opt in
         "StarFive Dubhe")
 		dubhe;;
+	"StarFive JH8100")
+		jh8100;;
 	"Quit")
             break;;
         *)
@@ -319,4 +364,3 @@ do
     esac
     REPLY=
 done
-

+ 10 - 0
wic/starfive-jh8100.wks

@@ -0,0 +1,10 @@
+#short-description: Create SD card image for Starfive Duhbe
+# long-description: Creates a partitioned SD card image for Starfive Dubhe.
+
+#boot partition
+part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 1024 --size=200M --use-uuid
+
+#root partition
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 1024 --size=2G --use-uuid
+
+bootloader --append "rootwait console=ttyS0,115200"