Skip to content

Commit

Permalink
1st commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ced2911 committed May 19, 2012
0 parents commit 01fdb65
Show file tree
Hide file tree
Showing 127 changed files with 37,374 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.o
*.d
*.a
.svn
11 changes: 11 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

Present author and main programmer of ext2fs in alphabetical order:

Theodore Ts'o

Many more are contributing to this project. Read it all up at http://e2fsprogs.sourceforge.net/ext2.html


Nintendo GameCube/Wii port author:

Dimok
10 changes: 10 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
First of all thanks goes to everyone who contributed to ext2fs directly or indirectly.
Visit the site to inform yourself who was involved in it http://e2fsprogs.sourceforge.net/ext2.html

The following people have contributed directly or indirectly
to the Nintendo GameCube/Wii port of ext2fs.

Michael "Chishm" Chisholm
rodries
Rhys "Shareese" Koedijk
Dimok
340 changes: 340 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

default: xenon

all: release

xenon:
$(MAKE) -C source PLATFORM=xenon BUILD=xenon_debug
clean:
$(MAKE) -C source clean

install: xenon
$(MAKE) -C source install

110 changes: 110 additions & 0 deletions include/ext2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/********************************************************************************
* ext2.h - devoptab file routines for EXT2/3/4-based devices. *
* *
* Copyright (c) 2010 Dimok *
* *
* This program/include file is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as published *
* by the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program/include file is distributed in the hope that it will be *
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software Foundation, *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
********************************************************************************/
#ifndef __EXT2_H_
#define __EXT2_H_

#ifdef __cplusplus
extern "C" {
#endif
#ifndef XENON
#include <gctypes.h>
#include <gccore.h>
#include <ogc/disc_io.h>
#else
#include <xetypes.h>
#include <diskio/disc_io.h>
#endif

/**
* EXT2 cache options
*
* It is recommended to use more pages instead of large page sizes for cache due to the sporadic write behaviour of ext file system.
* It will significantly increase the speed. A page size of 32 is mostly suffiecient. The larger the page count the faster the
* read/write between smaller files will be. Larger page sizes result in faster read/write of single big files.
*/
#define EXT2_CACHE_DEFAULT_PAGE_COUNT 64 /* The default number of pages in the cache */
#define EXT2_CACHE_DEFAULT_PAGE_SIZE 32 /* The default number of sectors per cache page */

/* EXT2 mount flags */
#define EXT2_FLAG_RW 0x00001 /* Open the filesystem for reading and writing. Without this flag, the filesystem is opened for reading only. */
#define EXT2_FLAG_FORCE 0x00400 /* Open the filesystem regardless of the feature sets listed in the superblock */
#define EXT2_FLAG_JOURNAL_DEV_OK 0x01000 /* Only open external journal devices if this flag is set (e.g. ext3/ext4) */
#define EXT2_FLAG_64BITS 0x20000 /* Use the new style 64-Bit bitmaps. For more information see gen_bitmap64.c */
#define EXT2_FLAG_PRINT_PROGRESS 0x40000 /* If this flag is set the progress of file operations will be printed to stdout */
#define EXT2_FLAG_SKIP_MMP 0x100000 /* Open without multi-mount protection check. */
#define EXT2_FLAG_DEFAULT (EXT2_FLAG_RW | EXT2_FLAG_64BITS | EXT2_FLAG_JOURNAL_DEV_OK | EXT2_FLAG_SKIP_MMP)

/**
* Find all EXT2/3/4 partitions on a block device.
*
* @param INTERFACE The block device to search
* @param PARTITIONS (out) A pointer to receive the array of partition start sectors
*
* @return The number of entries in PARTITIONS or -1 if an error occurred (see errno)
* @note The caller is responsible for freeing PARTITIONS when finished with it
*/
int ext2FindPartitions(const DISC_INTERFACE *interface, sec_t **partitions);

/**
* Mount a EXT2/3/4 partition from a specific sector on a block device.
*
* @param NAME The name to mount the device under (can then be accessed as "NAME:/")
* @param INTERFACE The block device to mount
* @param STARTSECTOR The sector the partition begins at
* @param CACHEPAGECOUNT The total number of pages in the device cache
* @param CACHEPAGESIZE The number of sectors per cache page
* @param FLAGS Additional mounting flags (see above)
*
* @return True if mount was successful, false if no partition was found or an error occurred (see errno)
*/
bool ext2Mount(const char *name, const DISC_INTERFACE *interface, sec_t startSector, u32 cachePageCount, u32 cachePageSize, u32 flags);

/**
* Unmount a EXT2/3/4 partition.
*
* @param NAME The name of mount used in ext2Mount()
*/
void ext2Unmount(const char *name);

/**
* Get the volume name of a mounted EXT2/3/4 partition.
*
* @param NAME The name of mount
*
* @return The volumes name if successful or NULL if an error occurred (see errno)
*/
const char *ext2GetVolumeName (const char *name);

/**
* Set the volume name of a mounted EXT2/3/4 partition.
*
* @param NAME The name of mount
* @param VOLUMENAME The new volume name
*
* @return True if mount was successful, false if an error occurred (see errno)
* @note The mount must be write-enabled else this will fail
*/
bool ext2SetVolumeName (const char *name, const char *volumeName);

#ifdef __cplusplus
}
#endif

#endif
75 changes: 75 additions & 0 deletions nbproject/Package-Default.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash -x

#
# Generated - do not edit!
#

# Macros
TOP=`pwd`
CND_PLATFORM=GNU_Xenon-Linux-x86
CND_CONF=Default
CND_DISTDIR=dist
CND_BUILDDIR=build
NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=MissingOutputInProject
OUTPUT_BASENAME=MissingOutputInProject
PACKAGE_TOP_DIR=extfs/

# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}

# Setup
cd "${TOP}"
mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
rm -rf ${NBTMPDIR}
mkdir -p ${NBTMPDIR}

# Copy files and create directories and links
cd "${TOP}"
makeDirectory "${NBTMPDIR}/extfs"
copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755


# Generate tar file
cd "${TOP}"
rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/extfs.tar
cd ${NBTMPDIR}
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/extfs.tar *
checkReturnCode

# Cleanup
cd "${TOP}"
rm -rf ${NBTMPDIR}
167 changes: 167 additions & 0 deletions nbproject/configurations.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="80">
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
<df name="extfs" root=".">
<df name="include">
<in>ext2.h</in>
</df>
<df name="lib">
<df name="xenon">
</df>
</df>
<df name="source">
<df name="xenon_debug">
<in>alloc.d</in>
<in>alloc_sb.d</in>
<in>alloc_stats.d</in>
<in>alloc_tables.d</in>
<in>badblocks.d</in>
<in>bb_compat.d</in>
<in>bb_inode.d</in>
<in>bitmaps.d</in>
</df>
<in>alloc.c</in>
<in>alloc_sb.c</in>
<in>alloc_stats.c</in>
<in>alloc_tables.c</in>
<in>badblocks.c</in>
<in>bb_compat.c</in>
<in>bb_inode.c</in>
<in>bit_ops.h</in>
<in>bitmaps.c</in>
<in>bitops.c</in>
<in>bitops.h</in>
<in>blkmap64_ba.c</in>
<in>blknum.c</in>
<in>block.c</in>
<in>bmap.c</in>
<in>bmap64.h</in>
<in>bmove.c</in>
<in>brel.h</in>
<in>brel_ma.c</in>
<in>check_desc.c</in>
<in>closefs.c</in>
<in>com_err.c</in>
<in>com_err.h</in>
<in>config.h</in>
<in>crc16.c</in>
<in>crc16.h</in>
<in>crc32c.c</in>
<in>crc32c_defs.h</in>
<in>crc32c_table.h</in>
<in>csum.c</in>
<in>dblist.c</in>
<in>dblist_dir.c</in>
<in>dir_iterate.c</in>
<in>dirblock.c</in>
<in>dirhash.c</in>
<in>disc_cache.c</in>
<in>disc_cache.h</in>
<in>dupfs.c</in>
<in>e2image.h</in>
<in>expanddir.c</in>
<in>ext2.c</in>
<in>ext2_err.c</in>
<in>ext2_err.h</in>
<in>ext2_ext_attr.h</in>
<in>ext2_fs.h</in>
<in>ext2_internal.c</in>
<in>ext2_internal.h</in>
<in>ext2_io.h</in>
<in>ext2_types.h</in>
<in>ext2dir.c</in>
<in>ext2dir.h</in>
<in>ext2file.c</in>
<in>ext2file.h</in>
<in>ext2fs.h</in>
<in>ext2fsP.h</in>
<in>ext3_extents.h</in>
<in>ext_attr.c</in>
<in>extent.c</in>
<in>fiemap.h</in>
<in>fileio.c</in>
<in>finddev.c</in>
<in>flushb.c</in>
<in>freefs.c</in>
<in>gekko_io.c</in>
<in>gekko_io.h</in>
<in>gen_bitmap.c</in>
<in>gen_bitmap64.c</in>
<in>get_pathname.c</in>
<in>getsectsize.c</in>
<in>getsize.c</in>
<in>i_block.c</in>
<in>icount.c</in>
<in>imager.c</in>
<in>ind_block.c</in>
<in>initialize.c</in>
<in>inline.c</in>
<in>inode.c</in>
<in>inode_io.c</in>
<in>io_manager.c</in>
<in>irel.h</in>
<in>irel_ma.c</in>
<in>ismounted.c</in>
<in>jfs_compat.h</in>
<in>jfs_dat.h</in>
<in>jfs_user.h</in>
<in>kernel-jbd.h</in>
<in>kernel-list.h</in>
<in>link.c</in>
<in>llseek.c</in>
<in>lookup.c</in>
<in>mem_allocate.h</in>
<in>mkdir.c</in>
<in>mkjournal.c</in>
<in>mmp.c</in>
<in>namei.c</in>
<in>native.c</in>
<in>newdir.c</in>
<in>openfs.c</in>
<in>partitions.h</in>
<in>progress.c</in>
<in>punch.c</in>
<in>read_bb.c</in>
<in>read_bb_file.c</in>
<in>res_gdt.c</in>
<in>rw_bitmaps.c</in>
<in>sparse.c</in>
<in>swapfs.c</in>
<in>tdb.c</in>
<in>tdb.h</in>
<in>unlink.c</in>
<in>valid_blk.c</in>
<in>version.c</in>
<in>version.h</in>
<in>write_bb_file.c</in>
</df>
</df>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false"
kind="IMPORTANT_FILES_FOLDER">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceFolderFilter>^(nbproject)$</sourceFolderFilter>
<sourceRootList>
<Elem>.</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="Default" type="0">
<toolsSet>
<remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>
<compilerSet>default</compilerSet>
</toolsSet>
<makefileType>
<makeTool>
<buildCommandWorkingDir>.</buildCommandWorkingDir>
<buildCommand>${MAKE} -f Makefile</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
<executablePath></executablePath>
</makeTool>
</makefileType>
</conf>
</confs>
</configurationDescriptor>
Empty file.
Loading

0 comments on commit 01fdb65

Please sign in to comment.