source: common/makefile-functions@ b11c10b

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

Reimplemented support for partial builds.

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