Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] regarding creating my own customized package in buildroot and use it in my OS in Raspberry Pi
@ 2018-05-07  7:02 s.vineeth amalraj
  2018-05-07  7:16 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: s.vineeth amalraj @ 2018-05-07  7:02 UTC (permalink / raw)
  To: buildroot

Dear Sir,

I am Vineeth. I would like to create a simple python package in my
customized os for RPi-3. I could able to see the package name in the make
menuconfig after following the steps below, but when building it says no
file (in my case tamiltest.c) is present and make error is coming.


Kindly help me out with this. Below are the steps which I followed. Thank
you!

1. Created a package (i.e folder) named *"tamil"* under
/home/sands/Documents/vineeth/buildroot-at91/package.
2. Inside *tamil* folder, I created 2 files named *tamil.mk
<http://tamil.mk/>* and *Config.in*

3.Under *Config.in*  the below code is pasted:

*config BR2_PACKAGE_TAMIL*
*       bool "tamil"*
*       help*
*               This is sample tamil package.*
*        https://en.wikipedia.org/wiki/Tamils
<https://en.wikipedia.org/wiki/Tamils>*

4. Next under *tamil.mk <http://tamil.mk/>* file the below code is pasted:

*TAMIL_MODULE_VERSION = 1.0*
*TAMIL_SITE = /home/sands/Documents/vineeth/testtamil.c*
*TAMIL_SITE_METHOD = local*
*TAMIL_LICENSE = GPLv2*
*TAMIL_LICENSE_FILES = COPYING*
*TAMIL_MODULE_MAKE_OPTS = \*
*        CONFIG_DUMMY1= \*
*        CONFIG_DUMMY2=y*

*define KERNEL_MODULE_BUILD_CMDS*
*        $(MAKE) -C '$(@D)' LINUX_DIR='$(LINUX_DIR)' CC='$(TARGET_CC)'
LD='$(TARGET_LD)' modules*
*endef*

*$(eval $(kernel-module))*
*$(eval $(generic-package))*

5.Then in the *buildroot-->package-->Config.in file*, add the below lines (
*Note:* this Config.in is different. this is only used to display our
created package name in the make menuconfig)

*menu "My tamil package"*
*        source "package/tamil/Config.in"*
*endmenu*


6. I created a file named *testtamil.c* and saved in /home/sands/Documents/
vineeth/testtamil.c.  and in the file testtamil.c i have pasted the below
code:

*#include<stdio.h>*
*int main()*
*{*
*printf("tamil is tested\n");*
*printf("working fine");*

*return 1;*
*}*

*Issue:* This is reflecting in *make menuconfig* but not building and
getting make error and below is the error which i faced.

ERROR: /home/sands/Documents/vineeth/testtamil.c does not exist
package/pkg-generic.mk:194: recipe for target '/home/sands/Documents/vineeth
/buildroot-at91/output/build/tamil/.stamp_rsynced' failed
make[1]: *** [/home/sands/Documents/vineeth/buildroot-at91/output/build/tamil/.stamp_rsynced]
Error 1
Makefile:79: recipe for target '_all' failed
make: *** [_all] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180507/a04f36c3/attachment.html>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] regarding creating my own customized package in buildroot and use it in my OS in Raspberry Pi
  2018-05-07  7:02 [Buildroot] regarding creating my own customized package in buildroot and use it in my OS in Raspberry Pi s.vineeth amalraj
@ 2018-05-07  7:16 ` Thomas Petazzoni
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-05-07  7:16 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 7 May 2018 12:32:39 +0530, s.vineeth amalraj wrote:

> I am Vineeth. I would like to create a simple python package in my

You're saying "python package" here, but below, you try to build a C
program.

> 4. Next under *tamil.mk <http://tamil.mk/>* file the below code is pasted:
> 
> *TAMIL_MODULE_VERSION = 1.0*
> *TAMIL_SITE = /home/sands/Documents/vineeth/testtamil.c*

This should be a folder, not a file. I also recommend to use a relative
path, for example:

	TAMIL_SITE = $(TOPDIR)/../tamil/

> *TAMIL_SITE_METHOD = local*
> *TAMIL_LICENSE = GPLv2*
> *TAMIL_LICENSE_FILES = COPYING*
> *TAMIL_MODULE_MAKE_OPTS = \*
> *        CONFIG_DUMMY1= \*
> *        CONFIG_DUMMY2=y*
> 
> *define KERNEL_MODULE_BUILD_CMDS*
> *        $(MAKE) -C '$(@D)' LINUX_DIR='$(LINUX_DIR)' CC='$(TARGET_CC)'
> LD='$(TARGET_LD)' modules*
> *endef*
> 
> *$(eval $(kernel-module))*

Why are you trying to build it as a kernel module ? The program source
code you have below is just a user-space program.

> 6. I created a file named *testtamil.c* and saved in /home/sands/Documents/
> vineeth/testtamil.c.  and in the file testtamil.c i have pasted the below
> code:
> 
> *#include<stdio.h>*
> *int main()*
> *{*
> *printf("tamil is tested\n");*
> *printf("working fine");*
> 
> *return 1;*
> *}*

This is just a user-space program. Why do you think you need to use the
"kernel-module" infrastructure ?

> *Issue:* This is reflecting in *make menuconfig* but not building and
> getting make error and below is the error which i faced.
> 
> ERROR: /home/sands/Documents/vineeth/testtamil.c does not exist
> package/pkg-generic.mk:194: recipe for target '/home/sands/Documents/vineeth
> /buildroot-at91/output/build/tamil/.stamp_rsynced' failed
> make[1]: *** [/home/sands/Documents/vineeth/buildroot-at91/output/build/tamil/.stamp_rsynced]
> Error 1
> Makefile:79: recipe for target '_all' failed
> make: *** [_all] Error 2

Please make sure TAMIL_SITE points to a folder, not a file.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] regarding creating my own customized package in buildroot and use it in my OS in Raspberry Pi
       [not found] <mailman.7.1525694405.18540.buildroot@busybox.net>
@ 2018-05-09  6:35 ` Andreas Ziegler
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Ziegler @ 2018-05-09  6:35 UTC (permalink / raw)
  To: buildroot

Hi Vineeth,

> ... I am able to build without any error. But am not able to view
> that in my newly built OS. Or couldn't use that package in my OS. I am 
> not
> able to sort where the issue is? Kindly help. Thank you!

you are probably missing code in your makefile(s) for installing your 
package. You need to copy the executable to the target root filesystem 
somehow, otherwise it will not show up in the target system.

Usually this code is placed in the project's makefile [1] and executed 
by the buildroot environment, but you could also place instructions 
directly into your buildroot .mk file.

For a quick-and-dirty solution you might check existing packages [2] for 
examples what could be done. For a reference I would recommend section 
17.5 of the buildroot manual [3].

Kind regards,
Andreas

[1] It should have a section to handle the 'make install' command.
[2] E.g. package/b43-firmware, package/tcping
[3] 
https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_packages_with_specific_build_systems

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-09  6:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-07  7:02 [Buildroot] regarding creating my own customized package in buildroot and use it in my OS in Raspberry Pi s.vineeth amalraj
2018-05-07  7:16 ` Thomas Petazzoni
     [not found] <mailman.7.1525694405.18540.buildroot@busybox.net>
2018-05-09  6:35 ` Andreas Ziegler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox