#include "libfstools.h"
-char const *extroot_prefix = NULL;
-
/*
* This will execute "block extroot" and make use of mounted extroot or return
* an error.
*/
-int mount_extroot(void)
+int mount_extroot(char const *extroot_prefix)
{
char ldlib_path[32];
char block_path[32];
struct stat s;
pid_t pid;
- if (!extroot_prefix)
- return -1;
-
/* try finding the library directory */
snprintf(ldlib_path, sizeof(ldlib_path), "%s/upper/lib", extroot_prefix);
__FS_STATE_LAST = FS_STATE_READY,
};
-extern char const *extroot_prefix;
-extern int mount_extroot(void);
+extern int mount_extroot(char const *extroot_prefix);
extern int mount_snapshot(struct volume *v);
extern int mount_overlay(struct volume *v);
* Check for extroot config in overlay (rootfs_data) and if present then
* prefer it over rootfs_data.
*/
- extroot_prefix = "/tmp/overlay";
- if (!mount_extroot()) {
+ if (!mount_extroot("/tmp/overlay")) {
ULOG_INFO("switched to extroot\n");
return 0;
}
}
/* Check for extroot config in rootfs before even trying rootfs_data */
- extroot_prefix = "";
- if (!mount_extroot()) {
+ if (!mount_extroot("")) {
ULOG_NOTE("switched to extroot\n");
return 0;
}