summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <walsimou@walsimou.com>2009-08-10 17:12:33 +0200
committerAbdoulaye Walsimou Gaye <walsimou@walsimou.com>2009-08-10 17:12:33 +0200
commit1af3d4da4fd99f9259c26442a5a3e320455eb00c (patch)
treee0aabb7ac09234fa6494a47f3e5d2674dd51ab89 /mk
parent759cd1881f15ae390b78a4126e198a57607bee1a (diff)
downloadembtoolkit-1af3d4da4fd99f9259c26442a5a3e320455eb00c.tar.gz
embtoolkit-1af3d4da4fd99f9259c26442a5a3e320455eb00c.tar.bz2
embtoolkit-1af3d4da4fd99f9259c26442a5a3e320455eb00c.tar.xz
Rootfs: rework filesystems generation
This patch reworks filesystems generation in order to make build of other filesystems type easy. Signed-off-by: Abdoulaye Walsimou Gaye <walsimou@walsimou.com>
Diffstat (limited to 'mk')
-rw-r--r--mk/fs.mk48
-rw-r--r--mk/packages.mk20
-rw-r--r--mk/rootfs.mk38
3 files changed, 68 insertions, 38 deletions
diff --git a/mk/fs.mk b/mk/fs.mk
new file mode 100644
index 0000000..bd4e439
--- /dev/null
+++ b/mk/fs.mk
@@ -0,0 +1,48 @@
+################################################################################
+# GAYE Abdoulaye Walsimou, <walsimou@walsimou.com>
+# Copyright(C) 2009 GAYE Abdoulaye Walsimou. All rights reserved.
+#
+# 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 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.
+#
+# 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 fs.mk
+# \brief fs.mk of Embtoolkit, targets for sereval filesystems build.
+# \author GAYE Abdoulaye Walsimou, <walsimou@walsimou.com>
+# \date August 2009
+################################################################################
+
+ifeq ($(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2),y)
+
+endif
+
+build_tarbz2_rootfs:
+ $(FAKEROOT_BIN) -s $(EMBTK_ROOT)/.fakeroot.001 -- \
+ $(MAKEDEVS_DIR)/makedevs \
+ -d $(EMBTK_ROOT)/src/devices_table.txt $(ROOTFS)
+ cd $(ROOTFS) ; $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
+ tar cjf rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 * ; \
+ mv rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 $(EMBTK_ROOT)
+
+build_jffs2_rootfs:
+ $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
+ $(HOSTTOOLS)/usr/sbin/mkfs.jffs2 \
+ -n -e $(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_BLOCKSIZE) -r $(ROOTFS) \
+ -o $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2.temp
+ $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
+ $(HOSTTOOLS)/usr/sbin/sumtool \
+ -n -e $(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_BLOCKSIZE) \
+ -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
+
diff --git a/mk/packages.mk b/mk/packages.mk
index 3b28e3a..5a41ba4 100644
--- a/mk/packages.mk
+++ b/mk/packages.mk
@@ -44,15 +44,6 @@ ROOTFS_COMPONENTS += mtd-utils_target_install
ROOTFS_COMPONENTS_CLEAN += mtd-utils_target_clean
endif
-#Packages for host
-
-#fakeroot
-ifeq ($(CONFIG_EMBTK_HAVE_ROOTFS),y)
-include $(EMBTK_ROOT)/mk/fakeroot.mk
-include $(EMBTK_ROOT)/mk/makedevs.mk
-HOSTTOOLS_COMPONENTS := makedevs_install fakeroot_install
-endif
-
#gdb
ifeq ($(CONFIG_EMBTK_HAVE_GDB),y)
include $(EMBTK_ROOT)/mk/termcap.mk
@@ -62,14 +53,3 @@ HOSTTOOLS_COMPONENTS += gdb_host_install
endif
endif
-#lzo
-include $(EMBTK_ROOT)/mk/lzo.mk
-
-#mtd-utils
-ifeq ($(CONFIG_EMBTK_HAVE_ROOTFS),y)
-include $(EMBTK_ROOT)/mk/mtd-utils.mk
-endif
-
-#zlib
-include $(EMBTK_ROOT)/mk/zlib.mk
-
diff --git a/mk/rootfs.mk b/mk/rootfs.mk
index cf2313e..6d6d7a2 100644
--- a/mk/rootfs.mk
+++ b/mk/rootfs.mk
@@ -24,13 +24,27 @@
ifeq ($(CONFIG_EMBTK_HAVE_ROOTFS),y)
+#include various filesystems targets
+include $(EMBTK_ROOT)/mk/fs.mk
+
+#host tools in order to build root filesystems: fakeroot and makedevs.
+include $(EMBTK_ROOT)/mk/fakeroot.mk
+include $(EMBTK_ROOT)/mk/makedevs.mk
+HOSTTOOLS_COMPONENTS += makedevs_install fakeroot_install
+
ifeq ($(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2),y)
+include $(EMBTK_ROOT)/mk/lzo.mk
+include $(EMBTK_ROOT)/mk/mtd-utils.mk
+include $(EMBTK_ROOT)/mk/zlib.mk
HOSTTOOLS_COMPONENTS += mtd-utils_host_install
HOSTTOOLS_COMPONENTS_CLEAN += mtd-utils_host_clean
+FILESYSTEMS += build_jffs2_rootfs
endif
rootfs_build: rootfs_clean mkinitialpath $(HOSTTOOLS_COMPONENTS) \
-$(ROOTFS_COMPONENTS)
+$(ROOTFS_COMPONENTS) rootfs_fill build_tarbz2_rootfs $(FILESYSTEMS)
+
+rootfs_fill:
ifeq ($(CONFIG_EMBTK_TARGET_ARCH_64BITS),y)
@mkdir -p $(ROOTFS)/lib64
@mkdir -p $(ROOTFS)/usr/lib64
@@ -50,28 +64,16 @@ else
@cp -R $(SYSROOT)/usr/sbin/* $(ROOTFS)/usr/sbin/
@-$(TARGETSTRIP) $(ROOTFS)/usr/sbin/*
endif
- $(FAKEROOT_BIN) -s $(EMBTK_ROOT)/.fakeroot.001 -- \
- $(MAKEDEVS_DIR)/makedevs \
- -d $(EMBTK_ROOT)/src/devices_table.txt $(ROOTFS)
- cd $(ROOTFS) ; $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
- tar cjf rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 * ; \
- mv rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 $(EMBTK_ROOT)
-ifeq ($(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2),y)
- $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
- $(HOSTTOOLS)/usr/sbin/mkfs.jffs2 -n -e 128 -r $(ROOTFS) \
- -o $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2.temp
- $(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
- $(HOSTTOOLS)/usr/sbin/sumtool -n -e 128 \
- -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
-endif
rootfs_clean: $(HOSTTOOLS_COMPONENTS_CLEAN) $(ROOTFS_COMPONENTS_CLEAN)
@rm -rf rootfs-*
else
-rootfs_build: $(HOSTTOOLS_COMPONENTS)
+rootfs_build:
+ @echo "############### Root filesystem build not selected #############"
+ @echo "# Root filesystem build not selected in the configuration #"
+ @echo "# interface. If you want to build one please select it. #"
+ @echo "################################################################"
rootfs_clean: $(HOSTTOOLS_COMPONENTS_CLEAN)
endif