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