How to add my own software to a Buildroot Linux package?

后端 未结 2 347
南方客
南方客 2021-01-31 05:05

I am trying to add my own program to a small linux, created with Buildroot. What I\'ve done so far:

  • I\'ve created a new directory inside my \'buildroot/package/

2条回答
  •  时光说笑
    2021-01-31 05:56

    In general, the sources for buildroot packages are taken from a (downloaded) tarball. What you are doing right now (placing the sources inside package/HelloWorld) is not the right way to proceed.

    Buildroot does have provisions for 'local' package sources, which you could use if you really need to. You'll need the HELLOWORLD_SITE_METHOD variable for that.

    Please refer to http://buildroot.uclibc.org/downloads/manual/manual.html#adding-packages for more information.

    Also, you don't need to define HELLOWORLD_DIR, HELLOWORLD_BINARY, HELLOWORLD_TARGET_BINARY.

    Update: regarding your additional question:

    UPDATE: The program builds and install at the desired location but when I try to run it like so: ./helloworld, I get: bash: ./helloworld: No such file or directory, it has execution rights.. what is the matter with it? (I try to run it after I mount the rootfs.ext2 into a ubuntu directory, the target arch for buildroot is i368, so it should be ok, right?)

    No, it does not work like that. You can't just mount rootfs.ext2 and expect to run programs from it. This is, among others, because the programs inside rootfs.ext2 are compiled against the libraries also inside rootfs.ext2, but if you run it like that it will use the libraries in /usr/lib. You either have to boot your system entirely with the rootfs.ext2, use qemu, or use a chroot environment. For chroot, you should use the 'tar' filesystem format, not ext2. See also here: http://buildroot.uclibc.org/downloads/manual/manual.html#_chroot

提交回复
热议问题