Changeset 8825e69 for common/libs/func_book_parser
- Timestamp:
- 03/30/2022 03:45:35 PM (3 years ago)
- Branches:
- ablfs-more, trunk
- Children:
- 3e82b0b
- Parents:
- 2bd2fb8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/libs/func_book_parser
r2bd2fb8 r8825e69 11 11 exit 1" 12 12 13 echo -n "Downloading the lfs document, $COMMIT commit... "13 echo -n "Downloading the lfs document, $COMMIT branch/tag/commit... " 14 14 15 15 # Grab a fresh book if it's missing, otherwise, update it from the … … 51 51 # Extract the commands 52 52 echo -n "Extracting commands for" 53 case ${PROGNAME} in 53 echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build... " 54 # The scripts pages are xincluded by the book, so must 55 # be generated for running xsltproc 56 pushd $BOOK > /dev/null 57 if [ -f process-scripts.sh ]; then 58 bash process-scripts.sh >> $LOGDIR/$LOG 2>&1 59 fi 60 # Recent git versions need version.ent to be generated 61 if [ -f git-version.sh ]; then 62 bash git-version.sh "$INITSYS" >> $LOGDIR/$LOG 2>&1 63 fi 64 popd > /dev/null 54 65 55 lfs) 56 echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build... " 57 # The scripts pages are xincluded by the book, so must 58 # be generated for running xsltproc 59 pushd $BOOK > /dev/null 60 if [ -f process-scripts.sh ]; then 61 bash process-scripts.sh >> $LOGDIR/$LOG 2>&1 62 fi 63 # Recent git versions need version.ent to be generated 64 if [ -f git-version.sh ]; then 65 bash git-version.sh "$INITSYS" >> $LOGDIR/$LOG 2>&1 66 fi 67 popd > /dev/null 66 # First profile the book, for revision and arch. Note that 67 # MULTIBLIB is set to "default" if pure 64 bit book. In this case, 68 # profiling on arch is useless, but does not hurt either. 69 xsltproc --nonet \ 70 --xinclude \ 71 --stringparam profile.revision "$INITSYS" \ 72 --stringparam profile.arch "$MULTILIB" \ 73 --output prbook.xml \ 74 $BOOK/stylesheets/lfs-xsl/profile.xsl \ 75 $BOOK/index.xml >> $LOGDIR/$LOG 2>&1 68 76 69 # First profile the book, for revision and arch. Note that 70 # MULTIBLIB is set to "default" if pure 64 bit book. In this 71 # profiling on arch is useless, but does not hurt either. 72 xsltproc --nonet \ 73 --xinclude \ 74 --stringparam profile.revision "$INITSYS" \ 75 --stringparam profile.arch "$MULTILIB" \ 76 --output prbook.xml \ 77 $BOOK/stylesheets/lfs-xsl/profile.xsl \ 78 $BOOK/index.xml >> $LOGDIR/$LOG 2>&1 79 80 # Use the profiled book for generating the scriptlets 81 xsltproc --nonet \ 82 --stringparam testsuite "$TEST" \ 83 --stringparam bomb-testsuite "$BOMB_TEST" \ 84 --stringparam ncurses5 "$NCURSES5" \ 85 --stringparam strip "$STRIP" \ 86 --stringparam del-la-files "$DEL_LA_FILES" \ 87 --stringparam full-locale "$FULL_LOCALE" \ 88 --stringparam timezone "$TIMEZONE" \ 89 --stringparam page "$PAGE" \ 90 --stringparam lang "$LANG" \ 91 --stringparam pkgmngt "$PKGMNGT" \ 92 --stringparam wrap-install "$WRAP_INSTALL" \ 93 --stringparam hostname "$HOSTNAME" \ 94 --stringparam interface "$INTERFACE" \ 95 --stringparam ip "$IP_ADDR" \ 96 --stringparam gateway "$GATEWAY" \ 97 --stringparam prefix "$PREFIX" \ 98 --stringparam broadcast "$BROADCAST" \ 99 --stringparam domain "$DOMAIN" \ 100 --stringparam nameserver1 "$DNS1" \ 101 --stringparam nameserver2 "$DNS2" \ 102 --stringparam font "$FONT" \ 103 --stringparam fontmap "$FONTMAP" \ 104 --stringparam unicode "$UNICODE" \ 105 --stringparam keymap "$KEYMAP" \ 106 --stringparam local "$LOCAL" \ 107 --stringparam log-level "$LOG_LEVEL" \ 108 --stringparam script-root "$SCRIPT_ROOT" \ 109 --output "./${COMMANDS}/" \ 110 $XSL \ 111 prbook.xml >> $LOGDIR/$LOG 2>&1 112 # Remove flags requesting user action in some cases. Much easier here than 113 # in the stylesheet... 114 sed -i 's/-iv /-v /' "./${COMMANDS}/"chapter??/*kernel* 115 ;; 116 *) echo -n " ${L_arrow}${PROGNAME}${R_arrow} book invalid, terminate build... " 117 exit 1 ;; 118 esac 77 # Use the profiled book for generating the scriptlets 78 xsltproc --nonet \ 79 --stringparam testsuite "$TEST" \ 80 --stringparam bomb-testsuite "$BOMB_TEST" \ 81 --stringparam ncurses5 "$NCURSES5" \ 82 --stringparam strip "$STRIP" \ 83 --stringparam del-la-files "$DEL_LA_FILES" \ 84 --stringparam full-locale "$FULL_LOCALE" \ 85 --stringparam timezone "$TIMEZONE" \ 86 --stringparam page "$PAGE" \ 87 --stringparam lang "$LANG" \ 88 --stringparam pkgmngt "$PKGMNGT" \ 89 --stringparam wrap-install "$WRAP_INSTALL" \ 90 --stringparam hostname "$HOSTNAME" \ 91 --stringparam interface "$INTERFACE" \ 92 --stringparam ip "$IP_ADDR" \ 93 --stringparam gateway "$GATEWAY" \ 94 --stringparam prefix "$PREFIX" \ 95 --stringparam broadcast "$BROADCAST" \ 96 --stringparam domain "$DOMAIN" \ 97 --stringparam nameserver1 "$DNS1" \ 98 --stringparam nameserver2 "$DNS2" \ 99 --stringparam font "$FONT" \ 100 --stringparam fontmap "$FONTMAP" \ 101 --stringparam unicode "$UNICODE" \ 102 --stringparam keymap "$KEYMAP" \ 103 --stringparam local "$LOCAL" \ 104 --stringparam log-level "$LOG_LEVEL" \ 105 --stringparam script-root "$SCRIPT_ROOT" \ 106 --output "./${COMMANDS}/" \ 107 $XSL \ 108 prbook.xml >> $LOGDIR/$LOG 2>&1 109 # Remove flags requesting user action in some cases. Much easier here than 110 # in the stylesheet... 111 sed -i 's/-iv /-v /' "./${COMMANDS}/"chapter??/*kernel* 119 112 120 113 echo "done" … … 122 115 # Make the scripts executable. 123 116 chmod -R +x "$JHALFSDIR/${COMMANDS}" 124 125 # Create the packages file. We need it for proper Makefile creation 126 # lfs does not use this anymore, but this is taken care in the 127 # function body 128 create_package_list 129 # On the other hand, lfs needs two auxiliary files 130 if [ "${PROGNAME}" = lfs ]; then 131 create_chroot_scripts 132 create_kernfs_scripts 133 fi 117 create_chroot_scripts 118 create_kernfs_scripts 134 119 135 120 # we create the VERSION variable here. Should maybe go into its own 136 121 # function. But at this point we can use the profiled xml to get 137 122 # version from lfs-release in the lfs case. 138 case $PROGNAME in 139 lfs) 140 VERSION=$(grep 'echo.*lfs-release' prbook.xml | sed 's/.*echo[ ]*\([^ ]*\).*/\1/') 141 ;; 142 *) 143 VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;; 144 esac 123 VERSION=$(grep 'echo.*lfs-release' prbook.xml | sed 's/.*echo[ ]*\([^ ]*\).*/\1/') 145 124 146 125 # Done. Moving on... 147 126 get_sources 148 }149 150 #----------------------------#151 create_package_list() { #152 #----------------------------#153 154 # Create the packages file. We need it for proper Makefile creation155 rm -f pkg_tarball_list156 echo -n "Creating <${PROGNAME}> list of tarball names for $BOOK"157 if [ ! -z "$ARCH" ] ; then echo -n " $ARCH" ; fi158 echo -n "... "159 case ${PROGNAME} in160 lfs)161 # lfs does not use the package list anymore162 ;;163 *)164 esac165 166 echo "done"167 168 127 } 169 128 … … 176 135 if [ ! -z $ARCH ] ; then echo -n " $ARCH" ; fi 177 136 echo -n "... " 178 case ${PROGNAME} in 179 lfs) 180 xsltproc --nonet --xinclude \ 181 -o chroot-scripts/ chroot.xsl \ 182 $BOOK/chapter0?/*chroot*.xml >> $LOGDIR/$LOG 2>&1 183 ;; 184 *) 185 esac 137 xsltproc --nonet --xinclude \ 138 -o chroot-scripts/ chroot.xsl \ 139 $BOOK/chapter0?/*chroot*.xml >> $LOGDIR/$LOG 2>&1 186 140 echo "done" 187 141 … … 197 151 if [ ! -z $ARCH ] ; then echo -n " $ARCH" ; fi 198 152 echo -n "... " 199 case ${PROGNAME} in 200 lfs) 201 xsltproc --nonet \ 202 -o kernfs-scripts/devices.sh kernfs.xsl \ 203 $BOOK/*/kernfs.xml >> $LOGDIR/$LOG 2>&1 204 xsltproc --nonet \ 205 -o kernfs-scripts/teardown.sh kernfs.xsl \ 206 $BOOK/chapter??/reboot.xml >> $LOGDIR/$LOG 2>&1 207 ;; 208 *) 209 esac 153 xsltproc --nonet \ 154 -o kernfs-scripts/devices.sh kernfs.xsl \ 155 $BOOK/*/kernfs.xml >> $LOGDIR/$LOG 2>&1 156 xsltproc --nonet \ 157 -o kernfs-scripts/teardown.sh kernfs.xsl \ 158 $BOOK/chapter??/reboot.xml >> $LOGDIR/$LOG 2>&1 159 210 160 echo "done" 211 161
Note:
See TracChangeset
for help on using the changeset viewer.