Skip to content

Commit 1ab944c

Browse files
committed
Include the associated header from vendor_dlkm_utils.cc
While writing #1850 I ran into an issue that the compiler didn't check return type mismatches between the same function, leading to segfaults at runtime. Including the header makes the functions explicitly conflict. Bug: b/464088042
1 parent c3e057a commit 1ab944c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

base/cvd/cuttlefish/host/commands/assemble_cvd/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ cf_cc_library(
499499
"//cuttlefish/common/libs/utils:disk_usage",
500500
"//cuttlefish/common/libs/utils:environment",
501501
"//cuttlefish/common/libs/utils:files",
502+
"//cuttlefish/common/libs/utils:result",
502503
"//cuttlefish/common/libs/utils:subprocess",
503504
"//cuttlefish/host/commands/assemble_cvd:boot_image_utils",
504505
"//cuttlefish/host/commands/assemble_cvd:kernel_module_parser",

base/cvd/cuttlefish/host/commands/assemble_cvd/vendor_dlkm_utils.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16+
#include "cuttlefish/host/commands/assemble_cvd/vendor_dlkm_utils.h"
17+
1618
#include <fcntl.h>
1719

1820
#include <algorithm>
@@ -407,12 +409,13 @@ Result<void> RepackSuperWithPartition(const std::string& superimg_path,
407409
return {};
408410
}
409411

410-
Result<void> BuildVbmetaImage(const std::string& image_path,
412+
Result<void> BuildVbmetaImage(const std::string& vendor_dlkm_img,
411413
const std::string& vbmeta_path) {
412-
CF_EXPECT(!image_path.empty());
413-
CF_EXPECTF(FileExists(image_path), "'{}' does not exist", image_path);
414+
CF_EXPECT(!vendor_dlkm_img.empty());
415+
CF_EXPECTF(FileExists(vendor_dlkm_img), "'{}' does not exist",
416+
vendor_dlkm_img);
414417

415-
CF_EXPECT(Avb().MakeVbMetaImage(vbmeta_path, {}, {image_path},
418+
CF_EXPECT(Avb().MakeVbMetaImage(vbmeta_path, {}, {vendor_dlkm_img},
416419
{"--padding_size", "4096"}));
417420
return {};
418421
}

base/cvd/cuttlefish/host/commands/assemble_cvd/vendor_dlkm_utils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ Result<void> SplitRamdiskModules(const std::string& ramdisk_path,
2626
const std::string& vendor_dlkm_build_dir,
2727
const std::string& system_dlkm_build_dir);
2828

29-
Result<bool> WriteFsConfig(const char* output_path, const std::string& fs_root,
30-
const std::string& mount_point);
31-
3229
Result<void> RepackSuperWithPartition(const std::string& superimg_path,
3330
const std::string& image_path,
3431
const std::string& partition_name);

0 commit comments

Comments
 (0)