Commit Graph

40141 Commits

Author SHA1 Message Date
Ingo Weinhold
fa9fde956e Remove unused Node fields 2011-07-17 16:54:25 +02:00
Ingo Weinhold
8ae81ef94e Kernel interface abstraction for attribute access
* Introduce interface AttributeCookie and currently only implementation
  UnpackingAttributeCookie. This is an interface for reading/stat()ing
  an attribute.
* Add abstract virtual Node::OpenAttribute() method that returns an
  AttributeCookie and implemented it for derived classes.
* In the kernel interface attribute hooks use AttributeCookie now. The
  attribute directory hooks are unchanged.
2011-07-17 16:54:25 +02:00
Ingo Weinhold
22a808885b Remove kernel_interface.cpp LeafNode dependency
Introduce abstract virtual Node::ReadSymlink() method that is now used
in packagefs_read_symlink() instead of casting to LeafNode.
2011-07-17 16:54:25 +02:00
Ingo Weinhold
4b5dbacdbf Make Volume::Read{Lock,Unlock} const 2011-07-17 16:54:24 +02:00
Ingo Weinhold
31cd721ebd Change package and resolvable version 2011-07-17 16:54:24 +02:00
Ingo Weinhold
01102ee50e WIP towards packagefs package links support
* Introduce Version class representing a version.
* Introduce Dependency and Resolvable class and add lists of either to
  Package.
* Parse package attributes and add dependencies and resolvables to
  Package.
* Add a mount type to Volume and add a respective mount parameter
  "mount-type" (values "system", "common", "home", "custom"). Also
  implies the shine-through type, if that's not given.
* Introduce class PackageFamily which groups equally named and versioned
  packages.
* Add class PackageFSRoot. Each instance represents a possible file
  system root (separate roots for different chroot environments). Tracks
  Volumes belonging to the same root and their packages.
2011-07-17 16:54:24 +02:00
Ingo Weinhold
ddabac20de Rename Package "name" property to "fileName" 2011-07-17 16:54:24 +02:00
Ingo Weinhold
6e6ca8c530 Fix resolvable name 2011-07-17 16:54:23 +02:00
Ingo Weinhold
5957270c72 Print the package version nicely 2011-07-17 16:54:23 +02:00
Ingo Weinhold
fe5928847a Completed vfs_bind_mount_directory() support
We don't need to explicitly track the covered/covering nodes per mount
after all. In fs_unmount() we iterate through all vnodes multiple times
anyway and can deal with the covers/covered_by vnodes there. Also, the
root vnode doesn't need to be handled specially anymore.
2011-07-17 16:54:23 +02:00
Ingo Weinhold
0be138ab2f vfs_bind_mount_directory(): Fail if unmounting 2011-07-17 16:54:23 +02:00
Ingo Weinhold
19c48aa4ae fix_dirent(): Fix ref count leaks
* Only get an additional parent reference, when going to call
  vnode_path_to_vnode().
* Put the reference of the vnode vnode_path_to_vnode() returns.
2011-07-17 16:54:22 +02:00
Ingo Weinhold
9561ddca0f remove_vnode(): Also consider covering vnode busy 2011-07-17 16:54:22 +02:00
Ingo Weinhold
4ef5b631e7 Implement packagefs_get_vnode_name() hook 2011-07-17 16:54:22 +02:00
Ingo Weinhold
b478cc3fc5 Put TimGMSoundFont package in the right directory 2011-07-17 16:54:22 +02:00
Ingo Weinhold
60043152eb Mount packagefs with "system" shine-through mode 2011-07-17 16:54:21 +02:00
Ingo Weinhold
51191b1d4c Remove debug output 2011-07-17 16:54:21 +02:00
Ingo Weinhold
314cb5f13e Add support for shine-through directories
* packagefs_mount(): Initialize the fs_volume earlier, so it is more
  usuable in Volume::Mount().
* The new mount parameter "shine-through" can be used to specify which
  shine-through mode shall be used. Can be "system", "common", "home",
  and "none". Depending on the setting it is decided which directories
  of the underlying file system are bind-mounted on top of ours.
