source: common/makefile-functions@ 830f28d

2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since 830f28d 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
Line 
1
2# $Id$
3
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
15tab_ = " "
16nl_ = ""
17
18#==== BUILD MESSAGES ===
19
20define echo_PHASE
21 @clear
22 @echo $(BOLD)--------------------------------------------------------------------------------
23 @echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
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)
40 @echo su requires a password
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
50
51define echo_message
52 @echo $(BOLD)--------------------------------------------------------------------------------
53 @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
54endef
55
56#=======================
57
58
59#=== BUILD FUNCTIONS ===
60
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
69 @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
70 ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
71 rm -rf $(SRC)/$$ROOT && \
72 rm -rf $(SRC)/$${ROOT%-*}-build
73endef
74
75#==#
76
77define unpack
78 @cd $(SRCSDIR) && \
79 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
80endef
81
82define unpack2
83 @cd $(SRC) && \
84 tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
85endef
86
87#==#
88
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
104define get_pkg_root_LUSER
105 @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
106 echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
107endef
108
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
115endef
116
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
121endef
122
123#==#
124
125define housekeeping
126 @touch $@ && \
127 sleep .25 && \
128 echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
129 echo --------------------------------------------------------------------------------$(WHITE)
130
131endef
132
133#=======================
134
135
136#==== FINAL MESSAGES ===
137
138define echo_report
139 @echo; \
140 echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created; \
141 echo; \
142 echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE); \
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.
147endef
148
149define echo_finished
150 @echo $(BOLD)
151 @echo --------------------------------------------------------------------------------
152 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
153 @echo --------------------------------------------------------------------------------
154 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
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
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.
163 @echo
164 @echo $(tab_)- Set a password for the root user.
165 @echo
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.
170 @echo
171 @echo $(tab_)- Exit from the chroot.
172 @echo
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
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 --------------------------------------------------------------------------------
186 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
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 --------------------------------------------------------------------------------
195 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
196 @echo --------------------------------------------------------------------------------
197 @echo
198 @echo The build is not complete. Follow the next steps:$(WHITE)
199 @echo
200 @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
201 @echo $(tab_) and any other configuration file required to suit your needs.
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
207 @echo $(tab_) $(BOLD)cd /jhalfs
208 @echo $(tab_) $(BOLD)make makesys
209 @echo The build process should resume. Follow any instructions that appear.
210 @echo --------------------------------------------------------------------------------
211 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
212 @echo --------------------------------------------------------------------------------$(WHITE)
213endef
Note: See TracBrowser for help on using the repository browser.