Skip to content

Commit 4f427fb

Browse files
committed
Rename and expose detect_and_mount_boot
1 parent 9b57ae6 commit 4f427fb

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/bootman/bootman.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ bool boot_manager_set_prefix(BootManager *self, char *prefix)
212212
free(self->user_initrd_freestanding_dir);
213213
}
214214
self->user_initrd_freestanding_dir = user_initrd_dir;
215-
215+
216216
if (self->bootloader) {
217217
self->bootloader->destroy(self);
218218
self->bootloader = NULL;
@@ -331,7 +331,7 @@ bool boot_manager_remove_kernel_wrapper(BootManager *self, const Kernel *kernel)
331331
CHECK_ERR_RET_VAL(!kernels || kernels->len == 0, false,
332332
"No kernels discovered in %s, bailing", self->kernel_dir);
333333

334-
did_mount = detect_and_mount_boot(self, &boot_dir);
334+
did_mount = boot_manager_detect_and_mount_boot(self, &boot_dir);
335335
CHECK_DBG_RET_VAL(did_mount < 0, false, "Boot was not mounted");
336336

337337
for (uint16_t i = 0; i < kernels->len; i++) {
@@ -371,7 +371,7 @@ bool boot_manager_remove_kernel(BootManager *self, const Kernel *kernel)
371371
return self->bootloader->remove_kernel(self, kernel);
372372
}
373373

374-
int detect_and_mount_boot(BootManager *self, char **boot_dir) {
374+
int boot_manager_detect_and_mount_boot(BootManager *self, char **boot_dir) {
375375
autofree(char) *boot_dev = NULL;
376376
const char *prefix;
377377
int wanted_boot_mask;
@@ -412,7 +412,7 @@ bool boot_manager_set_default_kernel(BootManager *self, const Kernel *kernel)
412412
CHECK_ERR_RET_VAL(!kernels || kernels->len == 0, false,
413413
"No kernels discovered in %s, bailing", self->kernel_dir);
414414

415-
did_mount = detect_and_mount_boot(self, &boot_dir);
415+
did_mount = boot_manager_detect_and_mount_boot(self, &boot_dir);
416416
CHECK_DBG_RET_VAL(did_mount < 0, false, "Boot was not mounted");
417417

418418
for (uint16_t i = 0; i < kernels->len; i++) {
@@ -608,7 +608,7 @@ char **boot_manager_list_kernels(BootManager *self)
608608
/* Sort them to ensure static ordering */
609609
nc_array_qsort(kernels, kernel_compare_reverse);
610610

611-
did_mount = detect_and_mount_boot(self, &boot_dir);
611+
did_mount = boot_manager_detect_and_mount_boot(self, &boot_dir);
612612
if (did_mount >= 0) {
613613
default_kernel = boot_manager_get_default_kernel(self);
614614
if (did_mount > 0) {

src/bootman/bootman.h

+7
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ bool boot_manager_set_default_kernel(BootManager *manager, const Kernel *kernel)
297297
*/
298298
char *boot_manager_get_default_kernel(BootManager *manager);
299299

300+
/**
301+
* Detect and mount the boot directory.
302+
* @param boot_dir Path indicating the mounted boot directory.
303+
* @return an integer value, indicating success or failure.
304+
*/
305+
int boot_manager_detect_and_mount_boot(BootManager *self, char **boot_dir);
306+
300307
/**
301308
* Return the CbmDeviceProbe for the root partition
302309
*

src/bootman/bootman_private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int mount_boot(BootManager *self, char **boot_directory);
7171
*
7272
* @see mount_boot() for return and error conditions.
7373
*/
74-
int detect_and_mount_boot(BootManager *self, char **boot_dir);
74+
int boot_manager_detect_and_mount_boot(BootManager *self, char **boot_dir);
7575

7676
/**
7777
* Internal function to sort by Kernel structs by release number (highest first)

src/bootman/update.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool boot_manager_update(BootManager *self)
4141
return boot_manager_update_image(self);
4242
}
4343

44-
did_mount = detect_and_mount_boot(self, &boot_dir);
44+
did_mount = boot_manager_detect_and_mount_boot(self, &boot_dir);
4545
if (did_mount >= 0) {
4646
/* Do a native update */
4747
ret = boot_manager_update_native(self);

0 commit comments

Comments
 (0)