* Fix infinite loop in Volume::_RemovePackageContent().
* Use the RETURN_ERROR() macro in more places to help with debugging.
2011-07-17 16:54:21 +02:00
Ingo Weinhold
d61a8548f9 Add support for bind-mounting directories
* Add support function vfs_get_mount_point(), so a file system can get
  its own mount point (i.e. the node it covers). Re-added
  fs_mount::covers_vnode for that purpose -- the root node isn't know to
  the VFS before the mount() hook returns.
* Add function vfs_bind_mount_directory() which bind-mounts a directory
  to another. The Vnode::covers/covered_by mechanism is used, so this
  isn't true bind-mounting, but sufficient for what we need ATM and
  cheaper as well. The vnodes connected thus aren't tracked yet, which
  is needed for undoing the connection when unmounting.
* get_vnode_name(): Don't use dir_read() to read the directory. Since we
  have already resolved vnode to the covered vnode, we don't want the
  dirents to be "fixed" to refer to the covering nodes. Such a vnode
  simply wouldn't be found.
2011-07-17 16:54:21 +02:00
Ingo Weinhold
313e1e37f2 Add vfs_ prefix to resolve_vnode_to_covering_vnode() 2011-07-17 16:54:20 +02:00
Ingo Weinhold
2e21fc5436 Generalize use of Vnode::covered_by/covers
* Introduce Vnode flags for covered and covering. Can be used as a quick
  check when one doesn't already hold sVnodeLock.
* Rename resolve_mount_point_to_volume_root() to
  resolve_vnode_to_covering_vnode().
* Adjust all code that deals with transitions between mount points and
  volume root vnodes to generally support covered/covering vnodes.
2011-07-17 16:54:20 +02:00
Ingo Weinhold
3cc710798b Replaced fs_mount::covers_vnode by Vnode::covers
Introduce a Vnode::covers field. It is currently only used for the root
node of an fs_mount, replacing fs_mount::covers_vnode.
2011-07-17 16:54:20 +02:00
Ingo Weinhold
9280379a7b Comment typo fixes 2011-07-17 16:54:20 +02:00
Ingo Weinhold
253e6eeb6a Ignore build/user_config_headers 2011-07-17 16:54:19 +02:00
Ingo Weinhold
3f6ca2fdca Move remaining /boot/system contents into packages
* Build system: Create packages haiku-devel, haiku-welcome,
  haiku-userguide, and makefile-engine.
* The TimGMSoundFont and BeBook zip files have been repackaged as hpkg
  files.
* Adjust the optional package definitions accordingly.
2011-07-17 16:54:19 +02:00
Ingo Weinhold
d00bcc1607 Hard code "Public Domain" as acceptable license 2011-07-17 16:54:19 +02:00
Ingo Weinhold
0d792bb3bb Fixed input server start fallback
After failing to start the input server by signature, the fallback
didn't append the input server name to the servers directory returned by
find_directory().
2011-07-17 16:54:19 +02:00
Ingo Weinhold
fdc30d62ce Fix gcc2 and ICU optional packages
* InstallOptionalHaikuImagePackage: In case of hpkg packages, copy them
  to the target directory, instead of extracting them.
* Correct gcc 2 package download URL.
* The ICU gcc 2 optional packages has been repackaged as hpkg. Use that.
  For gcc 4 things are broken, now.
2011-07-17 16:54:19 +02:00
Ingo Weinhold
f724ec0e1e ExtractArchive: Add hpkg support 2011-07-17 16:54:18 +02:00
Ingo Weinhold
05384d6944 Changed architecture to x86_gcc2
This needs to be created dynamically somehow, but for the time being we
want things to work for gcc2 and x86 at least.
2011-07-17 16:54:18 +02:00
Ingo Weinhold
d971dfb688 Nicer error output 2011-07-17 16:54:18 +02:00
Ingo Weinhold
52e079692f write_pos(): Fix return value for attribute writes 2011-07-17 16:54:18 +02:00
Ingo Weinhold
55a34b69f3 fs_write_attr(): Allow 0-length NULL buffer 2011-07-17 16:54:17 +02:00
Ingo Weinhold
8ba02058b9 Add atomic_*() functions to boot loader 2011-07-17 16:54:17 +02:00
Ingo Weinhold
18e7d26c8d Mount the /boot/system packagefs on boot 2011-07-17 16:54:17 +02:00
Ingo Weinhold
ba65f94667 Fix image rules wrt system/ relative entries
* Introduce on-container jam variable HAIKU_CONTAINER_SYSTEM_DIR_TOKENS
  containing the directory tokens relative to the container root to
  refer to system.
