1 |
commit: 8a2d60dc2a299985ab966a1a630bb16381f3491d |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 1 06:28:58 2020 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 3 22:04:18 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=8a2d60dc |
7 |
|
8 |
targets: Drop most fstypes |
9 |
|
10 |
This removes support for various file systems from the embedded target |
11 |
(a target for producing images for embedded systems, as far as I |
12 |
understand) and for ISOs. For ISOs, squashfs is great and everyone uses |
13 |
it -- it provides better performance from a CD than the alternatives |
14 |
like zisofs, normal, or noloop. |
15 |
|
16 |
For embedded, it's unclear whether the target is used at all. There are |
17 |
some very old specs in releng.git that use 'rel_type: embedded', but I'm |
18 |
not sure if the target is used at all these days. To that end, I've |
19 |
asked in #gentoo-embedded if anyone uses it. I've removed what I believe |
20 |
to be the file system options that don't provide any value, leaving |
21 |
jffs2 for now. |
22 |
|
23 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
24 |
|
25 |
doc/catalyst-spec.5.txt | 11 ++---- |
26 |
examples/livecd-stage2_template.spec | 8 +--- |
27 |
targets/embedded/fs-runscript.sh | 15 -------- |
28 |
targets/support/filesystem-functions.sh | 65 --------------------------------- |
29 |
targets/support/functions.sh | 14 ------- |
30 |
targets/support/target_image_setup.sh | 20 ---------- |
31 |
6 files changed, 5 insertions(+), 128 deletions(-) |
32 |
|
33 |
diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt |
34 |
index e269e16d..cd7aebd9 100644 |
35 |
--- a/doc/catalyst-spec.5.txt |
36 |
+++ b/doc/catalyst-spec.5.txt |
37 |
@@ -170,18 +170,13 @@ Filesystem |
38 |
*livecd/fstype*:: |
39 |
The fstype is used to determine what sort of CD we should build. This |
40 |
is used to set the type of loopback filesystem that we will use on our |
41 |
-CD. Possible values are as follows: |
42 |
- `squashfs`;; This gives the best compression, but requires a kernel patch. |
43 |
- `zisofs`;; This uses in-kernel compression and is supported on all platforms. |
44 |
- `normal`;; This creates a loop without compression. |
45 |
- `noloop`;; This copies the files to the CD directly, without using a |
46 |
- loopback. |
47 |
+CD. Possible values are: |
48 |
+ `squashfs` |
49 |
+ `jffs2` |
50 |
|
51 |
*livecd/fsops*:: |
52 |
The fsops are a list of optional parameters that can be passed to the |
53 |
tool which will create the filesystem specified in *livecd/fstype* |
54 |
-It is valid for the following fstypes: `squashfs`, `jffs`, `jffs2`, |
55 |
-and `cramfs`. |
56 |
|
57 |
*livecd/iso*:: |
58 |
This is the full path and filename to the ISO image that the |
59 |
|
60 |
diff --git a/examples/livecd-stage2_template.spec b/examples/livecd-stage2_template.spec |
61 |
index 3b9ca1da..f4a20cab 100644 |
62 |
--- a/examples/livecd-stage2_template.spec |
63 |
+++ b/examples/livecd-stage2_template.spec |
64 |
@@ -83,18 +83,14 @@ kerncache_path: |
65 |
|
66 |
# The fstype is used to determine what sort of CD we should build. This is |
67 |
# used to set the type of loopback filesystem that we will use on our CD. |
68 |
-# Possible options are as follows: |
69 |
-# squashfs - This gives the best compression, but requires a kernel patch. |
70 |
-# zisofs - This uses in-kernel compression and is supported on all platforms. |
71 |
-# normal - This creates a loop without compression. |
72 |
-# noloop - This copies the files to the CD directly, without using a loopback. |
73 |
+# Possible options are as follows: squashfs, jffs2 |
74 |
# example: |
75 |
# livecd/fstype: squashfs |
76 |
livecd/fstype: |
77 |
|
78 |
# The fsops are a list of optional parameters that can be passed to the tool |
79 |
# which will create the filesystem specified in livecd/fstype. It is valid for |
80 |
-# the following fstypes: squashfs, jffs, jffs2, cramfs |
81 |
+# the following fstypes: squashfs, jffs2 |
82 |
livecd/fsops: |
83 |
|
84 |
# The cdtar is essentially the bootloader for the CD. It also holds the main |
85 |
|
86 |
diff --git a/targets/embedded/fs-runscript.sh b/targets/embedded/fs-runscript.sh |
87 |
index 7e70848b..5e339608 100755 |
88 |
--- a/targets/embedded/fs-runscript.sh |
89 |
+++ b/targets/embedded/fs-runscript.sh |
90 |
@@ -13,32 +13,17 @@ fs_check() { |
91 |
} |
92 |
|
93 |
case ${1} in |
94 |
- jffs) |
95 |
- fs_check /usr/sbin/mkfs.jffs jffs sys-fs/mtd |
96 |
- mkfs.jffs -d ${root_fs_path} -o ${clst_image_path}/root.img \ |
97 |
- ${clst_embedded_fs_ops} || die "Could not create a jffs filesystem" |
98 |
- ;; |
99 |
jffs2) |
100 |
fs_check /usr/sbin/mkfs.jffs2 jffs2 sys-fs/mtd |
101 |
mkfs.jffs2 --root=${root_fs_path} --output=${clst_image_path}/root.img\ |
102 |
${clst_embedded_fs_ops} || die "Could not create a jffs2 filesystem" |
103 |
;; |
104 |
|
105 |
- cramfs) |
106 |
- fs_check /sbin/mkcramfs cramfs sys-fs/cramfs |
107 |
- mkcramfs ${clst_embedded_fs_ops} ${root_fs_path} \ |
108 |
- ${clst_image_path}/root.img || \ |
109 |
- die "Could not create a cramfs filesystem" |
110 |
- ;; |
111 |
- |
112 |
squashfs) |
113 |
fs_check /usr/bin/gensquashfs squashfs sys-fs/squashfs-tools-ng |
114 |
gensquashfs -D ${root_fs_path} ${clst_embedded_fs_ops} \ |
115 |
${clst_image_path}/root.img || |
116 |
die "Could not create a squashfs filesystem" |
117 |
;; |
118 |
- |
119 |
- *) |
120 |
- ;; |
121 |
esac |
122 |
exit $? |
123 |
|
124 |
diff --git a/targets/support/filesystem-functions.sh b/targets/support/filesystem-functions.sh |
125 |
index 03303b14..a95ae0b9 100755 |
126 |
--- a/targets/support/filesystem-functions.sh |
127 |
+++ b/targets/support/filesystem-functions.sh |
128 |
@@ -3,55 +3,6 @@ |
129 |
# Dont forget to update functions.sh check_looptype |
130 |
# $1 is the target directory for the filesystem |
131 |
|
132 |
-create_normal_loop() { |
133 |
- export source_path="${clst_destpath}" |
134 |
- export destination_path="$1" |
135 |
- export loopname="image.loop" |
136 |
- |
137 |
- # We get genkernel-built kernels and initrds in place, create the loopback |
138 |
- # file system on $clst_target_path, mount it, copy our bootable filesystem |
139 |
- # over, umount it, and have a ready-to-burn ISO tree at $clst_target_path. |
140 |
- |
141 |
- echo "Calculating size of loopback filesystem..." |
142 |
- loopsize=`du -ks ${source_path} | cut -f1` |
143 |
- [ "${loopsize}" = "0" ] && loopsize=1 |
144 |
- # Add 4MB for filesystem slop |
145 |
- loopsize=`expr ${loopsize} + 4096` |
146 |
- echo "Creating loopback file..." |
147 |
- dd if=/dev/zero of=${destination_path}/${loopname} bs=1k count=${loopsize} \ |
148 |
- || die "${loopname} creation failure" |
149 |
- mke2fs -m 0 -F -q ${destination_path}/${loopname} \ |
150 |
- || die "Couldn't create ext2 filesystem" |
151 |
- install -d ${destination_path}/loopmount |
152 |
- sync; sync; sleep 3 # Try to work around 2.6.0+ loopback bug |
153 |
- mount -t ext2 -o loop ${destination_path}/${loopname} \ |
154 |
- ${destination_path}/loopmount \ |
155 |
- || die "Couldn't mount loopback ext2 filesystem" |
156 |
- sync; sync; sleep 3 # Try to work around 2.6.0+ loopback bug |
157 |
- echo "cp -pPR ${source_path}/* ${destination_path}/loopmount" |
158 |
- cp -pPR ${source_path}/* ${destination_path}/loopmount |
159 |
- [ $? -ne 0 ] && { umount ${destination_path}/${loopname}; \ |
160 |
- die "Couldn't copy files to loopback ext2 filesystem"; } |
161 |
- umount ${destination_path}/loopmount \ |
162 |
- || die "Couldn't unmount loopback ext2 filesystem" |
163 |
- rm -rf ${destination_path}/loopmount |
164 |
- # Now, $clst_target_path should contain a proper bootable image for our |
165 |
- # ISO, including boot loader and loopback filesystem. |
166 |
-} |
167 |
- |
168 |
-create_zisofs() { |
169 |
- rm -rf "$1/zisofs" > /dev/null 2>&1 |
170 |
- echo "Creating zisofs..." |
171 |
- mkzftree -z 9 -p2 "${clst_destpath}" "$1/zisofs" \ |
172 |
- || die "Could not run mkzftree, did you emerge zisofs" |
173 |
-} |
174 |
- |
175 |
-create_noloop() { |
176 |
- echo "Copying files for image (no loop)..." |
177 |
- cp -pPR "${clst_destpath}"/* "$1" \ |
178 |
- || die "Could not copy files to image (no loop)" |
179 |
-} |
180 |
- |
181 |
create_squashfs() { |
182 |
echo "Creating squashfs..." |
183 |
export loopname="image.squashfs" |
184 |
@@ -59,14 +10,6 @@ create_squashfs() { |
185 |
|| die "gensquashfs failed, did you emerge squashfs-tools-ng?" |
186 |
} |
187 |
|
188 |
-create_jffs() { |
189 |
- echo "Creating jffs..." |
190 |
- export loopname="image.jffs" |
191 |
- # fs_check /usr/sbin/mkfs.jffs jffs sys-fs/mtd |
192 |
- mkfs.jffs -d ${clst_destpath} -o $1/${loopname} ${clst_fsops} \ |
193 |
- || die "Could not create a jffs filesystem" |
194 |
-} |
195 |
- |
196 |
create_jffs2(){ |
197 |
echo "Creating jffs2..." |
198 |
export loopname="image.jffs" |
199 |
@@ -74,11 +17,3 @@ create_jffs2(){ |
200 |
mkfs.jffs2 --root=${clst_destpath} --output=$1/${loopname} ${clst_fsops} \ |
201 |
|| die "Could not create a jffs2 filesystem" |
202 |
} |
203 |
- |
204 |
-create_cramfs(){ |
205 |
- echo "Creating cramfs..." |
206 |
- export loopname="image.cramfs" |
207 |
- #fs_check /sbin/mkcramfs cramfs sys-fs/cramfs |
208 |
- mkcramfs ${clst_fsops} ${clst_destpath} $1/${loopname} \ |
209 |
- || die "Could not create a cramfs filesystem" |
210 |
-} |
211 |
|
212 |
diff --git a/targets/support/functions.sh b/targets/support/functions.sh |
213 |
index 9da13baf..daf6f190 100755 |
214 |
--- a/targets/support/functions.sh |
215 |
+++ b/targets/support/functions.sh |
216 |
@@ -230,26 +230,12 @@ check_bootargs(){ |
217 |
|
218 |
check_filesystem_type(){ |
219 |
case ${clst_fstype} in |
220 |
- normal) |
221 |
- cmdline_opts="${cmdline_opts} looptype=normal loop=/image.loop" |
222 |
- ;; |
223 |
- zisofs) |
224 |
- cmdline_opts="${cmdline_opts} looptype=zisofs loop=/zisofs" |
225 |
- ;; |
226 |
- noloop) |
227 |
- ;; |
228 |
squashfs) |
229 |
cmdline_opts="${cmdline_opts} looptype=squashfs loop=/image.squashfs" |
230 |
;; |
231 |
- jffs) |
232 |
- cmdline_opts="${cmdline_opts} looptype=jffs loop=/image.jffs" |
233 |
- ;; |
234 |
jffs2) |
235 |
cmdline_opts="${cmdline_opts} looptype=jffs2 loop=/image.jffs2" |
236 |
;; |
237 |
- cramfs) |
238 |
- cmdline_opts="${cmdline_opts} looptype=cramfs loop=/image.cramfs" |
239 |
- ;; |
240 |
esac |
241 |
} |
242 |
|
243 |
|
244 |
diff --git a/targets/support/target_image_setup.sh b/targets/support/target_image_setup.sh |
245 |
index 559bc56c..423dc4c4 100755 |
246 |
--- a/targets/support/target_image_setup.sh |
247 |
+++ b/targets/support/target_image_setup.sh |
248 |
@@ -8,34 +8,14 @@ mkdir -p $1 |
249 |
|
250 |
loopret=1 |
251 |
case ${clst_fstype} in |
252 |
- normal) |
253 |
- create_normal_loop $1 |
254 |
- loopret=$? |
255 |
- ;; |
256 |
- zisofs) |
257 |
- create_zisofs $1 |
258 |
- loopret=$? |
259 |
- ;; |
260 |
- noloop) |
261 |
- create_noloop $1 |
262 |
- loopret=$? |
263 |
- ;; |
264 |
squashfs) |
265 |
create_squashfs $1 |
266 |
loopret=$? |
267 |
;; |
268 |
- jffs) |
269 |
- create_jffs $1 |
270 |
- loopret=$? |
271 |
- ;; |
272 |
jffs2) |
273 |
create_jffs2 $1 |
274 |
loopret=$? |
275 |
;; |
276 |
- cramfs) |
277 |
- create_cramfs $1 |
278 |
- loopret=$? |
279 |
- ;; |
280 |
esac |
281 |
|
282 |
if [ ${loopret} = "1" ] |