Gentoo Archives: gentoo-catalyst

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

Replies

Subject Author
Re: [gentoo-catalyst] [PATCH 2/8] targets: Drop most fstypes Matt Turner <mattst88@g.o>