ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] Porting asterisk to ltib


From: Vadim Lebedev
Subject: Re: [Ltib] Porting asterisk to ltib
Date: Wed, 16 Jul 2008 15:03:53 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080502)

Stuart,

Thanks a lot for clarifictaions.

I've stumbled on a problem:
I've folowed the Faq on:

How can I add a completely new package to the root filesystem

until step 5 where i need to execute

./ltib -m prep -p zaptel

And i get  following:

Cannot find spec file that contains the package name zaptel.
If necessary please give the whole spec file name (with the
.spec extension).

Exiting on error or interrupt



Any ideas?

Thanks
Vadim
PS. I'm attaching my  zaptel.spec file

Stuart Hughes wrote:
Hi Vadim,

Both these are set as environment variables inside the ltib script.

SCB_WANT_CF is set when you pass the option -c (--configure) to ltib.
PKG_BUSYBOX_WANT_CF is set when the corresponding option is turn on
during a configuration session in ltib:

$ ./ltib -m config
[ ]   Configure busybox at build time

This prompt is set in config/userspace/packages.lkc:

config PKG_BUSYBOX_WANT_CF
    depends PKG_BUSYBOX
    bool "Configure busybox at build time"
    help
      Select this if you want to interactively configure busybox during
      the build.  A copy of the configured value will be put back
      into the platforms configuration directory, with the suffix .dev


Note that -c is available so that you can do:

$ ./ltib -p <pkg> -c

This lets you drop to the config screen in your package without having
to fiddle with the main config.

Regards, Stuart



On Tue, 2008-07-15 at 18:21 +0200, Vadim Lebedev wrote:
  
Stuart 
Thanks a lot for info and pointers

Looking into busybox.spec i've one more question how the vars like
"$PKG_BUSYBOX_WANT_CF" or  "$SCB_WANT_CF"

set during the build process?

Thanks
Vadim


Stuart Hughes wrote: 
    
Hi Vadim,

Take a look at dist/lfs-5.1/busybox/busybox.spec which needs something
similar.

Basically you need a clause in the build section of the spec file like
(sub busybox for zaptel):

if [ -n "$PKG_BUSYBOX_WANT_CF" -o -n "$SCB_WANT_CF" ]
then
    make menuconfig HOSTCC="$BUILDCC"
    cp .config $PLATFORM_PATH/$PKG_BUSYBOX_PRECONFIG
else
    yes "" | make config HOSTCC="$BUILDCC"
fi

The in config/userspace/packages.lkc you need to add your package.  Look
at busybox again to get the idea.  Finally you need to add a mapping for
your package name to spec file names in config/userspace/pkg_map.  All
this is described in the faq (see bitshrine.org or the doc directory).

The group depends on what it does, the list you can chose from is
defined in /usr/share/doc/rpm-<ver>/GROUPS, but basically something from
this list:

Amusements/Games
Amusements/Graphics
Applications/Archiving
Applications/Communications
Applications/Databases
Applications/Editors
Applications/Emulators
Applications/Engineering
Applications/File
Applications/Internet
Applications/Multimedia
Applications/Productivity
Applications/Publishing
Applications/System
Applications/Text
Development/Debuggers
Development/Languages
Development/Libraries
Development/System
Development/Tools
Documentation
System Environment/Base
System Environment/Daemons
System Environment/Kernel
System Environment/Libraries
System Environment/Shells
User Interface/Desktops
User Interface/X
User Interface/X Hardware Support

Also, if you're package is kernel drivers, you'll need to add the
clause:select PKG_KERNEL_LEAVESRC to your entry in packages.lkc.  For an
example of how to build kernel modules outside the kernel tree, look at:
config/userspace/package.lkc : PKG_HELLOWORLD_MOD and the corresponding
spec file: dist/lfs-5.1/helloworld/hello_mod.spec

Regards, Stuart


On Tue, 2008-07-15 at 17:02 +0200, Vadim Lebedev wrote:
  
      
Hi Stuart,

Thanks for your help offer

Here is first question:

In order to build asterisk i need to build zaptel package which
includes various drivers
Zaptel package provides an interactive 'menuselect'  utility allowing
for selection of drivers
to be built, which is 1) built uisng $(HOSTCC)  compiler and supposed
to be run using 'make menuconfig' command

