Profile

Gerard Beekmans gerard at linuxfromscratch.org
Tue Sep 5 19:17:17 PDT 2000


Hi,

Ok the new more or less official profile is ready. It's almost ready up to 
chroot. I haven't put in a few things yet because we first need to agree on 
the structure, names of the tags, names of the arguments tags can have and 
such. So I'll update the profile as we make decisions. The profile that gets 
us into chroot will grow the next few days on these decisions.

There are a few flaws in the profile which I have documented in the profile. 

<!--
I'm not sure how this is going to work, but tags are going to be used as
variables as well. Example
below you find <target>/dev/hda11</target>
If I need to use the value of the <target> tag I'll refer to it as
$target, whether this is illegal or not. If it is not the proper way,
fix it please. And is --/> the proper way to end an xml comment tag?
--/>

<alfs>
	<defaults>
		<target>/dev/hda11</target>
		<mountpoint>/mnt/lfs</mountpoint>
		<cflags>-O3 -mcpu=i686 -march=i686</cflags>
		<cxxflags>-O3 -mcpu=i686 -march=i686</cxxflags>
		<tarballdir>/mnt/lfs/usr/src/sources</tarballdir>
		<unpackdir>/mnt/lfs/usr/src</unpackdir>
	</defaults>

<make_file_sys device=$target>

<create_mount_point dir=$mountpoint>

<mount_file_sys device=$target dir=$mountpoint>

<creating_dirs>
	<cd dir=$lfs>
	<mkdir 
		dirs="bin boot dev dev/pts etc home lib mnt proc root sbin tmp usr var">

	<cd dir=$lfs/usr>
	<mkdir dirs="bin etc include lib local sbin share src tmp var">
	
	<link type="symbolic" source="share/man" dest="man">
	<link type="symbolic" source="share/doc" dest="doc">
	<link type="symbolic" source="share/info" dest="info">
	
	<cd dir=$lfs/usr/share>
	<mkdir dirs="dict doc info locale man nls misc terminfo zoneinfo">
	
	<cd dir=$lfs/usr/share/man>
	<mkdir dirs="man1 man2 man3 man4 man5 man6 man7 man8">
	
	<cd dir=$lfs/usr/local>
	<mkdir 
		dirs="bin boot dev dev/pts etc home lib mnt proc root sbin tmp usr var">

	<cd dir=$lfs/usr>
	<mkdir dirs="bin etc include lib local sbin share src tmp var">
	
	<link type="symbolic" source="share/man" dest="man">
	<link type="symbolic" source="share/doc" dest="doc">
	<link type="symbolic" source="share/info" dest="info">
	
	<cd dir=$lfs/usr/share>
	<mkdir dirs="dict doc info locale man nls misc terminfo zoneinfo">
	
	<cd dir=$lfs/usr/share/man>
	<mkdir dirs="man1 man2 man3 man4 man5 man6 man7 man8"

	<cd dir=$lfs>
	<change_mode value="0750" target="root">
	<change_mode value="0555" target="proc">
	<change_mode value="1777" target="tmp usr/tmp var/tmp">

</creating_dirs>

	<package>
		<name>Bash</name>
		<version>2.4</version>
		<topleveldir dir="bash-2.04">

<!-- 
./configure needs to be put in it's own block. The reasoning will become 
cclear later on when we install glibc
--/>

		<prebuild>
			<command>./configure</command>
			<flags>--enable-static-link --prefix=/usr --disable-nls</flags>
		</prebuild>

		<build>
			<command>make</command>
		</build>

<!--
everywhere you see that i used <env_vars> for a make install parameter.
This name is misleading and should be changed into <vars> or <makevars>
or something like that. <flags> is already used to specify real flags like
'-e' used with binutils and gcc
--/>
		<install>
			<command>make</command>
			<env_vars>prefix=$LFS/usr</env_vars>
			<make_target>install</make_target>
		</install>

