mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-24 02:25:03 +08:00
722b9ca4ca
The two utilities are now converted to dynamic executables as shared libraries are supported in recovery mode. As part of the conversion, shared libraries that are depended from them are also marked as recovery_available: true. Bug: 79146551 Test: adb reboot recovery, and select 'Wipe data/factory reset'. The data partition is formatted and there is no selinux denial. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Change-Id: I22fbc83a4ff0496096efca90721b0db1237c32cd From AOSP commit: df1f088849ed3336bb4f6f200c29b30682f15948
275 lines
5.9 KiB
Plaintext
275 lines
5.9 KiB
Plaintext
// Copyright 2017 The Android Open Source Project
|
|
|
|
// Library used to export files from this directory to other programs in this
|
|
// project.
|
|
cc_library {
|
|
name: "libext2_misc",
|
|
host_supported: true,
|
|
recovery_available: true,
|
|
defaults: ["e2fsprogs-defaults"],
|
|
|
|
target: {
|
|
windows: {
|
|
include_dirs: [ "external/e2fsprogs/include/mingw" ],
|
|
enabled: true,
|
|
cflags: ["-Wno-unused-variable"],
|
|
},
|
|
},
|
|
|
|
srcs: [
|
|
"create_inode.c",
|
|
],
|
|
cflags: ["-Wno-error=format-extra-args"],
|
|
shared_libs: [
|
|
"libext2_quota",
|
|
"libext2fs",
|
|
],
|
|
system_shared_libs: ["libc", "libdl"],
|
|
export_include_dirs: ["."],
|
|
}
|
|
|
|
//########################################################################
|
|
// Build mke2fs
|
|
|
|
cc_binary {
|
|
name: "mke2fs",
|
|
host_supported: true,
|
|
recovery_available: true,
|
|
defaults: ["e2fsprogs-defaults"],
|
|
|
|
srcs: [
|
|
"mke2fs.c",
|
|
"util.c",
|
|
"mk_hugefiles.c",
|
|
"default_profile.c",
|
|
],
|
|
cflags: [
|
|
"-Wno-error=format",
|
|
"-Wno-error=type-limits",
|
|
"-Wno-format-extra-args",
|
|
],
|
|
target: {
|
|
host: {
|
|
static_libs: [
|
|
"libext2_blkid",
|
|
"libext2_misc",
|
|
"libext2_uuid",
|
|
"libext2_quota",
|
|
"libext2_com_err",
|
|
"libext2_e2p",
|
|
"libext2fs",
|
|
"libsparse",
|
|
"libbase",
|
|
"libz",
|
|
],
|
|
},
|
|
not_windows: {
|
|
required: [
|
|
"mke2fs.conf",
|
|
],
|
|
},
|
|
windows: {
|
|
include_dirs: [ "external/e2fsprogs/include/mingw" ],
|
|
cflags: [
|
|
"-D_POSIX",
|
|
"-D__USE_MINGW_ALARM",
|
|
// mke2fs.c has a warning from gcc which cannot be suppressed:
|
|
// passing argument 3 of 'ext2fs_get_device_size' from
|
|
// incompatible pointer type
|
|
"-Wno-error"
|
|
],
|
|
ldflags: ["-static"],
|
|
host_ldlibs: ["-lws2_32"],
|
|
enabled: true
|
|
},
|
|
android: {
|
|
required: [
|
|
"mke2fs.conf",
|
|
],
|
|
shared_libs: [
|
|
"libext2fs",
|
|
"libext2_blkid",
|
|
"libext2_misc",
|
|
"libext2_uuid",
|
|
"libext2_quota",
|
|
"libext2_com_err",
|
|
"libext2_e2p",
|
|
],
|
|
symlinks: ["mkfs.ext2", "mkfs.ext3", "mkfs.ext4"],
|
|
},
|
|
},
|
|
stl: "libc++_static",
|
|
include_dirs: ["external/e2fsprogs/e2fsck"],
|
|
}
|
|
|
|
//##########################################################################
|
|
// Build tune2fs
|
|
|
|
cc_defaults {
|
|
name: "tune2fs-defaults",
|
|
defaults: ["e2fsprogs-defaults"],
|
|
srcs: [
|
|
"tune2fs.c",
|
|
"util.c",
|
|
],
|
|
cflags: ["-DNO_RECOVERY"],
|
|
include_dirs: ["external/e2fsprogs/e2fsck"],
|
|
}
|
|
|
|
tune2fs_libs = [
|
|
"libext2_com_err",
|
|
"libext2_blkid",
|
|
"libext2_quota",
|
|
"libext2_uuid",
|
|
"libext2_e2p",
|
|
"libext2fs",
|
|
]
|
|
|
|
cc_binary {
|
|
name: "tune2fs",
|
|
host_supported: true,
|
|
defaults: ["tune2fs-defaults"],
|
|
|
|
shared_libs: tune2fs_libs,
|
|
system_shared_libs: ["libc", "libdl"],
|
|
}
|
|
|
|
cc_binary {
|
|
name: "tune2fs_static",
|
|
static_executable: true,
|
|
defaults: ["tune2fs-defaults"],
|
|
|
|
static_libs: tune2fs_libs,
|
|
}
|
|
|
|
cc_library_static {
|
|
name: "libtune2fs",
|
|
defaults: ["tune2fs-defaults"],
|
|
|
|
cflags: ["-DBUILD_AS_LIB"],
|
|
static_libs: tune2fs_libs,
|
|
}
|
|
|
|
//########################################################################
|
|
// Build badblocks
|
|
|
|
cc_binary {
|
|
name: "badblocks",
|
|
host_supported: true,
|
|
defaults: ["e2fsprogs-defaults"],
|
|
|
|
srcs: ["badblocks.c"],
|
|
shared_libs: [
|
|
"libext2fs",
|
|
"libext2_com_err",
|
|
"libext2_uuid",
|
|
"libext2_blkid",
|
|
"libext2_e2p",
|
|
],
|
|
system_shared_libs: ["libc", "libdl"],
|
|
}
|
|
|
|
//########################################################################
|
|
// Build chattr
|
|
|
|
cc_binary {
|
|
name: "chattr",
|
|
host_supported: true,
|
|
defaults: ["e2fsprogs-defaults"],
|
|
|
|
srcs: ["chattr.c"],
|
|
shared_libs: [
|
|
"libext2_com_err",
|
|
"libext2_e2p",
|
|
],
|
|
system_shared_libs: ["libc", "libdl"],
|
|
}
|
|
|
|
//########################################################################
|
|
// Build lsattr
|
|
|
|
cc_defaults {
|
|
name: "lsattr-defaults",
|
|
srcs: ["lsattr.c"],
|
|
defaults: ["e2fsprogs-defaults"],
|
|
}
|
|
|
|
lsattr_libs = [
|
|
"libext2_com_err",
|
|
"libext2_e2p",
|
|
]
|
|
|
|
cc_binary {
|
|
name: "lsattr",
|
|
host_supported: true,
|
|
defaults: ["lsattr-defaults"],
|
|
|
|
shared_libs: lsattr_libs,
|
|
system_shared_libs: ["libc", "libdl"],
|
|
}
|
|
|
|
cc_binary {
|
|
name: "lsattr_static",
|
|
static_executable: true,
|
|
defaults: ["lsattr-defaults"],
|
|
|
|
static_libs: lsattr_libs,
|
|
}
|
|
|
|
//########################################################################
|
|
// Build blkid
|
|
|
|
cc_binary {
|
|
name: "blkid",
|
|
defaults: ["e2fsprogs-defaults"],
|
|
|
|
srcs: ["blkid.c"],
|
|
shared_libs: [
|
|
"libext2fs",
|
|
"libext2_blkid",
|
|
"libext2_com_err",
|
|
"libext2_e2p",
|
|
],
|
|
system_shared_libs: ["libc", "libdl"],
|
|
}
|
|
|
|
//########################################################################
|
|
// Build e4crypt
|
|
|
|
cc_binary {
|
|
name: "e4crypt",
|
|
host_supported: true,
|
|
defaults: ["e2fsprogs-defaults"],
|
|
|
|
srcs: ["e4crypt.c"],
|
|
shared_libs: [
|
|
"libext2fs",
|
|
"libext2_uuid",
|
|
],
|
|
system_shared_libs: ["libc", "libdl"],
|
|
|
|
target: {
|
|
darwin: {
|
|
enabled: false,
|
|
},
|
|
},
|
|
}
|
|
|
|
//##########################################################################
|
|
// Build e2image
|
|
|
|
cc_binary {
|
|
name: "e2image",
|
|
host_supported: true,
|
|
defaults: ["e2fsprogs-defaults"],
|
|
|
|
srcs: ["e2image.c"],
|
|
shared_libs: [
|
|
"libext2fs",
|
|
"libext2_blkid",
|
|
"libext2_com_err",
|
|
"libext2_quota",
|
|
],
|
|
system_shared_libs: ["libc", "libdl"],
|
|
}
|