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