[lfs-dev] LFS systemd-specific stuff

Bruce Dubbs bruce.dubbs at gmail.com
Mon May 23 15:55:21 PDT 2016


DJ Lucas wrote:
>
>
> On 05/22/2016 01:31 PM, Bruce Dubbs wrote:
>> DJ Lucas wrote:
>>
>>> I might have missed the first message here. I had a minor issue with my
>>> mail filter (after moving my mail host last week) and it was right around
>>> the time the second message came in. Are you discussing merging the
>>> books,
>>> or moving to profiled XML to make two targets from one source?
>>
>> Two targets from one source so we can share those files that are the
>> same for both books.
>>
>> What I had in mind is a different indexd.xml for the systemd book along
>> with a systemd target in the Makefile.  I want to try to prototype this
>> today in a new branch.  If I get it working I'll commit that branch for
>> further review.  For file naming, I plan to just append a 'd' to the
>> different files, ie indexd.xml vs index.xml.
>>
>> If it works out, it should make the maintenance work for the systemd
>> version of the book a lot easier.
>
> It should, and avoids adding anything specific for each book directly in
> the XML source as proposed here:
> http://archive.linuxfromscratch.org/mail-archives/blfs-dev/2014-February/026800.html
>
> The part I had no creative ideas about was the split changelog (ie: having
> to put changes in both changelogs), which is why I had ultimately
> suggested the above simple changes.

I see what is being suggested, and I did get it to work.  What I did was 
to  add an attribute to a tag, for example I added the following to the 
changelog:

<para revision="systemd">A test</para>

And then I changed the build instructions in the Makefile to:

$(Q)xsltproc --nonet                   \
    --output $(RENDERTMP)/lfs-html2.xml \
    --stringparam profile.revision sysv \
    stylesheets/lfs-xsl/profile.xsl     \
    $(RENDERTMP)/lfs-html.xml

xsltproc --nonet                              \
    --stringparam chunk.quietly $(CHUNK_QUIET) \
    --stringparam rootid "$(ROOT_ID)"          \
    --stringparam base.dir $(BASEDIR)/         \
    stylesheets/lfs-chunked.xsl                \
    $(RENDERTMP)/lfs-html.xml

The book still builds, and the test paragraph is missing.  If I change the 
two instances of sysv above to systemd, then the paragraph prints.

My knowledge of xsl is still pretty weak but here are some references I 
have been using:

http://www.dpawson.co.uk/docbook/markup.html#ConditionalText
http://www.sagehill.net/docbookxsl/AlternateText.html#ProfileFilter

------

In other areas, I've been able to merge the two books in a bit more 
cumbersome method than the above.  I had to have separate systemd pages 
for about 30 out of 255 xml files.  With the above, I should be able to 
reduce those 30 separate pages substantially.

For the change log, it appears we just need to add the appropriate 
revision= to the entries for those that only affect one book.

My goal is to just run 'make' to build the sysv book and 'make systemd' 
for the other.  I think the method may work for BLFS also.

   -- Bruce


   -- Bruce




More information about the lfs-dev mailing list