All of lore.kernel.org
 help / color / mirror / Atom feed
* remove /usr/share/terminfo
@ 2013-03-18 12:13 Hans Beckérus
  2013-03-19  9:34 ` Hans Beckérus
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Beckérus @ 2013-03-18 12:13 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]

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?

Hans

[-- Attachment #2: Type: text/html, Size: 2020 bytes --]

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

* Re: remove /usr/share/terminfo
  2013-03-18 12:13 Hans Beckérus
@ 2013-03-19  9:34 ` Hans Beckérus
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Beckérus @ 2013-03-19  9:34 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 3520 bytes --]

On Mon, Mar 18, 2013 at 1:13 PM, Hans Beckérus <hans.beckerus@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

[-- Attachment #2: Type: text/html, Size: 3927 bytes --]

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

* Re: remove /usr/share/terminfo
       [not found] <6119177.GIhaGmj4Be@jake>
@ 2013-03-24 14:01 ` Hans Beckerus
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Beckerus @ 2013-03-24 14:01 UTC (permalink / raw)
  To: Jochen Trumpf; +Cc: yocto@yoctoproject.org

On 2013-03-24 11:06, Jochen Trumpf wrote:
> Hi Hans,
>
> I am not subscribed to [yocto], just browsing it occasionally, so please
> excuse the private email.
>
> For this sort of thing I am using the following in my image recipe (stolen
> from some gumstix image recipe in meta-gumstix-extras, danny branch):
>
> -- cut --
> # this section removes remnants of legacy sysvinit support
> # for packages installed above
> IMAGE_FILE_BLACKLIST += " \
>                          /etc/init.d/crond \
>                          /etc/init.d/dbus-1 \
>                          /etc/init.d/sshd \
>   "
>
> remove_blacklist_files() {
>          for i in ${IMAGE_FILE_BLACKLIST}; do
>                  rm -rf ${IMAGE_ROOTFS}$i
>          done
>
> }
>
> ROOTFS_POSTPROCESS_COMMAND =+ "remove_blacklist_files ; "
> -- cut --
>
> You can add arbitrary commands to ROOTFS_POSTPROCESS_COMMAND, e.g. your link
> to the network share. As you can see, you can use wildcards in the blacklist
> entries, or anything that rm -rf will understand.
>
> In case you want to use a similar mechanism to ADD files that are not already
> present on your build machine, that is not (easily) possible since
> image.bbclass does not support do_fetch, so SRC_URI does not work within an
> image recipe. The philosophy seems to be that you need a separate recipe to
> add things.
>
> Hope this helps.
>
> Cheers,
> Jochen
>
> P.S.: Feel free to forward this to the list if you think it might be
> interesting for other people.

Hi Jochen. Thanks for the information. As you might have seen already, I 
solved it by using a .bbappend for ncurses, but I must admit that your 
solution is a lot more elegant. I will try your approach instead and 
keep it in mind when needing something similar in the future.

Hans



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

end of thread, other threads:[~2013-03-24 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <6119177.GIhaGmj4Be@jake>
2013-03-24 14:01 ` remove /usr/share/terminfo Hans Beckerus
2013-03-18 12:13 Hans Beckérus
2013-03-19  9:34 ` Hans Beckérus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.