2006-03-19 12:14:42 +01:00
|
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
2006-08-30 04:01:04 +02:00
|
|
|
|
BOLD = "[0;1m"
|
|
|
|
|
RED = "[1;31m"
|
|
|
|
|
GREEN = "[0;32m"
|
|
|
|
|
ORANGE = "[0;33m"
|
|
|
|
|
BLUE = "[1;34m"
|
|
|
|
|
WHITE = "[00m"
|
|
|
|
|
YELLOW = "[1;33m"
|
|
|
|
|
|
|
|
|
|
OFF = "[0m"
|
|
|
|
|
BOLD = "[1m"
|
|
|
|
|
REVERSE = "[7m"
|
|
|
|
|
|
|
|
|
|
|
2006-09-02 05:04:03 +02:00
|
|
|
|
define echo_PHASE
|
|
|
|
|
@clear
|
|
|
|
|
@echo $(BOLD)--------------------------------------------------------------------------------
|
|
|
|
|
@echo Executing $(BLUE)$(1)$(WHITE) scripts
|
|
|
|
|
@echo $(BOLD)--------------------------------------------------------------------------------
|
|
|
|
|
#echo $(WHITE)
|
|
|
|
|
endef
|
|
|
|
|
|
2006-08-30 04:01:04 +02:00
|
|
|
|
define echo_SU_request
|
|
|
|
|
@echo $(BOLD)--------------------------------------------------------------------------------
|
|
|
|
|
@echo $(BLUE)$@
|
|
|
|
|
@echo $(WHITE)ROOT privilege is required to perform a number commands
|
2006-09-13 22:04:46 +02:00
|
|
|
|
@echo sudo will request a password to all high privilege cmds to execute correctly
|
2006-08-30 04:01:04 +02:00
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define echo_SULUSER_request
|
|
|
|
|
@clear
|
|
|
|
|
@echo $(BOLD)--------------------------------------------------------------------------------
|
|
|
|
|
@echo $(BOLD)$(BLUE)$@
|
|
|
|
|
@echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
|
|
|
|
|
@echo su requires a password
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define echo_CHROOT_request
|
|
|
|
|
@clear
|
|
|
|
|
@echo $(BOLD)--------------------------------------------------------------------------------
|
|
|
|
|
@echo $(BOLD)$(BLUE)$@
|
|
|
|
|
@echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)
|
|
|
|
|
@echo a password is required
|
|
|
|
|
endef
|
2006-03-07 21:02:53 +01:00
|
|
|
|
|
|
|
|
|
define echo_message
|
2006-08-30 04:01:04 +02:00
|
|
|
|
@echo $(BOLD)--------------------------------------------------------------------------------
|
|
|
|
|
@echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
|
2006-03-07 21:02:53 +01:00
|
|
|
|
endef
|
|
|
|
|
|
2006-08-11 05:34:10 +02:00
|
|
|
|
define remove_existing_dirs
|
|
|
|
|
@PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
|
|
|
|
|
ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
|
|
|
|
|
rm -rf $(SRCSDIR)/$$ROOT && \
|
|
|
|
|
rm -rf $(SRCSDIR)/$${ROOT%-*}-build
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define remove_existing_dirs2
|
2006-08-30 04:01:04 +02:00
|
|
|
|
@PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
|
2006-08-11 05:34:10 +02:00
|
|
|
|
ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
|
|
|
|
|
rm -rf $(SRC)/$$ROOT && \
|
2006-08-26 05:19:13 +02:00
|
|
|
|
rm -rf $(SRC)/$${ROOT%-*}-build
|
2006-08-11 05:34:10 +02:00
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define remove_build_dirs
|
|
|
|
|
@ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
|
|
|
|
rm -rf $(SRCSDIR)/$$ROOT && \
|
|
|
|
|
rm -rf $(SRCSDIR)/$(1)-build
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define remove_build_dirs2
|
|
|
|
|
@ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
|
|
|
|
rm -rf $(SRC)/$$ROOT && \
|
|
|
|
|
rm -rf $(SRC)/$(1)-build
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define housekeeping
|
|
|
|
|
@touch $@ && \
|
|
|
|
|
sleep .25 && \
|
2006-08-30 04:01:04 +02:00
|
|
|
|
echo -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
|
2006-08-11 05:34:10 +02:00
|
|
|
|
echo --------------------------------------------------------------------------------$(WHITE)
|
|
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define get_pkg_root
|
|
|
|
|
@ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
|
|
|
|
if [ "$(1)" != "nouser" ]; then \
|
|
|
|
|
echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars; \
|
|
|
|
|
chown -R $(LUSER) $(SRCSDIR)/$$ROOT; \
|
|
|
|
|
else \
|
|
|
|
|
echo "export PKGDIR=$(crSRCSDIR)/$$ROOT" > envars; \
|
|
|
|
|
fi;
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define get_pkg_root2
|
|
|
|
|
@ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
|
|
|
|
echo "export PKGDIR=$(SRC)/$$ROOT" > envars
|
|
|
|
|
endef
|
|
|
|
|
|
2006-08-30 04:01:04 +02:00
|
|
|
|
define get_pkg_root_LUSER
|
|
|
|
|
@ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
|
|
|
|
|
echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
|
|
|
|
|
endef
|
|
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
|
define unpack
|
2006-08-11 05:34:10 +02:00
|
|
|
|
@cd $(SRCSDIR) && \
|
2006-06-02 19:53:17 +02:00
|
|
|
|
tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
|
2006-03-07 21:02:53 +01:00
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define unpack2
|
2006-08-11 05:34:10 +02:00
|
|
|
|
@cd $(SRCSDIR) && \
|
2006-06-02 19:53:17 +02:00
|
|
|
|
/tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
|
2006-03-07 21:02:53 +01:00
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define unpack3
|
2006-03-19 12:14:42 +01:00
|
|
|
|
@cd $(SRC) && \
|
2006-06-02 19:53:17 +02:00
|
|
|
|
tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
|
2006-03-07 21:02:53 +01:00
|
|
|
|
endef
|
|
|
|
|
|
2006-04-26 22:24:58 +02:00
|
|
|
|
define echo_report
|
|
|
|
|
@echo
|
|
|
|
|
@echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created
|
|
|
|
|
@echo
|
|
|
|
|
@echo ${WHITE}Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE)
|
|
|
|
|
@echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE)
|
|
|
|
|
@echo
|
|
|
|
|
@echo That will help us to keep more accurate SBU and
|
|
|
|
|
@echo disk usage values into the book. Thanks.
|
|
|
|
|
endef
|
|
|
|
|
|
2006-03-07 21:02:53 +01:00
|
|
|
|
define echo_finished
|
|
|
|
|
@echo $(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo $(BOLD) Finished the build of $(BLUE)$(1)$(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo -e \\t\\t$(RED)W A R N I N G$(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo
|
2006-03-28 22:41:15 +02:00
|
|
|
|
@echo To be able to boot your new system you need to follow
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo the next steps:$(WHITE)
|
|
|
|
|
@echo
|
|
|
|
|
@echo -e \\t- Enter to the chroot using the command found
|
2006-03-30 20:26:11 +02:00
|
|
|
|
@echo -e \\tin the section -Entering the Chroot Environment-
|
2006-07-26 20:42:01 +02:00
|
|
|
|
@echo -e \\texcept if building CLFS with METHOD=boot.
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo
|
2006-06-10 18:48:25 +02:00
|
|
|
|
@echo -e \\t- Set a password for the root user.
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo
|
2006-07-26 20:42:01 +02:00
|
|
|
|
@echo -e \\t- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo -e \\t/etc/sysconfig/console, /etc/sysconfig/network,
|
|
|
|
|
@echo -e \\t/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
|
|
|
|
|
@echo -e \\tany other configuration file required to suit your needs.
|
|
|
|
|
@echo
|
2006-06-10 18:48:25 +02:00
|
|
|
|
@echo -e \\t- Exit from the chroot.
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo
|
2006-07-26 20:42:01 +02:00
|
|
|
|
@echo -e \\t- Set-up the boot loader, except if building CLFS with METHOD=boot.
|
2006-06-10 18:48:25 +02:00
|
|
|
|
@echo -e \\tYou can set-up the host bootloader or the new boot-loader
|
|
|
|
|
@echo -e \\tinstalled on the new system.
|
|
|
|
|
@echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter
|
2006-07-26 20:42:01 +02:00
|
|
|
|
@echo -e \\tthe chroot and be sure that /dev is populated with the
|
2006-06-10 18:48:25 +02:00
|
|
|
|
@echo -e \\trequired devices before configure the boot-loader. When ready,
|
|
|
|
|
@echo -e \\texit from the chroot and umount the filesystems
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo
|
|
|
|
|
@echo If you are an experienced LFS user, several of those steps can be
|
|
|
|
|
@echo skipped or done in a different way. But then, that is something
|
|
|
|
|
@echo that you already know and there is no need to discuss it here.
|
|
|
|
|
@echo $(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------$(WHITE)
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define echo_boot_finished
|
|
|
|
|
@echo $(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo $(BOLD) Finished building a minimal boot system for $(BLUE)$(1)$(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo -e \\t\\t$(RED)W A R N I N G$(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo
|
|
|
|
|
@echo The build is not complete. Follow the next steps:$(WHITE)
|
|
|
|
|
@echo
|
2006-07-26 20:42:01 +02:00
|
|
|
|
@echo -e \\t- Edit or create $(MOUNT_PT)/etc/fstab
|
2006-03-27 20:46:32 +02:00
|
|
|
|
@echo -e \\t and any other configuration file required to suit your needs.
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo $(BOLD)
|
|
|
|
|
@echo $(BOLD)$(YELLOW)
|
2006-03-28 02:01:50 +02:00
|
|
|
|
@echo 1.If it is necessary, transfer the newly created partition to the target machine
|
2006-03-28 22:41:15 +02:00
|
|
|
|
@echo 2.Boot the new partition.
|
|
|
|
|
@echo 3.Once you are logged in issue the following commands
|
|
|
|
|
@echo -e \\t $(BOLD})cd /jhalfs
|
2006-03-27 20:46:32 +02:00
|
|
|
|
@echo -e \\t $(BOLD)make makesys
|
2006-03-07 21:02:53 +01:00
|
|
|
|
@echo The build process should resume. Follow any instructions that appear.
|
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
|
@echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
|
|
|
|
|
@echo --------------------------------------------------------------------------------$(WHITE)
|
|
|
|
|
endef
|