Boot loader: Add support for choosing an old packages state

For potential boot volumes with older packages states the respective
item in the boot volume menu now has a sub menu for selecting a state.
The boot loader functionality for this feature is complete -- i.e. the
respective kernel is loaded and the name of the old state is added to
the kernel args -- but kernel packagefs and package daemon support is
still missing.
This commit is contained in:
Ingo Weinhold
2014-04-18 23:31:39 +02:00
parent 59881eaa16
commit 5c0f8450ac
7 changed files with 692 additions and 63 deletions
@@ -29,6 +29,7 @@
#define BOOT_VOLUME_USER_SELECTED "user selected"
#define BOOT_VOLUME_BOOTED_FROM_IMAGE "booted from image"
#define BOOT_VOLUME_PACKAGED "packaged"
#define BOOT_VOLUME_PACKAGES_STATE "packages state"
#define BOOT_VOLUME_PARTITION_OFFSET "partition offset"
#define BOOT_VOLUME_DISK_IDENTIFIER "disk identifier"
+17 -4
View File
@@ -18,6 +18,8 @@
struct file_map_run;
struct stat;
class PackageVolumeInfo;
class PackageVolumeState;
/** This is the base class for all VFS nodes */
@@ -114,7 +116,11 @@ public:
BootVolume();
~BootVolume();
status_t SetTo(Directory* rootDirectory);
status_t SetTo(Directory* rootDirectory,
PackageVolumeInfo* packageVolumeInfo
= NULL,
PackageVolumeState* packageVolumeState
= NULL);
void Unset();
bool IsValid() const
@@ -125,9 +131,16 @@ public:
Directory* SystemDirectory() const
{ return fSystemDirectory; }
bool IsPackaged() const
{ return fPackaged; }
{ return fPackageVolumeInfo != NULL; }
PackageVolumeInfo* GetPackageVolumeInfo() const
{ return fPackageVolumeInfo; }
PackageVolumeState* GetPackageVolumeState() const
{ return fPackageVolumeState; }
private:
status_t _SetTo(Directory* rootDirectory,
PackageVolumeInfo* packageVolumeInfo,
PackageVolumeState* packageVolumeState);
int _OpenSystemPackage();
private:
@@ -136,8 +149,8 @@ private:
Directory* fSystemDirectory;
// "system" directory of the volume; if packaged the root
// directory of the mounted packagefs
bool fPackaged;
// indicates whether the boot volume's system is packaged
PackageVolumeInfo* fPackageVolumeInfo;
PackageVolumeState* fPackageVolumeState;
};