I'm trying understand how to hook the OPTIONAL activation of this
utility into the build

Another question what would be the correct group for asterisk and
drivers?

Thanks
Vadim  


Stuart Hughes wrote: 
    
        
Hi Vadim,

I've not heard of anyone having done this, but I'd help if you have
questions.

Regards, Stuart

On Tue, 2008-07-15 at 15:30 +0200, Vadim Lebedev wrote:
  
      
          
Hello,

I'm trying to port asterisk to ltib environment

I wonder if somebody already did it  and  will be willing to share info 
and/or .spec files and/or advice.

Thanks
Vadim
    
        
            
  
      
          
  
      
    
    


  

%define base %(echo %{_prefix} | sed -e s,/usr.*$,,)
%define pfx /opt/freescale/rootfs/%{_target_cpu}

Summary         : zaptel drivers and utilities
Name            : zaptel
Version         : 1.4.11
Release         : 1
License         : GPL
Vendor          : Digium
Packager        : Vadim Lebedev at mbdsys dot com
Group           : Applications/Communication
Source          : %{name}-%{version}.tar.gz
BuildRoot       : %{_tmppath}/%{name}
Prefix          : %{pfx}

%Description
%{summary}

%Prep
%setup

%Build
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build}

PKG_ZAPTEL_PRECONFIG=${PKG_ZAPTEL_PRECONFIG:-zaptel.menuselect.makeopts}
if [ -f "$PLATFORM_PATH/${PKG_ZAPTEL_PRECONFIG}" ]
then
    cp $PLATFORM_PATH/$PKG_ZAPTEL_PRECONFIG menuselect.makeopts
else
    if [ -f "$CONFIG_DIR/defaults/$PKG_ZAPTEL_PRECONFIG" ]
    then
        cp "$CONFIG_DIR/defaults/$PKG_ZAPTEL_PRECONFIG"  menuselect.makeopts
    fi
fi
if [ -n "$PKG_ZAPTEL_WANT_CF" -o -n "$SCB_WANT_CF" ]
then
    make menuconfig HOSTCC="$BUILDCC"
    cp menuselect.makeopts $PLATFORM_PATH/$PKG_ZAPTEL_PRECONFIG
fi

KSRC_DIR=${PKG_KERNEL_PATH_PRECONFIG:-$RPM_BUILD_DIR/linux}
KBOUT="$(eval echo $PKG_KERNEL_KBUILD_PRECONFIG)"
KBOUT=${KBOUT:-$KSRC_DIR}
if grep -q 'CONFIG_PPC_MERGE=y' $KBOUT/.config
then
    LINTARCH=powerpc
fi
if [ ! -f $KBOUT/.config ]
then
    cat <<TXT
You need a built unpacked kernel source tree in:
$KBOUT
to build kernel modules
TXT
    exit 1
fi

if [ -f $KBOUT/include/config/kernel.release ]
then
    KVER=`cat $KBOUT/include/config/kernel.release`
else
    KVER="`perl -e '$/ = ""; $_ = <>; 
m,VERSION\s*=\s*(\d)\s*PATCHLEVEL\s*=\s*(\d+)\s*SUBLEVEL\s*=\s*(\d+)\s*EXTRAVERSION[
 \t]*=[ \t]*(\S*),m; print  "$1.$2.$3$4"' $KSRC_DIR/Makefile`"
fi






make HOSTCC="$BUILDCC" KSRC=$KSRC_DIR KVERS=$KVER ARCH=arm
%Install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{pfx}/%{base}/lib/modules/$KVER/misc/
cp *.ko $RPM_BUILD_ROOT/%{pfx}/%{base}/lib/modules/$KVER/misc/



%Clean
rm -rf $RPM_BUILD_ROOT

%Files
%defattr(-,root,root)
%attr(4755,root,root) %{pfx}/%{base}/bin/busybox
%{pfx}/*

%changelog
* Wed Jul 16 2008 Vadim Lebedev <address@hidden>
- Initial version

reply via email to

[Prev in Thread] Current Thread [Next in Thread]