Changeset d68eb1b for LFS


Ignore:
Timestamp:
01/12/2014 09:40:20 PM (10 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
2.4, ablfs-more, legacy, new_features, trunk
Children:
b97ed5b
Parents:
7735c7a
Message:

Major change to th scripts layout:

  • Do not put the chroot commands in $PROGNAME-commands, but rather in a separate directory chroot-scripts
  • Use the commands in the chroot-scripts directory to generate the CHROOT variables in Makefile
  • The commands are extracted to $PROGNAME-commands only if they do not have role="nodump attribute and they do not begin with "chroot" (for compatibility with previous books where chroot commands did not have the role="nodump" attribute.
Location:
LFS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LFS/lfs.xsl

    r7735c7a rd68eb1b  
    5555                  count(descendant::screen/userinput) &gt; 0 and
    5656                  count(descendant::screen/userinput) &gt;
    57                       count(descendant::screen[@role='nodump'])">
     57                      count(descendant::screen[@role='nodump']) and
     58                  count(descendant::screen/userinput) &gt;
     59                      count(descendant::screen/userinput[starts-with(string(),'chroot')])">
     60<!-- The last condition is a hack to allow previous versions of the
     61     book where the chroot commands did not have role="nodump".
     62     It only works if the chroot command is the only one on the page -->
    5863        <!-- The dirs names -->
    5964      <xsl:variable name="pi-dir" select="../processing-instruction('dbhtml')"/>
     
    134139                                                        ]//userinput"/>
    135140      </xsl:if>
    136       <xsl:if test="not(@id='ch-system-chroot') and
    137                     not(@id='ch-system-revisedchroot')">
    138         <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
    139       </xsl:if>
     141      <xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"&#xA;</xsl:text>
    140142      <xsl:text>exit&#xA;</xsl:text>
    141143    </exsl:document>
     
    144146
    145147  <xsl:template match="sect2">
    146     <!--XML::Parser is on the same page as Perl. The present code is OK
    147         except for PKG_DEST and PKGDIR, which would be the same as for Perl.
    148         so set them to valid values.
    149         Since rev 10281, that is no more true. So comment out.
    150     <xsl:if test="contains(string(./title),'XML::Parser')">
    151       <xsl:text>PKGDIR=$(dirname $PKGDIR)/</xsl:text>
    152       <xsl:copy-of select="substring-after(.//userinput[@remap='pre'], 'cd ')"/>
    153       <xsl:text>
    154 PKG_DEST=$(dirname $PKGDIR)/000-xml-parser
    155 </xsl:text>
    156     </xsl:if>-->
    157148    <xsl:apply-templates
    158149      select=".//screen[not(@role) or
  • LFS/master.sh

    r7735c7a rd68eb1b  
    198198    this_script=`basename $file`
    199199
    200     # We'll run the chroot commands differently than the others, so skip them in the
    201     # dependencies and target creation.
     200    # Skip the "stripping" scripts if the user does not want to strip.
    202201    # Skip also linux-headers in iterative builds.
    203202    case "${this_script}" in
    204       *chroot)      continue ;;
    205203      *stripping*) [[ "${STRIP}" = "n" ]] && continue ;;
    206204      *linux-headers*) [[ -n "$N" ]] && continue ;;
     
    210208    name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@' -e 's,'$N',,'`
    211209
    212     # Find the version of the command files, if it corresponds with the building of
    213     # a specific package. We need this here to can skip scripts not needed for
    214     # iterations rebuilds
     210    # Find the tarball corresponding to our script.
     211    # If it doesn't, we skip it in iterations rebuilds (except stripping).
    215212    pkg_tarball=$(get_package_tarball_name $name)
    216213    pkg_version=$(get_package_version $pkg_tarball)
     
    256253      case $name in
    257254        binutils | gcc | glibc | gmp | mpfr )
    258           [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version"
     255          [[ "$TEST" != "0" ]] &&
     256             CHROOT_wrt_test_log "${this_script}" "$pkg_version"
    259257          ;;
    260258        * )
    261           [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version"
     259          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] &&
     260             CHROOT_wrt_test_log "${this_script}" "$pkg_version"
    262261          ;;
    263262      esac
     
    433432  CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
    434433  i=1
    435   for file in chapter06/*chroot* ; do
     434  for file in ../chroot-scripts/*chroot* ; do
    436435    chroot=`cat $file | \
    437436            sed -e "s@chroot@$CHROOT_LOC@" \
     
    442441                -e 's|\\$|&&|g' \
    443442                -e 's|exit||g' \
    444                 -e 's|$| -c|' \
    445443                -e 's|"$$LFS"|$(MOUNT_PT)|' \
    446444                -e 's|set -e||' \
     
    495493mk_CHROOT: mk_SUDO
    496494        @\$(call echo_CHROOT_request)
    497         @( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT")
     495        @( sudo \$(CHROOT1) -c "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT")
    498496        @touch \$@
    499497
    500498mk_BOOT: mk_CHROOT
    501499        @\$(call echo_CHROOT_request)
    502         @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
     500        @( sudo \$(CHROOT2) -c "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
    503501        @touch \$@
    504502
     
    506504        @if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
    507505          \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
    508           (sudo \$(CHROOT2) "make -C $BLFS_ROOT/work"); \\
     506          (sudo \$(CHROOT2) -c "make -C $BLFS_ROOT/work"); \\
    509507        fi;
    510508        @touch \$@
     
    514512          \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
    515513          sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
    516           (sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
     514          (sudo \$(CHROOT2) -c "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
    517515        fi;
    518516        @touch \$@
     
    546544
    547545chroot: devices
    548         sudo /usr/sbin/chroot \$(MOUNT_PT) /tools/bin/env -i \\
    549       HOME=/root TERM=\$(TERM) PS1='\\u:\\w\\\$\$ ' \\
    550       PATH=/bin:/usr/bin:/sbin:/usr/sbin \\
    551       /tools/bin/bash --login
     546        sudo \$(CHROOT2)
    552547        \$(MAKE) teardown
    553548
Note: See TracChangeset for help on using the changeset viewer.