source: common/makefile-functions@ dd529e9

experimental
Last change on this file since dd529e9 was f11a672, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Revising makefile-functions

  • Property mode set to 100644
File size: 6.7 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 @echo $(BOLD)--------------------------------------------------------------------------------
22 @echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
23 @echo $(BOLD)--------------------------------------------------------------------------------
24 @echo $(WHITE)
25endef
26
27define sh_echo_PHASE
28 echo $(BOLD)--------------------------------------------------------------------------------;\
29 echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts; \
30 echo $(BOLD)--------------------------------------------------------------------------------echo $(WHITE)
31endef
32
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)
44 @echo sudo requires a password
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
53
54define echo_message
55 @echo $(BOLD)--------------------------------------------------------------------------------
56 @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
57endef
58
59define housekeeping
60 @touch $@ && \
61 sleep .25 && \
62 echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
63 echo --------------------------------------------------------------------------------$(WHITE) && \
64 if [ "$(BREAKPOINT)" = "$@" ] ; then \
65 echo $(tab_)$(RED)The build has been stopped at $(BLUE)$@ $(RED)as requested$(WHITE) ; \
66 false ; \
67 fi
68endef
69
70#=======================
71
72
73#=== INSTALL_LOG FUNCTIONS ===
74
75define touch_timestamp
76 @touch $(SRC)/timestamp-marker && sleep 1
77endef
78
79define touch_timestamp_LUSER
80 @touch $(SRCSDIR)/timestamp-marker && sleep 1
81endef
82
83define log_new_files
84 @find / -xdev ! -path "/$(SCRIPT_ROOT)/*" ! -path "/tmp/*" ! -path "$(SRC)/*" \
85 -newer $(SRC)/timestamp-marker -not -type d \
86 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(crFILELOGDIR)/$(1)
87endef
88
89define log_new_files_LUSER
90 @find $(BASEDIR) -xdev ! -path "$(BASEDIR)/$(SCRIPT_ROOT)/*" ! -path "$(BASEDIR)/tmp/*" ! -path "$(SRCSDIR)/*" \
91 -newer $(SRCSDIR)/timestamp-marker -not -type d \
92 -printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(BASEDIR)$(crFILELOGDIR)/$(1)
93endef
94
95#=======================
96
97
98#==== FINAL MESSAGES ===
99
100define echo_report
101 echo ; \
102 echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created ; \
103 echo ; \
104 echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE) ; \
105 echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE) ; \
106 echo ; \
107 echo That will help us to keep more accurate SBU and ; \
108 echo disk usage values into the book. Thanks. ; \
109 echo $(BOLD)--------------------------------------------------------------------------------$(WHITE)
110endef
111
112define echo_finished
113 @echo $(BOLD)
114 @echo --------------------------------------------------------------------------------
115 @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
116 @echo --------------------------------------------------------------------------------
117 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
118 @echo --------------------------------------------------------------------------------
119 @echo
120 @echo To be able to boot your new system you need to follow
121 @echo the next steps:$(WHITE)
122 @echo
123 @echo $(tab_)- Enter to the chroot using the command found
124 @echo $(tab_)in the section -Entering the Chroot Environment-
125 @echo $(tab_)except if building CLFS with METHOD=boot.
126 @echo
127 @echo $(tab_)- Set a password for the root user.
128 @echo
129 @echo $(tab_)- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
130 @echo $(tab_)/etc/sysconfig/console, /etc/sysconfig/network,
131 @echo $(tab_)/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
132 @echo $(tab_)any other configuration file required to suit your needs.
133 @echo
134 @echo $(tab_)- Exit from the chroot.
135 @echo
136 @echo $(tab_)- Set-up the boot loader, except if building CLFS with METHOD=boot.
137 @echo $(tab_)You can set-up the host bootloader or the new boot-loader
138 @echo $(tab_)installed on the new system.
139 @echo $(tab_)If the last, you must to mount the virtual filesystems, re-enter
140 @echo $(tab_)the chroot and be sure that /dev is populated with the
141 @echo $(tab_)required devices before configure the boot-loader. When ready,
142 @echo $(tab_)exit from the chroot and umount the filesystems
143 @echo
144 @echo If you are an experienced LFS user, several of those steps can be
145 @echo skipped or done in a different way. But then, that is something
146 @echo that you already know and there is no need to discuss it here.
147 @echo $(BOLD)
148 @echo --------------------------------------------------------------------------------
149 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
150 @echo --------------------------------------------------------------------------------$(WHITE)
151endef
152
153define echo_boot_finished
154 @echo $(BOLD)
155 @echo --------------------------------------------------------------------------------
156 @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
157 @echo --------------------------------------------------------------------------------
158 @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
159 @echo --------------------------------------------------------------------------------
160 @echo
161 @echo The build is not complete. Follow the next steps:$(WHITE)
162 @echo
163 @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
164 @echo $(tab_) and any other configuration file required to suit your needs.
165 @echo $(BOLD)
166 @echo $(BOLD)$(YELLOW)
167 @echo 1.If it is necessary, transfer the newly created partition to the target machine
168 @echo 2.Boot the new partition.
169 @echo 3.Once you are logged in issue the following commands
170 @echo $(tab_) $(BOLD)cd /jhalfs
171 @echo $(tab_) $(BOLD)make makesys
172 @echo The build process should resume. Follow any instructions that appear.
173 @echo --------------------------------------------------------------------------------
174 @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
175 @echo --------------------------------------------------------------------------------$(WHITE)
176endef
Note: See TracBrowser for help on using the repository browser.