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
@@ -205,7 +205,7 @@ int fs_ext2_open(int fd, fs_ops_t *fs)
|
||||
int fs_ext2_probe(int fd, llong offs)
|
||||
{
|
||||
if (ext2_probe(fd, offs))
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ int
|
||||
fs_hfs_probe( int fd, llong offs )
|
||||
{
|
||||
if (hfs_probe(fd, offs))
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ int
|
||||
fs_hfsp_probe(int fd, llong offs)
|
||||
{
|
||||
if (volume_probe(fd, offs))
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -69,8 +69,10 @@ static inline int fs_hfs_probe( int fd, llong offs ) { return -1; }
|
||||
|
||||
#ifdef CONFIG_ISO9660
|
||||
extern int fs_iso9660_open( int fd, fs_ops_t *fs );
|
||||
extern int fs_iso9660_probe( int fd, llong offs );
|
||||
#else
|
||||
static inline int fs_iso9660_open( int fd, fs_ops_t *fs ) { return -1; }
|
||||
static inline int fs_iso9660_probe( int fd, llong offs ) { return -1; }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXT2
|
||||
|
||||
@@ -359,12 +359,12 @@ files_probe( files_info_t *mi )
|
||||
err = fs_hfs_probe(fd, offs);
|
||||
DPRINTF("--- HFS returned %d\n", err);
|
||||
}
|
||||
/*
|
||||
|
||||
if( err ) {
|
||||
err = fs_iso9660_open(fd, fs);
|
||||
err = fs_iso9660_probe(fd, offs);
|
||||
DPRINTF("--- ISO9660 returned %d\n", err);
|
||||
}
|
||||
*/
|
||||
|
||||
if( err ) {
|
||||
err = fs_ext2_probe(fd, offs);
|
||||
DPRINTF("--- ext2 returned %d\n", err);
|
||||
|
||||
Reference in New Issue
Block a user