source: common/makefile-functions@ 5932971

2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since 5932971 was cd4466f, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Added BLFS_TOOL support to CLFS2 and some bug fixes.

  • Property mode set to 100644
File size: 7.1 KB
RevLine 
[877cc6a]1
2# $Id$
3
[045b2dc]4BOLD = "[0;1m"
5RED = "[1;31m"
6GREEN = "[0;32m"
7ORANGE = "[0;33m"
8BLUE = "[1;34m"
9WHITE = "[00m"
10YELLOW = "[1;33m"
11
12OFF = "[0m"
13REVERSE = "[7m"
14
[fc6076c]15tab_ = " "
16nl_ = ""
[045b2dc]17
[1f81129]18#==== BUILD MESSAGES ===
19
[045b2dc]20define echo_PHASE
21 @clear
22 @echo $(BOLD)--------------------------------------------------------------------------------
[f4d9a48]23 @echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
[045b2dc]24 @echo $(BOLD)--------------------------------------------------------------------------------
25 #echo $(WHITE)
26endef
27
28define echo_SU_request
29 @echo $(BOLD)--------------------------------------------------------------------------------
30 @echo $(BLUE)$@
31 @echo $(WHITE)ROOT privilege is required to perform a number commands
32 @echo sudo will request a password to all high privilege cmds to execute correctly
33endef
34
35define echo_SULUSER_request
36 @clear
37 @echo $(BOLD)--------------------------------------------------------------------------------
38 @echo $(BOLD)$(BLUE)$@
39 @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
[1f81129]40 @echo su requires a password
[045b2dc]41endef
42
43define echo_CHROOT_request
44 @clear
45 @echo $(BOLD)--------------------------------------------------------------------------------
46 @echo $(BOLD)$(BLUE)$@
47 @echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)
48 @echo a password is required
49endef
[877cc6a]50
51define echo_message
[045b2dc]52 @echo $(BOLD)--------------------------------------------------------------------------------
53 @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
[877cc6a]54endef
55
[1f81129]56#=======================
57
58
59#=== BUILD FUNCTIONS ===
60
[401f81e]61define remove_existing_dirs
62 @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
63 ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
64 rm -rf $(SRCSDIR)/$$ROOT && \
65 rm -rf $(SRCSDIR)/$${ROOT%-*}-build
66endef
67
68define remove_existing_dirs2
[045b2dc]69 @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
[401f81e]70 ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
71 rm -rf $(SRC)/$$ROOT && \
[d8851cf]72 rm -rf $(SRC)/$${ROOT%-*}-build
[401f81e]73endef
74
[1f81129]75#==#
[401f81e]76
[1f81129]77define unpack
78 @cd $(SRCSDIR) && \
79 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
[401f81e]80endef
81
[1f81129]82define unpack2
83 @cd $(SRC) && \
84 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
[401f81e]85endef
86
[1f81129]87#==#
88
[401f81e]89define get_pkg_root
90 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
91 if [ "$(1)" != "nouser" ]; then \
92 echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars; \
93 chown -R $(LUSER) $(SRCSDIR)/$$ROOT; \
94 else \
95 echo "export PKGDIR=$(crSRCSDIR)/$$ROOT" > envars; \
96 fi;
97endef
98
99define get_pkg_root2
100 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
101 echo "export PKGDIR=$(SRC)/$$ROOT" > envars
102endef
103
[045b2dc]104define get_pkg_root_LUSER
105 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
106 echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
107endef
108
[1f81129]109#==#
110
111define remove_build_dirs
112 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
113 rm -rf $(SRCSDIR)/$$ROOT && \
114 rm -rf $(SRCSDIR)/$(1)-build
[877cc6a]115endef
116
[1f81129]117define remove_build_dirs2
118 @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
119 rm -rf $(SRC)/$$ROOT && \
120 rm -rf $(SRC)/$(1)-build
[877cc6a]121endef
122
[1f81129]123#==#
124
125define housekeeping
126 @touch $@ && \
127 sleep .25 && \
128 echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
129 echo --------------------------------------------------------------------------------$(WHITE)
130
[877cc6a]131endef
132
[1f81129]133#=======================
134
135
136#==== FINAL MESSAGES ===
137
[453bef0]138define echo_report
[e780eda]139 @echo; \
140 echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created; \
141 echo; \
[cd4466f]142 echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE); \
[e780eda]143 echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE); \
144 echo; \
145 echo That will help us to keep more accurate SBU and; \
146 echo disk usage values into the book. Thanks.
[453bef0]147endef
148
[877cc6a]149define echo_finished
150 @echo $(BOLD)
151 @echo --------------------------------------------------------------------------------
152 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
153 @echo --------------------------------------------------------------------------------
[f4d9a48]154 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
[877cc6a]155 @echo --------------------------------------------------------------------------------
156 @echo
157 @echo To be able to boot your new system you need to follow
158 @echo the next steps:$(WHITE)
159 @echo
[f4d9a48]160 @echo $(tab_)- Enter to the chroot using the command found
161 @echo $(tab_)in the section -Entering the Chroot Environment-
162 @echo $(tab_)except if building CLFS with METHOD=boot.
[877cc6a]163 @echo
[f4d9a48]164 @echo $(tab_)- Set a password for the root user.
[877cc6a]165 @echo
[f4d9a48]166 @echo $(tab_)- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
167 @echo $(tab_)/etc/sysconfig/console, /etc/sysconfig/network,
168 @echo $(tab_)/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
169 @echo $(tab_)any other configuration file required to suit your needs.
[877cc6a]170 @echo
[f4d9a48]171 @echo $(tab_)- Exit from the chroot.
[877cc6a]172 @echo
[f4d9a48]173 @echo $(tab_)- Set-up the boot loader, except if building CLFS with METHOD=boot.
174 @echo $(tab_)You can set-up the host bootloader or the new boot-loader
175 @echo $(tab_)installed on the new system.
176 @echo $(tab_)If the last, you must to mount the virtual filesystems, re-enter
177 @echo $(tab_)the chroot and be sure that /dev is populated with the
178 @echo $(tab_)required devices before configure the boot-loader. When ready,
179 @echo $(tab_)exit from the chroot and umount the filesystems
[877cc6a]180 @echo
181 @echo If you are an experienced LFS user, several of those steps can be
182 @echo skipped or done in a different way. But then, that is something
183 @echo that you already know and there is no need to discuss it here.
184 @echo $(BOLD)
185 @echo --------------------------------------------------------------------------------
[f4d9a48]186 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
[877cc6a]187 @echo --------------------------------------------------------------------------------$(WHITE)
188endef
189
190define echo_boot_finished
191 @echo $(BOLD)
192 @echo --------------------------------------------------------------------------------
193 @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
194 @echo --------------------------------------------------------------------------------
[f4d9a48]195 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
[877cc6a]196 @echo --------------------------------------------------------------------------------
197 @echo
198 @echo The build is not complete. Follow the next steps:$(WHITE)
199 @echo
[f4d9a48]200 @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
201 @echo $(tab_) and any other configuration file required to suit your needs.
[877cc6a]202 @echo $(BOLD)
203 @echo $(BOLD)$(YELLOW)
204 @echo 1.If it is necessary, transfer the newly created partition to the target machine
205 @echo 2.Boot the new partition.
206 @echo 3.Once you are logged in issue the following commands
[d981bde]207 @echo $(tab_) $(BOLD)cd /jhalfs
[f4d9a48]208 @echo $(tab_) $(BOLD)make makesys
[877cc6a]209 @echo The build process should resume. Follow any instructions that appear.
210 @echo --------------------------------------------------------------------------------
[f4d9a48]211 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
[877cc6a]212 @echo --------------------------------------------------------------------------------$(WHITE)
213endef
Note: See TracBrowser for help on using the repository browser.