Where does post-build script belong?
I'm trying to use a post-build script to fix up the init.d/S59snmpd file, but I can't figure out what the post-build script path should be.
It would be awfully nice if the help text for "path" config options explained what directory the path is relative to. Alternatively, it might be nice if there were some variables that could be used in user-configured paths to anchor the path to specific points in the build, output, or source tree.
Putting an absolute path in a config file doesn't really seem like a workable option.
Signature · 3 lines
Grant Edwards grant.b.edwards Yow! Now, let's SEND OUT
at for QUICHE!!
gmail.com Quoted 4 lines · Grant Edwards
I'm trying to use a post-build script to fix up the init.d/S59snmpd file, but I can't figure out what the post-build script path should be.
The post-build script can be where you want it :)
When you define the post build script to run, it is relative to the buildroot main directory
Personally, I keep my post-build is a directory structure like:board/manufacture/model/post-build.sh
Then I have a
board/manufacture/model/root-additions/
directory structure.
Quoted 9 lines
It would be awfully nice if the help text for "path" config options explained what directory the path is relative to. Alternatively, it might be nice if there were some variables that could be used in user-configured paths to anchor the path to specific points in the build, output, or source tree.
Putting an absolute path in a config file doesn't really seem like a workable option.
Agreed
Somewhere I saw some slides that had a recommended way to do this. It also had a minimal post-build script to run. It is on the mailing list somewhere.
J.C. Woltz
Quoted 10 lines · J.C. Woltz
Quoted 4 lines · Grant Edwards
I'm trying to use a post-build script to fix up the init.d/S59snmpd file, but I can't figure out what the post-build script path should be.
The post-build script can be where you want it :) When you define the post build script to run, it is relative to the buildroot main directory
That's the bit of info I was looking for. I'd been trying to figure that out via trial-and-error for a while, but I'd been editing the defautl config file without ever regenerating the .config file in the output directory -- so it was all "error" and no "trial".
Quoted 2 lines
Personally, I keep my post-build is a directory structure like:
board/manufacture/model/post-build.sh
I prefer to modify the buildroot source tree as little as possible (it makes upgrading to a new version easier). So I keep everything outside it that I can. I've put what used to be my package/customize/source directory in "../customfiles", my post-build script in "../postbuild.sh", and my output directory is "../output".
Quoted 6 lines
Quoted 6 lines
It would be awfully nice if the help text for "path" config options explained what directory the path is relative to. Alternatively, it might be nice if there were some variables that could be used in user-configured paths to anchor the path to specific points in the build, output, or source tree.
Quoted 8 lines
Quoted 2 lines
Putting an absolute path in a config file doesn't really seem like a workable option.
Agreed
Somewhere I saw some slides that had a recommended way to do this. It also had a minimal post-build script to run. It is on the mailing list somewhere.
I think somebody posted a pointer to a week or so back when I was asking about a change to the customize.mk file.
Signature · 3 lines
Grant Edwards grant.b.edwards Yow! I'm having a RELIGIOUS
at EXPERIENCE ... and I don't
gmail.com take any DRUGSGrant Edwards wrote:
...
Quoted 7 lines
Quoted 2 lines
Personally, I keep my post-build is a directory structure like:
board/manufacture/model/post-build.shI prefer to modify the buildroot source tree as little as possible (it makes upgrading to a new version easier). So I keep everything outside it that I can. I've put what used to be my package/customize/source directory in "../customfiles", my post-build script in "
../postbuild.sh", and my output directory is "../output".
Buildroot can be used in different ways, so yours is not necessarily wrong. But the structure of Buildroot is such that you can put your customizations in a few, well-defined places, which typically are the board/mycompany/myproduct dir and your config file.
To add proprietary packages what I do is to create a packages/mcompany/ dir with packages inside.
If you need to add currently unsupported opensource packages you can just submit a patch to this mailing-list for mainline inclusion.
Finally, especially if you need many customizations, I suggest you think about using git. You can have mainline Buildroot in the master branch and you modifications in another branch. It is very quick to merge your branch with an updated Buildroot, if you follow the guidelines above.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
It would be awfully nice if the help text for "path" config options explained what directory the path is relative to. Alternatively, it might be nice if there were some variables that could be used in user-configured paths to anchor the path to specific points in the build, output, or source tree.
Putting an absolute path in a config file doesn't really seem like a workable option.
Quoted 8 lines
Quoted 5 lines
Agreed
Somewhere I saw some slides that had a recommended way to do this. It also had a minimal post-build script to run. It is on the mailing list somewhere.
I think somebody posted a pointer to a week or so back when I was asking about a change to the customize.mk file.
Here it is:
Quoted 5 lines
For more details, seehttp://free-electrons.com/blog/elce-2011-videos/, search for "Using Buildroot For a Real Project". There's a video of Thomas Petazzoni with many best practices for using Buildroot. My above suggestion comes from slide 24 of his presentation. Thanks Thomas.
From:
http://lists.busybox.net/pipermail/buildroot/2012-February/049989.html
Look at slide 25 too.
Luca
Quoted 12 lines · Luca Ceresoli
Grant Edwards wrote:
...Quoted 8 lines
Quoted 2 lines
Personally, I keep my post-build is a directory structure like:
board/manufacture/model/post-build.shI prefer to modify the buildroot source tree as little as possible (it makes upgrading to a new version easier). So I keep everything outside it that I can. I've put what used to be my package/customize/source directory in "../customfiles", my post-build script in "
../postbuild.sh", and my output directory is "../output".
Quoted 4 lines
Buildroot can be used in different ways, so yours is not necessarily wrong. But the structure of Buildroot is such that you can put your customizations in a few, well-defined places, which typically are the board/mycompany/myproduct dir and your config file.
I don't want to replace the default skeleton. I want to add some files to it, and possible modify a few. The documentation describes two ways to do that:
1) package/customize
2) post-build script
I'm told 1) is now depricated, so I'm switching to 2).
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
Quoted 5 lines
To add proprietary packages what I do is to create a packages/mcompany/ dir with packages inside.
If you need to add currently unsupported opensource packages you can just submit a patch to this mailing-list for mainline inclusion.
That's not what I'm doing. I'm mainly adding some basic web pages and a few init scripts that do things like set the hostname, and start some of the busybox daemons like httpd, inetd, etc. My "extra" applications are built externally and bundled as as ipkg packages that are installed/managed outside of buildroot's package system.
Quoted 2 lines
Finally, especially if you need many customizations, I suggest you think about using git.
I'd love to use git, but we're standardized on subversion (which does not handle branching merging at all well). :/
In the past I've tried combining svn and git and it just didn't work.
Quoted 3 lines
You can have mainline Buildroot in the master branch and you modifications in another branch. It is very quick to merge your branch with an updated Buildroot, if you follow the guidelines above.
Signature · 3 lines
Grant Edwards grant.b.edwards Yow! I know things about
at TROY DONAHUE that can't
gmail.com even be PRINTED!!On Tuesday 21 February 2012 14:54:47 Grant Edwards wrote:
[snip]
Quoted 4 lines
I don't want to replace the default skeleton. I want to add some files to it, and possible modify a few. The documentation describes two ways to do that:
Quoted 8 lines
1) package/customize
2) post-build script
I'm told 1) is now depricated, so I'm switching to 2).
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
I put it in board/mycompany/myproduct/skeleton. Although
rootfs-additions would be a better name than skeleton.
I would like to add a feature to buildroot to simplify out-of-tree
additions (rootfs files, patches, config files, extra packages, ...). I'll send out an RFC for that soonish.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Quoted 10 lines · Arnout Vandecappelle
On Tuesday 21 February 2012 14:54:47 Grant Edwards wrote:
[snip]Quoted 8 lines
I don't want to replace the default skeleton. I want to add some files to it, and possible modify a few. The documentation describes two ways to do that:
1) package/customize
2) post-build script
Quoted 7 lines
Quoted 4 lines
I'm told 1) is now depricated, so I'm switching to 2).
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
I put it in board/mycompany/myproduct/skeleton. Although rootfs-additions would be a better name than skeleton.
Ah, perhaps I've misunderstood what a custom skeleton was for the past several years. I thought it was the basis for the filesystem. Is the custom skeleton something that's _added_ on top of the default skeleton rather than used in place of it?
Signature · 4 lines
Grant Edwards grant.b.edwards Yow! How many retured
at bricklayers from FLORIDA
gmail.com are out purchasing PENCIL
SHARPENERS right NOW??Quoted 13 lines · Grant Edwards
Quoted 12 lines · Arnout Vandecappelle
On Tuesday 21 February 2012 14:54:47 Grant Edwards wrote:
[snip]Quoted 10 lines
I don't want to replace the default skeleton. I want to add some files to it, and possible modify a few. The documentation describes two ways to do that:
1) package/customize
2) post-build script
I'm told 1) is now depricated, so I'm switching to 2).
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
I put it in board/mycompany/myproduct/skeleton. Although rootfs-additions would be a better name than skeleton.
Ah, perhaps I've misunderstood what a custom skeleton was for the past several years. I thought it was the basis for the filesystem. Is the custom skeleton something that's _added_ on top of the default skeleton rather than used in place of it?
Perhaps, but it is your script. If you want to completely replace the existing skeleton you can, but I think it makes more sense to just overlay new stuff on top of the default skeleton. This makes your new skeleton much smaller, and since it is run after every build, you don't have to wonder if changes make it to the target filesystem, it always does.
Regards, Steve
Quoted 18 lines · Steve Calfee
Quoted 17 lines · Grant Edwards
Quoted 16 lines · Arnout Vandecappelle
On Tuesday 21 February 2012 14:54:47 Grant Edwards wrote:
[snip]Quoted 4 lines
I don't want to replace the default skeleton. I want to add some files to it, and possible modify a few. The documentation describes two ways to do that:
Quoted 8 lines
1) package/customize
2) post-build script
I'm told 1) is now depricated, so I'm switching to 2).
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
I put it in board/mycompany/myproduct/skeleton. Although rootfs-additions would be a better name than skeleton.
Quoted 8 lines
Quoted 5 lines
Ah, perhaps I've misunderstood what a custom skeleton was for the past several years. I thought it was the basis for the filesystem. Is the custom skeleton something that's _added_ on top of the default skeleton rather than used in place of it?
Perhaps, but it is your script. If you want to completely replace the existing skeleton you can, but I think it makes more sense to just overlay new stuff on top of the default skeleton.
I seem to be completely lost. Is board/mycompany/myproduct/skeleton above a post-build script or a custom skelecton (something you set BR2_ROOTFS_SKELETON_CUSTOM_PATH to point to)?
Quoted 3 lines
This makes your new skeleton much smaller, and since it is run after every build, you don't have to wonder if changes make it to the target filesystem, it always does.
Signature · 3 lines
Grant Edwards grant.b.edwards Yow! A can of ASPARAGUS,
at 73 pigeons, some LIVE ammo,
gmail.com and a FROZEN DAQUIRI!!Quoted 24 lines · Grant Edwards
Quoted 23 lines · Steve Calfee
Quoted 22 lines · Grant Edwards
Quoted 8 lines · Arnout Vandecappelle
On Tuesday 21 February 2012 14:54:47 Grant Edwards wrote:
[snip]Quoted 6 lines
I don't want to replace the default skeleton. I want to add some files to it, and possible modify a few. The documentation describes two ways to do that:
1) package/customize
Quoted 8 lines
Quoted 6 lines
2) post-build script
I'm told 1) is now depricated, so I'm switching to 2).
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
I put it in board/mycompany/myproduct/skeleton. Although rootfs-additions would be a better name than skeleton.
Ah, perhaps I've misunderstood what a custom skeleton was for the past several years. I thought it was the basis for the filesystem. Is the custom skeleton something that's _added_ on top of the default skeleton rather than used in place of it?
Quoted 6 lines
Quoted 3 lines
Perhaps, but it is your script. If you want to completely replace the existing skeleton you can, but I think it makes more sense to just overlay new stuff on top of the default skeleton.
I seem to be completely lost. Is board/mycompany/myproduct/skeleton above a post-build script or a custom skelecton (something you set
BR2_ROOTFS_SKELETON_CUSTOM_PATHto point to)?
Hi Grant,
I was not aware of that config option. In fact there are no uses of it in the current /board... stuff. What I and what I think others have done is create my own mini-skeleton in the board.... directory. I can then stick in scripts, /etc/ files and maybe even externally built binaries into /usr/bin/ in my local area. Then when the post build script is executed I just copy all the files from my skeleton to the target skeleton. This will overlay the default stuff (that are duplicates in my area) and add any new stuff. After the post-build script the target skeleton will get all packaged up as a rootfs for your target system.
Someone else will have to describe what that option is for.
Regards, Steve
Quoted 3 lines
Quoted 3 lines
This makes your new skeleton much smaller, and since it is run after every build, you don't have to wonder if changes make it to the target filesystem, it always does.
Quoted 24 lines · On Tuesday 28 February 2012 21:36:15 Grant Edwards wrote:
Quoted 23 lines · Steve Calfee
Quoted 22 lines · Grant Edwards
Quoted 8 lines · Arnout Vandecappelle
On Tuesday 21 February 2012 14:54:47 Grant Edwards wrote:
[snip]Quoted 6 lines
I don't want to replace the default skeleton. I want to add some files to it, and possible modify a few. The documentation describes two ways to do that:
1) package/customize
Quoted 8 lines
Quoted 6 lines
2) post-build script
I'm told 1) is now depricated, so I'm switching to 2).
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
I put it in board/mycompany/myproduct/skeleton. Although rootfs-additions would be a better name than skeleton.
Ah, perhaps I've misunderstood what a custom skeleton was for the past several years. I thought it was the basis for the filesystem. Is the custom skeleton something that's _added_ on top of the default skeleton rather than used in place of it?
Quoted 7 lines
Quoted 3 lines
Perhaps, but it is your script. If you want to completely replace the existing skeleton you can, but I think it makes more sense to just overlay new stuff on top of the default skeleton.
I seem to be completely lost. Is board/mycompany/myproduct/skeleton above a post-build script or a custom skelecton (something you set
BR2_ROOTFS_SKELETON_CUSTOM_PATHto point to)?
The BR2_ROOTFS_SKELETON_CUSTOM_PATH is a real skeleton: it is copied to
the target fs before anything else is done. It's called a skeleton because it's mostly empty directories (/proc, /sys, /mnt, /usr/bin, ...). There are a few files in /etc/ and /root as well.
If you copy board/mycompany/myproduct/skeleton to the target in the
post-build script, that will go over everything else, because the post-build script runs at the end. That's why I say it should be called rootfs-additions: it's added to the rootfs, it isn't the skeleton of the rootfs.
The post-build script (BR2_ROOTFS_POST_BUILD_SCRIPT) is just a script;
you have to add the command to copy it yourself. For one customer, for instance, I have:
BR2_ROOTFS_POST_BUILD_SCRIPT=board/mycompany/myproduct/cp-skeleton.sh
where cp-skeleton.sh contains:
dir="$(dirname $0)"/skeleton
if [ -d "$dir" ]; then
rsync --exclude .svn --exclude '*~' -a "$dir"/* "$1"
fi
(indeed, this customer is using subversion :-)
Ideally there should be a BR2_ROOTFS_ADDITIONS config option that does
exactly that, but I haven't gotten around to implementing it yet.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Quoted 15 lines · Steve Calfee
Quoted 14 lines
Quoted 14 lines
Quoted 11 lines
Quoted 5 lines
Quoted 2 lines
Where under board/mycompany/myproduct do you put "extra" files that will be added to the standard skeleton?
I put it in board/mycompany/myproduct/skeleton. Although rootfs-additions would be a better name than skeleton.
Ah, perhaps I've misunderstood what a custom skeleton was for the past several years. I thought it was the basis for the filesystem. Is the custom skeleton something that's _added_ on top of the default skeleton rather than used in place of it?
Perhaps, but it is your script. If you want to completely replace the existing skeleton you can, but I think it makes more sense to just overlay new stuff on top of the default skeleton.
Quoted 6 lines
Quoted 3 lines
I seem to be completely lost. Is board/mycompany/myproduct/skeleton above a post-build script or a custom skelecton (something you set
BR2_ROOTFS_SKELETON_CUSTOM_PATHto point to)?I was not aware of that config option. In fact there are no uses of it in the current /board... stuff.
It's in the config file from buildroot-2011.05, and the docs still talk about it:
http://buildroot.uclibc.org/downloads/buildroot.html#custom_targetfs
What I may have misunderstood is whether that custom skeleton replaces the default skeleton or is copied on top of it. My reading of the doc is that it replaces the default skeleton, and that wasn't what I wanted, so I used the customize package. I have since switched to using a post-build script that copies my "extras" tree onto the default skeleton present in output/target.
Quoted 6 lines
What I and what I think others have done is create my own mini-skeleton in the board.... directory. I can then stick in scripts,
/etc/files and maybe even externally built binaries into/usr/bin/in my local area. Then when the post build script is executed I just copy all the files from my skeleton to the target skeleton.
Yep. That's what I was doing via the customize package and what I'm now doing now a post-build script.
Quoted 5 lines
This will overlay the default stuff (that are duplicates in my area) and add any new stuff. After the post-build script the target skeleton will get all packaged up as a rootfs for your target system.
Someone else will have to describe what that option is for.
The doc says one of the options for customizing the filesystem is
* Create your own target skeleton. You can start with the default skeleton available under fs/skeleton and then customize it to suit your needs. The BR2_ROOTFS_SKELETON_CUSTOM and BR2_ROOTFS_SKELETON_CUSTOM_PATH will allow you to specify the location of your custom skeleton. At build time, the contents of the skeleton are copied to output/target before any package installation.
I read that as meaning buildroot will use my own customized target skeleton instead of the default one. Previously in the thread when people mentioned custom skeletons, I thought that option was what they were talking about.
This is all academic at this point, since a post-build script appears to be the recommeded method and is how I'm doing things now.
Signature · 3 lines
Grant Edwards grant.b.edwards Yow! The PILLSBURY DOUGHBOY
at is CRYING for an END to
gmail.com BURT REYNOLDS movies!!Quoted 15 lines · On Tuesday 28 February 2012 22:06:28 Steve Calfee wrote:
Quoted 3 lines
I seem to be completely lost. Is board/mycompany/myproduct/skeleton above a post-build script or a custom skelecton (something you set
BR2_ROOTFS_SKELETON_CUSTOM_PATHto point to)?Hi Grant,
I was not aware of that config option. In fact there are no uses of it in the current /board... stuff. What I and what I think others have done is create my own mini-skeleton in the board.... directory. I can then stick in scripts, etc files and maybe even externally built binaries into
/usr/bin/in my local area. Then when the post build script is executed I just copy all the files from my skeleton to the target skeleton. This will overlay the default stuff (that are duplicates in my area) and add any new stuff. After the post-build script the target skeleton will get all packaged up as a rootfs for your target system.
Quoted 1 line
Someone else will have to describe what that option is for.
If you ask me, BR2_ROOTFS_SKELETON_CUSTOM_PATH is indeed useless and
should be deprecated.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Quoted 16 lines · Arnout Vandecappelle
Quoted 15 lines · On Tuesday 28 February 2012 22:06:28 Steve Calfee wrote:
Quoted 3 lines
I seem to be completely lost. ?Is board/mycompany/myproduct/skeleton above a post-build script or a custom skelecton (something you set
BR2_ROOTFS_SKELETON_CUSTOM_PATHto point to)?Hi Grant,
I was not aware of that config option. In fact there are no uses of it in the current /board... stuff. What I and what I think others have done is create my own mini-skeleton in the board.... directory. I can then stick in scripts, etc files and maybe even externally built binaries into
/usr/bin/in my local area. Then when the post build script is executed I just copy all the files from my skeleton to the target skeleton. This will overlay the default stuff (that are duplicates in my area) and add any new stuff. After the post-build script the target skeleton will get all packaged up as a rootfs for your target system.
Quoted 4 lines
Quoted 1 line
Someone else will have to describe what that option is for.
?If you ask me,
BR2_ROOTFS_SKELETON_CUSTOM_PATHis indeed useless and should be deprecated.
Although I'm not using it myself, I don't think this needs to be deprecated. I can imagine that there are users who have a significantly different skeleton that it would be a nuisance to have to tweak it from a script.
Although we may recommend in the docs to use the post-build script + rootfs-additions, I would keep the custom option as well.
Best regards,
Thomas
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Grant" == Grant Edwards <[email protected]> writes:
Hi,
Grant> The doc says one of the options for customizing the filesystem is
Grant> * Create your own target skeleton. You can start with the default
Grant> skeleton available under fs/skeleton and then customize it to suit Grant> your needs. The BR2_ROOTFS_SKELETON_CUSTOM and Grant> BR2_ROOTFS_SKELETON_CUSTOM_PATH will allow you to specify the Grant> location of your custom skeleton. At build time, the contents of Grant> the skeleton are copied to output/target before any package Grant> installation.
Grant> I read that as meaning buildroot will use my own customized target Grant> skeleton instead of the default one. Previously in the thread when Grant> people mentioned custom skeletons, I thought that option was what they Grant> were talking about.
We had support for custom target skeletons pretty much forever, and that is still supported. What the recent discussion has been about is a different approach to pretty much do the same. Stick with the default skeleton, but add any customization at the END of the build sequence using the post-build script.
Both approaches have advantages and disadvantages, it depends on how closely your needs are to the default skeleton, and if you want to automatically use any changes to the default skeleton when you upgrade your buildroot version.
Signature · 1 line
Bye, Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas De Schampheleire <[email protected]> writes:
Hi,
Quoted 2 lines
Quoted 2 lines
?If you ask me,
BR2_ROOTFS_SKELETON_CUSTOM_PATHis indeed useless and should be deprecated.
Thomas> Although I'm not using it myself, I don't think this needs to be Thomas> deprecated. I can imagine that there are users who have a Thomas> significantly different skeleton that it would be a nuisance to have Thomas> to tweak it from a script.
Thomas> Although we may recommend in the docs to use the post-build script + Thomas> rootfs-additions, I would keep the custom option as well.
Agreed. It doesn't add much complexity to BR, and we've had it for a very long time, so chances are people are using it (E.G. I know some people at work do).
Signature · 1 line
Bye, Peter Korsgaard