<!--
Sometimes I put one file in source, sometimes more. I'm not consistent with 
it. We need to decide what to do: have multiple <cp> <rm> <mv> tags, one for 
every file, or put multiple files in one <rm> <cp> <mv> tag
--/>

		<postinstall>
			<mv source="$lfs/usr/bin/bash dest="$lfs/bin">
			<mv source="$lfs/usr/bin/bashbug dest="$lfs/bin">
			<cd dir="$lfs/bin">
			<link type="symbolic" source="bash" dest="sh">

<!--
about the link one:
later on I do this: <link type="symbolic" source="$lfs/usr/bin/blah" 
dest="$lfs/bin/blah"> or something to that extend. What's best.
Have the backend cd to the dest directory, or use a <cd> tag
--/>

	</package>
		<name>Binutils</name>
		<version>2.10</version>
		<topleveldir dir="binutils-1.10">

		<prebuild>
			<command>./configure</command>
			<flags>--prefix=/us --disable-nls</flags>
		</prebuild>

		<build>
			<command>make</command>
			<flags>-e</flags>
			<env_vars>LDFLAGS=-all-static tooldir=/usr</env_vars>
		</build>

		<install>
			<command>make</command>
			<flags>-e</flags>
			<env_vars>prefix=$LFS/usr tooldir=$LFS/usr</env_vars>
			<make_target>install</make_target>
		</install>

	</package>

	<package>
		<name>Bzip2</name>
		<version>1.0.1</version>
		<topleveldir dir="bzip2-1.0.1">

		<prebuild>
			<edit file="Makefile">
				<search>$(CC) $(CFLAGS) -o</search>
				<replace>$(CC) $(CFLAGS) $(LDFLAGS) -o</replace>
			</edit>
		</prebuild>

		<build>
			<command>make</command>
			<env_vars>LDFLAGS=-static</env_vars>
		</build>

		<install>
			<command>make</command>
			<env_vars>PREFIX=$lfs/usr</env_vars>
			<make_target>install</make_target>
		</install>

		<postinstall>
			<mv source="$lfs/usr/bin/bzcat" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/bunzip2" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/bzip2" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/bzip2recover" dest="$lfs/bin">
		</postinstall>

	</package>

	<package>
		<name>Diffutils</name>
		<version>2.7</diffutils</version>
		<topleveldir dir="diffutils-2.7">

		<prebuild>
			<command>./configure</command>
			<env_vars>CPPFLAGS="-Dre_max_failures=re_max_failures2"</env_vars>
			<flags>--prefix=/usr --disable-nls</flags>
		</prebuild>

		<build>
			<command>make</command>
			<env_vars>LDFLAGS=-static</env_vars>
		</build>

		<install>
			<command>make</command>
			<env_vars>prefix=$lfs/usr</env_vars>
			<make_target>install</make_target>
		</install>

	</package>

	<package>
		<name>Fileutils</name>
		<version>4.0</version>
		<topleveldir dir="fileutils-4.0">

		<prebuild>
			<command>./configure</command>
			<flags>--disable-nls --prefix=/usr</flags>
		</prebuild>

		<build>
			<command>make</command>
			<env_vars>LDFLAGS=-static</env_vars>
		</build>

		<install>
			<command>make</command>
			<env_vars>prefix=$lfs/usr</env_vars>
			<make_target>install</make_target>
		</install>
		
		<postinstall>
			<mv source="$lfs/usr/bin/chgrp" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/chmod" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/chown" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/cp" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/dd" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/df" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/dir" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/dircolors" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/du" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/install" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/ln" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/ls" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/mkdir" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/mkfifo" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/mknod" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/mv" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/rm" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/rmdir" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/sync" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/touch" dest="$lfs/bin">
			<mv source="$lfs/usr/bin/vdir" dest="$lfs/bin">
			<link type="symbolic" source="$lfs/bin/install" 
