diff options
-rw-r--r-- | mk/fs.mk | 56 | ||||
-rw-r--r-- | mk/initialpath.mk | 42 | ||||
-rw-r--r-- | mk/rootfs.mk | 4 |
3 files changed, 49 insertions, 53 deletions
@@ -23,23 +23,25 @@ # \date August 2009 ################################################################################ +JFFS2_ROOTFS := $(EMBTK_GENERATED)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2 +BZIP2_ROOTFS := rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 +SQUASHFS_ROOTFS := $(EMBTK_GENERATED)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).squashfs +INITRAMFS_ROOTFS := $(EMBTK_GENERATED)/initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) + build_rootfs_devnodes: - $(call EMBTK_GENERIC_MESSAGE,"Populating device nodes of the root \ - filesystem...") - @$(FAKEROOT_BIN) -s $(EMBTK_ROOT)/.fakeroot.001 -- \ - $(MAKEDEVS_DIR)/makedevs \ + $(call EMBTK_GENERIC_MSG,"Populating device nodes of the rootfs...") + @$(FAKEROOT_BIN) -s $(FAKEROOT_ENV_FILE) -- $(MAKEDEVS_DIR)/makedevs \ -d $(EMBTK_ROOT)/src/devices_table.txt $(ROOTFS) build_tarbz2_rootfs: - $(call EMBTK_GENERIC_MESSAGE,"Generating tar.bz2 file of the root \ - filesystem...") - @cd $(ROOTFS) ; $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \ + $(call EMBTK_GENERIC_MSG,"Generating TAR.BZ2 file of the rootfs...") + @cd $(ROOTFS) ; $(FAKEROOT_BIN) -i $(FAKEROOT_ENV_FILE) -- \ tar cjf rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 * ; \ - mv rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 $(EMBTK_ROOT) + mv $(BZIP2_ROOTFS) $(EMBTK_GENERATED)/ build_jffs2_rootfs: - $(call EMBTK_GENERIC_MESSAGE,"Generating JFFS2 root filesystem...") - @$(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \ + $(call EMBTK_GENERIC_MSG,"Generating JFFS2 rootfs..") + @$(FAKEROOT_BIN) -i $(FAKEROOT_ENV_FILE) -- \ $(HOSTTOOLS)/usr/sbin/mkfs.jffs2 \ --eraseblock=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_ERASEBLOCKSIZE) \ --pad=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_ERASEBLOCKSIZE) \ @@ -47,33 +49,25 @@ build_jffs2_rootfs: --cleanmarker=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_CLEANMARKERSIZE) \ $(if $(CONFIG_EMBTK_TARGET_ARCH_LITTLE_ENDIAN), \ --little-endian, --big-endian) \ - -n --root=$(ROOTFS) \ - -o $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2.temp - @$(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \ + -n --root=$(ROOTFS) -o $(JFFS2_ROOTFS).temp + @$(FAKEROOT_BIN) -i $(FAKEROOT_ENV_FILE) -- \ $(HOSTTOOLS)/usr/sbin/sumtool \ --eraseblock=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_ERASEBLOCKSIZE) \ --cleanmarker=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_CLEANMARKERSIZE) \ $(if $(CONFIG_EMBTK_TARGET_ARCH_LITTLE_ENDIAN), \ --littleendian, --bigendian) \ - -n -p \ - -i $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2.temp \ - -o $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2 - @rm -rf $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2.temp + -n -p -i $(JFFS2_ROOTFS).temp -o $(JFFS2_ROOTFS) + @rm -rf $(JFFS2_ROOTFS).temp build_squashfs_rootfs: - $(call EMBTK_GENERIC_MESSAGE,"Generating squashfs root filesystem...") - $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \ - $(HOSTTOOLS)/usr/bin/mksquashfs $(ROOTFS) \ - rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).squashfs + $(call EMBTK_GENERIC_MSG,"Generating SQUASHFS rootfs...") + $(FAKEROOT_BIN) -i $(FAKEROOT_ENV_FILE) -- \ + $(MKSQUASHFS_BIN) $(ROOTFS) $(SQUASHFS_ROOTFS) build_initramfs_archive: - $(call EMBTK_GENERIC_MESSAGE,"Generating cpio archive for initramfs...") -ifeq ($(EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO_GZIPED),y) - @$(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \ - $(EMBTK_ROOT)/scripts/mkinitramfs $(ROOTFS) gzip \ - $(EMBTK_ROOT)/initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) -else - @$(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \ - $(EMBTK_ROOT)/scripts/mkinitramfs $(ROOTFS) bzip2 \ - $(EMBTK_ROOT)/initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) -endif + $(call EMBTK_GENERIC_MSG,"Generating cpio archive for INITRAMFS...") + @$(FAKEROOT_BIN) -i $(FAKEROOT_ENV_FILE) -- \ + $(EMBTK_ROOT)/scripts/mkinitramfs $(ROOTFS) \ + $(if $(EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO_GZIPED),gzip,bzip2) \ + $(INITRAMFS_ROOTFS) + diff --git a/mk/initialpath.mk b/mk/initialpath.mk index 7bec77c..2978834 100644 --- a/mk/initialpath.mk +++ b/mk/initialpath.mk @@ -2,18 +2,19 @@ # Embtoolkit # Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. # -# This program is free software; you can distribute it and/or modify it -# under the terms of the GNU General Public License -# (Version 2 or later) published by the Free Software Foundation. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. # -# This program is distributed in the hope it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. # -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. ################################################################################ # # \file initialpath.mk @@ -23,15 +24,17 @@ # \date May 2009 ################################################################################ -SYSROOT:=$(EMBTK_ROOT)/sysroot-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) -TOOLS:=$(EMBTK_ROOT)/tools-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) -TOOLS_BUILD:=$(EMBTK_ROOT)/build/tools_build-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) -PACKAGES_BUILD:=$(EMBTK_ROOT)/build/packages_build-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) -ROOTFS:=$(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) -HOSTTOOLS :=$(EMBTK_ROOT)/host-tools-$(EMBTK_MCU_FLAG) -DOWNLOAD_DIR := $(subst ",,$(strip $(CONFIG_EMBTK_DOWNLOAD_DIR))) +SYSROOT := $(EMBTK_ROOT)/sysroot-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) +TOOLS := $(EMBTK_ROOT)/tools-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) +TOOLS_BUILD := $(EMBTK_ROOT)/build/tools_build-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) +PACKAGES_BUILD := $(EMBTK_ROOT)/build/packages_build-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) +EMBTK_GENERATED := $(EMBTK_ROOT)/generated +ROOTFS := $(EMBTK_GENERATED)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG) +HOSTTOOLS := $(EMBTK_ROOT)/host-tools-$(EMBTK_MCU_FLAG) +DOWNLOAD_DIR := $(subst ",,$(strip $(CONFIG_EMBTK_DOWNLOAD_DIR))) -export SYSROOT TOOLS TOOLS_BUILD PACKAGES_BUILD ROOTFS HOSTTOOLS DOWNLOAD_DIR +export SYSROOT TOOLS TOOLS_BUILD PACKAGES_BUILD EMBTK_GENERATED ROOTFS +export HOSTTOOLS DOWNLOAD_DIR mkinitialpath: @mkdir -p $(SYSROOT) @@ -68,8 +71,7 @@ endif rmallpath: @rm -Rf $(PACKAGES_BUILD) $(ROOTFS) $(TOOLS) $(TOOLS_BUILD) $(SYSROOT) - @rm -Rf rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)* - @rm -Rf initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)* + @rm -Rf $(EMBTK_GENERATED) ifneq ($(CONFIG_EMBTK_CACHE_PATCHES),y) @rm -rf $(DOWNLOAD_DIR)/*.patch endif diff --git a/mk/rootfs.mk b/mk/rootfs.mk index 8b36a83..7289b70 100644 --- a/mk/rootfs.mk +++ b/mk/rootfs.mk @@ -121,8 +121,8 @@ endif @mkdir -p $(PACKAGES_BUILD) rootfs_clean: $(ROOTFS_HOSTTOOLS_CLEAN) $(ROOTFS_COMPONENTS_CLEAN) - @rm -rf $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)* - @rm -rf $(EMBTK_ROOT)/initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)* + @rm -rf $(EMBTK_GENERATED)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)* + @rm -rf $(EMBTK_GENERATED)/initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)* else rootfs_build: |