Add boot loader packagefs support

* Add pread().
* Add Node::ReadLink() to read a symbolic link path.
* Add Directory::LookupDontTraverse() and make Lookup() non-abstract.
  Lookup() is implemented via LookupDontTraverse() and Node::ReadLink().
* Adjust all FS implementations accordingly.
* Add a packagefs implementation. Unlike other FS implementations it
  isn't a pseudo-module, but provides a function to explicitly mount a
  package file (packagefs_mount_file()).
* Finish BootVolume::SetTo() implementation, mounting the package file
  and replacing fSystemDirectory.

Now the boot loader can load the kernel and boot modules from a packaged
system. The kernel boots up to the point where the boot volume is
mounted.
This commit is contained in:
Ingo Weinhold
2011-07-17 16:54:15 +02:00
parent 3057223796
commit cbc85916fb
16 changed files with 1006 additions and 83 deletions
+8 -3
View File
@@ -26,8 +26,12 @@ class Node : public DoublyLinkedListLinkImpl<Node> {
virtual status_t Open(void **_cookie, int mode);
virtual status_t Close(void *cookie);
virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize) = 0;
virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize) = 0;
virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer,
size_t bufferSize) = 0;
virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer,
size_t bufferSize) = 0;
virtual status_t ReadLink(char* buffer, size_t bufferSize);
virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
virtual status_t GetFileMap(struct file_map_run *runs, int32 *count);
@@ -55,7 +59,8 @@ class Directory : public Node {
virtual int32 Type() const;
virtual Node *Lookup(const char *name, bool traverseLinks) = 0;
virtual Node* Lookup(const char* name, bool traverseLinks);
virtual Node* LookupDontTraverse(const char* name) = 0;
virtual status_t GetNextEntry(void *cookie, char *nameBuffer, size_t bufferSize) = 0;
virtual status_t GetNextNode(void *cookie, Node **_node) = 0;