Ignore:
Timestamp:
09/19/2007 04:50:48 PM (17 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
3778352
Parents:
0510381
Message:

Updated experimental branch to current trunk code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/makefile-functions

    r0510381 r9c9775f  
    1111
    1212OFF     = "[0m"
    13 BOLD    = "[1m"
    1413REVERSE = "[7m"
    1514
     15tab_    = "     "
     16nl_     = ""
     17
     18#==== BUILD MESSAGES ===
    1619
    1720define echo_PHASE
    18   @clear
    19   @echo $(BOLD)--------------------------------------------------------------------------------
    20   @echo -e \\t\\tExecuting $(BLUE)$(1)$(WHITE) scripts
    21   @echo $(BOLD)--------------------------------------------------------------------------------
    22   #echo $(WHITE)
     21  @echo $(BOLD)--------------------------------------------------------------------------------
     22  @echo  $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
     23  @echo $(BOLD)--------------------------------------------------------------------------------
     24  @echo $(WHITE)
     25endef
     26
     27define sh_echo_PHASE
     28  echo $(BOLD)--------------------------------------------------------------------------------;\
     29  echo  $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts; \
     30  echo $(BOLD)--------------------------------------------------------------------------------echo $(WHITE)
    2331endef
    2432
     
    3139
    3240define echo_SULUSER_request
    33   @clear
    3441  @echo $(BOLD)--------------------------------------------------------------------------------
    3542  @echo $(BOLD)$(BLUE)$@
    3643  @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
    37   @echo su requires a password
     44  @echo sudo requires a password
    3845endef
    3946
    4047define echo_CHROOT_request
    41   @clear
    4248  @echo $(BOLD)--------------------------------------------------------------------------------
    4349  @echo $(BOLD)$(BLUE)$@
     
    5157endef
    5258
     59#=======================
     60
     61
     62#=== BUILD FUNCTIONS ===
     63
    5364define remove_existing_dirs
    5465  @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
    5566  ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
    56   rm -rf $(SRCSDIR)/$$ROOT && \
    57   rm -rf $(SRCSDIR)/$${ROOT%-*}-build
     67  [ -n "$$ROOT" ] && \
     68  if [ -d $(SRCDIR)/$$ROOT ]; then \
     69    rm -rf $(SRCSDIR)/$$ROOT && \
     70    rm -rf $(SRCSDIR)/$${ROOT%-*}-build; \
     71  fi;
    5872endef
    5973
     
    6175  @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
    6276  ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
    63   rm -rf $(SRC)/$$ROOT && \
    64   rm -rf $(SRC)/$${ROOT%-*}-build
    65 endef
    66 
    67 define remove_build_dirs
    68   @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
    69   rm -rf $(SRCSDIR)/$$ROOT && \
    70   rm -rf $(SRCSDIR)/$(1)-build
    71 endef
    72 
    73 define remove_build_dirs2
    74   @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
    75   rm -rf $(SRC)/$$ROOT && \
    76   rm -rf $(SRC)/$(1)-build
    77 endef
    78 
    79 define housekeeping
    80   @touch  $@ && \
    81   sleep .25 && \
    82   echo  -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
    83   echo --------------------------------------------------------------------------------$(WHITE)
    84 
    85 endef
     77  [ -n "$$ROOT" ] && \
     78  if [ -d $(SRC)/$$ROOT ]; then \
     79    rm -rf $(SRC)/$$ROOT && \
     80    rm -rf $(SRC)/$${ROOT%-*}-build; \
     81  fi;
     82endef
     83
     84#==#
     85
     86define unpack
     87  @cd $(SRCSDIR) && \
     88  tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
     89endef
     90
     91define unpack2
     92  @cd $(SRC) && \
     93  tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
     94endef
     95
     96#==#
    8697
    8798define get_pkg_root
     
    105116endef
    106117
    107 define unpack
    108   @cd $(SRCSDIR) && \
    109   tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
    110 endef
    111 
    112 define unpack2
    113   @cd $(SRCSDIR) && \
    114   /tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
    115 endef
    116 
    117 define unpack3
    118   @cd $(SRC) && \
    119   tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
    120 endef
     118#==#
     119
     120define touch_timestamp
     121  @touch $(SRC)/timestamp-marker && sleep 1
     122endef
     123
     124define touch_timestamp_LUSER
     125  @touch $(SRCSDIR)/timestamp-marker && sleep 1
     126endef
     127
     128define log_new_files
     129  @find / -xdev ! -path "/$(SCRIPT_ROOT)/*" ! -path "/tmp/*" ! -path "$(SRC)/*" \
     130  -newer $(SRC)/timestamp-marker -not -type d \
     131  -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(crFILELOGDIR)/$(1)
     132endef
     133
     134define log_new_files_LUSER
     135  @find $(BASEDIR) -xdev ! -path "$(BASEDIR)/$(SCRIPT_ROOT)/*" ! -path "$(BASEDIR)/tmp/*" ! -path "$(SRCSDIR)/*" \
     136  -newer $(SRCSDIR)/timestamp-marker -not -type d \
     137  -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(BASEDIR)$(crFILELOGDIR)/$(1)
     138endef
     139
     140#==@
     141
     142define remove_build_dirs
     143  @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
     144  rm -rf $(SRCSDIR)/$$ROOT && \
     145  rm -rf $(SRCSDIR)/$(1)-build
     146endef
     147
     148define remove_build_dirs2
     149  @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
     150  rm -rf $(SRC)/$$ROOT && \
     151  rm -rf $(SRC)/$(1)-build
     152endef
     153
     154#==#
     155
     156define housekeeping
     157  @touch  $@ && \
     158  sleep .25 && \
     159  echo  -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
     160  echo --------------------------------------------------------------------------------$(WHITE) && \
     161  if [ "$(BREAKPOINT)" = "$@" ] ; then \
     162     echo $(tab_)$(RED)The build has been stopped at $(BLUE)$@ $(RED)as requested$(WHITE) ; \
     163     false ; \
     164  fi
     165endef
     166
     167#=======================
     168
     169
     170#==== FINAL MESSAGES ===
    121171
    122172define echo_report
    123   @echo
    124   @echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created
    125   @echo
    126   @echo ${WHITE}Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE)
    127   @echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE)
    128   @echo
    129   @echo That will help us to keep more accurate SBU and
    130   @echo disk usage values into the book. Thanks.
     173  echo ; \
     174  echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created ; \
     175  echo ; \
     176  echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE) ; \
     177  echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE) ; \
     178  echo ; \
     179  echo That will help us to keep more accurate SBU and ; \
     180  echo disk usage values into the book. Thanks. ; \
     181  echo $(BOLD)--------------------------------------------------------------------------------$(WHITE)
    131182endef
    132183
     
    136187  @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
    137188  @echo --------------------------------------------------------------------------------
    138   @echo -e \\t\\t$(RED)W A R N I N G$(BOLD)
     189  @echo  $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
    139190  @echo --------------------------------------------------------------------------------
    140191  @echo
     
    142193  @echo the next steps:$(WHITE)
    143194  @echo
    144   @echo -e \\t- Enter to the chroot using the command found
    145   @echo -e \\tin the section -Entering the Chroot Environment-
    146   @echo -e \\texcept if building CLFS with METHOD=boot.
    147   @echo
    148   @echo -e \\t- Set a password for the root user.
    149   @echo
    150   @echo -e \\t- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
    151   @echo -e \\t/etc/sysconfig/console, /etc/sysconfig/network,
    152   @echo -e \\t/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
    153   @echo -e \\tany other configuration file required to suit your needs.
    154   @echo
    155   @echo -e \\t- Exit from the chroot.
    156   @echo
    157   @echo -e \\t- Set-up the boot loader, except if building CLFS with METHOD=boot.
    158   @echo -e \\tYou can set-up the host bootloader or the new boot-loader
    159   @echo -e \\tinstalled on the new system.
    160   @echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter
    161   @echo -e \\tthe chroot and be sure that /dev is populated with the
    162   @echo -e \\trequired devices before configure the boot-loader. When ready,
    163   @echo -e \\texit from the chroot and umount the filesystems
     195  @echo  $(tab_)- Enter to the chroot using the command found
     196  @echo  $(tab_)in the section -Entering the Chroot Environment-
     197  @echo  $(tab_)except if building CLFS with METHOD=boot.
     198  @echo
     199  @echo  $(tab_)- Set a password for the root user.
     200  @echo
     201  @echo  $(tab_)- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
     202  @echo  $(tab_)/etc/sysconfig/console, /etc/sysconfig/network,
     203  @echo  $(tab_)/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
     204  @echo  $(tab_)any other configuration file required to suit your needs.
     205  @echo
     206  @echo  $(tab_)- Exit from the chroot.
     207  @echo
     208  @echo  $(tab_)- Set-up the boot loader, except if building CLFS with METHOD=boot.
     209  @echo  $(tab_)You can set-up the host bootloader or the new boot-loader
     210  @echo  $(tab_)installed on the new system.
     211  @echo  $(tab_)If the last, you must to mount the virtual filesystems, re-enter
     212  @echo  $(tab_)the chroot and be sure that /dev is populated with the
     213  @echo  $(tab_)required devices before configure the boot-loader. When ready,
     214  @echo  $(tab_)exit from the chroot and umount the filesystems
    164215  @echo
    165216  @echo If you are an experienced LFS user, several of those steps can be
     
    168219  @echo $(BOLD)
    169220  @echo --------------------------------------------------------------------------------
    170   @echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
     221  @echo  $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
    171222  @echo --------------------------------------------------------------------------------$(WHITE)
    172223endef
     
    177228  @echo        $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
    178229  @echo --------------------------------------------------------------------------------
    179   @echo -e \\t\\t$(RED)W A R N I N G$(BOLD)
     230  @echo  $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
    180231  @echo --------------------------------------------------------------------------------
    181232  @echo
    182233  @echo The build is not complete. Follow the next steps:$(WHITE)
    183234  @echo
    184   @echo -e \\t- Edit or create $(MOUNT_PT)/etc/fstab
    185   @echo -e \\t and any other configuration file required to suit your needs.
     235  @echo  $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
     236  @echo  $(tab_) and any other configuration file required to suit your needs.
    186237  @echo $(BOLD)
    187238  @echo $(BOLD)$(YELLOW)
     
    189240  @echo  2.Boot the new partition.
    190241  @echo  3.Once you are logged in issue the following commands
    191   @echo -e \\t $(BOLD})cd /jhalfs
    192   @echo -e \\t $(BOLD)make makesys
     242  @echo  $(tab_) $(BOLD)cd /jhalfs
     243  @echo  $(tab_) $(BOLD)make makesys
    193244  @echo  The build process should resume. Follow any instructions that appear.
    194245  @echo --------------------------------------------------------------------------------
    195   @echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
     246  @echo  $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
    196247  @echo --------------------------------------------------------------------------------$(WHITE)
    197248endef
Note: See TracChangeset for help on using the changeset viewer.