1 #############################################################
3 # mkcloop to build to target cloop filesystems
5 #############################################################
6 ### /cloop_2.01.5.orig.tar.gz
8 CLOOP_DIR
=$(BUILD_DIR
)/cloop-
$(CLOOP_VERSION
)
9 ### CLOOP_SOURCE=cloop_$(CLOOP_VERSION).5.orig.tar.gz
10 ### CLOOP_SITE=$(BR2_DEBIAN_MIRROR)/debian/pool/main/c/cloop
11 # http://ftp.debian.org/debian/pool/main/c/cloop/cloop_2.01.5-4.diff.gz
12 ### CLOOP_PATCH1:=cloop_2.01.5-4.diff.gz
13 ### CLOOP_PATCH1_URL:=$(CLOOP_SITE)
14 # http://developer.linuxtag.net/knoppix/sources/cloop_2.01-5.tar.gz
15 CLOOP_SOURCE
=cloop_
$(CLOOP_VERSION
)-5.
tar.gz
16 CLOOP_SITE
=http
://developer.linuxtag.net
/knoppix
/sources
18 CLOOP_TARGET
:=$(IMAGE
).cloop
19 ### Note: not used yet! ck
20 ### $(DL_DIR)/$(CLOOP_PATCH1):
21 ### $(WGET) -P $(DL_DIR) $(CLOOP_PATCH1_URL)/$(CLOOP_PATCH1)
23 $(DL_DIR
)/$(CLOOP_SOURCE
):
24 $(WGET
) -P
$(DL_DIR
) $(CLOOP_SITE
)/$(CLOOP_SOURCE
)
26 $(CLOOP_DIR
)/.unpacked
: $(DL_DIR
)/$(CLOOP_SOURCE
) ### $(DL_DIR)/$(CLOOP_PATCH1)
27 $(ZCAT
) $(DL_DIR
)/$(CLOOP_SOURCE
) |
tar -C
$(BUILD_DIR
) -xvf
-
29 ### $(ZCAT) $(DL_DIR)/$(CLOOP_PATCH1) | patch -p1 -d $(CLOOP_DIR)
30 ### toolchain/patch-kernel.sh $(CLOOP_DIR) target/cloop/ cloop\*.patch
32 $(CLOOP_DIR
)/create_compressed_fs
: $(CLOOP_DIR
)/.unpacked
33 $(MAKE
) CFLAGS
="-Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_ERROR_SILENT" -C
$(CLOOP_DIR
) \
36 cloop
: $(CLOOP_DIR
)/create_compressed_fs
38 cloop-source
: $(DL_DIR
)/$(CLOOP_SOURCE
)
41 -$(MAKE
) -C
$(CLOOP_DIR
) clean
46 #############################################################
48 # Build the cloop.o kernel module for the HOST
50 #############################################################
52 $(CLOOP_DIR
)/cloop.o
: $(CLOOP_DIR
)/create_compressed_fs
53 $(MAKE
) CFLAGS
="-Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_ERROR_SILENT" -C
$(CLOOP_DIR
) -j1
55 cloop-module
: $(CLOOP_DIR
)/cloop.o
57 #############################################################
59 # Build the cloop root filesystem image
61 # Note: we need additionall host tools:
63 # mkisofs 2.01a34-unofficial-iconv from http://users.utu.fi/jahhein/mkisofs/
65 # symlinks: scan/change symbolic links - v1.2 - by Mark Lord
66 # from ftp://ftp.ibiblio.org/pub/Linux/utils/file/
68 #############################################################
70 ### Note: target/default/device_table.txt is not yet supported! ck
71 # the quickfix is to use sudo to mount the previous created cramroot
76 clooproot
: cloop check-tools
$(IMAGE
).cramfs
### cramfsroot
77 -@find
$(TARGET_DIR
) -type f
-perm
+111 | xargs
$(STRIPCMD
) 2>/dev
/null || true
78 ifneq ($(BR2_HAVE_MANPAGES
),y
)
79 @
rm -rf
$(TARGET_DIR
)/usr
/share
/man
81 ifneq ($(BR2_HAVE_INFOPAGES
),y
)
82 @
rm -rf
$(TARGET_DIR
)/usr
/share
/info
84 @rmdir
-p
--ignore-fail-on-non-empty
$(TARGET_DIR
)/usr
/share
85 ### $(CLOOP_DIR)/create_compressed_fs -q -D target/default/device_table.txt $(TARGET_DIR) $(CLOOP_TARGET)
86 ## mkisofs -r $(TARGET_DIR) | $(CLOOP_DIR)/create_compressed_fs - 65536 > $(CLOOP_TARGET)
87 sudo
/sbin
/losetup
-d
/dev
/loop1
88 sudo
/sbin
/losetup
/dev
/loop1
$(IMAGE
).cramfs
89 sudo mkdir
-p
/mnt
/compressed
90 sudo mount
-o ro
-t cramfs
/dev
/loop1
/mnt
/compressed
91 mkisofs
-r
/mnt
/compressed |
$(CLOOP_DIR
)/create_compressed_fs
- 65536 > $(CLOOP_TARGET
)
92 - symlinks
-r
/mnt
/compressed
93 sudo umount
/mnt
/compressed
94 @echo
"Mounting a compressed image:"
95 @echo
" sudo mkdir -p /mnt/compressed"
96 @echo
" sudo /sbin/insmod cloop"
97 @echo
" sudo /sbin/losetup /dev/cloop1 $(CLOOP_TARGET)"
98 @echo
" sudo mount -o ro -t iso9660 /dev/cloop1 /mnt/compressed"
100 clooproot-source
: cloop-source
103 -$(MAKE
) -C
$(CLOOP_DIR
) clean
108 #############################################################
109 # symlinks -r /mnt/compressed
110 # dangling: /mnt/compressed/dev/log -> /tmp/log
111 # other_fs: /mnt/compressed/etc/mtab -> /proc/mounts
112 # other_fs: /mnt/compressed/var/lib/pcmcia -> /tmp
113 # other_fs: /mnt/compressed/var/lock -> /tmp
114 # other_fs: /mnt/compressed/var/log -> /tmp
115 # other_fs: /mnt/compressed/var/pcmcia -> /tmp
116 # other_fs: /mnt/compressed/var/run -> /tmp
117 # other_fs: /mnt/compressed/var/spool -> /tmp
118 # other_fs: /mnt/compressed/var/tmp -> /tmp
120 # ls -lrsS root_fs_*.*
121 # 1296 -rw-r--r-- 1 claus users 1325478 Mar 13 16:52 root_fs_powerpc.cloop
122 # 1448 -rw-r--r-- 1 claus users 1482752 Mar 13 16:52 root_fs_powerpc.cramfs
123 # 1840 -rw-r--r-- 1 claus users 1883408 Mar 13 13:14 root_fs_powerpc.jffs2
124 #############################################################