Index: .gitignore
===================================================================
--- .gitignore	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ .gitignore	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -1,3 +1,4 @@
 lfs-bootscripts-*.tar.xz
+conditional.ent
 version.ent
 appendices/*.script
Index: Makefile
===================================================================
--- Makefile	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ Makefile	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -190,5 +190,5 @@
 
 version:
-	$(Q)./git-version.sh
+	$(Q)./git-version.sh $(REV)
 
 #dump-commands: validate
Index: chapter01/askforhelp.xml
===================================================================
--- chapter01/askforhelp.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter01/askforhelp.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -39,7 +39,5 @@
     <itemizedlist>
       <listitem>
-        <para>The version of the book being used (in this case
-              <phrase revision="sysv">&version;</phrase>
-              <phrase revision="systemd">&versiond;</phrase>)</para>
+        <para>The version of the book being used (in this case &version;</para>
       </listitem>
       <listitem>
Index: chapter01/changelog.xml
===================================================================
--- chapter01/changelog.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter01/changelog.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -11,8 +11,5 @@
   <title>Changelog</title>
 
-  <para>This is version
-        <phrase revision="sysv">&version;</phrase>
-        <phrase revision="systemd">&versiond;</phrase>
-  of the Linux From Scratch book, dated
+  <para>This is version &version; of the Linux From Scratch book, dated
   &releasedate;. If this book is more than six months old, a newer and better
   version is probably already available. To find out, please check one of the
Index: chapter07/cleanup.xml
===================================================================
--- chapter07/cleanup.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter07/cleanup.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -128,9 +128,6 @@
     </note>
 
-<screen role="nodump" revision="sysv"><userinput>cd $LFS
+<screen role="nodump"><userinput>cd $LFS
 tar -cJpf $HOME/lfs-temp-tools-&version;.tar.xz .</userinput></screen>
-
-<screen role="nodump" revision="systemd"><userinput>cd $LFS
-tar -cJpf $HOME/lfs-temp-tools-&versiond;.tar.xz .</userinput></screen>
 
   </sect2>
@@ -158,11 +155,7 @@
     your entire host system.  YOU ARE WARNED.</para></warning>
 
-<screen role="nodump" revision="sysv"><computeroutput>cd $LFS
+<screen role="nodump"><computeroutput>cd $LFS
 rm -rf ./*
 tar -xpf $HOME/lfs-temp-tools-&version;.tar.xz</computeroutput></screen>
-
-<screen role="nodump" revision="systemd"><computeroutput>cd $LFS
-rm -rf ./*
-tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen>
 
     <para>
Index: chapter10/grub.xml
===================================================================
--- chapter10/grub.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter10/grub.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -157,6 +157,6 @@
 set root=(hd0,2)
 
-menuentry "GNU/Linux, Linux &linux-version;-lfs-&versiond;" {
-        linux   /boot/vmlinuz-&linux-version;-lfs-&versiond; root=/dev/sda2 ro
+menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" {
+        linux   /boot/vmlinuz-&linux-version;-lfs-&version; root=/dev/sda2 ro
 }</literal>
 EOF</userinput></screen>
Index: chapter10/kernel.xml
===================================================================
--- chapter10/kernel.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter10/kernel.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -228,5 +228,5 @@
 <screen revision="sysv"><userinput remap="install">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
 
-<screen revision="systemd"><userinput remap="install">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&versiond;</userinput></screen>
+<screen revision="systemd"><userinput remap="install">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
 
     <para><filename>System.map</filename> is a symbol file for the kernel.
@@ -337,6 +337,5 @@
       <seglistitem>
         <seg>config-&linux-version;,
-        <phrase revision="sysv">vmlinuz-&linux-version;-lfs-&version;,</phrase>
-        <phrase revision="systemd">vmlinuz-&linux-version;-lfs-&versiond;,</phrase>
+        vmlinuz-&linux-version;-lfs-&version;
         and System.map-&linux-version;</seg>
         <seg>/lib/modules, /usr/share/doc/linux-&linux-version;</seg>
@@ -360,6 +359,5 @@
 
       <varlistentry id="lfskernel">
-        <term revision="sysv"><filename>vmlinuz-&linux-version;-lfs-&version;</filename></term>
-        <term revision="systemd"><filename>vmlinuz-&linux-version;-lfs-&versiond;</filename></term>
+        <term><filename>vmlinuz-&linux-version;-lfs-&version;</filename></term>
         <listitem>
           <para>The engine of the Linux system. When turning on the computer,
Index: chapter11/reboot.xml
===================================================================
--- chapter11/reboot.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter11/reboot.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -21,20 +21,17 @@
   <itemizedlist>
 
-    <listitem><para>A text mode browser such as <ulink revision="sysv"
-    url='&blfs-book;basicnet/lynx.html'>Lynx</ulink><ulink revision="systemd"
-    url='&blfs-systemd-book;basicnet/lynx.html'>Lynx</ulink>
+    <listitem><para>A text mode browser such as <ulink
+    url='&blfs-book;basicnet/lynx.html'>Lynx</ulink>
     will allow you to easily view the BLFS book in one virtual terminal, while
     building packages in another.</para></listitem>
 
-    <listitem><para>The <ulink revision="sysv"
-    url='&blfs-book;postlfs/make-ca.html'>make-ca</ulink><ulink revision="systemd"
-    url='&blfs-systemd-book;postlfs/make-ca.html'>make-ca</ulink> package
+    <listitem><para>The <ulink
+    url='&blfs-book;postlfs/make-ca.html'>make-ca</ulink> package
     will allow you to set up local trusted anchor certificates, allowing
     the system to verify SSL certificates provided by remote servers (for
     example, a website using HTTPS).</para></listitem>
 
-    <listitem><para>The <ulink revision="sysv"
-    url='&blfs-book;general/gpm.html'>GPM</ulink><ulink revision="systemd"
-    url='&blfs-systemd-book;general/gpm.html'>GPM</ulink> package will allow
+    <listitem><para>The <ulink
+    url='&blfs-book;general/gpm.html'>GPM</ulink> package will allow
     you to perform copy/paste actions in your virtual
     terminals.</para></listitem>
@@ -48,27 +45,19 @@
     useful.</para></listitem>
 
-    <listitem><para>Installing <ulink revision="sysv"
-    url='&blfs-book;postlfs/sudo.html'>sudo</ulink><ulink revision="systemd"
-    url='&blfs-systemd-book;postlfs/sudo.html'>sudo</ulink> may be useful for
+    <listitem><para>Installing <ulink
+    url='&blfs-book;postlfs/sudo.html'>sudo</ulink> may be useful for
     building packages as a non-root user and easily installing the resulting
     packages in your new system.</para></listitem>
 
     <listitem><para>If you want to access your new system from a remote system
-    within a comfortable GUI environment, install <ulink revision="sysv"
-    url='&blfs-book;postlfs/openssh.html'>openssh</ulink><ulink revision="systemd"
-    url='&blfs-systemd-book;postlfs/openssh.html'>openssh</ulink>.
-    </para></listitem>
+    within a comfortable GUI environment, install <ulink
+    url='&blfs-book;postlfs/openssh.html'>openssh</ulink>.</para></listitem>
 
     <listitem><para>To make fetching files over the internet easier, install
-    <ulink
-    revision="sysv" url='&blfs-book;basicnet/wget.html'>wget</ulink><ulink
-    revision="systemd" url='&blfs-systemd-book;basicnet/wget.html'>wget</ulink>.
-    </para></listitem>
+    <ulink url='&blfs-book;basicnet/wget.html'>wget</ulink>.</para></listitem>
 
     <listitem><para>To connect to a wireless access point for networking,
-    install <ulink revision="sysv"
-    url='&blfs-book;basicnet/wpa_supplicant.html'>wpa_supplicant</ulink><ulink
-    revision="systemd"
-    url='&blfs-systemd-book;basicnet/wpa_supplicant.html'>wpa_supplicant</ulink>.
+    install <ulink
+    url='&blfs-book;basicnet/wpa_supplicant.html'>wpa_supplicant</ulink>.
     </para></listitem>
 
Index: chapter11/theend.xml
===================================================================
--- chapter11/theend.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter11/theend.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -32,10 +32,8 @@
   running:</para>
 
-<screen revision="sysv"><userinput>echo &version; &gt; /etc/lfs-release</userinput></screen>
+<screen><userinput>echo &version; &gt; /etc/lfs-release</userinput></screen>
 
-<screen revision="systemd"><userinput>echo &versiond; &gt; /etc/lfs-release</userinput></screen>
-
-  <para>Two files describing the installed system may be used by packages
-  that can be installed on the system later, either in binary form or by building
+  <para>Two files describing the installed system may be used by packages that
+  can be installed on the system later, either in binary form or by building
   them.</para>
 
@@ -44,14 +42,7 @@
   this file, run:</para>
 
-<screen revision="sysv"><userinput>cat &gt; /etc/lsb-release &lt;&lt; "EOF"
+<screen><userinput>cat &gt; /etc/lsb-release &lt;&lt; "EOF"
 DISTRIB_ID="Linux From Scratch"
 DISTRIB_RELEASE="&version;"
-DISTRIB_CODENAME="&lt;your name here&gt;"
-DISTRIB_DESCRIPTION="Linux From Scratch"
-EOF</userinput></screen>
-
-<screen revision="systemd"><userinput>cat &gt; /etc/lsb-release &lt;&lt; "EOF"
-DISTRIB_ID="Linux From Scratch"
-DISTRIB_RELEASE="&versiond;"
 DISTRIB_CODENAME="&lt;your name here&gt;"
 DISTRIB_DESCRIPTION="Linux From Scratch"
@@ -62,17 +53,9 @@
   this file, run:</para>
 
-<screen revision="sysv"><userinput>cat &gt; /etc/os-release &lt;&lt; "EOF"
+<screen><userinput>cat &gt; /etc/os-release &lt;&lt; "EOF"
 NAME="Linux From Scratch"
 VERSION="&version;"
 ID=lfs
 PRETTY_NAME="Linux From Scratch &version;"
-VERSION_CODENAME="&lt;your name here&gt;"
-EOF</userinput></screen>
-
-<screen revision="systemd"><userinput>cat &gt; /etc/os-release &lt;&lt; "EOF"
-NAME="Linux From Scratch"
-VERSION="&versiond;"
-ID=lfs
-PRETTY_NAME="Linux From Scratch &versiond;"
 VERSION_CODENAME="&lt;your name here&gt;"
 EOF</userinput></screen>
Index: chapter11/whatnow.xml
===================================================================
--- chapter11/whatnow.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ chapter11/whatnow.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -58,6 +58,5 @@
       <para>The Beyond Linux From Scratch book covers installation
       procedures for a wide range of software beyond the scope of the LFS
-      Book. The BLFS project is located at <ulink revision="sysv"
-      url="&blfs-book;"/><ulink revision="systemd" url="&blfs-systemd-book;"/>.
+      Book. The BLFS project is located at <ulink url="&blfs-book;"/>.
       </para>
     </listitem>
Index: general.ent
===================================================================
--- general.ent	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ general.ent	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -1,4 +1,8 @@
+<!-- Automatically generated by git-version.sh -->
+<!ENTITY % conditional-entities SYSTEM "conditional.ent">
+%conditional-entities;
+
 <!-- version info automatically generated by git
-     comment the following two lines for release -->
+     comment out the following two lines for release -->
 <!ENTITY % version-entities SYSTEM "version.ent">
 %version-entities;
@@ -7,21 +11,26 @@
      for releases (including -rc) -->
 <!--
+<![ %sysv; [
 <!ENTITY version         "10.2-rc1">
-<!ENTITY versiond        "10.2-systemd-rc1">
+]]>
+<![ %systemd; [
+<!ENTITY version         "10.2-systemd-rc1">
+]]>
 <!ENTITY releasedate     "August 26th, 2021">
 <!ENTITY copyrightdate   "1999-2021">
 -->
 
+<![ %sysv; [
 <!ENTITY short-version   "svn">  <!-- Used below in &blfs-book;
                                       Change to x.y for release but not -rc releases -->
+]]>
+<![ %systemd; [
+<!ENTITY short-version  "systemd">  <!--Change to stable-systemd for release  -->
+]]>
 <!ENTITY generic-version "development"> <!-- Use "development"  or "x.y[-pre{x}]" -->
-
-<!ENTITY short-versiond  "systemd">  <!--Change to stable-systemd for release  -->
-<!ENTITY generic-versiond "systemd">
 
 <!ENTITY lfs-root        "https://www.linuxfromscratch.org/">
 <!ENTITY blfs-root       "&lfs-root;blfs/">
 <!ENTITY blfs-book       "&blfs-root;view/&short-version;/">
-<!ENTITY blfs-systemd-book "&blfs-root;view/&short-versiond;/">
 <!ENTITY faq-root        "&lfs-root;faq/">
 <!ENTITY hints-root      "&lfs-root;hints/downloads/files/">
@@ -31,13 +40,18 @@
 <!ENTITY livecd-root     "&lfs-root;livecd/">
 <!ENTITY test-results    "&lfs-root;lfs/build-logs/&generic-version;/">
+<![ %sysv; [
 <!ENTITY errata          "&lfs-root;lfs/errata/&generic-version;/">
+]]>
+<![ %systemd; [
+<!ENTITY errata          "&lfs-root;lfs/errata/&short-version;/">
+]]>
 <!ENTITY secadv          "&lfs-root;lfs/advisories/">
 <!ENTITY min-kernel      "3.2">
-
+<!--
 <!ENTITY patches-rootd   "&lfs-root;patches/lfs/&generic-versiond;/">
 <!ENTITY downloads-rootd "&lfs-root;lfs/downloads/&generic-versiond;/">
 <!ENTITY test-resultsd   "&lfs-root;lfs/build-logs/&generic-versiond;/">
 <!ENTITY erratad         "&lfs-root;lfs/errata/&generic-versiond;/">
-
+-->
 <!ENTITY lfs-ticket-root "https://wiki.linuxfromscratch.org/lfs/ticket/">
 
Index: git-version.sh
===================================================================
--- git-version.sh	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ git-version.sh	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -1,9 +1,27 @@
 #!/bin/sh
+
+if [ "$1" = sysv ]; then
+	SYSV="INCLUDE"
+	SYSTEMD="IGNORE "
+elif [ "$1" = systemd ]; then
+	SYSV="IGNORE "
+	SYSTEMD="INCLUDE"
+else
+	echo You must provide either \"sysv\" or \"systemd\" as argument
+	exit 1
+fi
+
+echo "<!ENTITY % sysv    \"$SYSV\">"     >  conditional.ent
+echo "<!ENTITY % systemd \"$SYSTEMD\">"  >> conditional.ent
 
 if ! git status > /dev/null; then
 	# Either it's not a git repository, or git is unavaliable.
 	# Just workaround.
-	echo "<!ENTITY version           \"unknown\">"         >  version.ent
-	echo "<!ENTITY versiond          \"unknown-systemd\">" >> version.ent
+	echo "<![ %sysv; ["                                    >  version.ent
+	echo "<!ENTITY version           \"unknown\">"         >> version.ent
+	echo "]]>"                                             >> version.ent
+	echo "<![ %systemd; ["                                 >> version.ent
+	echo "<!ENTITY version           \"unknown-systemd\">" >> version.ent
+	echo "]]>"                                             >> version.ent
 	echo "<!ENTITY releasedate       \"unknown\">"         >> version.ent
 	echo "<!ENTITY copyrightdate     \"1999-2021\">"       >> version.ent
@@ -42,6 +60,10 @@
 fi
 
-echo "<!ENTITY version           \"$version\">"            >  version.ent
-echo "<!ENTITY versiond          \"$versiond\">"           >> version.ent
+echo "<![ %sysv; ["                                        >  version.ent
+echo "<!ENTITY version           \"$version\">"            >> version.ent
+echo "]]>"                                                 >> version.ent
+echo "<![ %systemd; ["                                     >> version.ent
+echo "<!ENTITY version          \"$versiond\">"            >> version.ent
+echo "]]>"                                                 >> version.ent
 echo "<!ENTITY releasedate       \"$full_date\">"          >> version.ent
 echo "<!ENTITY copyrightdate     \"1999-$year\">"          >> version.ent
Index: make-aux-files.sh
===================================================================
--- make-aux-files.sh	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ make-aux-files.sh	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -4,5 +4,5 @@
 
 # Get base file name and move bootscripts directory to that name
-version=`grep "ENTITY lfs-bootscripts-version" packages.ent |cut -d'"' -f2`
+version=`grep "ENTITY lfs-bootscripts-version" packages.ent | head -n1| cut -d'"' -f2`
 mv bootscripts lfs-bootscripts-$version
 
Index: patches.ent
===================================================================
--- patches.ent	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ patches.ent	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -73,9 +73,25 @@
 <!ENTITY perl-fix-patch-size "1.6 KB">
 
+<![ %sysv; [
 <!ENTITY sysvinit-consolidated-patch "sysvinit-&sysvinit-version;-consolidated-1.patch">
 <!ENTITY sysvinit-consolidated-patch-md5 "4900322141d493e74020c9cf437b2cdc">
 <!ENTITY sysvinit-consolidated-patch-size "2.4 KB">
+]]>
 
+<![ %systemd; [
+<!ENTITY sysvinit-consolidated-patch "not-used">
+<!ENTITY sysvinit-consolidated-patch-md5 "not-used">
+<!ENTITY sysvinit-consolidated-patch-size "not-used">
+]]>
+
+<![ %systemd; [
 <!ENTITY systemd-upstream-fixes-patch "systemd-&systemd-version;-upstream_fixes-1.patch">
 <!ENTITY systemd-upstream-fixes-patch-md5 "a4449dedf514486b8995ee501d1bb8cc">
 <!ENTITY systemd-upstream-fixes-patch-size "4 KB">
+]]>
+
+<![ %sysv; [
+<!ENTITY systemd-upstream-fixes-patch "not-used">
+<!ENTITY systemd-upstream-fixes-patch-md5 "not-used">
+<!ENTITY systemd-upstream-fixes-patch-size "not-used">
+]]>
Index: prologue/bookinfo.xml
===================================================================
--- prologue/bookinfo.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ prologue/bookinfo.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -8,6 +8,5 @@
 <bookinfo>
   <title>Linux From Scratch</title>
-  <subtitle revision='sysv'   >Version &version; </subtitle>
-  <subtitle revision='systemd'>Version &versiond;</subtitle>
+  <subtitle>Version &version; </subtitle>
   <subtitle>Published &releasedate;</subtitle>
 
Index: prologue/errata.xml
===================================================================
--- prologue/errata.xml	(revision d887817942f47b63fd9b81b0c074ab87ab718af0)
+++ prologue/errata.xml	(revision 0bf23c841e6573eb8b6117a98ddc1fd7225dfcd0)
@@ -16,6 +16,5 @@
   instructions in this release of LFS need any modifications to accommodate
   security vulnerabilities or other bug fixes, please visit
-  <ulink revision="sysv" url="&errata;"/>
-  <ulink revision="systemd" url="&erratad;"/>
+  <ulink url="&errata;"/>
   before proceeding with your build. You should note any
   changes shown and apply them to the relevant section of the book as you
