Skip to contentSkip to conversation

'make' behaviour in BuildRoot

DISCUSSION Daniel Ng 3 participants 5 messages Feb 14, 2007 – Feb 15, 2007

lore
Share & tools
lore

Daniel Ng

author
#0 lore raw

Hi,

Currently I have a working build system using BuildRoot, but it needs to be more efficient.

In particular, when I run the BuildRoot 'make', I end up with the final cramfs image which is great!

However, if I want to add a new file to the Root FS (eg. if I want to add the file 'test23' to '/usr') it seems that I have to do a 'make clean' first, and then run 'make' ie. a full rebuild.

This is because if I add the 'test23' file
to 'target/generic/target_skeleton/usr' and then just run 'make' I get the output at the bottom of this post [1].

-in other words it seems that the old 'build_powerpc/root' directory is used to rebuild the cramfs image. The file 'test23' was never added
to 'build_powerpc/root'.

-if I remove 'build_powerpc/root' and then run 'make', I get a script error that seems completely unrelated to my change. However the 'test23' file does appear in 'uild_powerpc/root'. Here is the tail of the output-

# Use fakeroot so mkcramfs believes the previous fakery

/home/dng/linuxppc/gcc-4.0.2_uclibc/usr/bin/fakeroot \
        -i /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env \
        -s /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env -- \
        /home/ppcroot/swdev/buildroot-dng/build_powerpc/cramfs-1.1/mkcramfs -q -

b \
/home/ppcroot/swdev/buildroot-
dng/build_powerpc/root /home/ppcroot/swdev/buildroot-dng/rootfs.powerpc.cramfs Swapping filesystem endian-ness
mkcramfs: /home/ppcroot/swdev/buildroot-dng/build_powerpc/cramfs- 1.1/mkcramfs:/home/ppcroot/swdev/buildroot- dng/build_powerpc/root/bin/fw_printenv: Invalid argument
mkcramfs: /home/ppcroot/swdev/buildroot-dng/build_powerpc/cramfs- 1.1/mkcramfs:/home/ppcroot/swdev/buildroot-dng/build_powerpc/root/bin/pppd:
Invalid argument
mkcramfs: scandir failed: /home/ppcroot/swdev/buildroot- dng/build_powerpc/root/bin/sethdlc
make: *** [cramfsroot] Error 8

Surely I shouldn't have to do a full BuildRoot rebuild (although it does work) just to add a new file to the Root FS??

Is there a way in BuildRoot to avoid having to do a full rebuild just for adding a single new file to the Root FS? (Maybe deleting 'build_powerpc/root' is the wrong thing to do, hence the above errors)

Here is the output as descibed in [1] above-

/home/ppcroot/swdev/buildroot-dng/build_powerpc/ppp-2.4.1/.unpacked' package/pppd/pppd.mk:20: warning: ignoring old commands for target /home/ppcroot/swdev/buildroot-dng/build_powerpc/ppp-2.4.1/.configured' package/pppd/pppd.mk:31: warning: ignoring old commands for target /home/ppcroot/swdev/buildroot-dng/build_powerpc/ppp-2.4.1/.configured' package/pppd/pppd.mk:52: warning: ignoring old commands for target /home/ppcroot/swdev/buildroot-dng/build_powerpc/ppp-2.4.1/pppd/pppd' package/pppd/pppd.mk:55: warning: ignoring old commands for target /home/ppcroot/swdev/buildroot-dng/build_powerpc/root/usr/sbin/pppd' package/pppd/pppd.mk:62: warning: ignoring old commands for target pppd-clean' package/pppd/pppd.mk:69: warning: ignoring old commands for target `pppd- dirclean'
#-@find /home/ppcroot/swdev/buildroot-dng/build_powerpc/root/lib -type f -name \*.so\* | xargs /home/dng/linuxppc/gcc-4.0.2_uclibc/bin/powerpc-linux-uclibc- strip --remove-section=.comment --remove-section=.note --strip-unneeded 2>/dev/null || true;
/sbin/ldconfig -r /home/ppcroot/swdev/buildroot-dng/build_powerpc/root 2>/dev/null
# Use fakeroot to pretend all target binaries are owned by root

/home/dng/linuxppc/gcc-4.0.2_uclibc/usr/bin/fakeroot \
        -i /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env \
        -s /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env -- \
        chown -R root:root /home/ppcroot/swdev/buildroot-dng/build_powerpc/root
# Use fakeroot to pretend to create all needed device nodes
/home/dng/linuxppc/gcc-4.0.2_uclibc/usr/bin/fakeroot \
        -i /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env \
        -s /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env -- \
        /home/dng/linuxppc/gcc-4.0.2_uclibc/bin/makedevs \
        -d target/generic/device_table.txt \
        /home/ppcroot/swdev/buildroot-dng/build_powerpc/root
rootdir=/home/ppcroot/swdev/buildroot-dng/build_powerpc/root
table='target/generic/device_table.txt'
# Use fakeroot so mkcramfs believes the previous fakery
/home/dng/linuxppc/gcc-4.0.2_uclibc/usr/bin/fakeroot \
        -i /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env \
        -s /home/dng/linuxppc/gcc-4.0.2_uclibc/fakeroot.env -- \
        /home/ppcroot/swdev/buildroot-dng/build_powerpc/cramfs-1.1/mkcramfs -q -

b \
/home/ppcroot/swdev/buildroot-
dng/build_powerpc/root /home/ppcroot/swdev/buildroot-dng/rootfs.powerpc.cramfs Swapping filesystem endian-ness

Cheers,
Daniel

#1 lore raw

Hello,

How about mounting the cramfs image and append 'test23' to '/usr' inside mounted image, then unmount the image.

If the image is compressed,
uncompress - mount - append - unmount - compress
procedure is needed, of course.

Thanks,

-- T.Suzuki

Quoted 6 lines · Daniel Ng

In particular, when I run the BuildRoot 'make', I end up with the final cramfs image which is great!

However, if I want to add a new file to the Root FS (eg. if I want to add the file 'test23' to '/usr') it seems that I have to do a 'make clean' first, and then run 'make' ie. a full rebuild.

author
#2 lore raw
Quoted 2 lines

How about mounting the cramfs image and append 'test23' to '/usr' inside mounted image, then unmount the image.

Thanks for your comment Suzuki, I realise I can do it the way you suggested but what if I start adding several files, or edit some of these files? I would end up with a mounted system whose tree structure would be quite different to the one in 'build_powerpc/root'. This would just lead to confusion and more of my hair falling out.

Surely I should just be able to type 'make' which would result in the tree structure updated in the cramfs image? Any ideas? Where are the BuildRoot experts out there? Can someone tell me how to subscribe to the BuildRoot list?

(Sorry I think my original example was a bit too simple).

#3 lore raw
Quoted 5 lines · On Wed, 14 Feb 2007 23:09:31 +0000 (UTC) Daniel Ng <[email protected]>…

Surely I should just be able to type 'make' which would result in the tree structure updated in the cramfs image? Any ideas? Where are the BuildRoot experts out there? Can someone tell me how to subscribe to the BuildRoot list?

The html docs are online, and they should be under buildroot/docs/

http://buildroot.uclibc.org/buildroot.html#custom_targetfs

You may just want option 1, for now. It sounds like you jumped to #2.

Or you can write a new rule for your test23 program.
http://buildroot.uclibc.org/buildroot.html#add_software

Or you can use this rule/config option
http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/package/customize/Config.in?rev=9614&view=auto

And the list info is here.
http://buildroot.uclibc.org/lists.html

author
#4 lore raw

Thanks for your help Andrew. I will follow these up on the BuildRoot list.