[yocto] remove /usr/share/terminfo

Hans Beckérus hans.beckerus at gmail.com
Tue Mar 19 02:34:37 PDT 2013


On Mon, Mar 18, 2013 at 1:13 PM, Hans Beckérus <hans.beckerus at gmail.com>wrote:

> This is a continuation of the thread handling removal of /boot/uImage and
> terminfo database. The /boot/uImage is solved but I am still having issues
> with trying to remove /usr/share/terminfo database. I thought it would be
> as easy as just creating a ncurses .bbappend and configure the package with
> OE_EXTRACONF = "--disable-database --enable-termcap". Not so. The problem
> is that the ncurses.inc has some hardcode configuration options. One of
> these is not compatible with "--disable-database". Specifically it is
> "--with-ticlib". To me it seems like the ncurses package has not been
> designed for providing the option to disable the terminfo database.
>
> What I did as a temporary workaround was to override the entire
> ncurses_config() option to overcome the conflict. But I am not very happy
> with this solution, neither I am very happy with what happens to the
> package when actually faulting out the terminfo support. The result of such
> a configuration is that the entire ncurses library gets crippled and a lot
> of packages can no longer be used, eg. htop. Also, the ncurses package
> recipe does not seem to create the termcap database instead of terminfo if
> such is removed. Which is completely natural since it does not support
> disabling terminfo in the first place.
> Maybe I could try the option to compile in the termcap database? But then
> I do not know what the gain would be. What I am after is to get rid of the
> database completely from the rootfs due to size constraints, but instead
> link to some network mounted location. If the terminfo database is missing
> ncurses will simply fallback to a dumb terminal setting which is fine on a
> production board. In a test environment the network location will be
> available and ncurses will be able to locate the database.
>
> Any ideas what can be done here? If I would like to remove the physical
> database from the rootfs and instead replace it by a soft link. Where would
> be the best place to do this?
>
>
So, just posting back my progress so far. Since I did not receive any
responses I simply had to try "something". Not very proud of it, but it
works. What I did was to create a ncurses .bbappend file in my layer
containing only this:

shell_do_install_append() {
       if [ "${CLASSOVERRIDE}" == "class-target" ]; then
               rm -rf "${D}${datadir}/terminfo"
               ln -sf /app/usr/share/terminfo "${D}${datadir}/terminfo"
       fi
}

So, what it does is by using brute force removing the terminfo database
from /usr/share as installed by the recipe and replacing it with a soft
link to a well known location, eg. an NFS mount point. The minimalistic
database is still kept in /etc/terminfo. This database serves most purposes
on a production board. If a full functional database is needed a user must
provide it through the link. The result is still a fully functional ncurses
implementation, but with heavily reduced footprint.

I do not know if my conditional to detect a target build is correct (I do
not wish to have this done for eg. natrive builds). There is probably a
much better way to have this code only being performed for certain classes.
Also I do not understand why using do_install_append() does not work, I had
to use shell_do_install_append() as shell_do_install is defined in
ncurses.inc otherwise I got recipe parse errors!?

Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20130319/ab2f2499/attachment.html>


More information about the yocto mailing list