linux package

Gerard Beekmans gerard at linuxfromscratch.org
Wed Feb 14 11:56:47 PST 2001


On February 14, 2001 11:42 am, Neven Has wrote:
> On Wed, Feb 14, 2001 at 02:28:57AM +0000, Bryan Dumm wrote:
> > <package name="linux" version="2.2.17">
> > 		<preconfigure>
> > 			<unpack
> > archive="&packages_dir;/linux-2.2.17.tar.bz2">&LFS;&builddir;</unpack>
> > 		</preconfigure>
> >
> > umm this is wrong. What if &builddir; was /my/kewl/dir?
>
> It is. :)
>
> I guess it's safe to hardcode "/usr/src" ?

hardcoding isn't a nice solution. You can even dispute if the kernel should 
be in /usr/src to start with (LFS just does it becuase I was used to doing 
so, but on my own system the kernel sits in /usr/linux). Sure you can say the 
tree contains source code so should be in /usr/src. I then say: my QT 
installation sits in /usr/qt as well, contains both the source and the 
compiled libraries, header files, etc but I don't put that in /usr/src/qt. In 
fact I know nobody who does that.

The FHS does not dicate the kernel sitting in /usr/src *I think* but I have 
to look that up to make sure. If the FHS recommends it, then hardcoding it is 
an idea, but still not nice and flexible. Since linux is the only tree where 
we keep it's source code around, I would suggest add a special entity for it 
<!ENTITY linuxdir "/usr/src/"> and then:
<unpack
archive="&packages_dir;/linux-2.2.17.tar.bz2">&LFS;/&linuxdir;</unpack>

Btw, i noticed this:

CVS' profile contain things like:
<unpack archive="&packages_dir;/bash-2.04.tar.bz2">&LFS;&builddir;</unpack>

But LFS and builddir are defined as:

<!ENTITY LFS "/mnt/lfs">
<!ENTITY builddir "/usr/src">

This will work fine as long as builddir keeps being declared with an absolute 
path. I am just wondering if anybody would need to define a relative path (i 
can't think up a reason why, but it's something that we should catch because 
it can be cause an error). If so, look at the outcome:

<!ENTITY LFS "/mnt/lfs">
<!ENTITY builddir "../../somewhere/src">

<unpack .........>&LFS;&builddir;</unpack>

which turns into /mnt/lfs../../somewhere/src - this will fail

We can fix this by adding a slash to unpack's value:
<unpack ...>&LFS;/&builddir;</unpack>

This will translate into /mnt/lfs/../../somewhere/src

and if builddir is an absolute path it will translate into:

/mnt/lfs//usr/src

The double slash is not a problem, no program will trip over it (at least no 
program I have seen so far).

-- 
Gerard Beekmans
www.linuxfromscratch.org

-*- If Linux doesn't have the solution, you have the wrong problem -*-





More information about the alfs-discuss mailing list