dest="$lfs/usr/bin/install">
		</postinstall>
	</package>

	<package>
		<name>GCC on normal system</name>
		<version>2.95.2</version>
		<topleveldir dir="gcc-2.95.2">
		<builddir dir="gcc-build">

		<prebuild>
			<command>$topleveldir/configure</command>
			<flags>--prefix=/usr/local/gcc2952 
--with-local-prefix=/usr/local/gcc2952</flags>
			<flags>--with-gxx-include-dir=/usr/local/gcc2952/include/g++</flags>
			<flags>--enable-shared --enable-languages=c,c++</flags>
		</prebuild>

		<build>
			<command>make</command>
			<make_target>bootstrap</make_target>
		</build>

		<install>
			<command>make</command>
			<make_target>install</make_target>
		</install>
	</package>

	<package>
		<name>GCC</name>
		<version>2.95.2</version>
		<topleveldir dir="gcc-2.95.2">
		<builddir dir="gcc-build">
<!-- $host is used below which should be declared here. Not sure yet how to 
obtain the value yet --/>

		<prebuild>
			<command>$topleveldir/configure</command>
			<flags>--prefix=/usr --with-gxx-include-dir=/usr/include/g++</flags>
			<flags>--enable-languages=c,c++ --disable-nls</flags>
		</prebuild>

		<build>
			<command>make</command>
			<flags>-e</flags>
			<env_vars>LDFLAGS=-static</env_vars>
			<make_target>bootstrap</make_target>
		</build>

		<install>
			<command>make</command>
			<env_vars>prefix=$LFS/usr local_prefix=$LFS/usr/local</env_vars>
			<env_vars>gxx_include_dir=$LFS/usr/include/g++</env_vars>
			<make_target>install</make_target>
		</install>

		<postinstall>
			<link type="symbolic" source="$lfs/usr/lib/gcc-lib/$host/2.95.2/cpp" 
dest="$lfs/lib/cpp">
			<link type="symbolic" source="$lfs/usr/lib/gcc-lib/$host/2.95.2/cpp" 
dest="$lfs/usr/lib/cpp">
			<link type="symbolic" source="$lfs/usr/bin/gcc" dest="$lfs/usr/bin/cc">
		</postinstall>
	</package>

	<package>
		<name>Linux kernel</name>
		<version>2.2.16</version>
		<topleveldir dir="linux">

		<prebuild>
			<command>yes "" | make config</command>
			<!-- this <command> above needs to be changed probably --/>
		</prebuild>

		<build>
			<command>make</command>
			<make_target>dep</make_target>
		</build>

		<postinstall>
			<link type="symbolic" source="$lfs/usr/src/linux/include/linux" 
dest="$lfs/usr/include/linux">
			<link type="symbolic" source="$lfs/usr/src/linux/include/asm" 
dest="$lfs/usr/include/asm">
		</postinstall>
	</package>

	<package>
		<name>Glibc</name>
		<version>2.1.3</version>
		<topleveldir dir="glibc-2.1.3">
		<builddir dir="glibc-build">
		<patchfile file="$unpackdir/glibc-2.1.3.patch">

		<prebuild>
			<create_file name="configparms">
				<data>
					slibdir=/lib
					sysconfdir=/etc
				</data>
			</create_file>		

			<!-- figure out bash version, if 2.04 or higher patch --/>
			<patch dir="$topleveldir">

<!-- 
this is the env_var / var thing I talked about earlier. The CC is a real 
environment variable that needs to be set before the script is run, or like 
the book does it CC=blahbleh ./configure bluhbloh
Things you pass to make install like make prefix=$lfs/usr install fit better 
as a <make_var> or something to avoid confusion
--/>

			<command>$topleveldir/configure</command>
			<env_vars condition=present>CC=/usr/local/gcc2952/bin/gcc</env_vars>
			<flags>--prefix=/usr --enable-add-ons 
--with-headers=$lfs/usr/include</flags>
		</prebuild>

		<!-- with <env_vars condition=present> I mean that the backend should only 
