Changeset d68eb1b for LFS/master.sh


Ignore:
Timestamp:
01/12/2014 09:40:20 PM (11 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.