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