Profile syntax for chapter 4

Gerard Beekmans gerard at linuxfromscratch.org
Mon Sep 25 05:06:38 PDT 2000


Hi,

We've waited enough time now. Let's continue on this profile.

We're going to follow a chapter-by-chapter approach. That way the information
you read here will be easier to handle. Chapters 1-3 don't need to be dealt
with as they just contain information. It all starts in chapter 4 with
preparing the LFS partition. Keep in mind all tags I post today are all open
for discussion. I'm just giving a few examples that sound reasonable to me
but might lack flexibility and that's what we are going to sort out now.

There are a few commands here we need to make up tags for. As we go I'm
documenting this on the alfs-docs list.

The first thing that happens is the user needing to run fdisk. We can make
fdisk run non-interactive but that often will not be desirable So we could
simply insert this tag:

<fdisk>

Perhaps, to be consistant a closing tag:

<fdisk></fdisk>

That should be translated in running the fdisk program in the foreground so
that the user can create a partition.

The next step is formatting that partition. After fdisk ran the user has to
give input regarding which partition he/she created as linux native and swap.
We can't simply do a diff on the old and new partition layout since the user
might not have added new partitions at all. Then again we can do a diff. so
we can present what we think are the newly created partitions. But those are
implementation details, let's not get too much into those kind of things.

Something like this might work:

<select_partition></select<partition>
<select_swap></select_swap>

We have to be able to make this all automatized if the user knows his hdd by
head and knows exactly how much he wants to allocate. He can fill out some
variables in the profile regarding disk, partition and size and the tool will
do it for him. But for the sake of simplicity let's assume the user want to
manually fdisk.

Then the partition needs to be formatted:
<format_partition>$partition</format_partition>
So $partition needs to be defined somewhere that contains the proper /dev/xxx
variable.

The book assumes that you will use the swap partition that's already in use
by your normal system. But that might not be the case here anymore, so a
mkswap like tag should be inserted somewhere at some point but I think that
can wait. Let's do it by-the-book first, but it wouldn't hurt if you guys can
think about it already so it can be dealt with in due time.

The next step is mounting the new partition under /mnt/lfs

<mkdir>/mnt/lfs</mkdir>
<mount device"$partition">$LFS</mount>

Yeah, you can even reverse it: <mount target="$LFS">$partition</mount>. So we
have to make up a rule is entered as a tag's parameter and what is the value
of a tag (the stuff between <blah></blah>)

Creating the directories:

We can throw in a ton of <cd> and <mkdir> tags to get it done. How about a
similar thing the book does now:

<create-dirs>
	<cd>$LFS</cd>
	<mkdir>bin boot dev dev/pts etc home lib mnt proc root sbin tmp var</mkdir>
	<for var="dirname">$LFS/usr $LFS/usr/local>
		<do>
			<mkdir>$dirname</mkdir>
			<cd>$dirname</cd>
			<mkdir>bin etc include lib sbin share src tmp var</mkdir>
			<ln type="symbolic">share/man man</ln>
			<ln type="symbolic">share/doc doc</ln>
			<ln type="symbolic">share/info info</ln>
			<cd>$dirname/share</cd>
			<mkdir>dict doc info locale man nls misc terminfo zoneinfo</mkdir>
			<cd>$dirname/share/man</cd>
			<mkdir>man1 man2 man3 man4 man5 man6 man7 man8</mkdir>
		</do>
	</for>
	<cd>$LFS/var</cd>
	<mkdir>lock log mail run spool tmp
</create-dirs>

That will be it for this thread.

So we need to agree on the tag names, attributes and the syntax of the tags,
attributes and variables.

A proposal can be:
break a command down into tags as follows:
	command -option1 -option2 value1 value2
xml version: <command option1="value" option2="value">value1 value2</command>

I won't be posting a complete profile. Let's just get the tags right and when
we have agreed on this I'll post a chapter4-xml-profile. I'll also put them
on http://alfs.linuxfromscratch.org

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