<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font size="-1">Hello Thomas,</font></p>
    <p><font size="-1">Thanks for feedback. <br>
      </font></p>
    <div class="moz-cite-prefix"><font size="-1">On 04-06-2018 17:55,
        Thomas Petazzoni wrote:</font><br>
    </div>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">Hello Refik,

Thanks a lot for your contribution! I believe it's your first Buildroot
contribution, so congratulations :-)

The first comment is that you should sent your patch using "git
send-email". Because you didn't do that, your patch has been horribly
rewrapped by your e-mail client, and it cannot be applied.</pre>
    </blockquote>
    <br>
    <p><font size="-1">I tried to send this patch via git send-email but
        I have problem with my ssl certificate as below;</font></p>
    <font size="-1">
    </font>
    <p><font size="-1">STARTTLS failed! SSL connect attempt failed with
        unknown error error:14090086:SSL
        routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
        at /usr/lib/git-core/git-send-email line 1241.<br>
      </font>
    </p>
    <font size="-1">
    </font>
    <p><font size="-1">When I solve problem, I will use this tool
        instead of sending via direct e-mail.</font></p>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

The second thing, less important, is that the [BALENA PATCH] subject
prefix is not necessary, just [PATCH] is sufficient or more precisely
[PATCHv2] for your next iteration.

The title should be:

        balena: new package

which is almost the same as what you did, but without the space
before :, and lower case.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

On Mon, 4 Jun 2018 17:22:37 +0300, Refik Tuzaklı wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">  package/Config.in          |  1 +
  package/balena/Config.in   | 16 +++++++++++
  package/balena/balena.hash |  2 ++
  package/balena/balena.mk   | 68 
++++++++++++++++++++++++++++++++++++++++++++++
</pre>
      </blockquote>
      <pre wrap="">
Please add an entry in the DEVELOPERS file for this package.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+    source "package/balena/Config.in"
      source "package/bootutils/Config.in"
</pre>
      </blockquote>
      <pre wrap="">
Indentation is wrong here, but maybe it's an artefact of not sending
with git send-email.</pre>
    </blockquote>
    <font size="-1">At my local patch file, I can not see this typo but
      I will take care of it.</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">diff --git a/package/balena/Config.in b/package/balena/Config.in
new file mode 100644
index 0000000..2904d2a
--- /dev/null
+++ b/package/balena/Config.in
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_BALENA
+    bool "balena"
+    depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+    depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+    depends on BR2_TOOLCHAIN_HAS_THREADS
+    depends on BR2_INIT_SYSTEMD
+    select BR2_PACKAGE_LVM2
+    select BR2_PACKAGE_LVM2_STANDARD_INSTALL
</pre>
      </blockquote>
      <pre wrap="">
You need to propagate the dependencies of lvm2 here:

        depends on BR2_TOOLCHAIN_HAS_THREADS
        depends on BR2_USE_MMU # needs fork()
        depends on !BR2_STATIC_LIBS # It fails to build statically</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+    help
+      Moby-based Container Engine for Embedded, IoT, and Edge uses
+
+      <a class="moz-txt-link-freetext" href="https://github.com/resin-os/balena">https://github.com/resin-os/balena</a>
+
+
</pre>
      </blockquote>
      <pre wrap="">
Only one empty line here.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+comment "balena needs systemd"
+    depends on !BR2_INIT_SYSTEMD
</pre>
      </blockquote>
      <pre wrap="">
Also, please run check-package to make sure the indentation is correct.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+BALENA_LICENSE = Apache-2.0
+BALENA_LICENSE_FILES = LICENSE
+
+BALENA_DEPENDENCIES = host-go host-pkgconf systemd lvm2
</pre>
      </blockquote>
      <pre wrap="">
