source: common/makefile-functions@ c5ff430

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

Reordered makefile_functions.

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