Skip to content

Commit

Permalink
VFS: Pass packages state selected in boot loader to packagefs
Browse files Browse the repository at this point in the history
  • Loading branch information
weinhold committed Apr 18, 2014
1 parent 8585939 commit 6b3a5ca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/system/kernel/fs/vfs_boot.cpp
Expand Up @@ -526,9 +526,17 @@ vfs_mount_boot_file_system(kernel_args* args)
&& lstat(kSystemPackagesDirectory, &st) == 0)) {
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,
0, "packages /boot/system/packages; type system",
0 /* unused argument length */);
0, arguments, 0 /* unused argument length */);
if (packageMount < 0) {
panic("Failed to mount system packagefs: %s",
strerror(packageMount));
Expand Down

0 comments on commit 6b3a5ca

Please sign in to comment.