Drop the host-go dependency, it's not needed because you're using the
golang-package infrastructure.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+BALENA_GOPATH = <a class="moz-txt-link-rfc2396E" href="mailto:$(@D)/.gopath">"$(@D)/.gopath"</a>
</pre>
      </blockquote>
      <pre wrap="">
I believe this is not needed, it's taken care of by the golang-package
infrastructure.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+BALENA_VERSION_DIR = 17.06.0-dev
</pre>
      </blockquote>
      <pre wrap="">
Ditto, should not be needed.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+BALENA_BUILD_TARGETS = balena
</pre>
      </blockquote>
      <pre wrap="">
This one is OK.

</pre>
      <blockquote type="cite">
        <pre wrap="">+BALENA_INSTALL_BINS = $(TARGET_DIR)/usr/bin/$(target)
</pre>
      </blockquote>
      <pre wrap="">
This one doesn't make sense because $(target) is empty. Instead list
the binaries to be installed.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+BALENA_CONFIGURE_ENV = GOPATH=${BALENA_GOPATH} \
+    $(TARGET_MAKE_ENV) \
+    $(HOST_GO_TARGET_ENV) \
+    DOCKER_GITCOMMIT=${BALENA_COMMIT} \
+    DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdirver_zfs 
exclude_graphdriver_devicemapper'
</pre>
      </blockquote>
      <pre wrap="">
None of that should be needed with the golang-package infrastructure.
Look at the docker-engine package for an example.</pre>
    </blockquote>
    <font size="-1">I thought so but when I remove one of them, it
      crashes while configuring. Even it is balena package, it needs some
      docker parameters.</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+
+BALENA_MAKE_ENV = GOPATH=$(BALENA_GOPATH) \
+    $(TARGET_MAKE_ENV) \
+    $(HOST_GO_TARGET_ENV)
</pre>
      </blockquote>
      <pre wrap="">
Same.

</pre>
      <blockquote type="cite">
        <pre wrap="">+
+BALENA_GLDFLAGS += -extldflags '-static'
</pre>
      </blockquote>
      <pre wrap="">
Same.

</pre>
      <blockquote type="cite">
        <pre wrap="">+
+define BALENA_CONFIGURE_CMDS
+    mkdir -p $(BALENA_GOPATH)/src/github.com/docker
+    ln -fs $(@D) $(BALENA_GOPATH)/src/github.com/docker/docker
</pre>
      </blockquote>
      <pre wrap="">
Not needed with the golang-package infrastructure.</pre>
    </blockquote>
    <font size="-1">golang-package does ;<br>
      <br>
      mkdir -p $(@D)/_gopath/src/github.com/resin-os/<br>
      ln -sf </font><font size="-1"><font size="-1">$(@D)</font> </font><font
      size="-1"><font size="-1">$(@D)</font>/_gopath/src/github.com/resin-os/balena<br>
      <br>
      but balena needs ;<br>
      mkdir -p </font><font size="-1"><font size="-1">$(@D)</font>/.gopath/src/github.com/docker<br>
      ln -fs </font><font size="-1"><font size="-1">$(@D)</font> </font><font
      size="-1"><font size="-1">$(@D)</font>/.gopath/src/github.com/docker/docker<br>
      <br>
      I think this caused by package itself. I am not a developer of
      balena, I can ask this issue to balena developers<br>
    </font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+    cd $(@D) && \
+        $(BALENA_CONFIGURE_ENV) \
+        bash ./hack/make.sh dynbinary-balena
</pre>
      </blockquote>
      <pre wrap="">
Do this in a POST_CONFIGURE_HOOKS.</pre>
    </blockquote>
    <font size="-1">OK</font><br>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+define BALENA_BUILD_CMDS
+    $(foreach target,$(BALENA_BUILD_TARGETS), \
+        cd $(BALENA_GOPATH)/src/github.com/docker/docker/cmd/mobynit; \
+        $(BALENA_MAKE_ENV) \
+        $(HOST_DIR)/bin/go build -v\
+            -ldflags "$(BALENA_GLDFLAGS)"
+    )
+endef
</pre>
      </blockquote>
      <pre wrap="">
