1 |
|
---|
2 | # $Id$
|
---|
3 |
|
---|
4 | BOLD = "[0;1m"
|
---|
5 | RED = "[1;31m"
|
---|
6 | GREEN = "[0;32m"
|
---|
7 | ORANGE = "[0;33m"
|
---|
8 | BLUE = "[1;34m"
|
---|
9 | WHITE = "[00m"
|
---|
10 | YELLOW = "[1;33m"
|
---|
11 |
|
---|
12 | OFF = "[0m"
|
---|
13 | BOLD = "[1m"
|
---|
14 | REVERSE = "[7m"
|
---|
15 |
|
---|
16 | tab_ = " "
|
---|
17 | nl_ = ""
|
---|
18 |
|
---|
19 | #==== BUILD MESSAGES ===
|
---|
20 |
|
---|
21 | define echo_PHASE
|
---|
22 | @clear
|
---|
23 | @echo $(BOLD)--------------------------------------------------------------------------------
|
---|
24 | @echo $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
|
---|
25 | @echo $(BOLD)--------------------------------------------------------------------------------
|
---|
26 | #echo $(WHITE)
|
---|
27 | endef
|
---|
28 |
|
---|
29 | define 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
|
---|
34 | endef
|
---|
35 |
|
---|
36 | define 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)
|
---|
41 | @echo su requires a password
|
---|
42 | endef
|
---|
43 |
|
---|
44 | define 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
|
---|
50 | endef
|
---|
51 |
|
---|
52 | define echo_message
|
---|
53 | @echo $(BOLD)--------------------------------------------------------------------------------
|
---|
54 | @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
|
---|
55 | endef
|
---|
56 |
|
---|
57 | #=======================
|
---|
58 |
|
---|
59 |
|
---|
60 | #=== BUILD FUNCTIONS ===
|
---|
61 |
|
---|
62 | define 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
|
---|
67 | endef
|
---|
68 |
|
---|
69 | define remove_existing_dirs2
|
---|
70 | @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
|
---|
71 | ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
|
---|
72 | rm -rf $(SRC)/$$ROOT && \
|
---|
73 | rm -rf $(SRC)/$${ROOT%-*}-build
|
---|
74 | endef
|
---|
75 |
|
---|
76 | #==#
|
---|
77 |
|
---|
78 | define unpack
|
---|
79 | @cd $(SRCSDIR) && \
|
---|
80 | tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
|
---|
81 | endef
|
---|
82 |
|
---|
83 | define unpack2
|
---|
84 | @cd $(SRC) && \
|
---|
85 | tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
|
---|
86 | endef
|
---|
87 |
|
---|
88 | #==#
|
---|
89 |
|
---|
90 | define 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;
|
---|
98 | endef
|
---|
99 |
|
---|
100 | define get_pkg_root2
|
---|
101 | @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
---|
102 | echo "export PKGDIR=$(SRC)/$$ROOT" > envars
|
---|
103 | endef
|
---|
104 |
|
---|
105 | define get_pkg_root_LUSER
|
---|
106 | @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
---|
107 | echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
|
---|
108 | endef
|
---|
109 |
|
---|
110 | #==#
|
---|
111 |
|
---|
112 | define remove_build_dirs
|
---|
113 | @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
---|
114 | rm -rf $(SRCSDIR)/$$ROOT && \
|
---|
115 | rm -rf $(SRCSDIR)/$(1)-build
|
---|
116 | endef
|
---|
117 |
|
---|
118 | define remove_build_dirs2
|
---|
119 | @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
---|
120 | rm -rf $(SRC)/$$ROOT && \
|
---|
121 | rm -rf $(SRC)/$(1)-build
|
---|
122 | endef
|
---|
123 |
|
---|
124 | #==#
|
---|
125 |
|
---|
126 | define housekeeping
|
---|
127 | @touch $@ && \
|
---|
128 | sleep .25 && \
|
---|
129 | echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
|
---|
130 | echo --------------------------------------------------------------------------------$(WHITE)
|
---|
131 |
|
---|
132 | endef
|
---|
133 |
|
---|
134 | #=======================
|
---|
135 |
|
---|
136 |
|
---|
137 | #==== FINAL MESSAGES ===
|
---|
138 |
|
---|
139 | define 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.
|
---|
148 | endef
|
---|
149 |
|
---|
150 | define echo_finished
|
---|
151 | @echo $(BOLD)
|
---|
152 | @echo --------------------------------------------------------------------------------
|
---|
153 | @echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
|
---|
154 | @echo --------------------------------------------------------------------------------
|
---|
155 | @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
|
---|
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
|
---|
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.
|
---|
164 | @echo
|
---|
165 | @echo $(tab_)- Set a password for the root user.
|
---|
166 | @echo
|
---|
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.
|
---|
171 | @echo
|
---|
172 | @echo $(tab_)- Exit from the chroot.
|
---|
173 | @echo
|
---|
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
|
---|
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 --------------------------------------------------------------------------------
|
---|
187 | @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
|
---|
188 | @echo --------------------------------------------------------------------------------$(WHITE)
|
---|
189 | endef
|
---|
190 |
|
---|
191 | define echo_boot_finished
|
---|
192 | @echo $(BOLD)
|
---|
193 | @echo --------------------------------------------------------------------------------
|
---|
194 | @echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
|
---|
195 | @echo --------------------------------------------------------------------------------
|
---|
196 | @echo $(tab_)$(tab_)$(RED)W A R N I N G$(BOLD)
|
---|
197 | @echo --------------------------------------------------------------------------------
|
---|
198 | @echo
|
---|
199 | @echo The build is not complete. Follow the next steps:$(WHITE)
|
---|
200 | @echo
|
---|
201 | @echo $(tab_)- Edit or create $(MOUNT_PT)/etc/fstab
|
---|
202 | @echo $(tab_) and any other configuration file required to suit your needs.
|
---|
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
|
---|
208 | @echo $(tab_) $(BOLD)cd /jhalfs
|
---|
209 | @echo $(tab_) $(BOLD)make makesys
|
---|
210 | @echo The build process should resume. Follow any instructions that appear.
|
---|
211 | @echo --------------------------------------------------------------------------------
|
---|
212 | @echo $(tab_)$(tab_)$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
|
---|
213 | @echo --------------------------------------------------------------------------------$(WHITE)
|
---|
214 | endef
|
---|