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