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