* Use the variable in *ToContainer rules that need to put something in
  system.
* AddFilesToContainer: Fix overlooked reference to AddFilesToHaikuImage.
* AddBootModuleSymlinksToContainer: Use relative symlinks. This avoids
  special-casing in the boot loader for packagefs.
2011-07-17 16:54:17 +02:00
Ingo Weinhold
6d7953ef0a Add boot module symlink for packagefs 2011-07-17 16:54:16 +02:00
Ingo Weinhold
cb89356142 Boot loader packagefs: Fix ".." lookups
* PackageDirectory::Lookup(): Support "." and ".." lookups.
* PackageLoaderContentHandler::HandleEntry(): If the entry doesn't have
  a parent directory, use the volume's root directory directly. This
  makes PackageVolume::AddNode() superfluous and also always passes a
  non-NULL parent directory to PackageNode::Init().
2011-07-17 16:54:16 +02:00
Ingo Weinhold
02b57b32a3 Bump boot loader heap size 2011-07-17 16:54:16 +02:00
Ingo Weinhold
441b85e1cc Assign node IDs to packagefs nodes
Fixes module loading. elf_load_image() checks the node ID to verify
whether an image was already loaded, so giving all nodes the same ID
only gets one image loaded. The IDs don't necessarily match the ones the
kernel packagefs assigns, which could be a problem later on.
2011-07-17 16:54:16 +02:00
Ingo Weinhold
533833f646 Add kernel args boot volume "packaged" flag
* Add BOOT_VOLUME_PACKAGED boot volume message field name constant.
* register_boot_file_system():
  - Now takes a BootVolume& parameter.
  - If the boot volume is packaged, add that info to the boot volume
    message.
2011-07-17 16:54:15 +02:00
Ingo Weinhold
cbc85916fb 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.
2011-07-17 16:54:15 +02:00
Ingo Weinhold
3057223796 Add BReferenceable to boot loader
Also force include kernel_cpp.h, so it doesn't have to be included in
every file (still is included in most, though).
2011-07-17 16:54:15 +02:00
Ingo Weinhold
b232be5a47 Boot loader build: add strerror,...
* Don't link against libsupc++ anymore. We use kernel_cpp.* instead.
* Link twice against boot_loader.a, so undefined symbols in FSs are
  resolved.
2011-07-17 16:54:15 +02:00
Ingo Weinhold
2ef572b8fe ReaderImplBase::ParseStrings(): Avoid new[0] 2011-07-17 16:54:14 +02:00
Ingo Weinhold
9a8c1339ce Split package kit DataReader.cpp
Pull AttributeDataReader and FDDataReader implementations out of
DataReader.cpp into own source files. Thus we can avoid dependencies
(e.g. to fs_attr code) we don't need/want.
2011-07-17 16:54:14 +02:00
Ingo Weinhold
abc3c57ba6 KernelLd rule: opt-out linking against libsupc++
Introduced HAIKU_NO_LIBSUPC++ variable on target to prevent linking
against libsupc++.
2011-07-17 16:54:14 +02:00
Ingo Weinhold
898396ef61 Increase boot loader heap size
We need more for packagefs support.
2011-07-17 16:54:14 +02:00
Ingo Weinhold
8f583b2771 Build fix 2011-07-17 16:54:13 +02:00
Ingo Weinhold
d11ea2b5ed Introduce BootVolume abstraction class
BootVolume is initialized from a root directory of a volume. It finds
the system directory, and -- not implemented yet -- mounts the system
package, if the system is packaged, replacing the system directory with
it. Adjusted several functionality (main(), the loader functions,
user_menu()) to use BootVolume instead of the root directory.
2011-07-17 16:54:13 +02:00