• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import("//build/ohos.gni")
2import("//build/ohos_var.gni")
3import("//developtools/profiler/build/config.gni")
4import("e2fsprogs.gni")
5
6group("e2fsprogs") {
7  deps = [
8    ":blkid",
9    ":e2fsck",
10    ":libext2_blkid",
11    ":libext2_com_err",
12    ":libext2_e2p",
13    ":libext2_misc",
14    ":libext2_quota",
15    ":libext2_uuid",
16    ":libext2fs",
17    ":mke2fs",
18    ":resize2fs",
19  ]
20  deps += [ ":e2fsdroid" ]
21}
22
23group("e2fsprogs_host_toolchain") {
24  deps = [
25    ":e2fsck($host_toolchain)",
26    ":mke2fs($host_toolchain)",
27  ]
28  deps += [ ":e2fsdroid($host_toolchain)" ]
29}
30
31ohos_static_library("libdacconfig") {
32  output_name = "libdacconfig"
33
34  sources = [ "e2fsprogs/contrib/android/dac_config.cpp" ]
35
36  part_name = "e2fsprogs"
37  subsystem_name = "thirdparty"
38}
39config("e2fsdroid-defaults") {
40  cflags = [
41    "-Wno-incompatible-pointer-types",
42    "-Wno-tautological-constant-out-of-range-compare",
43  ]
44}
45
46######################################################
47##Build e2fsdroid
48ohos_executable("e2fsdroid") {
49  configs = [ ":e2fsdroid-defaults" ]
50
51  defines = [ "HAVE_SYS_TYPES_H" ]
52  sources = [
53    "e2fsprogs/contrib/android/base_fs.c",
54    "e2fsprogs/contrib/android/basefs_allocator.c",
55    "e2fsprogs/contrib/android/block_list.c",
56    "e2fsprogs/contrib/android/block_range.c",
57    "e2fsprogs/contrib/android/e2fsdroid.c",
58    "e2fsprogs/contrib/android/fsmap.c",
59    "e2fsprogs/contrib/android/perms.c",
60  ]
61
62  include_dirs = [
63    "//third_party/e2fsprogs/e2fsprogs/contrib/android/",
64    "//third_party/e2fsprogs/e2fsprogs/lib",
65    "//third_party/e2fsprogs/e2fsprogs/lib/ext2fs",
66    "//third_party/e2fsprogs/e2fsprogs/misc",
67    "//third_party/selinux/libselinux/include",
68  ]
69
70  deps = [
71    ":libdacconfig",
72    ":libext2_com_err",
73    ":libext2_misc",
74    ":libext2fs",
75    "//third_party/selinux:libselinux",
76  ]
77
78  install_enable = true
79  subsystem_name = "thirdparty"
80  part_name = "e2fsprogs"
81  install_images = [
82    "system",
83    "updater",
84  ]
85}
86
87###################################################
88###Build e2fsck
89config("e2fsck-defaults") {
90  cflags = [
91    "-Wno-pointer-sign",
92    "-Wno-unused-variable",
93    "-Wno-error=format",
94  ]
95}
96
97ohos_executable("e2fsck") {
98  configs = [ ":e2fsck-defaults" ]
99  sources = [
100    "e2fsprogs/e2fsck/badblocks.c",
101    "e2fsprogs/e2fsck/dirinfo.c",
102    "e2fsprogs/e2fsck/dx_dirinfo.c",
103    "e2fsprogs/e2fsck/e2fsck.c",
104    "e2fsprogs/e2fsck/ea_refcount.c",
105    "e2fsprogs/e2fsck/ehandler.c",
106    "e2fsprogs/e2fsck/encrypted_files.c",
107    "e2fsprogs/e2fsck/extents.c",
108    "e2fsprogs/e2fsck/journal.c",
109    "e2fsprogs/e2fsck/logfile.c",
110    "e2fsprogs/e2fsck/message.c",
111    "e2fsprogs/e2fsck/pass1.c",
112    "e2fsprogs/e2fsck/pass1b.c",
113    "e2fsprogs/e2fsck/pass2.c",
114    "e2fsprogs/e2fsck/pass3.c",
115    "e2fsprogs/e2fsck/pass4.c",
116    "e2fsprogs/e2fsck/pass5.c",
117    "e2fsprogs/e2fsck/problem.c",
118    "e2fsprogs/e2fsck/quota.c",
119    "e2fsprogs/e2fsck/readahead.c",
120    "e2fsprogs/e2fsck/recovery.c",
121    "e2fsprogs/e2fsck/region.c",
122    "e2fsprogs/e2fsck/rehash.c",
123    "e2fsprogs/e2fsck/revoke.c",
124    "e2fsprogs/e2fsck/sigcatcher.c",
125    "e2fsprogs/e2fsck/super.c",
126    "e2fsprogs/e2fsck/unix.c",
127    "e2fsprogs/e2fsck/util.c",
128  ]
129
130  include_dirs = [
131    "//third_party/e2fsprogs/e2fsprogs/e2fsck",
132    "//third_party/e2fsprogs/e2fsprogs/lib",
133    "//third_party/e2fsprogs/e2fsprogs/lib/ext2fs",
134    "//third_party/mtd-utils/lib",
135  ]
136
137  deps = [
138    ":libext2_blkid",
139    ":libext2_com_err",
140    ":libext2_e2p",
141    ":libext2_quota",
142    ":libext2_uuid",
143    ":libext2fs",
144  ]
145
146  install_enable = true
147  subsystem_name = "thirdparty"
148  part_name = "e2fsprogs"
149  install_images = [
150    "system",
151    "updater",
152  ]
153}
154
155###################################################
156###Build libext2_blkid
157config("libext2-headers") {
158  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib" ]
159}
160
161config("libext2_blkid-defaults") {
162  cflags = [
163    "-Wno-implicit-function-declaration",
164    "-Wno-int-conversion",
165  ]
166  defines = [ "secure_getenv=getenv" ]
167}
168
169ohos_shared_library("libext2_blkid") {
170  configs = [
171    ":libext2_blkid-defaults",
172    ":libext2-headers",
173  ]
174  sources = [
175    "e2fsprogs/lib/blkid/cache.c",
176    "e2fsprogs/lib/blkid/dev.c",
177    "e2fsprogs/lib/blkid/devname.c",
178    "e2fsprogs/lib/blkid/devno.c",
179    "e2fsprogs/lib/blkid/getsize.c",
180    "e2fsprogs/lib/blkid/llseek.c",
181    "e2fsprogs/lib/blkid/probe.c",
182    "e2fsprogs/lib/blkid/read.c",
183    "e2fsprogs/lib/blkid/resolve.c",
184    "e2fsprogs/lib/blkid/save.c",
185    "e2fsprogs/lib/blkid/tag.c",
186    "e2fsprogs/lib/blkid/version.c",
187  ]
188
189  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/blkid" ]
190  deps = [ ":libext2_uuid" ]
191  cflags = [
192    "-Wno-error=attributes",
193    "-Wno-error=pointer-sign",
194    "-Wno-unused-parameter",
195    "-fno-strict-aliasing",
196  ]
197  install_enable = true
198  subsystem_name = "thirdparty"
199  part_name = "e2fsprogs"
200  install_images = [
201    "system",
202    "updater",
203  ]
204}
205
206###################################################
207###Build libext2_e2p
208config("libext2_e2p-defaults") {
209  cflags = [
210    "-Wall",
211    "-Werror",
212  ]
213}
214
215ohos_shared_library("libext2_e2p") {
216  sources = [
217    "e2fsprogs/lib/e2p/encoding.c",
218    "e2fsprogs/lib/e2p/errcode.c",
219    "e2fsprogs/lib/e2p/feature.c",
220    "e2fsprogs/lib/e2p/fgetflags.c",
221    "e2fsprogs/lib/e2p/fgetproject.c",
222    "e2fsprogs/lib/e2p/fgetversion.c",
223    "e2fsprogs/lib/e2p/fsetflags.c",
224    "e2fsprogs/lib/e2p/fsetproject.c",
225    "e2fsprogs/lib/e2p/fsetversion.c",
226    "e2fsprogs/lib/e2p/getflags.c",
227    "e2fsprogs/lib/e2p/getversion.c",
228    "e2fsprogs/lib/e2p/hashstr.c",
229    "e2fsprogs/lib/e2p/iod.c",
230    "e2fsprogs/lib/e2p/ljs.c",
231    "e2fsprogs/lib/e2p/ls.c",
232    "e2fsprogs/lib/e2p/mntopts.c",
233    "e2fsprogs/lib/e2p/ostype.c",
234    "e2fsprogs/lib/e2p/parse_num.c",
235    "e2fsprogs/lib/e2p/pe.c",
236    "e2fsprogs/lib/e2p/percent.c",
237    "e2fsprogs/lib/e2p/pf.c",
238    "e2fsprogs/lib/e2p/ps.c",
239    "e2fsprogs/lib/e2p/setflags.c",
240    "e2fsprogs/lib/e2p/setversion.c",
241    "e2fsprogs/lib/e2p/uuid.c",
242  ]
243  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/e2p" ]
244
245  configs = [
246    ":libext2_e2p-defaults",
247    ":libext2-headers",
248  ]
249  cflags = [
250    "-Wno-error=attributes",
251    "-Wno-unused-parameter",
252  ]
253  install_enable = true
254  subsystem_name = "thirdparty"
255  part_name = "e2fsprogs"
256  install_images = [
257    "system",
258    "updater",
259  ]
260}
261
262###################################################
263###Build libext2_com_err
264config("libext2_com_err-defaults") {
265  cflags = [
266    "-Wno-int-conversion",
267    "-Wno-implicit-function-declaration",
268  ]
269  defines = [ "secure_getenv=getenv" ]
270}
271
272ohos_shared_library("libext2_com_err") {
273  sources = [
274    "e2fsprogs/lib/et/com_err.c",
275    "e2fsprogs/lib/et/com_right.c",
276    "e2fsprogs/lib/et/error_message.c",
277    "e2fsprogs/lib/et/et_name.c",
278    "e2fsprogs/lib/et/init_et.c",
279  ]
280
281  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/et" ]
282  configs = [
283    ":libext2_com_err-defaults",
284    ":libext2-headers",
285  ]
286  install_enable = true
287  subsystem_name = "thirdparty"
288  part_name = "e2fsprogs"
289  install_images = [
290    "system",
291    "updater",
292  ]
293}
294
295###################################################
296###Build libext2_com_err
297config("libext2fs-defaults") {
298  cflags = [
299    "-Wno-sign-compare",
300    "-Wno-pointer-sign",
301    "-Wno-implicit-function-declaration",
302    "-Wno-int-conversion",
303  ]
304  defines = [ "secure_getenv=getenv" ]
305}
306
307ohos_shared_library("libext2fs") {
308  sources = [
309    "e2fsprogs/lib/ext2fs/alloc.c",
310    "e2fsprogs/lib/ext2fs/alloc_sb.c",
311    "e2fsprogs/lib/ext2fs/alloc_stats.c",
312    "e2fsprogs/lib/ext2fs/alloc_tables.c",
313    "e2fsprogs/lib/ext2fs/atexit.c",
314    "e2fsprogs/lib/ext2fs/badblocks.c",
315    "e2fsprogs/lib/ext2fs/bb_inode.c",
316    "e2fsprogs/lib/ext2fs/bitmaps.c",
317    "e2fsprogs/lib/ext2fs/bitops.c",
318    "e2fsprogs/lib/ext2fs/blkmap64_ba.c",
319    "e2fsprogs/lib/ext2fs/blkmap64_rb.c",
320    "e2fsprogs/lib/ext2fs/blknum.c",
321    "e2fsprogs/lib/ext2fs/block.c",
322    "e2fsprogs/lib/ext2fs/bmap.c",
323    "e2fsprogs/lib/ext2fs/check_desc.c",
324    "e2fsprogs/lib/ext2fs/closefs.c",
325    "e2fsprogs/lib/ext2fs/crc16.c",
326    "e2fsprogs/lib/ext2fs/crc32c.c",
327    "e2fsprogs/lib/ext2fs/csum.c",
328    "e2fsprogs/lib/ext2fs/dblist.c",
329    "e2fsprogs/lib/ext2fs/dblist_dir.c",
330    "e2fsprogs/lib/ext2fs/digest_encode.c",
331    "e2fsprogs/lib/ext2fs/dir_iterate.c",
332    "e2fsprogs/lib/ext2fs/dirblock.c",
333    "e2fsprogs/lib/ext2fs/dirhash.c",
334    "e2fsprogs/lib/ext2fs/dupfs.c",
335    "e2fsprogs/lib/ext2fs/expanddir.c",
336    "e2fsprogs/lib/ext2fs/ext2_err.c",
337    "e2fsprogs/lib/ext2fs/ext_attr.c",
338    "e2fsprogs/lib/ext2fs/extent.c",
339    "e2fsprogs/lib/ext2fs/fallocate.c",
340    "e2fsprogs/lib/ext2fs/fileio.c",
341    "e2fsprogs/lib/ext2fs/finddev.c",
342    "e2fsprogs/lib/ext2fs/flushb.c",
343    "e2fsprogs/lib/ext2fs/freefs.c",
344    "e2fsprogs/lib/ext2fs/gen_bitmap.c",
345    "e2fsprogs/lib/ext2fs/gen_bitmap64.c",
346    "e2fsprogs/lib/ext2fs/get_num_dirs.c",
347    "e2fsprogs/lib/ext2fs/get_pathname.c",
348    "e2fsprogs/lib/ext2fs/getsectsize.c",
349    "e2fsprogs/lib/ext2fs/getsize.c",
350    "e2fsprogs/lib/ext2fs/hashmap.c",
351    "e2fsprogs/lib/ext2fs/i_block.c",
352    "e2fsprogs/lib/ext2fs/icount.c",
353    "e2fsprogs/lib/ext2fs/imager.c",
354    "e2fsprogs/lib/ext2fs/ind_block.c",
355    "e2fsprogs/lib/ext2fs/initialize.c",
356    "e2fsprogs/lib/ext2fs/inline.c",
357    "e2fsprogs/lib/ext2fs/inline_data.c",
358    "e2fsprogs/lib/ext2fs/inode.c",
359    "e2fsprogs/lib/ext2fs/io_manager.c",
360    "e2fsprogs/lib/ext2fs/ismounted.c",
361    "e2fsprogs/lib/ext2fs/link.c",
362    "e2fsprogs/lib/ext2fs/llseek.c",
363    "e2fsprogs/lib/ext2fs/lookup.c",
364    "e2fsprogs/lib/ext2fs/mkdir.c",
365    "e2fsprogs/lib/ext2fs/mkjournal.c",
366    "e2fsprogs/lib/ext2fs/mmp.c",
367    "e2fsprogs/lib/ext2fs/namei.c",
368    "e2fsprogs/lib/ext2fs/native.c",
369    "e2fsprogs/lib/ext2fs/newdir.c",
370    "e2fsprogs/lib/ext2fs/nls_utf8.c",
371    "e2fsprogs/lib/ext2fs/openfs.c",
372    "e2fsprogs/lib/ext2fs/progress.c",
373    "e2fsprogs/lib/ext2fs/punch.c",
374    "e2fsprogs/lib/ext2fs/qcow2.c",
375    "e2fsprogs/lib/ext2fs/rbtree.c",
376    "e2fsprogs/lib/ext2fs/read_bb.c",
377    "e2fsprogs/lib/ext2fs/read_bb_file.c",
378    "e2fsprogs/lib/ext2fs/res_gdt.c",
379    "e2fsprogs/lib/ext2fs/rw_bitmaps.c",
380    "e2fsprogs/lib/ext2fs/sha256.c",
381    "e2fsprogs/lib/ext2fs/sha512.c",
382    "e2fsprogs/lib/ext2fs/sparse_io.c",
383    "e2fsprogs/lib/ext2fs/swapfs.c",
384    "e2fsprogs/lib/ext2fs/symlink.c",
385    "e2fsprogs/lib/ext2fs/test_io.c",
386    "e2fsprogs/lib/ext2fs/undo_io.c",
387    "e2fsprogs/lib/ext2fs/unix_io.c",
388    "e2fsprogs/lib/ext2fs/unlink.c",
389    "e2fsprogs/lib/ext2fs/valid_blk.c",
390    "e2fsprogs/lib/ext2fs/version.c",
391  ]
392  configs = [ ":libext2fs-defaults" ]
393
394  deps = [ ":libext2_com_err" ]
395
396  cflags = [ "-Wno-unused-parameter" ]
397  include_dirs = [
398    "//third_party/e2fsprogs/e2fsprogs/lib/ext2fs",
399    "//third_party/e2fsprogs/e2fsprogs/lib",
400  ]
401  install_enable = true
402  subsystem_name = "thirdparty"
403  part_name = "e2fsprogs"
404  install_images = [
405    "system",
406    "updater",
407  ]
408}
409
410###################################################
411###Build libext2_ss
412config("libext2_ss-headers") {
413  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib" ]
414  defines = [ "secure_getenv=getenv" ]
415}
416
417ohos_static_library("libext2_ss") {
418  sources = [
419    "e2fsprogs/lib/ss/data.c",
420    "e2fsprogs/lib/ss/error.c",
421    "e2fsprogs/lib/ss/execute_cmd.c",
422    "e2fsprogs/lib/ss/get_readline.c",
423    "e2fsprogs/lib/ss/help.c",
424    "e2fsprogs/lib/ss/invocation.c",
425    "e2fsprogs/lib/ss/list_rqs.c",
426    "e2fsprogs/lib/ss/listen.c",
427    "e2fsprogs/lib/ss/pager.c",
428    "e2fsprogs/lib/ss/parse.c",
429    "e2fsprogs/lib/ss/prompt.c",
430    "e2fsprogs/lib/ss/request_tbl.c",
431    "e2fsprogs/lib/ss/requests.c",
432    "e2fsprogs/lib/ss/ss_err.c",
433    "e2fsprogs/lib/ss/std_rqs.c",
434  ]
435
436  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/ss" ]
437  configs = [ ":libext2_ss-headers" ]
438
439  deps = [ ":libext2_com_err" ]
440}
441
442###################################################
443###Build libext2_quota
444config("libext2_support-defaults") {
445  cflags = [
446    "-Wall",
447    "-Werror",
448  ]
449}
450
451ohos_shared_library("libext2_quota") {
452  sources = [
453    "e2fsprogs/lib/support/dict.c",
454    "e2fsprogs/lib/support/mkquota.c",
455    "e2fsprogs/lib/support/parse_qtype.c",
456    "e2fsprogs/lib/support/plausible.c",
457    "e2fsprogs/lib/support/prof_err.c",
458    "e2fsprogs/lib/support/profile.c",
459    "e2fsprogs/lib/support/profile_helpers.c",
460    "e2fsprogs/lib/support/quotaio.c",
461    "e2fsprogs/lib/support/quotaio_tree.c",
462    "e2fsprogs/lib/support/quotaio_v2.c",
463  ]
464  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/support" ]
465  configs = [
466    ":libext2_support-defaults",
467    ":libext2-headers",
468  ]
469  deps = [
470    ":libext2_blkid",
471    ":libext2_com_err",
472    ":libext2fs",
473  ]
474  install_enable = true
475  subsystem_name = "thirdparty"
476  part_name = "e2fsprogs"
477  install_images = [
478    "system",
479    "updater",
480  ]
481}
482
483###################################################
484###Build libext2_profile
485ohos_static_library("libext2_profile") {
486  sources = [
487    "e2fsprogs/lib/support/prof_err.c",
488    "e2fsprogs/lib/support/profile.c",
489  ]
490  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/support" ]
491  configs = [
492    ":libext2-headers",
493    ":libext2_support-defaults",
494  ]
495
496  deps = [ ":libext2_com_err" ]
497}
498
499###################################################
500###Build libext2_support
501ohos_static_library("libext2_support") {
502  sources = [ "e2fsprogs/lib/support/cstring.c" ]
503  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/support" ]
504  configs = [
505    ":libext2_support-defaults",
506    ":libext2-headers",
507  ]
508}
509
510###################################################
511###Build libext2_uuid
512config("libext2_uuid-defaults") {
513  cflags = [
514    "-Wall",
515    "-Werror",
516  ]
517}
518
519ohos_shared_library("libext2_uuid") {
520  sources = [
521    "e2fsprogs/lib/uuid/clear.c",
522    "e2fsprogs/lib/uuid/compare.c",
523    "e2fsprogs/lib/uuid/copy.c",
524    "e2fsprogs/lib/uuid/gen_uuid.c",
525    "e2fsprogs/lib/uuid/isnull.c",
526    "e2fsprogs/lib/uuid/pack.c",
527    "e2fsprogs/lib/uuid/parse.c",
528    "e2fsprogs/lib/uuid/unpack.c",
529    "e2fsprogs/lib/uuid/unparse.c",
530    "e2fsprogs/lib/uuid/uuid_time.c",
531  ]
532  include_dirs = [ "//third_party/e2fsprogs/e2fsprogs/lib/uuid" ]
533  cflags = [
534    "-Wno-unused-function",
535    "-Wno-unused-parameter",
536  ]
537  configs = [
538    ":libext2_uuid-defaults",
539    ":libext2-headers",
540  ]
541  install_enable = true
542  subsystem_name = "thirdparty"
543  part_name = "e2fsprogs"
544  install_images = [
545    "system",
546    "updater",
547  ]
548}
549
550###################################################
551###Build libext2_misc
552config("libext2_misc-defaults") {
553  cflags = [ "-Wno-pointer-sign" ]
554}
555
556ohos_shared_library("libext2_misc") {
557  configs = [ ":libext2_misc-defaults" ]
558  sources = [ "e2fsprogs/misc/create_inode.c" ]
559  include_dirs = [
560    "//third_party/e2fsprogs/e2fsprogs/misc",
561    "//third_party/e2fsprogs/e2fsprogs/lib",
562  ]
563  cflags = [ "-Wno-error=format-extra-args" ]
564
565  deps = [
566    ":libext2_com_err",
567    ":libext2fs",
568  ]
569  install_enable = true
570  subsystem_name = "thirdparty"
571  part_name = "e2fsprogs"
572  install_images = [
573    "system",
574    "updater",
575  ]
576}
577
578###################################################
579###Build mke2fs
580ohos_executable("mke2fs") {
581  configs = [ ":libext2_misc-defaults" ]
582  sources = [
583    "e2fsprogs/misc/default_profile.c",
584    "e2fsprogs/misc/mk_hugefiles.c",
585    "e2fsprogs/misc/mke2fs.c",
586    "e2fsprogs/misc/util.c",
587  ]
588
589  include_dirs = [
590    "//third_party/e2fsprogs/e2fsprogs/misc",
591    "//third_party/e2fsprogs/e2fsprogs/e2fsck",
592    "//third_party/e2fsprogs/e2fsprogs/lib",
593    "//third_party/e2fsprogs/e2fsprogs/lib/ext2fs",
594  ]
595  cflags = [
596    "-Wno-error=format",
597    "-Wno-error=type-limits",
598    "-Wno-format-extra-args",
599  ]
600
601  deps = [
602    ":libext2_blkid",
603    ":libext2_com_err",
604    ":libext2_e2p",
605    ":libext2_misc",
606    ":libext2_quota",
607    ":libext2_uuid",
608    ":libext2fs",
609  ]
610
611  install_enable = true
612  subsystem_name = "thirdparty"
613  part_name = "e2fsprogs"
614  install_images = [
615    "system",
616    "updater",
617  ]
618}
619
620###################################################
621###Build blkid
622ohos_executable("blkid") {
623  configs = [ ":libext2_misc-defaults" ]
624  sources = [ "e2fsprogs/misc/blkid.c" ]
625
626  include_dirs = [
627    "//third_party/e2fsprogs/e2fsprogs/misc",
628    "//third_party/e2fsprogs/e2fsprogs/lib",
629    "//third_party/e2fsprogs/e2fsprogs/lib/blkid",
630  ]
631  cflags = [
632    "-Wno-error=format",
633    "-Wno-error=type-limits",
634    "-Wno-format-extra-args",
635  ]
636
637  deps = [
638    ":libext2_blkid",
639    ":libext2fs",
640  ]
641
642  install_enable = true
643  subsystem_name = "filemanagement"
644  part_name = "storage_service"
645  install_images = [
646    "system",
647    "updater",
648  ]
649  external_deps = [ "c_utils:utils" ]
650}
651
652###################################################
653###Build resize2fs
654config("resize2fs-defaults") {
655  cflags = [ "-Wno-pointer-sign" ]
656}
657
658ohos_executable("resize2fs") {
659  configs = [ ":resize2fs-defaults" ]
660  sources = [
661    "e2fsprogs/resize/extent.c",
662    "e2fsprogs/resize/main.c",
663    "e2fsprogs/resize/online.c",
664    "e2fsprogs/resize/resize2fs.c",
665    "e2fsprogs/resize/resource_track.c",
666    "e2fsprogs/resize/sim_progress.c",
667  ]
668
669  include_dirs = [
670    "//third_party/e2fsprogs/e2fsprogs/resize",
671    "//third_party/e2fsprogs/e2fsprogs/e2fsck",
672    "//third_party/e2fsprogs/e2fsprogs/lib",
673    "//third_party/e2fsprogs/e2fsprogs/lib/ext2fs",
674  ]
675  cflags = [
676    "-Wno-error=format",
677    "-Wno-error=type-limits",
678    "-Wno-format-extra-args",
679  ]
680
681  deps = [
682    ":libext2_com_err",
683    ":libext2_e2p",
684    ":libext2fs",
685  ]
686
687  if (is_ohos) {
688    ldflags = [ "-stdlib=libc++_static" ]
689  }
690  install_enable = true
691  subsystem_name = "thirdparty"
692  part_name = "e2fsprogs"
693  install_images = [
694    "system",
695    "updater",
696  ]
697}
698