Application for Summer of Code 2007: Debarshi Ray Mentoring organization: GNU Project Abstract My proposal has two components which are aimed at improving the GNU Parted disk partitioning utility. The first of them is to improve the virtual filesystem or VFS layer in 'libparted', and make it possible to use external filesystem libraries which often have better support for newer filesystems or additional filesystem features. The second objective is to write a comprehensive set of unit tests making it easier for the developers to produce a better package. Detailed Description Currently Parted consists of three components-- 'libparted', 'parted' and 'partprobe'. The 'libparted' library is at the core of Parted's ability to create, destroy, resize, check and copy partitions and the file systems on them without losing any data. Parted supports a large number of disklabel types and filesystem types, which makes it usable on a wide variety of systems-- GNU, GNU/Linux, BeOS, FreeBSD and GNU/OpenSolaris or NexentaOS [1]. However most of these filesystems are supported through code that was developed in-house by the Parted developers, and they lack support for addtitional filesystem features. eg., the extended ext3 attributes are not supported. Providing support for new filesystem types is also difficult, since it is time consuming to develop and debug the filesystem code natively for Parted. eg., it can only detect NTFS and can not create, check, copy or resize it. The most logical solution that comes to the mind is through the use of external filesystem libraries in 'libparted'. Where the external libraries provide better support and are more updated than the home-grown code, it is advisable to replace 'libparted's own native code with these libraries. In fact the current ReiserFS support is heavily dependent on 'libreiserfs'. I would like to do the same for NTFS using the 'libntfs-3g' interface for the NTFS-3G driver [2] which supports almost the entire POSIX filesystem functionality for the Windows XP, Windows Server 2003, Windows 2000 and Windows Vista filesystems. Similarly, the 'e2fslibs' component of E2fsprogs [3] is a widely used library for Ext2/Ext3 having support for extended attributes. The current organization of 'libparted' involves a virtual filesystem or VFS layer. This layer helps to abstract away the implementation details and specific features of every filesystem type by the use of structures and enumerators which are common to all supported types. Users of 'libparted' need to interact with this layer only and need not be bothered about the individual filesystem types. However the API to retrieve or modify the information kept in these structures is incomplete. Such a set-up works as long as the underlying structures are simple and rarely change, since user programs can directly access the structures to retrieve whatever information is needed. In the absense of a well-defined interface it becomes cumbersome to retrieve some information whose structure is dependent on the particular filesystem type. eg., although 'libparted' does retrieve the volume names of Ext2/Ext3 and Linux's Swap filesystems, an external program like GParted [2] is not able to access them since they are kept in filesystem specific structures inaccessible to users of the library. This brings us to a point where we need to do the following with respect to the VFS layer: 1. Extend the API to be more complete. 2. Modify the infrastructure so that its easy to remove the outdated in-library code and instead use the more modern filesystem libraries that are available. Such fundamental changes in the code base are the breeding ground for new bugs and regressions and the current code base has only one unit test. Thus it is essential to write a set of comprehensive unit tests which cover the entire range of Parted's functionality. A possible approach to do the tests can be: 1. Create a particular disklabel on a loop mounted device and create some partitions. 2. Try reading the disklabel. 3. Try checking, creating, deleting, resizing, moving and copying different types of filesystems on these partitions. 4. Repeat the entire drill with every type of disklabel that is supported, and devices with different sector sizes. The reports of such tests would be an easy way to find out about the present status of the disklabel, filesystem and functionality support in Parted. I must stress that the tests that I plan to write are not going to be specific to the first part of my proposal, since having a comprehensive test framework is critical to achieving Parted 2.x. I plan to use CHECK [3] for the unit testing framework as decided by the Parted development team. Profit for GNU Since both the components of my proposal are a part of the roadmap to Parted 2.x [4], they would be crucial in taking it nearer to the goal of becoming a single-stop, modern disk partitioning utility for the GNU system. Roadmap 1. Since the objectives of this proposal have been debated on the mailing lists [5][6], there would not be much need for any extended discussions with the developers. I would rather concentrate on researching the best possible way to accomodate the external libraries, and identify the parts of the filesystem code that need to be replaced (till mid May). 2. a. Do the modifications that would be necessary to incorporate elegant use of any external filesystem library (by late June). b. Replace the current Ext2/Ext3 and NTFS code by the available libraries (by early July). c. Finish the VFS API to remove the need for applications to directly access any internal component of 'libparted' (by mid July). 3. Complete writing the unit tests (by early August). Biography I am a 22-year old student based in the city of Kolkata (formerly Calcutta), which is located in the state of West Bengal in eastern India. I was introduced to computers at the age of 10, and have always been fascinated by them and the concept of Free Software. At the age of sixteen I came first in the computer science paper in an academic and aptitude test organized by Council for Indian School Certificate Examination. Currently I am a final year undergraduate engineering student in Computer Science and Engineering studying at National Institute of Technology, Hamirpur, India. I have been involved with the development of GNU Parted [7] for the last seven to eight months, which have given me a good understanding of its internals. Apart from that I maintain GNU Songanizer [8] and stallman.org [9], and contribute to GNOWSYS [10] in my leisure. External Links [1] http://www.gnusolaris.org/gswiki [2] http://gparted.sourceforge.net/ [3] http://check.sourceforge.net/ [4] http://parted.alioth.debian.org/cgi-bin/trac.cgi/wiki/PlanningEdge [5] http://lists.alioth.debian.org/pipermail/parted-edge/2007-February/000094.html [6] http://lists.alioth.debian.org/pipermail/parted-edge/2007-March/000105.html [7] http://parted.alioth.debian.org/cgi-bin/trac.cgi/browser/AUTHORS [8] http://www.gnu.org/software/songanizer [9] http://stallman.org/ [10] http://www.gnu.org/software/gnowsys