set the
			 variable CC if the value is a legal value (in this context if the file
			 /usr/local/gcc2952/bin/gcc exists --/>

		<build>
			<command>make</command>
		</build>

<!-- like here (the <env_vars must be renamed) --/>

		<install>
			<command>make</command>
			<env_vars>install_root=$lfs</env_vars>
			<make_target>install</make_target>
		</install>

		<postinstall>
			<!-- determine if we need to copy the NSS library files. If so: --/>
			<cp source="/lib/libnss*" dest="$lfs/lib">
	</package>

	<package>
		<name>Grep</name>
		<version>2.4.2</version>
		<topleveldir dir="grep-2.4.2">

		<prebuild>
			<command>./configure</command>
			<env_vars>CPPFLAGS=-"Dre_max_failures=re_max_failures2"</env_vars>
			<flags>--prefix=/usr --disable-nls</flags>
		</prebuild>

		<build>
			<command>make</command>
			<env_vars>LDFLAGS=-static</env_vars>
		</build>

		<install>
			<command>make</command>
			<env_vars>prefix=$lfs/usr</env_vars>
			<make_target>install</make_target>
		</install>
	</package>

	<package>
		<name>Gzip</name>
		<version>1.2.4a</version>
		<topleveldir dir="gzip-1.2.4a">
		<patchfile file="glibc-1.2.4a.patch">

<!--
Here you see again that the <command> tag would much better fit in it's own 
block like:
<configure command="./configure">
	<flags>--disable-nls --prefix=/usr</flags>
</configure>
--/>
		<prebuild>
			<patch dir="$topleveldir">
			<command>./configure</command>
			<flags>--disable-nls --prefix=/usr</flags>
		</prebuild>

		<build>
			<command>make</command>
			<env_vars>LDFLAGS=-static</env_vars>
		</build>

		<install>
			<command>make</command>
			<env_vars>prefix=$lfs/usr</env_vars>
			<make_target>install</make_target>
		</install>

		<postinstall>
			<cp source="$lfs/usr/bin/gunzip $lfs/usr/bin/gzip" dest="$lfs/bin">
			<rm source="$lfs/usr/bin/gunzip $lfs/usr/bin/gzip">
		</postinstall>

	</package>

<!-- I haven't inserted these yet because we need to make changes and the 
more I add package wise the most i end up changing. The packages above 
demonstarte unique things that we need to take into account. make, sed, 
shutils, tar and textutils are all pretty straightfoward and are identical 
(some use a <mv> but that one has already been demonstrated above)
--/>
	<!-- insert make --/>
	<!-- insert sed --/>
	<!-- insert sh-utils --/>
	<!-- insert tar --/>
	<!-- insert textutils --/>

	<config_file>
		<name>passwd</name>
		<location>$lfs/etc</location>
		<data>
			root:x:0:0:root:/root:/bin/bash
		</data>
	</config_file>

	<config_file>
		<name>group</name>
		<location>$lfs/etc</location>
		<data>
			root:x:0:
			bin:x:1:
			sys:x:2:
			kmem:x:3:
			tty:x:4:
			uucp:x:5:
			daemon:x:6:
			floppy:x:7:
			disk:x:8:
		</data>
	</config_file>

	<prechroot>
		<cp source="/proc/devices" dest="$lfs/proc">
	</prechroot>

	<config_file>
		<name>.bash_profile</name>
		<location>$lfs/root/</location>
		<data>
			# Begin /root/.bash_profile

			TERM=linux
			CFLAGS="-O3 -mcpu=xxx -march=yyy"
			CXXFLAGS=$CFLAGS

			export TERM CFLAGS CXXFLAGS

			# End /root/.bash_profile
		</data>
	</config_file>

	<enter_chroot>
		<cd dir="$lfs">
		<command>chroot</command>
		<flags>$LFS env -i HOME=/root bash --login</flags>
	</enter_chroot>

</alfs>

========

Comments please, loads and loads of comments please. We need to beat this 
profile up and big time.

-- 
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