Changeset 9c9775f for common/makefile-functions
- Timestamp:
- 09/19/2007 04:50:48 PM (17 years ago)
- Branches:
- experimental
- Children:
- 3778352
- Parents:
- 0510381
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/makefile-functions
r0510381 r9c9775f 11 11 12 12 OFF = "[0m" 13 BOLD = "[1m"14 13 REVERSE = "[7m" 15 14 15 tab_ = " " 16 nl_ = "" 17 18 #==== BUILD MESSAGES === 16 19 17 20 define 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) 25 endef 26 27 define sh_echo_PHASE 28 echo $(BOLD)--------------------------------------------------------------------------------;\ 29 echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts; \ 30 echo $(BOLD)--------------------------------------------------------------------------------echo $(WHITE) 23 31 endef 24 32 … … 31 39 32 40 define echo_SULUSER_request 33 @clear34 41 @echo $(BOLD)-------------------------------------------------------------------------------- 35 42 @echo $(BOLD)$(BLUE)$@ 36 43 @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF) 37 @echo su requires a password44 @echo sudo requires a password 38 45 endef 39 46 40 47 define echo_CHROOT_request 41 @clear42 48 @echo $(BOLD)-------------------------------------------------------------------------------- 43 49 @echo $(BOLD)$(BLUE)$@ … … 51 57 endef 52 58 59 #======================= 60 61 62 #=== BUILD FUNCTIONS === 63 53 64 define remove_existing_dirs 54 65 @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \ 55 66 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; 58 72 endef 59 73 … … 61 75 @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \ 62 76 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; 82 endef 83 84 #==# 85 86 define unpack 87 @cd $(SRCSDIR) && \ 88 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) 89 endef 90 91 define unpack2 92 @cd $(SRC) && \ 93 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST) 94 endef 95 96 #==# 86 97 87 98 define get_pkg_root … … 105 116 endef 106 117 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 120 define touch_timestamp 121 @touch $(SRC)/timestamp-marker && sleep 1 122 endef 123 124 define touch_timestamp_LUSER 125 @touch $(SRCSDIR)/timestamp-marker && sleep 1 126 endef 127 128 define 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) 132 endef 133 134 define 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) 138 endef 139 140 #==@ 141 142 define remove_build_dirs 143 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \ 144 rm -rf $(SRCSDIR)/$$ROOT && \ 145 rm -rf $(SRCSDIR)/$(1)-build 146 endef 147 148 define remove_build_dirs2 149 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \ 150 rm -rf $(SRC)/$$ROOT && \ 151 rm -rf $(SRC)/$(1)-build 152 endef 153 154 #==# 155 156 define 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 165 endef 166 167 #======================= 168 169 170 #==== FINAL MESSAGES === 121 171 122 172 define 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) 131 182 endef 132 183 … … 136 187 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD) 137 188 @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) 139 190 @echo -------------------------------------------------------------------------------- 140 191 @echo … … 142 193 @echo the next steps:$(WHITE) 143 194 @echo 144 @echo -e \\t- Enter to the chroot using the command found145 @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 and153 @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-loader159 @echo -e \\tinstalled on the new system.160 @echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter161 @echo -e \\tthe chroot and be sure that /dev is populated with the162 @echo -e \\trequired devices before configure the boot-loader. When ready,163 @echo -e \\texit from the chroot and umount the filesystems195 @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 164 215 @echo 165 216 @echo If you are an experienced LFS user, several of those steps can be … … 168 219 @echo $(BOLD) 169 220 @echo -------------------------------------------------------------------------------- 170 @echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)221 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD) 171 222 @echo --------------------------------------------------------------------------------$(WHITE) 172 223 endef … … 177 228 @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD) 178 229 @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) 180 231 @echo -------------------------------------------------------------------------------- 181 232 @echo 182 233 @echo The build is not complete. Follow the next steps:$(WHITE) 183 234 @echo 184 @echo -e \\t- Edit or create $(MOUNT_PT)/etc/fstab185 @echo -e \\tand 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. 186 237 @echo $(BOLD) 187 238 @echo $(BOLD)$(YELLOW) … … 189 240 @echo 2.Boot the new partition. 190 241 @echo 3.Once you are logged in issue the following commands 191 @echo -e \\t $(BOLD})cd /jhalfs192 @echo -e \\t$(BOLD)make makesys242 @echo $(tab_) $(BOLD)cd /jhalfs 243 @echo $(tab_) $(BOLD)make makesys 193 244 @echo The build process should resume. Follow any instructions that appear. 194 245 @echo -------------------------------------------------------------------------------- 195 @echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)246 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD) 196 247 @echo --------------------------------------------------------------------------------$(WHITE) 197 248 endef
Note:
See TracChangeset
for help on using the changeset viewer.