Not needed, it should be done by the golang-package infrastructure.</pre>
    </blockquote>
    <font size="-1">build directory is </font><br>
    <pre wrap="">$(BALENA_GOPATH)/src/github.com/docker/docker/cmd/mobynit

I guess buildroot looks $(BALENA_GOPATH)/src/github.com/resin-io/balena/cmd/balena 
Am I right?
</pre>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">+
+define BALENA_INSTALL_TARGET_CMDS
+    $(foreach target,$(BALENA_BUILD_TARGETS), \
+        $(INSTALL) -D -m 0755 
$(@D)/bundles/17.06.0-dev/dynbinary-balena/$(target) $(BALENA_INSTALL_BINS)
+        ln -sf balena $(TARGET_DIR)/usr/bin/balenad
+        ln -sf balena $(TARGET_DIR)/usr/bin/balena-containerd
+        ln -sf balena $(TARGET_DIR)/usr/bin/balena-containerd-shim
+        ln -sf balena $(TARGET_DIR)/usr/bin/balena-containerd-ctr
+        ln -sf balena $(TARGET_DIR)/usr/bin/balena-runc
+        ln -sf balena $(TARGET_DIR)/usr/bin/balena-proxy
+    )
</pre>
      </blockquote>
      <pre wrap="">
Same.</pre>
    </blockquote>
    <font size="-1">build step creates </font><br>
    <pre wrap="">$(BALENA_GOPATH)/src/github.com/docker/docker/cmd/mobynit/mobynit

but we need

$(@D)/bundles/17.06.0-dev/dynbinary-balena/balena</pre>
    <blockquote type="cite" cite="mid:20180604165507.4df4e009@windsurf">
      <pre wrap="">

Basically, I have the feeling that you created this package as a
generic-package originally, and then quickly converted it to
golang-package. But the golang-package infrastructure greatly
simplifies Go packages, so you should really leverage the features of
the golang-package infrastructure.

Could you rework this package to use golang-package more effectively ?

Thanks a lot!

Thomas
</pre>
    </blockquote>
    <font size="-1">I check docker-engine before converting to golang
      package. Also I took balena_git.bb file on meta-resin as a
      reference for cross-compile procedure from Yocto Projects. If I
      can I want to rework on this package with your help.<br>
      <br>
      Cheers,<br>
      <br>
      Refik Tuzaklı<br>
      Embedded Software Engineer<br>
      IT and Simulation Group<br>
    </font><br>
    <p class="MsoNormal"><span style="font-size:9.0pt;
        font-family:"Arial","sans-serif"">Savronik
        A.Ş.</span></p>
    <p class="MsoNormal"><span style="font-size:9.0pt;
        font-family:"Arial","sans-serif";
        color:black">Organize Sanayi Bölgesi</span><span
        style="font-size:9.0pt;
        font-family:"Arial","sans-serif";
        color:black"></span></p>
    <p class="MsoNormal"><span style="font-size:9.0pt;
        font-family:"Arial","sans-serif";
        color:black">20. Cadde No: 19 26110 <br>
      </span></p>
    <p class="MsoNormal"><span style="font-size:9.0pt;
        font-family:"Arial","sans-serif";
        color:black">Eskişehir Turkey<br>
      </span></p>
    <p class="MsoNormal"><span style="font-size:9.0pt;
        font-family:"Arial","sans-serif"">Tel   :
        (+90 222) 236 1590</span></p>
    <p class="MsoNormal"><span style="font-size:9.0pt;
        font-family:"Arial","sans-serif"">Faks: (+90
        222) 236 1589</span></p>
    <span style=""><a target="_blank"><span style="font-size:8.0pt;
          font-family:"Arial","sans-serif";
          color:blue">www.savronik.com.tr</span></a></span>
  </body>
</html>