VFS: Pass packages state selected in boot loader to packagefs
This commit is contained in:
@@ -526,9 +526,17 @@ vfs_mount_boot_file_system(kernel_args* args)
|
|||||||
&& lstat(kSystemPackagesDirectory, &st) == 0)) {
|
&& lstat(kSystemPackagesDirectory, &st) == 0)) {
|
||||||
static const char* const kPackageFSName = "packagefs";
|
static const char* const kPackageFSName = "packagefs";
|
||||||
|
|
||||||
|
char arguments[256];
|
||||||
|
strlcpy(arguments, "packages /boot/system/packages; type system",
|
||||||
|
sizeof(arguments));
|
||||||
|
if (const char* stateName
|
||||||
|
= bootVolume.GetString(BOOT_VOLUME_PACKAGES_STATE, NULL)) {
|
||||||
|
strlcat(arguments, "; state ", sizeof(arguments));
|
||||||
|
strlcat(arguments, stateName, sizeof(arguments));
|
||||||
|
}
|
||||||
|
|
||||||
dev_t packageMount = _kern_mount("/boot/system", NULL, kPackageFSName,
|
dev_t packageMount = _kern_mount("/boot/system", NULL, kPackageFSName,
|
||||||
0, "packages /boot/system/packages; type system",
|
0, arguments, 0 /* unused argument length */);
|
||||||
0 /* unused argument length */);
|
|
||||||
if (packageMount < 0) {
|
if (packageMount < 0) {
|
||||||
panic("Failed to mount system packagefs: %s",
|
panic("Failed to mount system packagefs: %s",
|
||||||
strerror(packageMount));
|
strerror(packageMount));
|
||||||
|
|||||||
Reference in New Issue
Block a user