summaryrefslogtreecommitdiff
path: root/mk/fs.mk
blob: 23b35814010fe468e56312762dd4b71b6c90eba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
################################################################################
# Embtoolkit
# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. All rights reserved.
#
# 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 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/>.
#
################################################################################
#
# \file         fs.mk
# \brief	fs.mk of Embtoolkit, targets for sereval filesystems build.
# \author       Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
# \date         August 2009
################################################################################

build_rootfs_devnodes:
	$(call EMBTK_GENERIC_MESSAGE,"Populating device nodes of the root \
	filesystem...")
	@$(FAKEROOT_BIN) -s $(EMBTK_ROOT)/.fakeroot.001 -- \
	$(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 -- \
	tar cjf rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 * ; \
	mv rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).tar.bz2 $(EMBTK_ROOT)

build_jffs2_rootfs:
	$(call EMBTK_GENERIC_MESSAGE,"Generating JFFS2 root filesystem...")
	@$(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
	$(HOSTTOOLS)/usr/sbin/mkfs.jffs2 \
	--eraseblock=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_ERASEBLOCKSIZE) \
	--pad=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_ERASEBLOCKSIZE) \
	--pagesize=$(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2_PAGESIZE) \
	--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 -- \
	$(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

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

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