Changeset 9199a13


Ignore:
Timestamp:
06/10/2006 04:48:25 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
966cb20
Parents:
e35e794
Message:

Merged r2754:2768 from trunk.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • CLFS/master.sh

    re35e794 r9199a13  
    2121023-creatingtoolsdir:
    2222        @\$(call echo_message, Building)
    23         @mkdir -v \$(MOUNT_PT)/tools && \\
    24         rm -fv /tools && \\
    25         ln -sv \$(MOUNT_PT)/tools /
     23        @mkdir \$(MOUNT_PT)/tools && \\
     24        rm -f /tools && \\
     25        ln -s \$(MOUNT_PT)/tools /
    2626        @if [ ! -d \$(MOUNT_PT)/sources ]; then \\
    2727                mkdir \$(MOUNT_PT)/sources; \\
    2828        fi;
    2929        @chmod a+wt \$(MOUNT_PT)/sources && \\
    30         touch \$@
     30        touch \$@ && \\
     31        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     32        echo --------------------------------------------------------------------------------\$(WHITE)
    3133
    3234024-creatingcrossdir: 023-creatingtoolsdir
    3335        @mkdir -v \$(MOUNT_PT)/cross-tools && \\
    34         rm -fv /cross-tools && \\
    35         ln -sv \$(MOUNT_PT)/cross-tools /
    36         @touch \$@
     36        rm -f /cross-tools && \\
     37        ln -s \$(MOUNT_PT)/cross-tools /
     38        @touch \$@ && \\
     39        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     40        echo --------------------------------------------------------------------------------\$(WHITE)
    3741
    3842025-addinguser:  024-creatingcrossdir
     
    4852        chown lfs \$(MOUNT_PT)/cross-tools && \\
    4953        chown lfs \$(MOUNT_PT)/sources && \\
    50         touch \$@
     54        touch \$@ && \\
     55        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     56        echo --------------------------------------------------------------------------------\$(WHITE)
    5157
    5258026-settingenvironment:  025-addinguser
    5359        @\$(call echo_message, Building)
    5460        @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
    55                 mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
     61                mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
    5662        fi;
    5763        @if [ -f /home/lfs/.bash_profile  -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
    58                 mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
     64                mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
    5965        fi;
    6066        @echo "set +h" > /home/lfs/.bashrc && \\
     
    7480        @chown lfs:lfs /home/lfs/.bashrc && \\
    7581        touch envars && \\
    76         touch \$@
     82        touch \$@ && \\
     83        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     84        echo --------------------------------------------------------------------------------\$(WHITE)
    7785EOF
    7886) >> $MKFILE.tmp
     
    139147    #
    140148    # Include a touch of the target name so make can check if it's already been made.
    141     echo -e '\t@touch $@' >> $MKFILE.tmp
     149    wrt_touch
    142150    #
    143151    #--------------------------------------------------------------------#
     
    192200    #
    193201    # Include a touch of the target name so make can check if it's already been made.
    194     echo -e '\t@touch $@' >> $MKFILE.tmp
     202    wrt_touch
    195203    #
    196204    #--------------------------------------------------------------------#
     
    276284    #
    277285    # Include a touch of the target name so make can check if it's already been made.
    278     echo -e '\t@touch $@' >> $MKFILE.tmp
     286    wrt_touch
    279287    #
    280288    #--------------------------------------------------------------------#
     
    342350    #
    343351    # Include a touch of the target name so make can check if it's already been made.
    344     echo -e '\t@touch $@' >> $MKFILE.tmp
     352    wrt_touch
    345353    #
    346354    #--------------------------------------------------------------------#
     
    396404    #
    397405    # Include a touch of the target name so make can check if it's already been made.
    398     echo -e '\t@touch $@' >> $MKFILE.tmp
     406    wrt_touch
    399407    #
    400408    #--------------------------------------------------------------------#
     
    451459    #
    452460    # Include a touch of the target name so make can check if it's already been made.
    453     echo -e '\t@touch $@' >> $MKFILE.tmp
     461    wrt_touch
    454462    #
    455463    #--------------------------------------------------------------------#
     
    561569    #
    562570    # Include a touch of the target name so make can check if it's already been made.
    563     echo -e '\t@touch $@' >> $MKFILE.tmp
     571    wrt_touch
    564572    #
    565573    #--------------------------------------------------------------------#
     
    674682    #
    675683    # Include a touch of the target name so make can check if it's already been made.
    676     echo -e '\t@touch $@' >> $MKFILE.tmp
     684    wrt_touch
    677685    #
    678686    #--------------------------------------------------------------------#
     
    736744    #
    737745    # Include a touch of the target name so make can check if it's already been made.
    738     echo -e '\t@touch $@' >> $MKFILE.tmp
     746    wrt_touch
    739747    #
    740748    #--------------------------------------------------------------------#
     
    797805    #
    798806    # Include a touch of the target name so make can check if it's already been made.
    799     echo -e '\t@touch $@' >> $MKFILE.tmp
     807    wrt_touch
    800808    #
    801809    #--------------------------------------------------------------------#
     
    871879    #
    872880    # Include a touch of the target name so make can check if it's already been made.
    873     echo -e '\t@touch $@' >> $MKFILE.tmp
     881    wrt_touch
    874882    #
    875883    #--------------------------------------------------------------------#
     
    951959    #
    952960    # Include a touch of the target name so make can check if it's already been made.
    953     echo -e '\t@touch $@' >> $MKFILE.tmp
     961    wrt_touch
    954962    #
    955963    #--------------------------------------------------------------------#
     
    10911099        @\$(call echo_message, Building)
    10921100        @if [ -f /home/lfs/.bashrc.XXX ]; then \\
    1093                 mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
     1101                mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
    10941102        fi;
    10951103        @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
    1096                 mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
     1104                mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
    10971105        fi;
    10981106        @chown lfs:lfs /home/lfs/.bash* && \\
    1099         touch \$@
     1107        touch \$@ && \\
     1108        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     1109        echo --------------------------------------------------------------------------------\$(WHITE)
    11001110
    11011111do-housekeeping:
    1102         -umount \$(MOUNT_PT)/dev/pts
    1103         -umount \$(MOUNT_PT)/dev/shm
    1104         -umount \$(MOUNT_PT)/dev
    1105         -umount \$(MOUNT_PT)/sys
    1106         -umount \$(MOUNT_PT)/proc
    1107         -if [ ! -f user-lfs-exist ]; then \\
     1112        @-umount \$(MOUNT_PT)/dev/pts
     1113        @-umount \$(MOUNT_PT)/dev/shm
     1114        @-umount \$(MOUNT_PT)/dev
     1115        @-umount \$(MOUNT_PT)/sys
     1116        @-umount \$(MOUNT_PT)/proc
     1117        @-if [ ! -f user-lfs-exist ]; then \\
    11081118                userdel lfs; \\
    11091119                rm -rf /home/lfs; \\
     
    11771187        fi;
    11781188        @chown lfs:lfs /home/lfs/.bash* && \\
    1179         touch \$@
     1189        touch \$@ && \\
     1190        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     1191        echo --------------------------------------------------------------------------------\$(WHITE)
    11801192
    11811193
  • HLFS/master.sh

    re35e794 r9199a13  
    3131020-creatingtoolsdir:
    3232        @\$(call echo_message, Building)
    33         @mkdir -v \$(MOUNT_PT)/tools && \\
    34         rm -fv /tools && \\
    35         ln -sv \$(MOUNT_PT)/tools /
     33        @mkdir \$(MOUNT_PT)/tools && \\
     34        rm -f /tools && \\
     35        ln -s \$(MOUNT_PT)/tools /
    3636        @if [ ! -d \$(MOUNT_PT)/sources ]; then \\
    3737                mkdir \$(MOUNT_PT)/sources; \\
    3838        fi;
    3939        @chmod a+wt \$(MOUNT_PT)/sources && \\
    40         touch \$@
     40        touch \$@ && \\
     41        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     42        echo --------------------------------------------------------------------------------\$(WHITE)
    4143
    4244021-addinguser:  020-creatingtoolsdir
     
    5052        @chown lfs \$(MOUNT_PT)/tools && \\
    5153        chown lfs \$(MOUNT_PT)/sources && \\
    52         touch \$@
     54        touch \$@ && \\
     55        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     56        echo --------------------------------------------------------------------------------\$(WHITE)
    5357
    5458022-settingenvironment:  021-addinguser
    5559        @\$(call echo_message, Building)
    5660        @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
    57                 mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
     61                mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
    5862        fi;
    5963        @if [ -f /home/lfs/.bash_profile  -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
    60                 mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
     64                mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
    6165        fi;
    6266        @echo "set +h" > /home/lfs/.bashrc && \\
     
    7377        chown lfs:lfs /home/lfs/.bashrc && \\
    7478        touch envars && \\
    75         touch \$@
     79        touch \$@ && \\
     80        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     81        echo --------------------------------------------------------------------------------\$(WHITE)
    7682EOF
    7783) >> $MKFILE.tmp
     
    198204
    199205    # Include a touch of the target name so make can check if it's already been made.
    200     echo -e '\t@touch $@' >> $MKFILE.tmp
     206    wrt_touch
    201207    #
    202208    #--------------------------------------------------------------------#
     
    366372
    367373    # Include a touch of the target name so make can check if it's already been made.
    368     echo -e '\t@touch $@' >> $MKFILE.tmp
     374    wrt_touch
    369375    #
    370376    #--------------------------------------------------------------------#
     
    458464
    459465    # Include a touch of the target name so make can check if it's already been made.
    460     echo -e '\t@touch $@' >> $MKFILE.tmp
     466    wrt_touch
    461467    #
    462468    #--------------------------------------------------------------------#
     
    573579        @\$(call echo_message, Building)
    574580        @if [ -f /home/lfs/.bashrc.XXX ]; then \\
    575                 mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
     581                mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
    576582        fi;
    577583        @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
    578                 mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
     584                mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
    579585        fi;
    580586        @chown lfs:lfs /home/lfs/.bash* && \\
    581         touch \$@
     587        touch \$@ && \\
     588        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     589        echo --------------------------------------------------------------------------------\$(WHITE)
    582590
    583591do-housekeeping:
    584         -umount \$(MOUNT_PT)/dev/pts
    585         -umount \$(MOUNT_PT)/dev/shm
    586         -umount \$(MOUNT_PT)/dev
    587         -umount \$(MOUNT_PT)/sys
    588         -umount \$(MOUNT_PT)/proc
    589         -if [ ! -f user-lfs-exist ]; then \\
     592        @-umount \$(MOUNT_PT)/dev/pts
     593        @-umount \$(MOUNT_PT)/dev/shm
     594        @-umount \$(MOUNT_PT)/dev
     595        @-umount \$(MOUNT_PT)/sys
     596        @-umount \$(MOUNT_PT)/proc
     597        @-if [ ! -f user-lfs-exist ]; then \\
    590598                userdel lfs; \\
    591599                rm -rf /home/lfs; \\
  • LFS/master.sh

    re35e794 r9199a13  
    2121020-creatingtoolsdir:
    2222        @\$(call echo_message, Building)
    23         @mkdir -v \$(MOUNT_PT)/tools && \\
    24         rm -fv /tools && \\
    25         ln -sv \$(MOUNT_PT)/tools / && \\
    26         touch \$@
     23        @mkdir \$(MOUNT_PT)/tools && \\
     24        rm -f /tools && \\
     25        ln -s \$(MOUNT_PT)/tools / && \\
     26        touch \$@ && \\
     27        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     28        echo --------------------------------------------------------------------------------\$(WHITE)
    2729
    2830021-addinguser:  020-creatingtoolsdir
     
    3638        @chown lfs \$(MOUNT_PT)/tools && \\
    3739        chmod a+wt \$(MOUNT_PT)/sources && \\
    38         touch \$@
     40        touch \$@ && \\
     41        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     42        echo --------------------------------------------------------------------------------\$(WHITE)
    3943
    4044022-settingenvironment:  021-addinguser
    4145        @\$(call echo_message, Building)
    4246        @if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
    43                 mv -v /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
     47                mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
    4448        fi;
    4549        @if [ -f /home/lfs/.bash_profile  -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
    46                 mv -v /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
     50                mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
    4751        fi;
    4852        @echo "set +h" > /home/lfs/.bashrc && \\
     
    5559        chown lfs:lfs /home/lfs/.bashrc && \\
    5660        touch envars && \\
    57         touch \$@
     61        touch \$@ && \\
     62        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     63        echo --------------------------------------------------------------------------------\$(WHITE)
    5864EOF
    5965) >> $MKFILE.tmp
     
    135141    # Include a touch of the target name so make can check
    136142    # if it's already been made.
    137     echo -e '\t@touch $@' >> $MKFILE.tmp
     143    wrt_touch
    138144    #
    139145    #--------------------------------------------------------------------#
     
    247253    # Include a touch of the target name so make can check
    248254    # if it's already been made.
    249     echo -e '\t@touch $@' >> $MKFILE.tmp
     255    wrt_touch
    250256    #
    251257    #--------------------------------------------------------------------#
     
    329335    # Include a touch of the target name so make can check
    330336    # if it's already been made.
    331     echo -e '\t@touch $@' >> $MKFILE.tmp
     337    wrt_touch
    332338    #
    333339    #--------------------------------------------------------------------#
     
    407413clean:  clean-chapter789 clean-chapter6 clean-chapter5 clean-chapter4
    408414
     415restart: restart_code all
     416
    409417clean-chapter4:
    410418        -if [ ! -f user-lfs-exist ]; then \\
     
    439447        @\$(call echo_message, Building)
    440448        @if [ -f /home/lfs/.bashrc.XXX ]; then \\
    441                 mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
     449                mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
    442450        fi;
    443451        @if [ -f /home/lfs/.bash_profile.XXX ]; then \\
    444                 mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
     452                mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
    445453        fi;
    446454        @chown lfs:lfs /home/lfs/.bash* && \\
    447         touch \$@
     455        touch \$@ && \\
     456        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     457        echo --------------------------------------------------------------------------------\$(WHITE)
    448458
    449459do_housekeeping:
    450         -umount \$(MOUNT_PT)/sys
    451         -umount \$(MOUNT_PT)/proc
    452         -umount \$(MOUNT_PT)/dev/shm
    453         -umount \$(MOUNT_PT)/dev/pts
    454         -umount \$(MOUNT_PT)/dev
    455         -if [ ! -f user-lfs-exist ]; then \\
     460        @-umount \$(MOUNT_PT)/sys
     461        @-umount \$(MOUNT_PT)/proc
     462        @-umount \$(MOUNT_PT)/dev/shm
     463        @-umount \$(MOUNT_PT)/dev/pts
     464        @-umount \$(MOUNT_PT)/dev
     465        @-if [ ! -f user-lfs-exist ]; then \\
    456466                userdel lfs; \\
    457467                rm -rf /home/lfs; \\
     468        fi;
     469
     470restart_code:
     471        @echo ">>> This feature is experimental, BUGS may exist"
     472
     473        @if [ ! -L /tools ]; then \\
     474          echo -e "\\nERROR::\\n /tools is NOT a symlink.. /tools must point to \$(MOUNT_PT)/tools\\n" && false;\\
     475        fi;
     476
     477        @if [ ! -e /tools ]; then \\
     478          echo -e "\\nERROR::\\nThe target /tools points to does not exist.\\nVerify the target.. \$(MOUNT_PT)/tools\\n" && false;\\
     479        fi;
     480
     481        @if ! stat -c %N /tools | grep "\$(MOUNT_PT)/tools" >/dev/null ; then \\
     482          echo -e "\\nERROR::\\nThe symlink \\"/tools\\" does not point to \\"\$(MOUNT_PT)/tools\\".\\nCorrect the problem and rerun\\n" && false;\\
     483        fi;
     484
     485        @if [ -f ???-kernfs ]; then \\
     486          mkdir -pv \$(MOUNT_PT)/{dev,proc,sys};\\
     487          if [ ! -e \$(MOUNT_PT)/dev/console ]; then \\
     488            mknod -m 600 \$(MOUNT_PT)/dev/console c 5 1;\\
     489          fi;\\
     490          if [ ! -e \$(MOUNT_PT)/dev/null ]; then \\
     491            mknod -m 666 \$(MOUNT_PT)/dev/null c 1 3;\\
     492          fi;\\
     493          if !  mount -l | grep bind >/dev/null ; then \\
     494            mount --bind /dev \$(MOUNT_PT)/dev;\\
     495          fi;\\
     496          if ! mount -l | grep "\$(MOUNT_PT)/dev/pts" >/dev/null ; then \\
     497            mount -vt devpts devpts \$(MOUNT_PT)/dev/pts;\\
     498          fi;\\
     499          if ! mount -l | grep "\$(MOUNT_PT)/dev/shm" >/dev/null ; then \\
     500            mount -vt tmpfs shm \$(MOUNT_PT)/dev/shm;\\
     501          fi;\\
     502          if ! mount -l | grep "\$(MOUNT_PT)/proc" >/dev/null ; then \\
     503            mount -vt proc proc \$(MOUNT_PT)/proc;\\
     504          fi;\\
     505          if ! mount -l | grep "$\(MOUNT_PT)/sys" >/dev/null ; then \\
     506            mount -vt sysfs sysfs \$(MOUNT_PT)/sys;\\
     507          fi;\\
    458508        fi;
    459509
  • common/common-functions

    re35e794 r9199a13  
    219219        [[ -n \$\$ROOT ]] && \\
    220220        rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
    221         if [ -e \$(MOUNT_PT)\$(SRC)/${PKG_NAME%%-*}-build ]; then \\
    222                 rm -rf \$(MOUNT_PT)\$(SRC)/${PKG_NAME%%-*}-build; \\
     221        if [ -e \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build ]; then \\
     222                rm -rf \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build; \\
    223223        fi;
    224224EOF
     
    236236        [[ -n \$\$ROOT ]] && \\
    237237        rm -rf \$(SRC)/\$\$ROOT && \\
    238         if [ -e \$(SRC)/${PKG_NAME%%-*}-build ]; then \\
    239                 rm -rf \$(SRC)/${PKG_NAME%%-*}-build; \\
     238        if [ -e \$(SRC)/${PKG_NAME%-*}-build ]; then \\
     239                rm -rf \$(SRC)/${PKG_NAME%-*}-build; \\
    240240        fi;
    241241EOF
     
    460460                rm -r \$(SRC)/$name-build; \\
    461461        fi;
     462EOF
     463) >> $MKFILE.tmp
     464}
     465
     466
     467#----------------------------------#
     468wrt_touch() {                      #
     469#----------------------------------#
     470(
     471cat << EOF
     472        @touch  \$@ && \\
     473        sleep .25 && \\
     474        echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     475        echo --------------------------------------------------------------------------------\$(WHITE)
    462476EOF
    463477) >> $MKFILE.tmp
  • common/func_compare.sh

    re35e794 r9199a13  
    102102
    103103#----------------------------------#
    104 wrt_logs() {             #
     104wrt_logs() {                       #
    105105#----------------------------------#
    106106  local ITERATION=iteration-$1
     
    112112        mv ${LOGS} $ITERATION && \\
    113113        popd 1> /dev/null
    114         @touch \$@
     114        @touch \$@ && \\
     115        echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
     116        echo --------------------------------------------------------------------------------\$(WHITE)
    115117EOF
    116118) >> $MKFILE.tmp
  • common/makefile-functions

    re35e794 r9199a13  
    1313  @echo --------------------------------------------------------------------------------
    1414  @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)
    15   @echo --------------------------------------------------------------------------------$(WHITE)
     15  @echo $(WHITE)
    1616endef
    1717
     
    5757  @echo -e \\texcept if building CLFS with METHOO=boot.
    5858  @echo
    59   @echo -e \\t- Set a password for the root user
     59  @echo -e \\t- Set a password for the root user.
    6060  @echo
    6161  @echo -e \\t- Edit /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
     
    6464  @echo -e \\tany other configuration file required to suit your needs.
    6565  @echo
    66   @echo -e \\t- Set-up the boot loader. See the relevant book section.
     66  @echo -e \\t- Exit from the chroot.
    6767  @echo
    68   @echo -e \\t- Unmount the filesystems.
     68  @echo -e \\t- Set-up the boot loader, except if building CLFS with METHOO=boot.
     69  @echo -e \\tYou can set-up the host bootloader or the new boot-loader
     70  @echo -e \\tinstalled on the new system.
     71  @echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter
     72  @echo -e \\tto the chroot and be sure that /dev is populated with the
     73  @echo -e \\trequired devices before configure the boot-loader. When ready,
     74  @echo -e \\texit from the chroot and umount the filesystems
    6975  @echo
    7076  @echo If you are an experienced LFS user, several of those steps can be
  • common/progress_bar.sh

    re35e794 r9199a13  
    55set -e
    66
     7# Be sure that we know the taget name
    78[[ -z $1 ]] && exit
     9TARGET=$1  # Remember the target build we are looking for
    810
    9 if [ ! -f $1 ] ; then
    10   while fuser -v . 2>&1 | grep make >/dev/null ; do
    11     echo -n "."
    12     sleep 1
    13     [[ -f $1 ]] && exit
    14   done
    15 fi
     11declare -r  CSI=$'\e['  # DEC terminology, Control Sequence Introducer
     12declare -r  CURSOR_OFF=${CSI}$'?25l'
     13declare -r  CURSOR_ON=${CSI}$'?25h'
     14declare -r  ERASE_LINE=${CSI}$'2K'
     15declare -r  FRAME_OPEN=${CSI}$'2G['
     16declare -r  FRAME_CLOSE=${CSI}$'63G]'
     17declare -r  TS_POSITION=${CSI}$'65G'
     18declare -a  RESET_LINE=${CURSOR_OFF}${ERASE_LINE}${FRAME_OPEN}${FRAME_CLOSE}
     19
     20declare -a  GRAPHIC_STR="| / - \\ + "
     21declare -i  SEC=0  # Seconds accumulator
     22declare -i  PREV_SEC=0
     23
     24
     25write_or_exit() {
     26    # make has been killed or failed or run to completion, leave
     27  if ! fuser -v . 2>&1 | grep make >/dev/null ; then
     28     echo -n "${CURSOR_ON}" && exit
     29  fi
     30    # Target build complete, leave.
     31  [[ -f ${TARGET} ]] && echo -n "${CURSOR_ON}" && exit
     32    # It is safe to write to the screen
     33  echo -n "$1"
     34}
     35
     36  # initialize screen
     37write_or_exit "${RESET_LINE}${TS_POSITION}0 min. 0 sec. "
     38
     39  # loop forever..
     40while true ; do
     41
     42      # Loop through the animation string
     43    for GRAPHIC_CHAR in ${GRAPHIC_STR} ; do
     44      write_or_exit "${CSI}$((SEC + 3))G${GRAPHIC_CHAR}"
     45      sleep .12 # This value MUST be less than .2 seconds.
     46    done
     47
     48      # A BASH internal variable, the number of seconds the script
     49      # has been running. modulo convert to 0-59
     50    SEC=$(($SECONDS % 60))
     51
     52      # Detect rollover of the seconds.
     53    (( PREV_SEC > SEC )) && write_or_exit "${RESET_LINE}"
     54    (( PREV_SEC = SEC ))
     55
     56      # Display the accumulated time. div minutes.. modulo seconds.
     57    write_or_exit "${TS_POSITION}$(($SECONDS / 60)) min. $SEC sec. "
     58done
     59
     60exit
Note: See TracChangeset for help on using the changeset viewer.