mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Fix up non-grub iso9660 filesystem, plus correct a thinko where the sense of the existing hfs/ext2 probe functions was inverted
by default. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@796 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
c6a9039103
commit
0dddb61de8
@@ -152,6 +152,15 @@ static const fs_ops_t iso9660_ops = {
|
||||
.get_fstype = get_fstype,
|
||||
};
|
||||
|
||||
int
|
||||
fs_iso9660_probe( int fd, llong offs )
|
||||
{
|
||||
if (iso9660_probe(fd, offs))
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fs_iso9660_open(int fd, fs_ops_t *fs)
|
||||
{
|
||||
iso9660_VOLUME *volume;
|
||||
|
||||
@@ -189,6 +189,22 @@ int iso9660_umount(iso9660_VOLUME* volume)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int iso9660_probe(int fd, llong offset)
|
||||
{
|
||||
struct iso_primary_descriptor ipd;
|
||||
|
||||
seek_io(fd, 16 * ISOFS_BLOCK_SIZE + offset);
|
||||
read_io(fd, &ipd, sizeof (ipd));
|
||||
|
||||
if ((ipd.type[0] != ISO_VD_PRIMARY) ||
|
||||
(strncmp(ipd.id, ISO_STANDARD_ID, sizeof (ipd.id)) != 0) ||
|
||||
(ipd.version[0] != 1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct iso_directory_record *iso9660_get_root_node(iso9660_VOLUME* volume)
|
||||
{
|
||||
return (struct iso_directory_record *)volume->descriptor->root_directory_record;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
extern iso9660_VOLUME* iso9660_mount(int fd);
|
||||
extern int iso9660_umount(iso9660_VOLUME *volume);
|
||||
extern int iso9660_probe(int fd, llong offs);
|
||||
extern iso9660_DIR* iso9660_opendir(iso9660_VOLUME *, const char *name);
|
||||
extern iso9660_FILE* iso9660_open(iso9660_VOLUME *, const char *pathname);
|
||||
extern int iso9660_closedir(iso9660_DIR *dir);
|
||||
|
||||
Reference in New Issue
Block a user