diff options
author | Peter Gavin <pete@gentoo.org> | 2001-06-06 14:40:05 +0000 |
---|---|---|
committer | Peter Gavin <pete@gentoo.org> | 2001-06-06 14:40:05 +0000 |
commit | 258070eb5afc7917417e241799838a9c778212a1 (patch) | |
tree | 2c82ae5b23125b347229b174e4e1be5c1f4cfc9c | |
parent | Added tuxracer, yes you MUST have tcl-tk-8.05-r2 it won't compile without it, (diff) | |
download | gentoo-2-258070eb5afc7917417e241799838a9c778212a1.tar.gz gentoo-2-258070eb5afc7917417e241799838a9c778212a1.tar.bz2 gentoo-2-258070eb5afc7917417e241799838a9c778212a1.zip |
*** empty log message ***
22 files changed, 4225 insertions, 1 deletions
diff --git a/sys-apps/parted/files/digest-parted-1.4.14 b/sys-apps/parted/files/digest-parted-1.4.14 new file mode 100644 index 000000000000..3bfb1847bfb1 --- /dev/null +++ b/sys-apps/parted/files/digest-parted-1.4.14 @@ -0,0 +1 @@ +MD5 d8380734aca46a3bb32da867800d01f9 parted-1.4.14.tar.gz diff --git a/sys-apps/parted/files/digest-parted-1.4.14-r1 b/sys-apps/parted/files/digest-parted-1.4.14-r1 new file mode 100644 index 000000000000..3bfb1847bfb1 --- /dev/null +++ b/sys-apps/parted/files/digest-parted-1.4.14-r1 @@ -0,0 +1 @@ +MD5 d8380734aca46a3bb32da867800d01f9 parted-1.4.14.tar.gz diff --git a/sys-apps/parted/files/parted-1.4.14-r1-python-gentoo.diff b/sys-apps/parted/files/parted-1.4.14-r1-python-gentoo.diff new file mode 100644 index 000000000000..068f351fb0f7 --- /dev/null +++ b/sys-apps/parted/files/parted-1.4.14-r1-python-gentoo.diff @@ -0,0 +1,2336 @@ +diff -urP parted-1.4.14/Makefile.am parted-1.4.14-python/Makefile.am +--- parted-1.4.14/Makefile.am Sat Apr 7 18:04:37 2001 ++++ parted-1.4.14-python/Makefile.am Tue Jun 5 16:59:14 2001 +@@ -1,4 +1,4 @@ +-SUBDIRS = intl po libparted parted include doc debug ++SUBDIRS = intl po libparted parted include doc debug @PYTHON_SUBDIR@ + + EXTRA_DIST = ABOUT-NLS \ + AUTHORS \ +diff -urP parted-1.4.14/configure.in parted-1.4.14-python/configure.in +--- parted-1.4.14/configure.in Wed May 30 06:42:20 2001 ++++ parted-1.4.14-python/configure.in Tue Jun 5 17:44:02 2001 +@@ -65,6 +65,12 @@ + fi + AC_SUBST(PARTED_LDFLAGS) + ++AC_ARG_WITH(python, ++ [ --with-python build python module], ++ with_python=$withval, ++ with_python=no ++) ++ + dnl make libc threadsafe (not required for us, but useful other users of + dnl libparted) + CFLAGS="$CFLAGS -D_REENTRANT" +@@ -174,6 +180,33 @@ + LIBS="$OLD_LIBS" + fi + ++dnl Check for python ++if test x$with_python = xyes; then ++ AC_PATH_PROG(PYTHON, python python2.1 python2.0 python1.6 python1.5, no) ++ if test x$PYTHON = xno; then ++ AC_MSG_ERROR( ++Python version 1.5 or higher could not be found which is required for ++the --with-python. Either disable readline support with ++--without-python or downloaded and install it from: ++ http://www.python.org ++ ) ++ fi ++ changequote(<<,>>)dnl ++ PYTHON_VERSION=`${PYTHON} -c "import sys; print sys.version[:3]"` ++ PYTHON_PREFIX=`${PYTHON} -c "import sys; print sys.prefix"` ++ PYTHON_EXEC_PREFIX=`${PYTHON} -c "import sys; print sys.exec_prefix"` ++ changequote([,])dnl ++ PYTHON_INCLUDES="-I${PYTHON_PREFIX}/include/python${PYTHON_VERSION} -I${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/config" ++ pydynmoduledir="${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages" ++ PYTHON_SUBDIR=python ++fi ++AC_SUBST(PYTHON_PREFIX) ++AC_SUBST(PYTHON_EXEC_PREFIX) ++AC_SUBST(PYTHON_VERSION) ++AC_SUBST(PYTHON_INCLUDES) ++AC_SUBST(PYTHON_SUBDIR) ++AC_SUBST(pydynmoduledir) ++ + AC_SUBST(PARTED_LIBS) + + dnl One day, gettext might support libtool... +@@ -256,7 +289,7 @@ + LIBS="$OLD_LIBS" + fi + +-CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch -Werror" ++CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch" + + AC_OUTPUT([ + Makefile +@@ -271,6 +304,7 @@ + libparted/fs_reiserfs/Makefile + libparted/fs_ufs/Makefile + parted/Makefile ++python/Makefile + intl/Makefile + doc/Makefile + debug/Makefile +diff -urP parted-1.4.14/python/Makefile.am parted-1.4.14-python/python/Makefile.am +--- parted-1.4.14/python/Makefile.am Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/Makefile.am Tue Jun 5 15:52:16 2001 +@@ -0,0 +1,29 @@ ++AUTOMAKE_OPTIONS = 1.4 foreign ++ ++partedincludedir = -I$(top_srcdir)/include ++INCLUDES = $(partedincludedir) @PYTHON_INCLUDES@ @INTLINCS@ ++ ++noinst_LTLIBRARIES = libpartedmodule.la ++libpartedmodule_la_SOURCES = partedmodule.c \ ++ pydevice.c \ ++ pydisk.c \ ++ pygeometry.c \ ++ pyexception.c \ ++ pyfilesystem.c \ ++ pyconstraint.c \ ++ partedmodule.h \ ++ pyconstraint.h \ ++ pydevice.h \ ++ pydisk.h \ ++ pyexception.h \ ++ pyfilesystem.h \ ++ pygeometry.h ++ ++pythondir = $(pydynmoduledir) ++python_PROGRAMS = partedmodule.so ++partedmodule_so_SOURCES = ++partedmodule_so_LDFLAGS = $(top_builddir)/libparted/libparted.la \ ++ -shared -Wl,-soname,partedmodule.so ++ ++partedmodule.so: $(libpartedmodule_la_OBJECTS) ++ $(LINK) -g -o $@ $^ $(partedmodule_so_LDFLAGS); +diff -urP parted-1.4.14/python/partedmodule.c parted-1.4.14-python/python/partedmodule.c +--- parted-1.4.14/python/partedmodule.c Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/partedmodule.c Thu Apr 26 15:12:34 2001 +@@ -0,0 +1,334 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include <Python.h> ++ ++#include "parted/parted.h" ++ ++#include "partedmodule.h" ++#include "pydevice.h" ++#include "pydisk.h" ++#include "pyexception.h" ++#include "pygeometry.h" ++#include "pyfilesystem.h" ++#include "pyconstraint.h" ++ ++/* global error object */ ++PyObject *PyPartedError; ++ ++/* static global variables */ ++static PyObject *PyExceptionHandler; ++static char *py_exception_string = NULL; ++ ++/* common functions */ ++int ++py_ped_exception_string_check (void) ++{ ++ return (py_exception_string != NULL); ++} ++ ++ ++void ++py_ped_exception_string_clear (void) ++{ ++ if (py_exception_string != NULL) { ++ free (py_exception_string); ++ py_exception_string = NULL; ++ } ++} ++ ++void ++py_ped_set_error_from_ped_exception (void) ++{ ++ if (py_exception_string != NULL) { ++ PyErr_SetString(PyPartedError, py_exception_string); ++ py_ped_exception_string_clear (); ++ return; ++ } ++ PyErr_SetString(PyPartedError, "unknown error occured"); ++} ++ ++/* toplevel implementation */ ++ ++static PedExceptionOption ++py_exception_handler (PedException* ex) ++{ ++ PyObject * result, * args = NULL; ++ long rc; ++ char * type; ++ char * buf; ++ int len; ++ ++ if (py_exception_string != NULL) ++ free (py_exception_string); ++ ++ type = ped_exception_get_type_string (ex->type); ++ len = strlen (type) + strlen (ex->message) + 3; ++ buf = malloc (len); ++ snprintf (buf, len, "%s: %s", type, ex->message); ++ py_exception_string = buf; ++ ++ if (PyExceptionHandler == NULL) { ++ return PED_EXCEPTION_UNHANDLED; ++ } ++ ++ args = Py_BuildValue("(N)", (PyObject *) py_ped_exception_obj_new (ex)); ++ ++ result = PyEval_CallObject(PyExceptionHandler, args); ++ Py_XDECREF(args); ++ ++ if (result == NULL) { ++ PyErr_Print(); ++ PyErr_Clear(); ++ return PED_EXCEPTION_UNHANDLED; ++ } ++ ++ if (!PyInt_Check (result)) { ++ fprintf (stderr, ++ "ERROR: python exception handler did not " ++ "return expected int value\n"); ++ return PED_EXCEPTION_UNHANDLED; ++ } ++ ++ rc = PyInt_AsLong (result); ++ Py_DECREF (result); ++ return (PedExceptionOption) rc; ++} ++ ++static PyObject * ++py_ped_exception_set_handler (PyObject * self, PyObject * args) ++{ ++ PyObject *cb; ++ ++ /* if we already have a callback, releae it */ ++ if (PyExceptionHandler != NULL) { ++ Py_DECREF (PyExceptionHandler); ++ PyExceptionHandler = NULL; ++ } ++ ++ if (!PyArg_ParseTuple(args, "O", &cb)) ++ return NULL; ++ ++ if (!PyCallable_Check (cb)) { ++ PyErr_SetString(PyExc_TypeError, "parameter must be callable"); ++ return NULL; ++ } ++ Py_INCREF (cb); ++ PyExceptionHandler = cb; ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_device_get (PyObject * self, PyObject * args) ++{ ++ PyPedDevice *d; ++ PedDevice *dev; ++ char *path; ++ ++ if (!PyArg_ParseTuple(args, "s", &path)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if ((dev = ped_device_get (path)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ d = (PyPedDevice *) PyObject_NEW(PyObject, &PyPedDeviceType); ++ d->dev = dev; ++ return (PyObject *) d; ++} ++ ++static PyObject * ++py_ped_file_system_type_get (PyObject * self, PyObject * args) ++{ ++ char *type; ++ PedFileSystemType *fst; ++ ++ if (!PyArg_ParseTuple(args, "s", &type)) { ++ return NULL; ++ } ++ ++ if ((fst = ped_file_system_type_get (type)) == NULL) { ++ PyErr_SetString(PyPartedError, "unknown file system type"); ++ return NULL; ++ } ++ ++ return (PyObject *) py_ped_file_system_type_obj_new (fst); ++} ++ ++static PyObject * ++py_ped_file_system_type_get_next (PyObject * self, PyObject * args) ++{ ++ PyPedFileSystemTypeObj *pyfst = NULL; ++ PedFileSystemType *fst; ++ ++ if (!PyArg_ParseTuple(args, "|O!", &PyPedFileSystemTypeType, &pyfst)) { ++ PyErr_SetString(PyExc_TypeError, ++ "optional parameter must be a " ++ "PedFileSystemType"); ++ return NULL; ++ } ++ ++ fst = ped_file_system_type_get_next (pyfst ? pyfst->fs_type : NULL); ++ if (fst) ++ return (PyObject *) py_ped_file_system_type_obj_new (fst); ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_partition_flag_next (PyObject *obj, PyObject * args) ++{ ++ int flag, next; ++ ++ if (!PyArg_ParseTuple(args, "i", &flag)) ++ return NULL; ++ ++ next = ped_partition_flag_next (flag); ++ ++ return PyInt_FromLong (next); ++} ++ ++static PyObject * ++py_ped_partition_flag_get_by_name (PyObject *obj, PyObject * args) ++{ ++ char *name; ++ int flag; ++ ++ if (!PyArg_ParseTuple(args, "s", &name)) ++ return NULL; ++ ++ flag = ped_partition_flag_get_by_name (name); ++ ++ return PyInt_FromLong (flag); ++} ++ ++static PyObject * ++py_ped_partition_flag_get_name (PyObject *obj, PyObject * args) ++{ ++ int flag; ++ const char *name; ++ ++ if (!PyArg_ParseTuple(args, "i", &flag)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ name = ped_partition_flag_get_name (flag); ++ if (py_ped_exception_string_check ()) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return PyString_FromString (name); ++} ++ ++static struct PyMethodDef PyPedModuleMethods[] = { ++ { "device_get", ++ (PyCFunction) py_ped_device_get, METH_VARARGS, NULL }, ++ { "exception_set_handler", ++ (PyCFunction) py_ped_exception_set_handler, ++ METH_VARARGS, NULL }, ++ { "file_system_type_get", ++ (PyCFunction) py_ped_file_system_type_get, ++ METH_VARARGS, NULL }, ++ { "file_system_type_get_next", ++ (PyCFunction) py_ped_file_system_type_get_next, ++ METH_VARARGS, NULL }, ++ { "partition_flag_next", ++ (PyCFunction) py_ped_partition_flag_next, ++ METH_VARARGS, NULL }, ++ { "partition_flag_get_by_name", ++ (PyCFunction) py_ped_partition_flag_get_by_name, ++ METH_VARARGS, NULL }, ++ { "partition_flag_get_name", ++ (PyCFunction) py_ped_partition_flag_get_name, ++ METH_VARARGS, NULL }, ++ { NULL, NULL, 0, NULL } ++}; ++ ++void initparted(void) { ++ PyObject *m, *d, *o; ++ ++ if (!ped_init ()) ++ Py_FatalError("couldn't initialized parted"); ++ ++ m = Py_InitModule("parted", PyPedModuleMethods); ++ d = PyModule_GetDict(m); ++ ++ /* enum registration */ ++#define REGISTER_ENUM(val) \ ++ PyDict_SetItemString(d, #val, o=PyInt_FromLong(PED_ ## val)); \ ++ Py_DECREF(o); ++ ++ REGISTER_ENUM(DEVICE_UNKNOWN); ++ REGISTER_ENUM(DEVICE_SCSI); ++ REGISTER_ENUM(DEVICE_IDE); ++ REGISTER_ENUM(DEVICE_DAC960); ++ REGISTER_ENUM(DEVICE_CPQARRAY); ++ ++ REGISTER_ENUM(PARTITION_PRIMARY); ++ REGISTER_ENUM(PARTITION_LOGICAL); ++ REGISTER_ENUM(PARTITION_EXTENDED); ++ REGISTER_ENUM(PARTITION_FREESPACE); ++ REGISTER_ENUM(PARTITION_METADATA); ++ ++ REGISTER_ENUM(PARTITION_BOOT); ++ REGISTER_ENUM(PARTITION_ROOT); ++ REGISTER_ENUM(PARTITION_SWAP); ++ REGISTER_ENUM(PARTITION_HIDDEN); ++ REGISTER_ENUM(PARTITION_RAID); ++ REGISTER_ENUM(PARTITION_LVM); ++ REGISTER_ENUM(PARTITION_LBA); ++ ++ REGISTER_ENUM(PARTITION_FIRST_FLAG); ++ REGISTER_ENUM(PARTITION_LAST_FLAG); ++ ++ REGISTER_ENUM(DISK_TYPE_EXTENDED); ++ REGISTER_ENUM(DISK_TYPE_PARTITION_NAME); ++ ++ REGISTER_ENUM(EXCEPTION_INFORMATION); ++ REGISTER_ENUM(EXCEPTION_WARNING); ++ REGISTER_ENUM(EXCEPTION_ERROR); ++ REGISTER_ENUM(EXCEPTION_FATAL); ++ REGISTER_ENUM(EXCEPTION_BUG); ++ REGISTER_ENUM(EXCEPTION_NO_FEATURE); ++ ++ REGISTER_ENUM(EXCEPTION_UNHANDLED); ++ REGISTER_ENUM(EXCEPTION_YES); ++ REGISTER_ENUM(EXCEPTION_NO); ++ REGISTER_ENUM(EXCEPTION_OK); ++ REGISTER_ENUM(EXCEPTION_RETRY); ++ REGISTER_ENUM(EXCEPTION_IGNORE); ++ REGISTER_ENUM(EXCEPTION_CANCEL); ++ ++ REGISTER_ENUM(EXCEPTION_OK_CANCEL); ++ REGISTER_ENUM(EXCEPTION_YES_NO); ++ REGISTER_ENUM(EXCEPTION_YES_NO_CANCEL); ++ REGISTER_ENUM(EXCEPTION_IGNORE_CANCEL); ++ REGISTER_ENUM(EXCEPTION_RETRY_CANCEL); ++ REGISTER_ENUM(EXCEPTION_RETRY_IGNORE_CANCEL); ++ /* end enum registration */ ++ ++ /* register the exception handler marhaller function */ ++ ped_exception_set_handler (py_exception_handler); ++ ++ /* set up our exception class */ ++ PyPartedError = PyErr_NewException("parted.error", NULL, NULL); ++ PyDict_SetItemString(d, "error", PyPartedError); ++ Py_DECREF(PyPartedError); ++} +diff -urP parted-1.4.14/python/partedmodule.h parted-1.4.14-python/python/partedmodule.h +--- parted-1.4.14/python/partedmodule.h Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/partedmodule.h Thu Dec 7 09:45:26 2000 +@@ -0,0 +1,25 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef PARTEDMODULE_H_INCLUDED ++#define PARTEDMODULE_H_INCLUDED ++ ++#include <Python.h> ++ ++extern PyObject *PyPartedError; ++int py_ped_exception_string_check (void); ++void py_ped_exception_string_clear (void); ++extern void py_ped_set_error_from_ped_exception (void); ++ ++#endif /* PARTEDMODULE_H_INCLUDED */ +diff -urP parted-1.4.14/python/pyconstraint.c parted-1.4.14-python/python/pyconstraint.c +--- parted-1.4.14/python/pyconstraint.c Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pyconstraint.c Fri Apr 27 15:03:38 2001 +@@ -0,0 +1,109 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++*/ ++ ++#include "partedmodule.h" ++#include "pygeometry.h" ++#include "pyconstraint.h" ++ ++static void py_ped_constraint_dealloc (PyPedConstraint * c); ++static PyObject * py_ped_constraint_getattr (PyPedConstraint * c, char * name); ++ ++static char PyPedConstraintType__doc__[] = "This is the PartEd constraint " ++ "object"; ++PyTypeObject PyPedConstraintType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedConstraint", /* tp_name */ ++ sizeof(PyPedConstraint), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_constraint_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_constraint_getattr, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ 0L, /* tp_flags */ ++ PyPedConstraintType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++static PyObject * py_ped_constraint_duplicate (PyPedConstraint * c, ++ PyObject * args); ++ ++static struct PyMethodDef PyPedConstraintMethods[] = { ++ { "duplicate", ++ (PyCFunction) py_ped_constraint_duplicate, ++ METH_VARARGS, NULL }, ++ { NULL, NULL, 0, NULL } ++}; ++ ++static void ++py_ped_constraint_dealloc (PyPedConstraint * c) ++{ ++ if (!c->borrowed) ++ ped_constraint_destroy (c->constraint); ++ Py_XDECREF (c->disk); ++ PyMem_DEL(c); ++} ++ ++static PyObject * ++py_ped_constraint_duplicate (PyPedConstraint * c, PyObject * args) ++{ ++ PedConstraint *cst; ++ ++ cst = ped_constraint_duplicate (c->constraint); ++ return (PyObject *) py_ped_constraint_obj_new (cst, c->disk, 0); ++} ++ ++static PyObject * ++py_ped_constraint_getattr (PyPedConstraint * c, char * name) ++{ ++ if (!strcmp (name, "start_range")) ++ return (PyObject *) ++ py_ped_geometry_obj_new (c->constraint->start_range, ++ c->disk, 1); ++ if (!strcmp (name, "end_range")) ++ return (PyObject *) ++ py_ped_geometry_obj_new (c->constraint->end_range, ++ c->disk, 1); ++ if (!strcmp (name, "min_size")) ++ return (PyObject *) ++ PyLong_FromLongLong (c->constraint->min_size); ++ ++ return Py_FindMethod (PyPedConstraintMethods, (PyObject *) c, name); ++} ++ ++PyPedConstraint * ++py_ped_constraint_obj_new (PedConstraint *c, PyPedDisk *disk, int borrowed) ++{ ++ PyPedConstraint *con; ++ ++ con = (PyPedConstraint *) PyObject_NEW(PyObject, &PyPedConstraintType); ++ con->constraint = c; ++ con->borrowed = borrowed; ++ con->disk = disk; ++ Py_INCREF (disk); ++ ++ return con; ++} +diff -urP parted-1.4.14/python/pyconstraint.h parted-1.4.14-python/python/pyconstraint.h +--- parted-1.4.14/python/pyconstraint.h Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pyconstraint.h Thu Dec 7 17:55:09 2000 +@@ -0,0 +1,38 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * ++*/ ++ ++#ifndef PYCONSTRAINT_H_INCLUDED ++#define PYCONSTRAINT_H_INCLUDED ++ ++#include <Python.h> ++#include "parted/constraint.h" ++#include "pydisk.h" ++ ++typedef struct _PyPedConstraint PyPedConstraint; ++ ++struct _PyPedConstraint { ++ PyObject_HEAD; ++ PedConstraint *constraint; ++ PyPedDisk *disk; ++ int borrowed; ++}; ++ ++extern PyTypeObject PyPedConstraintType; ++ ++extern PyPedConstraint * py_ped_constraint_obj_new (PedConstraint *c, ++ PyPedDisk *part, ++ int borrowed); ++ ++#endif /* PYCONSTRAINT_H_INCLUDED */ +diff -urP parted-1.4.14/python/pydevice.c parted-1.4.14-python/python/pydevice.c +--- parted-1.4.14/python/pydevice.c Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pydevice.c Thu Dec 7 09:45:26 2000 +@@ -0,0 +1,152 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++#include "partedmodule.h" ++#include "pydevice.h" ++#include "pydisk.h" ++ ++static void py_ped_device_dealloc (PyPedDevice * s); ++static PyObject * py_ped_device_getattr (PyPedDevice * s, char * name); ++ ++static char PyPedDeviceType__doc__[] = "This is the PartEd device object"; ++PyTypeObject PyPedDeviceType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedDevice", /* tp_name */ ++ sizeof(PyPedDevice), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_device_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_device_getattr, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ 0L, /* tp_flags */ ++ PyPedDeviceType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++static PyObject * py_ped_device_open (PyPedDevice * s, PyObject * args); ++static PyObject * py_ped_device_close (PyPedDevice * s, PyObject * args); ++static PyObject * py_ped_device_sync (PyPedDevice * s, PyObject * args); ++static PyObject * py_ped_disk_open (PyPedDevice * s, PyObject * args); ++ ++static struct PyMethodDef PyPedDeviceMethods[] = { ++ { "open", (PyCFunction) py_ped_device_open, METH_VARARGS, NULL }, ++ { "close", (PyCFunction) py_ped_device_close, METH_VARARGS, NULL }, ++ { "sync", (PyCFunction) py_ped_device_sync, METH_VARARGS, NULL }, ++ { "disk_open", (PyCFunction) py_ped_disk_open, METH_VARARGS, NULL }, ++ { NULL, NULL, 0, NULL } ++}; ++ ++/* device implementation */ ++ ++PyPedDevice * py_ped_device_new (PedDevice *dev) ++{ ++ PyPedDevice *d; ++ ++ d = (PyPedDevice *) PyObject_NEW(PyObject, &PyPedDeviceType); ++ d->dev = dev; ++ return d; ++} ++ ++static void ++py_ped_device_dealloc (PyPedDevice * s) ++{ ++ /* s->dev will be destroyed if ped_device_free_all() is called */ ++ /* ped_device_destroy (s->dev); */ ++ PyMem_DEL(s); ++} ++ ++static PyObject * ++py_ped_device_getattr (PyPedDevice * d, char * name) ++{ ++ if (!strcmp (name, "length")) ++ return PyLong_FromLongLong (d->dev->length); ++ else if (!strcmp (name, "model")) ++ return PyString_FromString (d->dev->model); ++ else if (!strcmp (name, "path")) ++ return PyString_FromString (d->dev->path); ++ else if (!strcmp (name, "sector_size")) ++ return PyInt_FromLong (d->dev->sector_size); ++ else if (!strcmp (name, "type")) ++ return PyInt_FromLong (d->dev->type); ++ return Py_FindMethod (PyPedDeviceMethods, (PyObject *) d, name); ++} ++ ++static PyObject * ++py_ped_device_open (PyPedDevice * s, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_device_open (s->dev)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_device_close (PyPedDevice * s, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_device_close (s->dev)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_device_sync (PyPedDevice * s, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_device_sync (s->dev)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_disk_open (PyPedDevice * self, PyObject * args) ++{ ++ PyPedDevice *dev; ++ PyPedDisk *d; ++ PedDisk *disk; ++ ++ py_ped_exception_string_clear (); ++ if ((disk = ped_disk_open (self->dev)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ d = (PyPedDisk *) PyObject_NEW(PyObject, &PyPedDiskType); ++ d->disk = disk; ++ return (PyObject *) d; ++} ++ +diff -urP parted-1.4.14/python/pydevice.h parted-1.4.14-python/python/pydevice.h +--- parted-1.4.14/python/pydevice.h Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pydevice.h Thu Dec 7 09:45:26 2000 +@@ -0,0 +1,33 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef PYDEVICE_H_INCLUDED ++#define PYDEVICE_H_INCLUDED ++ ++#include <Python.h> ++ ++#include "parted/device.h" ++ ++extern PyTypeObject PyPedDeviceType; ++typedef struct _PyPedDevice PyPedDevice; ++ ++struct _PyPedDevice { ++ PyObject_HEAD; ++ PedDevice *dev; ++}; ++ ++PyPedDevice * py_ped_device_new (PedDevice *dev); ++ ++#endif /* PYDEVICE_H_INCLUDED */ ++ +diff -urP parted-1.4.14/python/pydisk.c parted-1.4.14-python/python/pydisk.c +--- parted-1.4.14/python/pydisk.c Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pydisk.c Sun Apr 22 18:42:44 2001 +@@ -0,0 +1,631 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include "partedmodule.h" ++#include "pydisk.h" ++#include "pydevice.h" ++#include "pygeometry.h" ++#include "pyfilesystem.h" ++#include "pyconstraint.h" ++ ++/* disk python object */ ++static void py_ped_disk_dealloc (PyPedDisk * d); ++static PyObject * py_ped_disk_getattr (PyPedDisk * d, char * name); ++ ++static char PyPedDiskType__doc__[] = "This is the PartEd disk object"; ++PyTypeObject PyPedDiskType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedDisk", /* tp_name */ ++ sizeof(PyPedDisk), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_disk_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_disk_getattr, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ 0L, /* tp_flags */ ++ PyPedDiskType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++static PyObject * py_ped_disk_next_partition (PyPedDisk * d, PyObject * args); ++static PyObject * py_ped_disk_write (PyPedDisk * d, PyObject * args); ++static PyObject * py_ped_disk_read (PyPedDisk * d, PyObject * args); ++static PyObject * py_ped_disk_delete_partition (PyPedDisk * d, PyObject * args); ++static PyObject * py_ped_disk_delete_all (PyPedDisk * d, PyObject * args); ++static PyObject * py_ped_disk_add_partition (PyPedDisk * d, PyObject * args); ++static PyObject * py_ped_disk_get_partition (PyPedDisk * d, PyObject * args); ++static PyObject * py_ped_constraint_any (PyPedDisk * self, PyObject * args); ++static PyObject * py_ped_geometry_new (PyPedDisk * self, PyObject * args); ++static PyObject * py_ped_partition_new (PyPedDisk * self, PyObject * args); ++static PyObject * py_ped_disk_minimize_extended_partition (PyPedDisk * self, PyObject * args); ++static PyObject * py_ped_disk_maximize_partition (PyPedDisk * self, PyObject * args); ++static PyObject * py_ped_disk_is_busy (PyPedDisk * d, PyObject * args); ++ ++static struct PyMethodDef PyPedDiskMethods[] = { ++ { "next_partition", (PyCFunction) py_ped_disk_next_partition, METH_VARARGS, NULL }, ++ { "read", (PyCFunction) py_ped_disk_read, METH_VARARGS, NULL }, ++ { "write", (PyCFunction) py_ped_disk_write, METH_VARARGS, NULL }, ++ { "delete_partition", (PyCFunction) py_ped_disk_delete_partition, METH_VARARGS, NULL }, ++ { "delete_all", (PyCFunction) py_ped_disk_delete_all, METH_VARARGS, NULL }, ++ { "add_partition", (PyCFunction) py_ped_disk_add_partition, METH_VARARGS, NULL }, ++ { "get_partition", (PyCFunction) py_ped_disk_get_partition, METH_VARARGS, NULL }, ++ { "constraint_any", (PyCFunction) py_ped_constraint_any, METH_VARARGS, NULL }, ++ { "geometry_new", (PyCFunction) py_ped_geometry_new, METH_VARARGS, NULL }, ++ { "partition_new", (PyCFunction) py_ped_partition_new, METH_VARARGS, NULL }, ++ { "minimize_extended_partition", (PyCFunction) py_ped_disk_minimize_extended_partition, METH_VARARGS, NULL }, ++ { "maximize_partition", (PyCFunction) py_ped_disk_maximize_partition, METH_VARARGS, NULL }, ++ { "is_busy", (PyCFunction) py_ped_disk_is_busy, METH_VARARGS, NULL }, ++ { NULL, NULL, 0, NULL } ++}; ++ ++/* partition python object */ ++ ++static void py_ped_partition_dealloc (PyPedPartition * p); ++static PyObject * py_ped_partition_getattr (PyPedPartition * p, char * name); ++ ++static char PyPedPartitionType__doc__[] = "This is the PartEd partition object"; ++PyTypeObject PyPedPartitionType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedPartition", /* tp_name */ ++ sizeof(PyPedPartition), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_partition_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_partition_getattr, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ 0L, /* tp_flags */ ++ PyPedPartitionType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++static PyObject * py_ped_partition_is_flag_available (PyPedPartition *p, PyObject * args); ++static PyObject * py_ped_partition_set_flag (PyPedPartition * self, PyObject * args); ++static PyObject * py_ped_partition_get_flag (PyPedPartition * self, PyObject * args); ++static PyObject * py_ped_partition_is_active (PyPedPartition * self, PyObject * args); ++static PyObject * py_ped_partition_set_system (PyPedPartition * self, PyObject * args); ++static PyObject * py_ped_partition_set_name (PyPedPartition * self, PyObject * args); ++static PyObject * py_ped_partition_get_name (PyPedPartition * self, PyObject * args); ++static PyObject * py_ped_partition_is_busy (PyPedPartition * self, PyObject * args); ++ ++static struct PyMethodDef PyPedPartitionMethods[] = { ++ { "is_flag_available", (PyCFunction) py_ped_partition_is_flag_available, METH_VARARGS, NULL }, ++ { "get_flag", (PyCFunction) py_ped_partition_get_flag, METH_VARARGS, NULL }, ++ { "set_flag", (PyCFunction) py_ped_partition_set_flag, METH_VARARGS, NULL }, ++ { "is_active", (PyCFunction) py_ped_partition_is_active, METH_VARARGS, NULL }, ++ { "set_system", (PyCFunction) py_ped_partition_set_system, METH_VARARGS, NULL }, ++ { "set_name", (PyCFunction) py_ped_partition_set_name, METH_VARARGS, NULL }, ++ { "get_name", (PyCFunction) py_ped_partition_get_name, METH_VARARGS, NULL }, ++ { "is_busy", (PyCFunction) py_ped_partition_is_busy, METH_VARARGS, NULL }, ++ { NULL, NULL, 0, NULL } ++}; ++ ++/* disk implementation */ ++ ++static void ++py_ped_disk_dealloc (PyPedDisk * d) ++{ ++ ped_disk_close (d->disk); ++ PyMem_DEL(d); ++} ++ ++static PyObject * ++py_ped_disk_getattr (PyPedDisk * d, char * name) ++{ ++ if (!strcmp (name, "dev")) ++ return (PyObject *) py_ped_device_new (d->disk->dev); ++ if (!strcmp (name, "max_primary_partition_count")) { ++ int num; ++ ++ py_ped_exception_string_clear (); ++ num = ped_disk_get_max_primary_partition_count (d->disk); ++ if (num == 0) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ return PyInt_FromLong (num); ++ } ++ if (!strcmp (name, "extended_partition")) { ++ PedPartition *ppart; ++ ++ py_ped_exception_string_clear (); ++ ppart = ped_disk_extended_partition (d->disk); ++ if (ppart != NULL) ++ return (PyObject *) py_ped_partition_obj_new (ppart, d, 1); ++ ++ if (py_ped_exception_string_check ()) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ Py_INCREF(Py_None); ++ return Py_None; ++ } ++ ++ return Py_FindMethod (PyPedDiskMethods, (PyObject *) d, name); ++} ++ ++static PyObject * ++py_ped_disk_next_partition (PyPedDisk * d, PyObject * args) ++{ ++ PyPedPartition *part = NULL; ++ PedPartition *ppart; ++ ++ if (!PyArg_ParseTuple(args, "|O!", &PyPedPartitionType, &part)) { ++ PyErr_SetString(PyExc_TypeError, ++ "optional parameter must be a PedPartition"); ++ return NULL; ++ } ++ ++ ppart = ped_disk_next_partition (d->disk, part ? part->part : NULL); ++ if (ppart != NULL) ++ return (PyObject *) py_ped_partition_obj_new (ppart, d, 1); ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_disk_read (PyPedDisk * d, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_disk_write (d->disk)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_disk_write (PyPedDisk * d, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_disk_write (d->disk)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_disk_delete_partition (PyPedDisk * d, PyObject * args) ++{ ++ PyPedPartition *part; ++ ++ if (!PyArg_ParseTuple(args, "O!", &PyPedPartitionType, &part)) { ++ PyErr_SetString(PyExc_TypeError, "PedPartition expected"); ++ return NULL; ++ } ++ ++ py_ped_exception_string_clear (); ++ if (!ped_disk_delete_partition (d->disk, part->part)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ /* the partition structure is freed as part of the ++ delete_partition call. Protect from the double free ++ by marking it borrowed */ ++ part->borrowed = 1; ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++ ++static PyObject * ++py_ped_disk_delete_all (PyPedDisk * d, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_disk_delete_all (d->disk)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_disk_add_partition (PyPedDisk * d, PyObject * args) ++{ ++ PyPedPartition *part; ++ PyPedConstraint *constraint; ++ ++ if (!PyArg_ParseTuple(args, "O!O!", &PyPedPartitionType, &part, ++ &PyPedConstraintType, &constraint)) { ++ PyErr_SetString(PyExc_TypeError, "bad argument"); ++ return NULL; ++ } ++ ++ py_ped_exception_string_clear (); ++ if (!ped_disk_add_partition (d->disk, part->part, ++ constraint->constraint)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ /* the disk takes ownership of the data in this partition ++ when added, protect from double free */ ++ part->borrowed = 1; ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_disk_get_partition_by_sector (PyPedDisk * d, PyObject * args) ++{ ++ PedPartition *part; ++ PedSector sect; ++ ++ if (!PyArg_ParseTuple(args, "L", §)) ++ return NULL; ++ ++ if ((part = ped_disk_get_partition_by_sector (d->disk, sect)) == NULL) { ++ PyErr_SetString(PyPartedError, "partition not found"); ++ return NULL; ++ } ++ ++ return (PyObject *) py_ped_partition_obj_new (part, d, 1); ++} ++ ++static PyObject * ++py_ped_disk_get_partition (PyPedDisk * d, PyObject * args) ++{ ++ PedPartition *part; ++ int num; ++ ++ if (!PyArg_ParseTuple(args, "i", &num)) ++ return NULL; ++ ++ if ((part = ped_disk_get_partition (d->disk, num)) == NULL) { ++ PyErr_SetString(PyPartedError, "partition not found"); ++ return NULL; ++ } ++ ++ return (PyObject *) py_ped_partition_obj_new (part, d, 1); ++} ++ ++static PyObject * ++py_ped_partition_new (PyPedDisk * self, PyObject * args) ++{ ++ PyPedFileSystemTypeObj *fs_type; ++ PedSector start, end; ++ PedPartition *part; ++ PedPartitionType type; ++ PyPedPartition *pypart; ++ ++ if (!PyArg_ParseTuple(args, "iO!LL", ++ &type, ++ &PyPedFileSystemTypeType, &fs_type, ++ &start, &end)) { ++ return NULL; ++ } ++ ++ py_ped_exception_string_clear (); ++ part = ped_partition_new (self->disk, type, fs_type->fs_type, ++ start, end); ++ if (part == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ pypart = py_ped_partition_obj_new (part, self, 0); ++ ++ return (PyObject *) pypart; ++} ++ ++static PyObject * ++py_ped_constraint_any (PyPedDisk * self, PyObject * args) ++{ ++ PyPedDisk *disk; ++ PedConstraint *constraint; ++ PyPedConstraint *pyconstraint; ++ ++ py_ped_exception_string_clear (); ++ constraint = ped_constraint_any (self->disk); ++ if (constraint == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ pyconstraint = py_ped_constraint_obj_new (constraint, self, 0); ++ ++ return (PyObject *) pyconstraint; ++} ++ ++static PyObject * ++py_ped_geometry_new (PyPedDisk * self, PyObject * args) ++{ ++ PedSector start, length; ++ PedGeometry *geom; ++ PyPedGeometry *pygeom; ++ ++ if (!PyArg_ParseTuple(args, "LL", &start, &length)) { ++ return NULL; ++ } ++ ++ py_ped_exception_string_clear (); ++ geom = ped_geometry_new (self->disk, start, length); ++ if (geom == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ pygeom = py_ped_geometry_obj_new (geom, self, 0); ++ pygeom->disk = self; ++ Py_INCREF (self); ++ ++ return (PyObject *) pygeom; ++} ++ ++static PyObject * ++py_ped_disk_minimize_extended_partition (PyPedDisk * self, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_disk_minimize_extended_partition (self->disk)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ Py_INCREF(Py_None); ++ return Py_None; ++ ++} ++ ++static PyObject * ++py_ped_disk_maximize_partition (PyPedDisk * self, PyObject * args) ++{ ++ PyPedPartition *part; ++ PyPedConstraint *constraint; ++ ++ if (!PyArg_ParseTuple(args, "O!O!", &PyPedPartitionType, &part, ++ &PyPedConstraintType, &constraint)) { ++ return NULL; ++ } ++ ++ py_ped_exception_string_clear (); ++ if (!ped_disk_maximize_partition (self->disk, part->part, ++ constraint->constraint)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_disk_is_busy (PyPedDisk *d, PyObject * args) ++{ ++ int state; ++ ++ py_ped_exception_string_clear (); ++ state = ped_disk_is_busy (d->disk); ++ if (py_ped_exception_string_check ()) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return PyInt_FromLong (state); ++} ++ ++/* partition implementation */ ++ ++PyPedPartition * ++py_ped_partition_obj_new (PedPartition *part, PyPedDisk *disk, int borrowed) ++{ ++ PyPedPartition *p; ++ ++ p = (PyPedPartition *) PyObject_NEW(PyObject, &PyPedPartitionType); ++ p->part = part; ++ p->borrowed = borrowed; ++ p->disk = disk; ++ Py_INCREF (disk); ++ ++ return p; ++} ++ ++static void ++py_ped_partition_dealloc (PyPedPartition * p) ++{ ++ if (!p->borrowed) ++ ped_partition_destroy (p->part); ++ Py_XDECREF (p->disk); ++ PyMem_DEL(p); ++} ++ ++static PyObject * ++py_ped_partition_getattr (PyPedPartition * p, char * name) ++{ ++ if (!strcmp (name, "num")) ++ return PyInt_FromLong (p->part->num); ++ if (!strcmp (name, "type")) ++ return PyInt_FromLong (p->part->type); ++ if (!strcmp (name, "type_name")) ++ return PyString_FromString ( ++ ped_partition_type_get_name (p->part->type)); ++ if (!strcmp (name, "geom")) ++ return (PyObject *) py_ped_geometry_obj_new (&p->part->geom, p->disk, 1); ++ if (!strcmp (name, "fs_type")) { ++ if (p->part->fs_type) ++ return (PyObject *) ++ py_ped_file_system_type_obj_new (p->part->fs_type); ++ Py_INCREF(Py_None); ++ return Py_None; ++ } ++ return Py_FindMethod (PyPedPartitionMethods, (PyObject *) p, name); ++} ++ ++static PyObject * ++py_ped_partition_is_flag_available (PyPedPartition *p, PyObject * args) ++{ ++ int av, flag; ++ ++ if (!PyArg_ParseTuple(args, "i", &flag)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ av = ped_partition_is_flag_available (p->part, flag); ++ if (py_ped_exception_string_check ()) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return PyInt_FromLong (av); ++} ++ ++static PyObject * ++py_ped_partition_set_flag (PyPedPartition *p, PyObject * args) ++{ ++ int flag, state; ++ ++ if (!PyArg_ParseTuple(args, "ii", &flag, &state)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if (!ped_partition_set_flag (p->part, flag, state)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_partition_get_flag (PyPedPartition *p, PyObject * args) ++{ ++ int flag, state; ++ ++ if (!PyArg_ParseTuple(args, "i", &flag)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ state = ped_partition_get_flag (p->part, flag); ++ if (py_ped_exception_string_check ()) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return PyInt_FromLong (state); ++} ++ ++ ++static PyObject * ++py_ped_partition_is_active (PyPedPartition *p, PyObject * args) ++{ ++ int state; ++ ++ py_ped_exception_string_clear (); ++ state = ped_partition_is_active (p->part); ++ if (py_ped_exception_string_check ()) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return PyInt_FromLong (state); ++} ++ ++static PyObject * ++py_ped_partition_set_system (PyPedPartition *p, PyObject * args) ++{ ++ PyPedFileSystemTypeObj *fs_type; ++ ++ if (!PyArg_ParseTuple(args, "O!", ++ &PyPedFileSystemTypeType, &fs_type)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if (!ped_partition_set_system (p->part, fs_type->fs_type)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++ ++static PyObject * ++py_ped_partition_set_name (PyPedPartition *p, PyObject * args) ++{ ++ char *name; ++ ++ if (!PyArg_ParseTuple(args, "s", &name)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if (!ped_partition_set_name (p->part, name)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_partition_get_name (PyPedPartition *p, PyObject * args) ++{ ++ const char *name; ++ ++ py_ped_exception_string_clear (); ++ if ((name = ped_partition_get_name (p->part)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return PyString_FromString (name); ++} ++ ++ ++static PyObject * ++py_ped_partition_is_busy (PyPedPartition *p, PyObject * args) ++{ ++ int state; ++ ++ py_ped_exception_string_clear (); ++ state = ped_partition_is_busy (p->part); ++ if (py_ped_exception_string_check ()) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return PyInt_FromLong (state); ++} +diff -urP parted-1.4.14/python/pydisk.h parted-1.4.14-python/python/pydisk.h +--- parted-1.4.14/python/pydisk.h Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pydisk.h Thu Dec 7 17:55:09 2000 +@@ -0,0 +1,45 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef PYDISK_H_INCLUDED ++#define PYDISK_H_INCLUDED ++ ++#include <Python.h> ++ ++#include "parted/disk.h" ++ ++typedef struct _PyPedDisk PyPedDisk; ++ ++struct _PyPedDisk { ++ PyObject_HEAD; ++ PedDisk *disk; ++}; ++ ++extern PyTypeObject PyPedDiskType; ++ ++typedef struct _PyPedPartition PyPedPartition; ++ ++struct _PyPedPartition { ++ PyObject_HEAD; ++ PedPartition *part; ++ PyPedDisk *disk; ++ int borrowed; ++}; ++ ++extern PyTypeObject PyPedPartitionType; ++ ++extern PyPedPartition * py_ped_partition_obj_new (PedPartition *part, PyPedDisk *disk, ++ int borrowed); ++ ++#endif /* PYDISK_H_INCLUDED */ +diff -urP parted-1.4.14/python/pyexception.c parted-1.4.14-python/python/pyexception.c +--- parted-1.4.14/python/pyexception.c Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pyexception.c Tue Dec 5 17:31:50 2000 +@@ -0,0 +1,78 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include "pyexception.h" ++ ++static void py_ped_exception_dealloc (PyPedException * s); ++static PyObject * py_ped_exception_getattr (PyPedException * s, char * name); ++ ++static char PyPedExceptionType__doc__[] = "This is the PartEd exception object"; ++PyTypeObject PyPedExceptionType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedException", /* tp_name */ ++ sizeof(PyPedException), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_exception_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_exception_getattr, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /*tp_hash*/ ++ 0, /*tp_call*/ ++ 0, /*tp_str*/ ++ 0, /*tp_getattro*/ ++ 0, /*tp_setattro*/ ++ 0, /*tp_as_buffer*/ ++ 0L, /*tp_flags*/ ++ PyPedExceptionType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++ ++/* exception implementation */ ++ ++static void ++py_ped_exception_dealloc (PyPedException * s) ++{ ++ PyMem_DEL(s); ++} ++ ++static PyObject * ++py_ped_exception_getattr (PyPedException * e, char * name) ++{ ++ if (!strcmp (name, "message")) ++ return PyString_FromString (e->ex->message); ++ else if (!strcmp (name, "type")) ++ return PyInt_FromLong (e->ex->type); ++ else if (!strcmp (name, "type_string")) ++ return PyString_FromString (ped_exception_get_type_string (e->ex->type)); ++ else if (!strcmp (name, "options")) ++ return PyInt_FromLong (e->ex->options); ++ return NULL; ++} ++ ++PyPedException * ++py_ped_exception_obj_new (PedException *ex) ++{ ++ PyPedException *e; ++ ++ e = (PyPedException *) PyObject_NEW(PyObject, &PyPedExceptionType); ++ e->ex = ex; ++ return e; ++} +diff -urP parted-1.4.14/python/pyexception.h parted-1.4.14-python/python/pyexception.h +--- parted-1.4.14/python/pyexception.h Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pyexception.h Thu Dec 7 09:45:26 2000 +@@ -0,0 +1,35 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef PYEXCEPTION_H_INCLUDED ++#define PYEXCEPTION_H_INCLUDED ++ ++#include <Python.h> ++ ++#include "parted/exception.h" ++ ++extern PyTypeObject PyPedExceptionType; ++ ++typedef struct _PyPedException PyPedException; ++ ++struct _PyPedException { ++ PyObject_HEAD; ++ PedException *ex; ++}; ++ ++PyPedException * ++py_ped_exception_obj_new (PedException *ex); ++ ++#endif /* PYEXCEPTION_H_INCLUDED */ ++ +diff -urP parted-1.4.14/python/pyfilesystem.c parted-1.4.14-python/python/pyfilesystem.c +--- parted-1.4.14/python/pyfilesystem.c Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pyfilesystem.c Thu Dec 7 17:55:09 2000 +@@ -0,0 +1,228 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include "partedmodule.h" ++ ++#include "pyfilesystem.h" ++#include "pyconstraint.h" ++#include "pygeometry.h" ++ ++/* filesystem python object */ ++ ++static void py_ped_file_system_dealloc (PyPedFileSystem* fs); ++static PyObject * py_ped_file_system_getattr (PyPedFileSystem * fs, char * name); ++ ++static char PyPedFileSystemType__doc__[] = "This is the PartEd filesystem object"; ++PyTypeObject PyPedFileSystemType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedFileSystem", /* tp_name */ ++ sizeof(PyPedFileSystem), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_file_system_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_file_system_getattr, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ 0L, /* tp_flags */ ++ PyPedFileSystemType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++static PyObject * py_ped_file_system_check (PyPedFileSystem * fs, PyObject * args); ++static PyObject * py_ped_file_system_copy (PyPedFileSystem * fs, PyObject * args); ++static PyObject * py_ped_file_system_resize (PyPedFileSystem * fs, PyObject * args); ++static PyObject * py_ped_file_system_get_resize_constraint (PyPedFileSystem * fs, PyObject * args); ++ ++static struct PyMethodDef PyPedFileSystemMethods[] = { ++ { "check", (PyCFunction) py_ped_file_system_check, METH_VARARGS, NULL }, ++ { "copy", (PyCFunction) py_ped_file_system_copy, METH_VARARGS, NULL }, ++ { "resize", (PyCFunction) py_ped_file_system_resize, METH_VARARGS, NULL }, ++ { "get_resize_constraint", (PyCFunction) py_ped_file_system_get_resize_constraint, METH_VARARGS, NULL }, ++ { NULL, NULL, 0, NULL } ++}; ++ ++ ++/* file system type python object */ ++ ++static void py_ped_file_system_type_dealloc (PyPedFileSystemTypeObj* fst); ++static PyObject * py_ped_file_system_type_getattr (PyPedFileSystemTypeObj* fst, char * name); ++ ++static char PyPedFileSystemTypeType__doc__[] = "This is the PartEd filesystem object"; ++PyTypeObject PyPedFileSystemTypeType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedFileSystemType", /* tp_name */ ++ sizeof(PyPedFileSystemType), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_file_system_type_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_file_system_type_getattr, /* tp_getattr */ ++ 0, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ 0L, /* tp_flags */ ++ PyPedFileSystemTypeType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++static struct PyMethodDef PyPedFileSystemTypeMethods[] = { ++ { NULL, NULL, 0, NULL } ++}; ++ ++/* ++ * filesystem implementation ++ */ ++ ++PyPedFileSystem * ++py_ped_file_system_obj_new (PedFileSystem *filesys, ++ PyPedGeometry *geom) ++{ ++ PyPedFileSystem *fs; ++ ++ fs = (PyPedFileSystem *) PyObject_NEW(PyObject, &PyPedFileSystemType); ++ fs->fs = filesys; ++ fs->geom = geom; ++ Py_INCREF (geom); ++ return fs; ++} ++ ++static void ++py_ped_file_system_dealloc (PyPedFileSystem * fs) ++{ ++ ped_file_system_close (fs->fs); ++ Py_XDECREF (fs->geom); ++ PyMem_DEL(fs); ++} ++ ++static PyObject * ++py_ped_file_system_getattr (PyPedFileSystem * fs, char * name) ++{ ++ if (!strcmp (name, "type")) ++ return PyString_FromString (fs->fs->type->name); ++ if (!strcmp (name, "geom")) ++ return (PyObject *) py_ped_geometry_obj_new (fs->fs->geom, fs->geom->disk, 1); ++ return Py_FindMethod (PyPedFileSystemMethods, (PyObject *) fs, name); ++} ++ ++static PyObject * ++py_ped_file_system_check (PyPedFileSystem * fs, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_file_system_check (fs->fs)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_file_system_copy (PyPedFileSystem * fs, PyObject * args) ++{ ++ PyPedGeometry *geom; ++ ++ if (!PyArg_ParseTuple(args, "O!", &PyPedGeometryType, &geom)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if (!ped_file_system_copy (fs->fs, geom->geom)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_file_system_resize (PyPedFileSystem * fs, PyObject * args) ++{ ++ PyPedGeometry *geom; ++ ++ if (!PyArg_ParseTuple(args, "O!", &PyPedGeometryType, &geom)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if (!ped_file_system_resize (fs->fs, geom->geom)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_file_system_get_resize_constraint (PyPedFileSystem * fs, PyObject * args) ++{ ++ PedConstraint *constraint; ++ ++ py_ped_exception_string_clear (); ++ if ((constraint = ped_file_system_get_resize_constraint (fs->fs)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return (PyObject *) py_ped_constraint_obj_new (constraint, fs->geom->disk, 0); ++} ++ ++/* ++ * file system type implementation ++ */ ++ ++ ++PyPedFileSystemTypeObj * ++py_ped_file_system_type_obj_new (const PedFileSystemType *fs_type) ++{ ++ PyPedFileSystemTypeObj *fst; ++ ++ fst = (PyPedFileSystemTypeObj *) PyObject_NEW(PyObject, &PyPedFileSystemTypeType); ++ fst->fs_type = fs_type; ++ return fst; ++} ++ ++static void ++py_ped_file_system_type_dealloc (PyPedFileSystemTypeObj* fst) ++{ ++ PyMem_DEL(fst); ++} ++ ++static PyObject * ++py_ped_file_system_type_getattr (PyPedFileSystemTypeObj * fst, char * name) ++{ ++ if (!strcmp (name, "name")) ++ return PyString_FromString (fst->fs_type->name); ++ return NULL; ++} +diff -urP parted-1.4.14/python/pyfilesystem.h parted-1.4.14-python/python/pyfilesystem.h +--- parted-1.4.14/python/pyfilesystem.h Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pyfilesystem.h Thu Dec 7 17:55:09 2000 +@@ -0,0 +1,49 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef PYFILESYSTEM_H_INCLUDED ++#define PYFILESYSTEM_H_INCLUDED ++ ++#include <Python.h> ++#include "parted/disk.h" ++#include "pygeometry.h" ++ ++typedef struct _PyPedFileSystem PyPedFileSystem; ++ ++struct _PyPedFileSystem { ++ PyObject_HEAD; ++ PedFileSystem* fs; ++ PyPedGeometry *geom; ++}; ++ ++extern PyTypeObject PyPedFileSystemType; ++ ++PyPedFileSystem * ++py_ped_file_system_obj_new (PedFileSystem* fs, ++ PyPedGeometry *geom); ++ ++typedef struct _PyPedFileSystemTypeObj PyPedFileSystemTypeObj; ++ ++struct _PyPedFileSystemTypeObj { ++ PyObject_HEAD; ++ const PedFileSystemType* fs_type; ++}; ++ ++extern PyTypeObject PyPedFileSystemTypeType; ++ ++PyPedFileSystemTypeObj* ++py_ped_file_system_type_obj_new (const PedFileSystemType* fs_type); ++ ++#endif /* PYFILESYSTEM_H_INCLUDED */ ++ +diff -urP parted-1.4.14/python/pygeometry.c parted-1.4.14-python/python/pygeometry.c +--- parted-1.4.14/python/pygeometry.c Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pygeometry.c Thu Apr 26 12:46:24 2001 +@@ -0,0 +1,245 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include "partedmodule.h" ++#include "pygeometry.h" ++#include "pyfilesystem.h" ++ ++static void py_ped_geometry_dealloc (PyPedGeometry * g); ++static PyObject * py_ped_geometry_getattr (PyPedGeometry * g, char * name); ++static int py_ped_geometry_setattr (PyPedGeometry * g, char * name, PyObject *value); ++ ++static char PyPedGeometryType__doc__[] = "This is the PartEd geometry object"; ++PyTypeObject PyPedGeometryType = { ++ PyObject_HEAD_INIT(&PyType_Type) ++ 0, /* ob_size */ ++ "PedGeometry", /* tp_name */ ++ sizeof(PyPedGeometry), /* tp_size */ ++ 0, /* tp_itemsize */ ++ (destructor) py_ped_geometry_dealloc, /* tp_dealloc */ ++ 0, /* tp_print */ ++ (getattrfunc) py_ped_geometry_getattr, /* tp_getattr */ ++ (setattrfunc) py_ped_geometry_setattr, /* tp_setattr */ ++ 0, /* tp_compare */ ++ 0, /* tp_repr */ ++ 0, /* tp_as_number */ ++ 0, /* tp_as_sequence */ ++ 0, /* tp_as_mapping */ ++ 0, /* tp_hash */ ++ 0, /* tp_call */ ++ 0, /* tp_str */ ++ 0, /* tp_getattro */ ++ 0, /* tp_setattro */ ++ 0, /* tp_as_buffer */ ++ 0L, /* tp_flags */ ++ PyPedGeometryType__doc__, ++ 0L,0L,0L,0L ++}; ++ ++/* geometry implementation */ ++ ++PyPedGeometry * ++py_ped_geometry_obj_new (PedGeometry* geom, PyPedDisk *disk, int borrowed) ++{ ++ PyPedGeometry *g; ++ ++ g = (PyPedGeometry *) PyObject_NEW (PyObject, &PyPedGeometryType); ++ g->geom = geom; ++ g->borrowed = borrowed; ++ g->disk = disk; ++ Py_INCREF (disk); ++ return g; ++} ++ ++static void ++py_ped_geometry_dealloc (PyPedGeometry * g) ++{ ++ if (!g->borrowed) ++ ped_geometry_destroy (g->geom); ++ Py_XDECREF (g->disk); ++ PyMem_DEL(g); ++} ++ ++static PyObject * ++py_ped_file_system_open (PyPedGeometry * self, PyObject * args) ++{ ++ PedFileSystem *fs; ++ PyPedFileSystem *pyfs; ++ ++ py_ped_exception_string_clear (); ++ if ((fs = ped_file_system_open (self->geom)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ pyfs = py_ped_file_system_obj_new (fs, self); ++ return (PyObject *) pyfs; ++} ++ ++static PyObject * ++py_ped_file_system_probe (PyPedGeometry * self, PyObject * args) ++{ ++ PedFileSystemType *fst; ++ ++ py_ped_exception_string_clear (); ++ if ((fst = ped_file_system_probe (self->geom)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return (PyObject *) py_ped_file_system_type_obj_new (fst); ++} ++ ++static PyObject * ++py_ped_file_system_create (PyPedGeometry * self, PyObject * args) ++{ ++ PedFileSystem *fs; ++ PyPedFileSystemTypeObj *fs_type; ++ PyPedFileSystem *pyfs; ++ ++ if (!PyArg_ParseTuple(args, "O!", ++ &PyPedFileSystemTypeType, &fs_type)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if ((fs = ped_file_system_create (self->geom, fs_type->fs_type)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ pyfs = py_ped_file_system_obj_new (fs, self); ++ return (PyObject *) pyfs; ++} ++ ++ ++static PyObject * ++py_ped_file_system_clobber (PyPedGeometry * self, PyObject * args) ++{ ++ py_ped_exception_string_clear (); ++ if (!ped_file_system_clobber (self->geom)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_geometry_set_end (PyPedGeometry * self, PyObject * args) ++{ ++ PedSector end; ++ ++ if (!PyArg_ParseTuple(args, "L", &end)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if (!ped_geometry_set_end (self->geom, end)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++ ++static PyObject * ++py_ped_geometry_set_start (PyPedGeometry * self, PyObject * args) ++{ ++ PedSector start; ++ ++ if (!PyArg_ParseTuple(args, "L", &start)) ++ return NULL; ++ ++ py_ped_exception_string_clear (); ++ if (!ped_geometry_set_start (self->geom, start)) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ Py_INCREF(Py_None); ++ return Py_None; ++} ++ ++static PyObject * ++py_ped_geometry_duplicate (PyPedGeometry * self, PyObject * args) ++{ ++ PedGeometry *geom; ++ ++ py_ped_exception_string_clear (); ++ if ((geom = ped_geometry_duplicate (self->geom)) == NULL) { ++ py_ped_set_error_from_ped_exception (); ++ return NULL; ++ } ++ ++ return (PyObject *) py_ped_geometry_obj_new (geom, self->disk, 0); ++} ++ ++static struct PyMethodDef PyPedGeometryMethods[] = { ++ { "file_system_open", ++ (PyCFunction) py_ped_file_system_open, METH_VARARGS, NULL }, ++ { "file_system_probe", ++ (PyCFunction) py_ped_file_system_probe, METH_VARARGS, NULL }, ++ { "file_system_create", ++ (PyCFunction) py_ped_file_system_create, METH_VARARGS, NULL }, ++ { "file_system_clobber", ++ (PyCFunction) py_ped_file_system_clobber, METH_VARARGS, NULL }, ++ { "set_start", ++ (PyCFunction) py_ped_geometry_set_start, METH_VARARGS, NULL }, ++ { "set_end", ++ (PyCFunction) py_ped_geometry_set_end, METH_VARARGS, NULL }, ++ { "duplicate", ++ (PyCFunction) py_ped_geometry_duplicate, METH_VARARGS, NULL }, ++ ++ { NULL, NULL, 0, NULL } ++}; ++ ++static PyObject * ++py_ped_geometry_getattr (PyPedGeometry * g, char * name) ++{ ++ ++#define RETURN_GEOM_VALUE(var) \ ++ if (!strcmp (name, #var)) \ ++ return PyLong_FromLongLong (g->geom->var) ++ ++ RETURN_GEOM_VALUE(start); ++ RETURN_GEOM_VALUE(end); ++ RETURN_GEOM_VALUE(length); ++ ++ return Py_FindMethod (PyPedGeometryMethods, (PyObject *) g, name); ++} ++ ++static int ++py_ped_geometry_setattr (PyPedGeometry * g, char * name, PyObject *value) ++{ ++#define SET_GEOM_VALUE(var) \ ++ if (!strcmp (name, #var)) { \ ++ if (!PyLong_Check (value)) { \ ++ PyErr_SetString(PyExc_TypeError, \ ++ "expected long long"); \ ++ return -1; \ ++ } \ ++ g->geom->var = PyLong_AsLongLong (value); \ ++ return 0; \ ++ } ++ SET_GEOM_VALUE(start); ++ SET_GEOM_VALUE(end); ++ SET_GEOM_VALUE(length); ++ ++ PyErr_SetString( PyExc_AttributeError, "unknown attribute" ); ++ return -1; ++} ++ ++ +diff -urP parted-1.4.14/python/pygeometry.h parted-1.4.14-python/python/pygeometry.h +--- parted-1.4.14/python/pygeometry.h Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/pygeometry.h Thu Dec 7 17:55:09 2000 +@@ -0,0 +1,37 @@ ++/* -*- Mode: c; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * Matt Wilson <msw@redhat.com> ++ * ++ * Copyright 2000 Red Hat, Inc. ++ * ++ * This software may be freely redistributed under the terms of the GNU ++ * library public license. ++ * ++ * You should have received a copy of the GNU Library Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifndef PYGEOMETRY_H_INCLUDED ++#define PYGEOMETRY_H_INCLUDED ++ ++#include <Python.h> ++ ++#include "pydisk.h" ++ ++typedef struct _PyPedGeometry PyPedGeometry; ++ ++struct _PyPedGeometry { ++ PyObject_HEAD; ++ PedGeometry* geom; ++ PyPedDisk *disk; ++ int borrowed; ++}; ++ ++extern PyTypeObject PyPedGeometryType; ++ ++PyPedGeometry * ++py_ped_geometry_obj_new (PedGeometry* geom, PyPedDisk *disk, int borrowed); ++ ++#endif /* PYGEOMETRY_H_INCLUDED */ ++ +diff -urP parted-1.4.14/python/test.py parted-1.4.14-python/python/test.py +--- parted-1.4.14/python/test.py Wed Dec 31 19:00:00 1969 ++++ parted-1.4.14-python/python/test.py Thu Apr 19 16:10:26 2001 +@@ -0,0 +1,128 @@ ++#!/usr/bin/env python ++ ++import sys ++for dir in ('.', ''): ++ try: ++ sys.path.remove(dir) ++ except ValueError: ++ pass ++sys.path = [ ".libs" ] + sys.path ++ ++import parted ++ ++def get_flags (part): ++ string="" ++ if not part.is_active (): ++ return string ++ first=1 ++ flag = parted.partition_flag_next (0) ++ while flag: ++ if part.get_flag (flag): ++ string = string + parted.partition_flag_get_name (flag) ++ if first: ++ first = 0 ++ else: ++ string = string + ", " ++ flag = parted.partition_flag_next (flag) ++ return string ++ ++def do_print (disk): ++ goodparts = { parted.PARTITION_PRIMARY : None, ++ parted.PARTITION_EXTENDED : None, ++ parted.PARTITION_LOGICAL : None, ++ parted.PARTITION_FREESPACE : None } ++ ++ print ("%s: %s length %ld, maximum " ++ "primary partitions: %d" % (disk.dev.path, disk.dev.model, ++ disk.dev.length, disk.max_primary_partition_count)) ++ ++ part = disk.next_partition() ++ if part: ++ print "Device Type Filesystem Start End Length Flags" ++ print "------ ---- ---------- ----- --- ------ -----" ++ while part: ++ if goodparts.has_key(part.type): ++ device = "" ++ fs_type_name = "" ++ if part.num > 0: ++ device = "%s%d" % (disk.dev.path, ++ part.num) ++ if part.fs_type: ++ fs_type_name = part.fs_type.name ++ flags = get_flags (part) ++ print ("%-9s %-12s %-12s %-10ld %-10ld %-10ld %7s" ++ % (device, part.type_name, fs_type_name, ++ part.geom.start, part.geom.end, part.geom.length, ++ flags)) ++ part = disk.next_partition(part) ++ print ++ ++def exception_handler(exception): ++ print "%s: %s" % (exception.type_string, exception.message) ++ return parted.EXCEPTION_UNHANDLED ++ ++parted.exception_set_handler (exception_handler) ++dev = parted.device_get ('/tmp/fstest') ++disk = dev.disk_open () ++ ++do_print (disk) ++part = disk.get_partition (0) ++fst = part.geom.file_system_probe () ++print "%s filesystem probed on device %s%d" % (fst.name, ++ disk.dev.path, ++ part.num) ++ ++fs = part.geom.file_system_open () ++fs.check() ++const = fs.get_resize_constraint() ++print "minimum size for this filesystem is %d sectors" % const.min_size ++print "start range from %d to %d" % (const.start_range.start, const.start_range.end) ++print "end range from %d to %d" % (const.end_range.start, const.end_range.end) ++ ++new_end = fs.geom.duplicate() ++#new_end.set_end (const.min_size + 512) ++new_end.set_end (const.end_range.end) ++fs.resize (new_end) ++ ++def foo(): ++ disk.delete_all () ++ do_print (disk) ++ ++ fs_type = parted.file_system_type_get ("ext2") ++ ++ sections = disk.dev.length / 4 ++ ++ # add a partition ++ newp = disk.partition_new (parted.PARTITION_PRIMARY, ++ fs_type, 0L, sections - 1) ++ newp.set_flag (parted.PARTITION_RAID, 1) ++ constraint = disk.constraint_any () ++ disk.add_partition (newp, constraint) ++ do_print (disk) ++ ++ # add another... ++ newp = disk.partition_new (parted.PARTITION_PRIMARY, ++ fs_type, sections, 2 * sections - 1) ++ newp.set_flag (parted.PARTITION_RAID, 1) ++ constraint = disk.constraint_any () ++ disk.add_partition (newp, constraint) ++ do_print (disk) ++ ++ # another ++ newp = disk.partition_new (parted.PARTITION_PRIMARY, ++ fs_type, 2 * sections, 3 * sections - 1) ++ newp.set_flag (parted.PARTITION_RAID, 1) ++ constraint = disk.constraint_any () ++ disk.add_partition (newp, constraint) ++ do_print (disk) ++ ++ # another... ++ newp = disk.partition_new (parted.PARTITION_PRIMARY, ++ fs_type, 3 * sections, 4 * sections - 1) ++ newp.set_flag (parted.PARTITION_RAID, 1) ++ constraint = disk.constraint_any () ++ disk.add_partition (newp, constraint) ++ do_print (disk) ++ ++ disk.write() ++ diff --git a/sys-apps/parted/parted-1.4.14-r1.ebuild b/sys-apps/parted/parted-1.4.14-r1.ebuild new file mode 100644 index 000000000000..92476db740b4 --- /dev/null +++ b/sys-apps/parted/parted-1.4.14-r1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Peter Gavin <pete@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/sys-apps/parted/parted-1.4.14-r1.ebuild,v 1.1 2001/06/06 14:40:04 pete Exp $ + +#P= +A=${P}.tar.gz +S=${WORKDIR}/${P} +DESCRIPTION="an advanced partition modification system" +SRC_URI="ftp://ftp.gnu.org/gnu/${PN}/${A}" +HOMEPAGE="http://www.gnu.org/software/${PN}" + +RDEPEND="virtual/glibc + >=sys-apps/e2fsprogs-1.19-r2 + readline? ( >=sys-libs/readline-4.1-r2 ) + nls? ( >=sys-devel/gettext-0.10.38-r2 ) + python? ( >=dev-lang/python-2.0 )" + +DEPEND="${RDEPEND} + >=sys-devel/autoconf-2.50 + >=sys-devel/automake-1.4" + +src_unpack() { + unpack ${A} + cd ${S} + try patch -p1 < ${FILESDIR}/${PF}-python-gentoo.diff + try aclocal + try autoconf + try automake +} + +src_compile() { + if [ "`use readline`" ] + then + myconf="${myconf} --with-readline" + fi + if [ "`use python`" ] + then + myconf="${myconf} --with-python" + fi + try PYTHON=/usr/bin/python ./configure --prefix=/usr --target=${CHOST} ${myconf} + try make +} + +src_install () { + try make DESTDIR=${D} install + dodoc ABOUT-NLS AUTHORS BUGS COPYING ChangeLog NEWS README THANKS TODO + cd doc ; docinto doc + dodoc API COPYING.DOC FAT USER USER.jp +} + diff --git a/sys-apps/parted/parted-1.4.14.ebuild b/sys-apps/parted/parted-1.4.14.ebuild index eb7366a1de63..fcd4cdc7f2b0 100644 --- a/sys-apps/parted/parted-1.4.14.ebuild +++ b/sys-apps/parted/parted-1.4.14.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2000 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Peter Gavin <pete@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/sys-apps/parted/parted-1.4.14.ebuild,v 1.3 2001/06/02 22:34:02 pete Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/parted/parted-1.4.14.ebuild,v 1.4 2001/06/06 14:40:04 pete Exp $ #P= A=${P}.tar.gz @@ -22,5 +22,8 @@ src_compile() { src_install () { try make DESTDIR=${D} install + dodoc ABOUT-NLS AUTHORS BUGS COPYING ChangeLog NEWS README THANKS TODO + cd doc ; docinto doc + dodoc API COPYING.DOC FAT USER USER.jp } diff --git a/sys-devel/autoconf/autoconf-2.50.ebuild b/sys-devel/autoconf/autoconf-2.50.ebuild new file mode 100644 index 000000000000..22d14e5417ad --- /dev/null +++ b/sys-devel/autoconf/autoconf-2.50.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Daniel Robbins <drobbins@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/sys-devel/autoconf/autoconf-2.50.ebuild,v 1.1 2001/06/06 14:40:04 pete Exp $ + +A=${P}.tar.gz +S=${WORKDIR}/${P} +DESCRIPTION="Used to create autoconfiguration files" +SRC_URI="ftp://alpha.gnu.org/gnu/${PN}/${A}" +HOMEPAGE="http://www.gnu.org/software/autoconf/autoconf.html" + +DEPEND=">=sys-devel/m4-1.4o-r2" + +src_unpack() { + unpack ${A} + cd ${S} +} + +src_compile() { + try ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --target=${CHOST} + try make ${MAKEOPTS} +} + +src_install() { + try make prefix=${D}/usr infodir=${D}/usr/share/info install + dodoc COPYING AUTHORS BUGS ChangeLog ChangeLog.0 ChangeLog.1 NEWS README TODO THANKS +} + + diff --git a/sys-devel/autoconf/files/digest-autoconf-2.50 b/sys-devel/autoconf/files/digest-autoconf-2.50 new file mode 100644 index 000000000000..cc3719ec8fbc --- /dev/null +++ b/sys-devel/autoconf/files/digest-autoconf-2.50 @@ -0,0 +1 @@ +MD5 b3d78c5aefd53ed69d93182239af65e3 autoconf-2.50.tar.gz diff --git a/sys-kernel/linux-extras/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff b/sys-kernel/linux-extras/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff new file mode 100644 index 000000000000..7322f1852a6c --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff @@ -0,0 +1,11 @@ +--- linux-2.4.5-ac5/drivers/md/Makefile.orig Sat Jun 2 00:49:51 2001 ++++ linux-2.4.5-ac5/drivers/md/Makefile Sat Jun 2 00:50:01 2001 +@@ -6,7 +6,7 @@ + + export-objs := md.o xor.o + list-multi := lvm-mod.o +-lvm-mod-objs := lvm.o lvm-snap.o lvm-fs.o ++lvm-mod-objs := lvm.o lvm-snap.o + + # Note: link order is important. All raid personalities + # and xor.o must come before md.o, as they each initialise diff --git a/sys-kernel/linux-extras/files/2.4.5.5/lvm.c.diff b/sys-kernel/linux-extras/files/2.4.5.5/lvm.c.diff new file mode 100644 index 000000000000..6392671b8f7e --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5.5/lvm.c.diff @@ -0,0 +1,20 @@ +--- lvm.c.orig Sat Apr 28 10:48:37 2001 ++++ lvm.c Sat Apr 28 11:07:07 2001 +@@ -1791,7 +1791,7 @@ + int max_hardblocksize = 0, hardblocksize; + + for (le = 0; le < lv->lv_allocated_le; le++) { +- hardblocksize = get_hardblocksize(lv->lv_current_pe[le].dev); ++ hardblocksize = get_hardsect_size(lv->lv_current_pe[le].dev); + if (hardblocksize == 0) + hardblocksize = 512; + if (hardblocksize > max_hardblocksize) +@@ -1801,7 +1801,7 @@ + if (lv->lv_access & LV_SNAPSHOT) { + for (e = 0; e < lv->lv_remap_end; e++) { + hardblocksize = +- get_hardblocksize( ++ get_hardsect_size( + lv->lv_block_exception[e].rdev_new); + if (hardblocksize == 0) + hardblocksize = 512; diff --git a/sys-kernel/linux-extras/files/2.4.5.5/pcmcia b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia new file mode 100755 index 000000000000..4cfb368ff68a --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia @@ -0,0 +1,97 @@ +#!/bin/sh +#RCUPDATE:3 4:69:This line is required for script management + +. /etc/rc.d/config/functions + +SERVICE=pcmcia +opts="start stop restart" + + # Slackware startup options go right here: + # Should be either i82365 or tcic + PCIC=i82365 + # Put socket driver timing parameters here + PCIC_OPTS= + # Put pcmcia_core options here + CORE_OPTS= + # Put cardmgr options here + CARDMGR_OPTS= + # To set the PCMCIA scheme at startup... + SCHEME= + +cleanup() +{ + while read SN CLASS MOD INST DEV EXTRA ; do + if [ "$SN" != "Socket" ] ; then + /etc/pcmcia/$CLASS stop $DEV 2> /dev/null + fi + done +} + +start() { + if [ -d /var/lib/pcmcia ] ; then + SC=/var/lib/pcmcia/scheme + RUN=/var/lib/pcmcia + else + SC=/var/run/pcmcia-scheme + RUN=/var/run + fi + if [ -L $SC -o ! -O $SC ] ; then rm -f $SC ; fi + if [ ! -f $SC ] ; then umask 022 ; touch $SC ; fi + if [ "$SCHEME" ] ; then umask 022 ; echo $SCHEME > $SC ; fi + fgrep -q pcmcia /proc/devices + if [ $? -ne 0 ] ; then + if [ -d /lib/modules/preferred ] ; then + PC=/lib/modules/preferred/pcmcia + else + PC=/lib/modules/`uname -r`/pcmcia + fi + if [ -d $PC ] ; then + echo -n " modules" + /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS 2>&1 > /dev/null + /sbin/insmod $PC/$PCIC.o $PCIC_OPTS 2>&1 > /dev/null + /sbin/insmod $PC/ds.o 2>&1 > /dev/null + else + echo " module directory $PC not found." + break + fi + fi + if [ -s /var/run/cardmgr.pid ] && \ + kill -0 `cat /var/run/cardmgr.pid` 2>/dev/null ; then + echo " cardmgr is already running." + else + if [ -r $RUN/stab ] ; then + cat $RUN/stab | cleanup + fi + /sbin/cardmgr $CARDMGR_OPTS 2>&1 > /dev/null + fi + touch /var/lock/subsys/pcmcia 2>&1 > /dev/null +} + +stop() { + if [ -s /var/run/cardmgr.pid ] ; then + PID=`cat /var/run/cardmgr.pid` + kill $PID + echo -n " cardmgr" + # Give cardmgr a few seconds to handle the signal + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null + fi + killall -q "CardBus Watcher" + if fgrep -q "ds " /proc/modules ; then + echo -n " modules" + /sbin/rmmod ds + /sbin/rmmod $PCIC + /sbin/rmmod pcmcia_core + fi + rm -f /var/lock/subsys/pcmcia +} + +restart() { + stop + start +} + +doservice ${@} + diff --git a/sys-kernel/linux-extras/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff new file mode 100644 index 000000000000..db555693924c --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff @@ -0,0 +1,11 @@ +--- pcmcia-cs-3.1.25/cardmgr/cardinfo.c~ Wed Feb 14 04:25:48 2001 ++++ pcmcia-cs-3.1.25/cardmgr/cardinfo.c Fri May 4 11:43:32 2001 +@@ -40,7 +40,7 @@ + #include <fcntl.h> + #include <errno.h> + #include <signal.h> +-#include <sys/time.h> ++#include <time.h> + #include <sys/ioctl.h> + #include <sys/stat.h> + #include <sys/file.h> diff --git a/sys-kernel/linux-extras/linux-extras-2.4.5.5.ebuild b/sys-kernel/linux-extras/linux-extras-2.4.5.5.ebuild new file mode 100644 index 000000000000..31f64083c4ca --- /dev/null +++ b/sys-kernel/linux-extras/linux-extras-2.4.5.5.ebuild @@ -0,0 +1,688 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Daniel Robbins <drobbins@gentoo.org> +# /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp + +# *** WARNING: This kernel package does not have XFS support! *** + +#OKV=original kernel version, KV=patched kernel version +OKV=2.4.5 +KV=2.4.5-ac5 + +if [ "${PN}" = "linux-extras" ] +then + S=/usr/src/linux-${KV} +else + S=${WORKDIR}/linux-${KV} +fi + +# Versions of LVM +LVMV=0.9.1_beta7 + +LVMVARC=0.9.1_beta7 +# Versions of alsa +AV=0.5.11 + +# Versionos of jfs +JFSV=0.2.1 + +# Versions of lm_sensors and i2c +SENV=20010530-gentoo +I2CV=20010530-gentoo + +# Versions of reiserfs +RV=20010327 +KNV="6.g" +PIV="1.d" + +# Versions of xmlprocfs +XMLV=0.3 + +# Versions of pcmcia-cs +PCV="3.1.25" + +# Version of XFS +XFSV=20010530-gentoo + +[ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes" +[ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources" +[ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries" + +# We use build in /usr/src/linux in case of linux-extras +# so we need no sources +if [ "${PN}" != "linux-extras" ] +then + SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2 + http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.bz2 + http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/linux-2.4.5-pre6-knfsd.patch.bz2 + http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/reiserfs-quota-2.4.4.dif.bz2" + +# http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/bigpatch-${OKV}.diff.bz2 +# http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-${JFSV}-patch.tar.gz +# http://download.sourceforge.net/xmlprocfs/linux-2.4-xmlprocfs-${XMLV}.patch.gz +# ftp://ftp.reiserfs.com/pub/reiserfs-for-2.4/linux-${OKV}-reiserfs-${RV}.patch.gz + + if [ "`use i2c`" ] || [ "`use lm_sensors`" ] + then +# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/i2c-${I2CV}.tar.gz" + SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/i2c-${I2CV}.tar.gz" + fi + if [ "`use lm_sensors`" ] + then +# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz" + SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/lm_sensors-${SENV}.tar.gz" + fi + if [ "`use lvm`" ] + then + SRC_URI="${SRC_URI} ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz" + fi + if [ "`use alsa`" ] + then + SRC_URI="${SRC_URI} ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2" + fi + if [ "`use pcmcia-cs`" ] + then + SRC_URI="${SRC_URI} http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz" + fi +#### XFS +# if [ "`use xfs`" ] +# then +# SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/linux-${KV}-xfs-${XFSV}.diff.gz" +# fi +#### XFS +fi + +if [ "${PN}" = "linux-extras" ] +then + DEPEND=">=sys-kernel/linux-sources-${PVR}" + RDEPEND=" " +#### XFS +# if [ "`use xfs`" ] +# then +# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" +# fi +#### XFS + if [ "`use alsa`" ] + then + PROVIDE="virtual/alsa" + fi +elif [ "${PN}" = "linux" ] +then + PROVIDE="virtual/kernel" + RDEPEND=">=sys-apps/reiserfs-utils-3.6.25-r1" + DEPEND=">=sys-apps/modutils-2.4.2 + >=sys-devel/flex-2.5.4a-r3 + >=dev-util/yacc-1.9.1-r1" +#### XFS +# if [ "`use xfs`" ] +# then +# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" +# fi +#### XFS + if [ "`use alsa`" ] + then + PROVIDE="${PROVIDE} virtual/alsa" + fi +fi + +HOMEPAGE="http://www.kernel.org/ + http://www.netroedge.com/~lm78/ + http://www.namesys.com + http://www.sistina.com/lvm/ + http://www.alsa-project.org + http://pcmcia-cs.sourceforge.net + http://linux-xfs.sgi.com/projects/xfs/" + +# this is not pretty... +LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include" + +src_unpack() { + + # We only need to unpack for linux and linux-sources + + if [ "${PN}" != "linux-extras" ] + then + + #unpack kernel and apply reiserfs-related patches + cd ${WORKDIR} + unpack linux-${OKV}.tar.bz2 + try mv linux linux-${KV} + cd ${S} + + # save this for later... + cp -a drivers/md/lvm-snap.h ${T} + + echo "Applying ${KV} patch..." + try bzip2 -dc ${DISTDIR}/patch-2.4.5-ac5.bz2 | patch -p1 + + echo "Applying reiserfs-knfsd patch..." +# try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | patch -p1 + try bzip2 -dc ${DISTDIR}/linux-2.4.5-pre6-knfsd.patch.bz2 | patch -p1 + +# echo "Applying reiserfs-procinfo patch..." +# try gzip -dc ${DISTDIR}/linux-${OKV}-procinfo-${PIV}.patch.gz | patch -p1 + + echo "Applying reiserfs-quota patch..." +# try bzip2 -dc ${DISTDIR}/reiserfs-quota-${OKV}.dif.bz2 | patch -p1 + try bzip2 -dc ${DISTDIR}/reiserfs-quota-2.4.4.dif.bz2 | patch -p1 + +# echo "Applying reiserfs patches..." +# try bzip2 -dc ${DISTDIR}/bigpatch-${OKV}.diff.bz2 | patch -p1 + + if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use i2c`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ] + then + mkdir -p ${S}/extras + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# cd ${S} +# echo "Applying xfs patch..." +# try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}.diff.gz | patch -p1 +# fi +#### XFS + + if [ "`use lvm`" ] + then + #create and apply LVM patch. The tools get built later. + cd ${S}/extras + echo "Unpacking and applying LVM patch..." + unpack lvm_${LVMVARC}.tar.gz + try cd LVM/${LVMV} + + # I had to hack this in so that LVM will look in the current linux + # source directory instead of /usr/src/linux for stuff - pete + try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}" + + cd PATCHES + try make KERNEL_VERSION=${KV} KERNEL_DIR=${S} + cd ${S} + patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-gentoo-pre-lvm.diff + mv -f ${T}/lvm-snap.h drivers/md +#### XFS +# if [ "`use xfs`" ] +# then +# try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm.diff +# fi +#### XFS + # the -l option allows this patch to apply cleanly (ignore whitespace changes) + try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch + cd ${S}/drivers/md + try patch -p0 < ${FILESDIR}/${PVR}/lvm.c.diff + fi + + if [ "`use alsa`" ] + then + #unpack alsa drivers + echo "Unpacking ALSA drivers..." + cd ${S}/extras + unpack alsa-driver-${AV}.tar.bz2 + fi + + if [ "`use i2c`" ] || [ "`use lm_sensors`" ] + then + if [ -z "`use i2c`" ] + then + echo "Note: Using i2c since lm_sensors is enabled." + fi + #unpack and apply the i2c patch + echo "Unpacking and applying i2c patch..." + cd ${S}/extras + unpack i2c-${I2CV}.tar.gz + try cd i2c-${I2CV} + try mkpatch/mkpatch.pl . ${S} > ${S}/i2c-patch + try cp -a Makefile Makefile.orig + + cd ${S} + try patch -p1 < i2c-patch + rm -f i2c-patch + fi + + if [ "`use lm_sensors`" ] + then + #unpack and apply the lm_sensors patch + echo "Unpacking and applying lm_sensors patch..." + cd ${S}/extras + unpack lm_sensors-${SENV}.tar.gz + try cd lm_sensors-${SENV} + try mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch + try rmdir src + try ln -s ../.. src + try cp -a Makefile Makefile.orig + + cd ${S} + try patch -p1 < lm_sensors-patch + rm -f lm_sensors-patch + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# echo "Applying xfs cleanup patch..." +# try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup.diff +# fi +#### XFS + + if [ "`use pcmcia-cs`" ] + then + echo "Unpacking pcmcia-cs tools..." + cd ${S}/extras + unpack pcmcia-cs-${PCV}.tar.gz + patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff + fi + #get sources ready for compilation or for sitting at /usr/src/linux + echo "Preparing for compilation..." + + cd ${S} + + #sometimes we have icky kernel symbols; this seems to get rid of them + try make mrproper + + #fix silly permissions in tarball + cd ${WORKDIR} + chown -R 0.0 ${S} + chmod -R a+r-w+X,u+w ${S} + fi +} + +src_compile() { + + if [ "${PN}" != "linux-sources" ] + then + if [ "${PN}" = "linux" ] + then + #this is the configuration for the default kernel + try cp ${FILESDIR}/${PVR}/config.bootcomp .config + try yes \"\" \| make oldconfig + echo "Ignore any errors from the yes command above." + try make include/linux/version.h + fi + + if [ "$PN" = "linux" ] + then + try make symlinks + fi + + if [ "`use lvm`" ] + then + #LVM tools are included in the linux and linux-extras pakcages + cd ${S}/extras/LVM/${LVMV} + + # This is needed for linux-extras + if [ -f "Makefile" ] + then + try make distclean + fi + # I had to hack this in so that LVM will look in the current linux + # source directory instead of /usr/src/linux for stuff - pete + try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}" + + try make + fi + + if [ "`use i2c`" ] || [ "`use lm_sensors`" ] + then + cd ${S}/extras/i2c-${I2CV} + try sed -e \''s:^LINUX=.*:LINUX=src:'\' \ + -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \ + -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \ + -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \ + Makefile.orig > Makefile + + try make clean + + try make + fi + + if [ "`use lm_sensors`" ] + then + cd ${S}/extras/lm_sensors-${SENV} + try sed -e \''s:^LINUX=.*:LINUX=src:'\' \ + -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \ + -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \ + -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \ + -e \''s#^PREFIX.*#PREFIX := /usr#'\' \ + -e \''s#^MANDIR.*#MANDIR := /usr/share/man#'\' \ + Makefile.orig > Makefile + + try make clean + + try make + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# cd ${S}/extras/xfs-${XFSV}/acl +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include"\" \ +# configure +# try make \ +# PKG_SBIN_DIR=/sbin \ +# PKG_INC_DIR=/usr/include/acl \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# cd ${S}/extras/xfs-${XFSV}/attr +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include"\" \ +# configure +# try make \ +# PKG_SBIN_DIR=/bin \ +# PKG_INC_DIR=/usr/include/acl \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# cd ${S}/extras/xfs-${XFSV}/xfsprogs +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include"\" \ +# configure +# try make \ +# PKG_SBIN_DIR=/sbin \ +# PKG_BIN_DIR=/usr/sbin \ +# PKG_INC_DIR=/usr/include/xfs \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# # dmapi and xfsdump must be built last, cuz they depend on libattr (in attr) and libxfs (in xfsprogs) +# cd ${S}/extras/xfs-${XFSV}/dmapi +# ln -sf ../../xfsprogs/include include/xfs +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/dmapi/include"\" \ +# configure +# try make \ +# PKG_INC_DIR=/usr/include/dmapi \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# cd ${S}/extras/xfs-${XFSV}/xfsdump +# ln -sf ../../xfsprogs/include include/xfs +# ln -sf ../../attr/include include/attr +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/xfsdump/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \ +# LDFLAGS=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\" \ +# configure +# try make \ +# PKG_BIN_DIR=/usr/sbin \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" \ +# LIBATTR=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -lattr"\" \ +# LIBXFS=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -lxfs"\" \ +# LIBHANDLE=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\" +# +# fi +#### XFS + + cd ${S} + + if [ "${PN}" == "linux" ] + then + try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep + try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" bzImage + #LEX=\""flex -l"\" bzImage + try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" modules + #LEX=\""flex -l"\" modules + + fi + # This must come after the kernel compilation in linux + if [ "`use alsa`" ] + then + cd ${S}/extras/alsa-driver-${AV} + # This is needed for linux-extras + if [ -f "Makefile.conf" ] + then + try make mrproper + fi + try ./configure --with-kernel=\"${S}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all + mkdir -p modules + try make + fi + if [ "`use pcmcia-cs`" ] + then + cd ${S}/extras/pcmcia-cs-${PCV} + # This is needed for linux-extras + if [ -f "Makefile" ] + then + try make clean + fi + try ./Configure -n --kernel=${S} --moddir=/lib/modules/${KV} \ + --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/ + try make all + fi + fi +} + +src_install() { + + # We install the alsa headers in all three packages + if [ "`use alsa`" ] + then + # get alsa includes + cd ${S}/extras/alsa-driver-${AV} + insinto /usr/src/linux-${KV}/include/linux + cd include + doins asound.h asoundid.h asequencer.h ainstr_*.h + fi + + if [ "${PN}" != "linux-sources" ] + then + dodir /usr/lib + + if [ "`use lvm`" ] + then + cd ${S}/extras/LVM/${LVMV}/tools + + try CFLAGS=\""${CFLAGS} -I${S}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \ + sbindir=${D}/sbin libdir=${D}/lib + #no need for a static library in /lib + mv ${D}/lib/*.a ${D}/usr/lib + + cd ${S}/extras/LVM/${LVMV} + docinto LVM-${LVMV} + dodoc ABSTRACT CHANGELOG CONTRIBUTORS COPYING COPYING.LIB FAQ KNOWN_BUGS LVM-HOWTO + dodoc README TODO WHATSNEW + fi + + if [ "`use lm_sensors`" ] + then + echo "Install sensor tools..." + #install sensors tools + cd ${S}/extras/lm_sensors-${SENV} + make install + docinto lm_sensors-${SENV} + dodoc BACKGROUND BUGS CHANGES CONTRIBUTORS COPYING INSTALL QUICKSTART README + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# cd ${S}/extras/xfs-${XFSV}/acl +# chmod +x install-sh +# try make \ +# PKG_SBIN_DIR=${D}/sbin \ +# PKG_INC_DIR=${D}/usr/include/acl \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/acl +# docinto xfs-${XFSV}/acl +# dodoc README doc/CHANGES doc/COPYING doc/PORTING +# +# cd ${S}/extras/xfs-${XFSV}/attr +# chmod +x install-sh +# try make \ +# PKG_SBIN_DIR=${D}/bin \ +# PKG_INC_DIR=${D}/usr/include/acl \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/attr +# docinto xfs-${XFSV}/attr +# dodoc README doc/CHANGES doc/COPYING doc/PORTING +# +# cd ${S}/extras/xfs-${XFSV}/xfsprogs +# chmod +x install-sh +# try make \ +# PKG_SBIN_DIR=${D}/sbin \ +# PKG_BIN_DIR=${D}/usr/sbin \ +# PKG_INC_DIR=${D}/usr/include/xfs \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/xfsprogs +# docinto xfs-${XFSV}/xfsprogs +# dodoc README doc/CHANGES doc/COPYING docs/CREDITS doc/PORTING doc/README.LVM doc/README.quota +# +# cd ${S}/extras/xfs-${XFSV}/dmapi +# chmod +x install-sh +# try make \ +# PKG_INC_DIR=${D}/usr/include/dmapi \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/dmapi +# docinto xfs-${XFSV}/dmapi +# dodoc README doc/CHANGES doc/COPYING doc/PORTING +# +# cd ${S}/extras/xfs-${XFSV}/xfsdump +# chmod +x install-sh +# try make \ +# PKG_BIN_DIR=${D}/usr/sbin \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/xfsprogs +# docinto xfs-${XFSV}/xfsdump +# dodoc README doc/CHANGES doc/COPYING doc/PORTING doc/README.xfsdump +# fi +#### XFS + + if [ "${PN}" = "linux" ] + then + dodir /usr/src + + dodir /usr/src/linux-${KV} + cd ${D}/usr/src + #grab includes and documentation only + echo ">>> Copying includes and documentation..." + find ${S}/include ${S}/Documentation -type f -name "*~" -exec rm -vf {} \; + cp -ax ${S}/include ${D}/usr/src/linux-${KV} + cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV} + + #grab compiled kernel + dodir /boot/boot + insinto /boot/boot + cd ${S} + doins arch/i386/boot/bzImage + + #grab modules + # Do we have a bug in modutils ? + # Meanwhile we use this quick fix (achim) + + install -d ${D}/lib/modules/`uname -r` + try make INSTALL_MOD_PATH=${D} modules_install + + depmod -b ${D} -F ${S}/System.map ${KV} +# rm -rf ${D}/lib/modules/`uname -r` + #fix symlink + cd ${D}/lib/modules/${KV} + rm build + ln -sf /usr/src/linux-${KV} build + fi + + if [ "`use alsa`" ] + then + cd ${S}/extras/alsa-driver-${AV} + docinto alsa-${AV} + dodoc COPYING INSTALL FAQ README WARNING + docinto alsa-${AV}/doc + dodoc doc/README.1st doc/SOUNDCARDS + mkdir -p ${D}/lib/modules/${KV}/misc + cp modules/*.o ${D}/lib/modules/${KV}/misc + fi + if [ "`use pcmcia-cs`" ] + then + #install PCMCIA modules and utilities + cd ${S}/extras/pcmcia-cs-${PCV} + try make PREFIX=${D} install + rm -rf ${D}/etc/rc.d + exeinto /etc/rc.d/init.d + doexe ${FILESDIR}/${PVR}/pcmcia + docinto pcmcia-cs-${PCV} + dodoc BUGS CHANGES COPYING LICENSE MAINTAINERS README README-2.4 SUPPORTED.CARDS + cd doc ; docinto pcmcia-cs-${PCV}/doc + dodoc PCMCIA-HOWTO PCMCIA-HOWTO.ps PCMCIA-PROG PCMCIA-PROG.ps + fi + else + dodir /usr/src + + cd ${S} + make mrproper + + if [ "`use lvm`" ] + then + cd ${S}/extras/LVM/${LVMV} + if [ -f Makefile ] + then + make distclean + fi + fi + if [ "`use lm_sensors`" ] + then + cd ${S}/extras/lm_sensors-${SENV} + make clean + fi + + echo ">>> Copying sources..." + find ${S} -type f -name "*~" -exec rm -vf {} \; + cp -ax ${S} ${D}/usr/src + + #don't overwrite existing .config if present + cd ${D}/usr/src/linux-${KV} + if [ -e .config ] + then + cp -a .config .config.eg + fi + fi +} + +pkg_postinst() { + if [ "${PN}" != "linux-extras" ] + then + rm -f ${ROOT}/usr/src/linux + ln -sf linux-${KV} ${ROOT}/usr/src/linux + fi + + #copy over our .config if one isn't already present + cd ${ROOT}/usr/src/linux-${KV} + if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ] + then + cp -a .config.eg .config + fi +} diff --git a/sys-kernel/linux-sources/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff b/sys-kernel/linux-sources/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff new file mode 100644 index 000000000000..7322f1852a6c --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff @@ -0,0 +1,11 @@ +--- linux-2.4.5-ac5/drivers/md/Makefile.orig Sat Jun 2 00:49:51 2001 ++++ linux-2.4.5-ac5/drivers/md/Makefile Sat Jun 2 00:50:01 2001 +@@ -6,7 +6,7 @@ + + export-objs := md.o xor.o + list-multi := lvm-mod.o +-lvm-mod-objs := lvm.o lvm-snap.o lvm-fs.o ++lvm-mod-objs := lvm.o lvm-snap.o + + # Note: link order is important. All raid personalities + # and xor.o must come before md.o, as they each initialise diff --git a/sys-kernel/linux-sources/files/2.4.5.5/lvm.c.diff b/sys-kernel/linux-sources/files/2.4.5.5/lvm.c.diff new file mode 100644 index 000000000000..6392671b8f7e --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5.5/lvm.c.diff @@ -0,0 +1,20 @@ +--- lvm.c.orig Sat Apr 28 10:48:37 2001 ++++ lvm.c Sat Apr 28 11:07:07 2001 +@@ -1791,7 +1791,7 @@ + int max_hardblocksize = 0, hardblocksize; + + for (le = 0; le < lv->lv_allocated_le; le++) { +- hardblocksize = get_hardblocksize(lv->lv_current_pe[le].dev); ++ hardblocksize = get_hardsect_size(lv->lv_current_pe[le].dev); + if (hardblocksize == 0) + hardblocksize = 512; + if (hardblocksize > max_hardblocksize) +@@ -1801,7 +1801,7 @@ + if (lv->lv_access & LV_SNAPSHOT) { + for (e = 0; e < lv->lv_remap_end; e++) { + hardblocksize = +- get_hardblocksize( ++ get_hardsect_size( + lv->lv_block_exception[e].rdev_new); + if (hardblocksize == 0) + hardblocksize = 512; diff --git a/sys-kernel/linux-sources/files/2.4.5.5/pcmcia b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia new file mode 100755 index 000000000000..4cfb368ff68a --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia @@ -0,0 +1,97 @@ +#!/bin/sh +#RCUPDATE:3 4:69:This line is required for script management + +. /etc/rc.d/config/functions + +SERVICE=pcmcia +opts="start stop restart" + + # Slackware startup options go right here: + # Should be either i82365 or tcic + PCIC=i82365 + # Put socket driver timing parameters here + PCIC_OPTS= + # Put pcmcia_core options here + CORE_OPTS= + # Put cardmgr options here + CARDMGR_OPTS= + # To set the PCMCIA scheme at startup... + SCHEME= + +cleanup() +{ + while read SN CLASS MOD INST DEV EXTRA ; do + if [ "$SN" != "Socket" ] ; then + /etc/pcmcia/$CLASS stop $DEV 2> /dev/null + fi + done +} + +start() { + if [ -d /var/lib/pcmcia ] ; then + SC=/var/lib/pcmcia/scheme + RUN=/var/lib/pcmcia + else + SC=/var/run/pcmcia-scheme + RUN=/var/run + fi + if [ -L $SC -o ! -O $SC ] ; then rm -f $SC ; fi + if [ ! -f $SC ] ; then umask 022 ; touch $SC ; fi + if [ "$SCHEME" ] ; then umask 022 ; echo $SCHEME > $SC ; fi + fgrep -q pcmcia /proc/devices + if [ $? -ne 0 ] ; then + if [ -d /lib/modules/preferred ] ; then + PC=/lib/modules/preferred/pcmcia + else + PC=/lib/modules/`uname -r`/pcmcia + fi + if [ -d $PC ] ; then + echo -n " modules" + /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS 2>&1 > /dev/null + /sbin/insmod $PC/$PCIC.o $PCIC_OPTS 2>&1 > /dev/null + /sbin/insmod $PC/ds.o 2>&1 > /dev/null + else + echo " module directory $PC not found." + break + fi + fi + if [ -s /var/run/cardmgr.pid ] && \ + kill -0 `cat /var/run/cardmgr.pid` 2>/dev/null ; then + echo " cardmgr is already running." + else + if [ -r $RUN/stab ] ; then + cat $RUN/stab | cleanup + fi + /sbin/cardmgr $CARDMGR_OPTS 2>&1 > /dev/null + fi + touch /var/lock/subsys/pcmcia 2>&1 > /dev/null +} + +stop() { + if [ -s /var/run/cardmgr.pid ] ; then + PID=`cat /var/run/cardmgr.pid` + kill $PID + echo -n " cardmgr" + # Give cardmgr a few seconds to handle the signal + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null + fi + killall -q "CardBus Watcher" + if fgrep -q "ds " /proc/modules ; then + echo -n " modules" + /sbin/rmmod ds + /sbin/rmmod $PCIC + /sbin/rmmod pcmcia_core + fi + rm -f /var/lock/subsys/pcmcia +} + +restart() { + stop + start +} + +doservice ${@} + diff --git a/sys-kernel/linux-sources/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff new file mode 100644 index 000000000000..db555693924c --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff @@ -0,0 +1,11 @@ +--- pcmcia-cs-3.1.25/cardmgr/cardinfo.c~ Wed Feb 14 04:25:48 2001 ++++ pcmcia-cs-3.1.25/cardmgr/cardinfo.c Fri May 4 11:43:32 2001 +@@ -40,7 +40,7 @@ + #include <fcntl.h> + #include <errno.h> + #include <signal.h> +-#include <sys/time.h> ++#include <time.h> + #include <sys/ioctl.h> + #include <sys/stat.h> + #include <sys/file.h> diff --git a/sys-kernel/linux-sources/files/digest-linux-sources-2.4.5.5 b/sys-kernel/linux-sources/files/digest-linux-sources-2.4.5.5 new file mode 100644 index 000000000000..a3ecb6bc9376 --- /dev/null +++ b/sys-kernel/linux-sources/files/digest-linux-sources-2.4.5.5 @@ -0,0 +1,9 @@ +MD5 ff807499928379c4274a307855b9eeeb alsa-driver-0.5.11.tar.bz2 +MD5 5c8144c6543b1900dd9b99dde700d4ae i2c-20010530-gentoo.tar.gz +MD5 25c825f461bb28cee03f7b216d763d6b linux-2.4.5-pre6-knfsd.patch.bz2 +MD5 923e94a6a4af9c8265bc1d66906659e4 linux-2.4.5.tar.bz2 +MD5 85be98dae125cb3d9398ba10cb595fc9 lm_sensors-20010530-gentoo.tar.gz +MD5 1ce6fb607f26dc20d4c77461057acb3c lvm_0.9.1_beta7.tar.gz +MD5 f16c87bc6f40c783625398c03ecbe38a patch-2.4.5-ac5.bz2 +MD5 4ec7264c95d17bb86c3a94f0a12ed11d pcmcia-cs-3.1.25.tar.gz +MD5 e2c8f8769e698202e273498749c40186 reiserfs-quota-2.4.4.dif.bz2 diff --git a/sys-kernel/linux-sources/linux-sources-2.4.5.5.ebuild b/sys-kernel/linux-sources/linux-sources-2.4.5.5.ebuild new file mode 100644 index 000000000000..31f64083c4ca --- /dev/null +++ b/sys-kernel/linux-sources/linux-sources-2.4.5.5.ebuild @@ -0,0 +1,688 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Daniel Robbins <drobbins@gentoo.org> +# /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp + +# *** WARNING: This kernel package does not have XFS support! *** + +#OKV=original kernel version, KV=patched kernel version +OKV=2.4.5 +KV=2.4.5-ac5 + +if [ "${PN}" = "linux-extras" ] +then + S=/usr/src/linux-${KV} +else + S=${WORKDIR}/linux-${KV} +fi + +# Versions of LVM +LVMV=0.9.1_beta7 + +LVMVARC=0.9.1_beta7 +# Versions of alsa +AV=0.5.11 + +# Versionos of jfs +JFSV=0.2.1 + +# Versions of lm_sensors and i2c +SENV=20010530-gentoo +I2CV=20010530-gentoo + +# Versions of reiserfs +RV=20010327 +KNV="6.g" +PIV="1.d" + +# Versions of xmlprocfs +XMLV=0.3 + +# Versions of pcmcia-cs +PCV="3.1.25" + +# Version of XFS +XFSV=20010530-gentoo + +[ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes" +[ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources" +[ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries" + +# We use build in /usr/src/linux in case of linux-extras +# so we need no sources +if [ "${PN}" != "linux-extras" ] +then + SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2 + http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.bz2 + http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/linux-2.4.5-pre6-knfsd.patch.bz2 + http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/reiserfs-quota-2.4.4.dif.bz2" + +# http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/bigpatch-${OKV}.diff.bz2 +# http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-${JFSV}-patch.tar.gz +# http://download.sourceforge.net/xmlprocfs/linux-2.4-xmlprocfs-${XMLV}.patch.gz +# ftp://ftp.reiserfs.com/pub/reiserfs-for-2.4/linux-${OKV}-reiserfs-${RV}.patch.gz + + if [ "`use i2c`" ] || [ "`use lm_sensors`" ] + then +# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/i2c-${I2CV}.tar.gz" + SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/i2c-${I2CV}.tar.gz" + fi + if [ "`use lm_sensors`" ] + then +# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz" + SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/lm_sensors-${SENV}.tar.gz" + fi + if [ "`use lvm`" ] + then + SRC_URI="${SRC_URI} ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz" + fi + if [ "`use alsa`" ] + then + SRC_URI="${SRC_URI} ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2" + fi + if [ "`use pcmcia-cs`" ] + then + SRC_URI="${SRC_URI} http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz" + fi +#### XFS +# if [ "`use xfs`" ] +# then +# SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/linux-${KV}-xfs-${XFSV}.diff.gz" +# fi +#### XFS +fi + +if [ "${PN}" = "linux-extras" ] +then + DEPEND=">=sys-kernel/linux-sources-${PVR}" + RDEPEND=" " +#### XFS +# if [ "`use xfs`" ] +# then +# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" +# fi +#### XFS + if [ "`use alsa`" ] + then + PROVIDE="virtual/alsa" + fi +elif [ "${PN}" = "linux" ] +then + PROVIDE="virtual/kernel" + RDEPEND=">=sys-apps/reiserfs-utils-3.6.25-r1" + DEPEND=">=sys-apps/modutils-2.4.2 + >=sys-devel/flex-2.5.4a-r3 + >=dev-util/yacc-1.9.1-r1" +#### XFS +# if [ "`use xfs`" ] +# then +# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" +# fi +#### XFS + if [ "`use alsa`" ] + then + PROVIDE="${PROVIDE} virtual/alsa" + fi +fi + +HOMEPAGE="http://www.kernel.org/ + http://www.netroedge.com/~lm78/ + http://www.namesys.com + http://www.sistina.com/lvm/ + http://www.alsa-project.org + http://pcmcia-cs.sourceforge.net + http://linux-xfs.sgi.com/projects/xfs/" + +# this is not pretty... +LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include" + +src_unpack() { + + # We only need to unpack for linux and linux-sources + + if [ "${PN}" != "linux-extras" ] + then + + #unpack kernel and apply reiserfs-related patches + cd ${WORKDIR} + unpack linux-${OKV}.tar.bz2 + try mv linux linux-${KV} + cd ${S} + + # save this for later... + cp -a drivers/md/lvm-snap.h ${T} + + echo "Applying ${KV} patch..." + try bzip2 -dc ${DISTDIR}/patch-2.4.5-ac5.bz2 | patch -p1 + + echo "Applying reiserfs-knfsd patch..." +# try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | patch -p1 + try bzip2 -dc ${DISTDIR}/linux-2.4.5-pre6-knfsd.patch.bz2 | patch -p1 + +# echo "Applying reiserfs-procinfo patch..." +# try gzip -dc ${DISTDIR}/linux-${OKV}-procinfo-${PIV}.patch.gz | patch -p1 + + echo "Applying reiserfs-quota patch..." +# try bzip2 -dc ${DISTDIR}/reiserfs-quota-${OKV}.dif.bz2 | patch -p1 + try bzip2 -dc ${DISTDIR}/reiserfs-quota-2.4.4.dif.bz2 | patch -p1 + +# echo "Applying reiserfs patches..." +# try bzip2 -dc ${DISTDIR}/bigpatch-${OKV}.diff.bz2 | patch -p1 + + if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use i2c`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ] + then + mkdir -p ${S}/extras + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# cd ${S} +# echo "Applying xfs patch..." +# try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}.diff.gz | patch -p1 +# fi +#### XFS + + if [ "`use lvm`" ] + then + #create and apply LVM patch. The tools get built later. + cd ${S}/extras + echo "Unpacking and applying LVM patch..." + unpack lvm_${LVMVARC}.tar.gz + try cd LVM/${LVMV} + + # I had to hack this in so that LVM will look in the current linux + # source directory instead of /usr/src/linux for stuff - pete + try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}" + + cd PATCHES + try make KERNEL_VERSION=${KV} KERNEL_DIR=${S} + cd ${S} + patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-gentoo-pre-lvm.diff + mv -f ${T}/lvm-snap.h drivers/md +#### XFS +# if [ "`use xfs`" ] +# then +# try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm.diff +# fi +#### XFS + # the -l option allows this patch to apply cleanly (ignore whitespace changes) + try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch + cd ${S}/drivers/md + try patch -p0 < ${FILESDIR}/${PVR}/lvm.c.diff + fi + + if [ "`use alsa`" ] + then + #unpack alsa drivers + echo "Unpacking ALSA drivers..." + cd ${S}/extras + unpack alsa-driver-${AV}.tar.bz2 + fi + + if [ "`use i2c`" ] || [ "`use lm_sensors`" ] + then + if [ -z "`use i2c`" ] + then + echo "Note: Using i2c since lm_sensors is enabled." + fi + #unpack and apply the i2c patch + echo "Unpacking and applying i2c patch..." + cd ${S}/extras + unpack i2c-${I2CV}.tar.gz + try cd i2c-${I2CV} + try mkpatch/mkpatch.pl . ${S} > ${S}/i2c-patch + try cp -a Makefile Makefile.orig + + cd ${S} + try patch -p1 < i2c-patch + rm -f i2c-patch + fi + + if [ "`use lm_sensors`" ] + then + #unpack and apply the lm_sensors patch + echo "Unpacking and applying lm_sensors patch..." + cd ${S}/extras + unpack lm_sensors-${SENV}.tar.gz + try cd lm_sensors-${SENV} + try mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch + try rmdir src + try ln -s ../.. src + try cp -a Makefile Makefile.orig + + cd ${S} + try patch -p1 < lm_sensors-patch + rm -f lm_sensors-patch + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# echo "Applying xfs cleanup patch..." +# try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup.diff +# fi +#### XFS + + if [ "`use pcmcia-cs`" ] + then + echo "Unpacking pcmcia-cs tools..." + cd ${S}/extras + unpack pcmcia-cs-${PCV}.tar.gz + patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff + fi + #get sources ready for compilation or for sitting at /usr/src/linux + echo "Preparing for compilation..." + + cd ${S} + + #sometimes we have icky kernel symbols; this seems to get rid of them + try make mrproper + + #fix silly permissions in tarball + cd ${WORKDIR} + chown -R 0.0 ${S} + chmod -R a+r-w+X,u+w ${S} + fi +} + +src_compile() { + + if [ "${PN}" != "linux-sources" ] + then + if [ "${PN}" = "linux" ] + then + #this is the configuration for the default kernel + try cp ${FILESDIR}/${PVR}/config.bootcomp .config + try yes \"\" \| make oldconfig + echo "Ignore any errors from the yes command above." + try make include/linux/version.h + fi + + if [ "$PN" = "linux" ] + then + try make symlinks + fi + + if [ "`use lvm`" ] + then + #LVM tools are included in the linux and linux-extras pakcages + cd ${S}/extras/LVM/${LVMV} + + # This is needed for linux-extras + if [ -f "Makefile" ] + then + try make distclean + fi + # I had to hack this in so that LVM will look in the current linux + # source directory instead of /usr/src/linux for stuff - pete + try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}" + + try make + fi + + if [ "`use i2c`" ] || [ "`use lm_sensors`" ] + then + cd ${S}/extras/i2c-${I2CV} + try sed -e \''s:^LINUX=.*:LINUX=src:'\' \ + -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \ + -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \ + -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \ + Makefile.orig > Makefile + + try make clean + + try make + fi + + if [ "`use lm_sensors`" ] + then + cd ${S}/extras/lm_sensors-${SENV} + try sed -e \''s:^LINUX=.*:LINUX=src:'\' \ + -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \ + -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \ + -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \ + -e \''s#^PREFIX.*#PREFIX := /usr#'\' \ + -e \''s#^MANDIR.*#MANDIR := /usr/share/man#'\' \ + Makefile.orig > Makefile + + try make clean + + try make + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# cd ${S}/extras/xfs-${XFSV}/acl +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include"\" \ +# configure +# try make \ +# PKG_SBIN_DIR=/sbin \ +# PKG_INC_DIR=/usr/include/acl \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# cd ${S}/extras/xfs-${XFSV}/attr +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include"\" \ +# configure +# try make \ +# PKG_SBIN_DIR=/bin \ +# PKG_INC_DIR=/usr/include/acl \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# cd ${S}/extras/xfs-${XFSV}/xfsprogs +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include"\" \ +# configure +# try make \ +# PKG_SBIN_DIR=/sbin \ +# PKG_BIN_DIR=/usr/sbin \ +# PKG_INC_DIR=/usr/include/xfs \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# # dmapi and xfsdump must be built last, cuz they depend on libattr (in attr) and libxfs (in xfsprogs) +# cd ${S}/extras/xfs-${XFSV}/dmapi +# ln -sf ../../xfsprogs/include include/xfs +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/dmapi/include"\" \ +# configure +# try make \ +# PKG_INC_DIR=/usr/include/dmapi \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" +# +# cd ${S}/extras/xfs-${XFSV}/xfsdump +# ln -sf ../../xfsprogs/include include/xfs +# ln -sf ../../attr/include include/attr +# try make distclean +# rm -f include/builddefs +# try make \ +# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/xfsdump/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \ +# LDFLAGS=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\" \ +# configure +# try make \ +# PKG_BIN_DIR=/usr/sbin \ +# PKG_LIB_DIR=/usr/lib \ +# PKG_MAN_DIR=/usr/share/man \ +# CC=\""gcc -I${S}/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \ +# OPTIMIZER=\""${CFLAGS}"\" \ +# DEBUG=\"\" \ +# LIBATTR=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -lattr"\" \ +# LIBXFS=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -lxfs"\" \ +# LIBHANDLE=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\" +# +# fi +#### XFS + + cd ${S} + + if [ "${PN}" == "linux" ] + then + try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep + try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" bzImage + #LEX=\""flex -l"\" bzImage + try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" modules + #LEX=\""flex -l"\" modules + + fi + # This must come after the kernel compilation in linux + if [ "`use alsa`" ] + then + cd ${S}/extras/alsa-driver-${AV} + # This is needed for linux-extras + if [ -f "Makefile.conf" ] + then + try make mrproper + fi + try ./configure --with-kernel=\"${S}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all + mkdir -p modules + try make + fi + if [ "`use pcmcia-cs`" ] + then + cd ${S}/extras/pcmcia-cs-${PCV} + # This is needed for linux-extras + if [ -f "Makefile" ] + then + try make clean + fi + try ./Configure -n --kernel=${S} --moddir=/lib/modules/${KV} \ + --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/ + try make all + fi + fi +} + +src_install() { + + # We install the alsa headers in all three packages + if [ "`use alsa`" ] + then + # get alsa includes + cd ${S}/extras/alsa-driver-${AV} + insinto /usr/src/linux-${KV}/include/linux + cd include + doins asound.h asoundid.h asequencer.h ainstr_*.h + fi + + if [ "${PN}" != "linux-sources" ] + then + dodir /usr/lib + + if [ "`use lvm`" ] + then + cd ${S}/extras/LVM/${LVMV}/tools + + try CFLAGS=\""${CFLAGS} -I${S}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \ + sbindir=${D}/sbin libdir=${D}/lib + #no need for a static library in /lib + mv ${D}/lib/*.a ${D}/usr/lib + + cd ${S}/extras/LVM/${LVMV} + docinto LVM-${LVMV} + dodoc ABSTRACT CHANGELOG CONTRIBUTORS COPYING COPYING.LIB FAQ KNOWN_BUGS LVM-HOWTO + dodoc README TODO WHATSNEW + fi + + if [ "`use lm_sensors`" ] + then + echo "Install sensor tools..." + #install sensors tools + cd ${S}/extras/lm_sensors-${SENV} + make install + docinto lm_sensors-${SENV} + dodoc BACKGROUND BUGS CHANGES CONTRIBUTORS COPYING INSTALL QUICKSTART README + fi + +#### XFS +# if [ "`use xfs`" ] +# then +# cd ${S}/extras/xfs-${XFSV}/acl +# chmod +x install-sh +# try make \ +# PKG_SBIN_DIR=${D}/sbin \ +# PKG_INC_DIR=${D}/usr/include/acl \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/acl +# docinto xfs-${XFSV}/acl +# dodoc README doc/CHANGES doc/COPYING doc/PORTING +# +# cd ${S}/extras/xfs-${XFSV}/attr +# chmod +x install-sh +# try make \ +# PKG_SBIN_DIR=${D}/bin \ +# PKG_INC_DIR=${D}/usr/include/acl \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/attr +# docinto xfs-${XFSV}/attr +# dodoc README doc/CHANGES doc/COPYING doc/PORTING +# +# cd ${S}/extras/xfs-${XFSV}/xfsprogs +# chmod +x install-sh +# try make \ +# PKG_SBIN_DIR=${D}/sbin \ +# PKG_BIN_DIR=${D}/usr/sbin \ +# PKG_INC_DIR=${D}/usr/include/xfs \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/xfsprogs +# docinto xfs-${XFSV}/xfsprogs +# dodoc README doc/CHANGES doc/COPYING docs/CREDITS doc/PORTING doc/README.LVM doc/README.quota +# +# cd ${S}/extras/xfs-${XFSV}/dmapi +# chmod +x install-sh +# try make \ +# PKG_INC_DIR=${D}/usr/include/dmapi \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/dmapi +# docinto xfs-${XFSV}/dmapi +# dodoc README doc/CHANGES doc/COPYING doc/PORTING +# +# cd ${S}/extras/xfs-${XFSV}/xfsdump +# chmod +x install-sh +# try make \ +# PKG_BIN_DIR=${D}/usr/sbin \ +# PKG_LIB_DIR=${D}/usr/lib \ +# PKG_MAN_DIR=${D}/usr/share/man \ +# install install-dev +# rm -rf ${D}/usr/share/doc/xfsprogs +# docinto xfs-${XFSV}/xfsdump +# dodoc README doc/CHANGES doc/COPYING doc/PORTING doc/README.xfsdump +# fi +#### XFS + + if [ "${PN}" = "linux" ] + then + dodir /usr/src + + dodir /usr/src/linux-${KV} + cd ${D}/usr/src + #grab includes and documentation only + echo ">>> Copying includes and documentation..." + find ${S}/include ${S}/Documentation -type f -name "*~" -exec rm -vf {} \; + cp -ax ${S}/include ${D}/usr/src/linux-${KV} + cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV} + + #grab compiled kernel + dodir /boot/boot + insinto /boot/boot + cd ${S} + doins arch/i386/boot/bzImage + + #grab modules + # Do we have a bug in modutils ? + # Meanwhile we use this quick fix (achim) + + install -d ${D}/lib/modules/`uname -r` + try make INSTALL_MOD_PATH=${D} modules_install + + depmod -b ${D} -F ${S}/System.map ${KV} +# rm -rf ${D}/lib/modules/`uname -r` + #fix symlink + cd ${D}/lib/modules/${KV} + rm build + ln -sf /usr/src/linux-${KV} build + fi + + if [ "`use alsa`" ] + then + cd ${S}/extras/alsa-driver-${AV} + docinto alsa-${AV} + dodoc COPYING INSTALL FAQ README WARNING + docinto alsa-${AV}/doc + dodoc doc/README.1st doc/SOUNDCARDS + mkdir -p ${D}/lib/modules/${KV}/misc + cp modules/*.o ${D}/lib/modules/${KV}/misc + fi + if [ "`use pcmcia-cs`" ] + then + #install PCMCIA modules and utilities + cd ${S}/extras/pcmcia-cs-${PCV} + try make PREFIX=${D} install + rm -rf ${D}/etc/rc.d + exeinto /etc/rc.d/init.d + doexe ${FILESDIR}/${PVR}/pcmcia + docinto pcmcia-cs-${PCV} + dodoc BUGS CHANGES COPYING LICENSE MAINTAINERS README README-2.4 SUPPORTED.CARDS + cd doc ; docinto pcmcia-cs-${PCV}/doc + dodoc PCMCIA-HOWTO PCMCIA-HOWTO.ps PCMCIA-PROG PCMCIA-PROG.ps + fi + else + dodir /usr/src + + cd ${S} + make mrproper + + if [ "`use lvm`" ] + then + cd ${S}/extras/LVM/${LVMV} + if [ -f Makefile ] + then + make distclean + fi + fi + if [ "`use lm_sensors`" ] + then + cd ${S}/extras/lm_sensors-${SENV} + make clean + fi + + echo ">>> Copying sources..." + find ${S} -type f -name "*~" -exec rm -vf {} \; + cp -ax ${S} ${D}/usr/src + + #don't overwrite existing .config if present + cd ${D}/usr/src/linux-${KV} + if [ -e .config ] + then + cp -a .config .config.eg + fi + fi +} + +pkg_postinst() { + if [ "${PN}" != "linux-extras" ] + then + rm -f ${ROOT}/usr/src/linux + ln -sf linux-${KV} ${ROOT}/usr/src/linux + fi + + #copy over our .config if one isn't already present + cd ${ROOT}/usr/src/linux-${KV} + if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ] + then + cp -a .config.eg .config + fi +} diff --git a/sys-kernel/linux/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff b/sys-kernel/linux/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff new file mode 100644 index 000000000000..7322f1852a6c --- /dev/null +++ b/sys-kernel/linux/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff @@ -0,0 +1,11 @@ +--- linux-2.4.5-ac5/drivers/md/Makefile.orig Sat Jun 2 00:49:51 2001 ++++ linux-2.4.5-ac5/drivers/md/Makefile Sat Jun 2 00:50:01 2001 +@@ -6,7 +6,7 @@ + + export-objs := md.o xor.o + list-multi := lvm-mod.o +-lvm-mod-objs := lvm.o lvm-snap.o lvm-fs.o ++lvm-mod-objs := lvm.o lvm-snap.o + + # Note: link order is important. All raid personalities + # and xor.o must come before md.o, as they each initialise diff --git a/sys-kernel/linux/files/2.4.5.5/lvm.c.diff b/sys-kernel/linux/files/2.4.5.5/lvm.c.diff new file mode 100644 index 000000000000..6392671b8f7e --- /dev/null +++ b/sys-kernel/linux/files/2.4.5.5/lvm.c.diff @@ -0,0 +1,20 @@ +--- lvm.c.orig Sat Apr 28 10:48:37 2001 ++++ lvm.c Sat Apr 28 11:07:07 2001 +@@ -1791,7 +1791,7 @@ + int max_hardblocksize = 0, hardblocksize; + + for (le = 0; le < lv->lv_allocated_le; le++) { +- hardblocksize = get_hardblocksize(lv->lv_current_pe[le].dev); ++ hardblocksize = get_hardsect_size(lv->lv_current_pe[le].dev); + if (hardblocksize == 0) + hardblocksize = 512; + if (hardblocksize > max_hardblocksize) +@@ -1801,7 +1801,7 @@ + if (lv->lv_access & LV_SNAPSHOT) { + for (e = 0; e < lv->lv_remap_end; e++) { + hardblocksize = +- get_hardblocksize( ++ get_hardsect_size( + lv->lv_block_exception[e].rdev_new); + if (hardblocksize == 0) + hardblocksize = 512; diff --git a/sys-kernel/linux/files/2.4.5.5/pcmcia b/sys-kernel/linux/files/2.4.5.5/pcmcia new file mode 100755 index 000000000000..4cfb368ff68a --- /dev/null +++ b/sys-kernel/linux/files/2.4.5.5/pcmcia @@ -0,0 +1,97 @@ +#!/bin/sh +#RCUPDATE:3 4:69:This line is required for script management + +. /etc/rc.d/config/functions + +SERVICE=pcmcia +opts="start stop restart" + + # Slackware startup options go right here: + # Should be either i82365 or tcic + PCIC=i82365 + # Put socket driver timing parameters here + PCIC_OPTS= + # Put pcmcia_core options here + CORE_OPTS= + # Put cardmgr options here + CARDMGR_OPTS= + # To set the PCMCIA scheme at startup... + SCHEME= + +cleanup() +{ + while read SN CLASS MOD INST DEV EXTRA ; do + if [ "$SN" != "Socket" ] ; then + /etc/pcmcia/$CLASS stop $DEV 2> /dev/null + fi + done +} + +start() { + if [ -d /var/lib/pcmcia ] ; then + SC=/var/lib/pcmcia/scheme + RUN=/var/lib/pcmcia + else + SC=/var/run/pcmcia-scheme + RUN=/var/run + fi + if [ -L $SC -o ! -O $SC ] ; then rm -f $SC ; fi + if [ ! -f $SC ] ; then umask 022 ; touch $SC ; fi + if [ "$SCHEME" ] ; then umask 022 ; echo $SCHEME > $SC ; fi + fgrep -q pcmcia /proc/devices + if [ $? -ne 0 ] ; then + if [ -d /lib/modules/preferred ] ; then + PC=/lib/modules/preferred/pcmcia + else + PC=/lib/modules/`uname -r`/pcmcia + fi + if [ -d $PC ] ; then + echo -n " modules" + /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS 2>&1 > /dev/null + /sbin/insmod $PC/$PCIC.o $PCIC_OPTS 2>&1 > /dev/null + /sbin/insmod $PC/ds.o 2>&1 > /dev/null + else + echo " module directory $PC not found." + break + fi + fi + if [ -s /var/run/cardmgr.pid ] && \ + kill -0 `cat /var/run/cardmgr.pid` 2>/dev/null ; then + echo " cardmgr is already running." + else + if [ -r $RUN/stab ] ; then + cat $RUN/stab | cleanup + fi + /sbin/cardmgr $CARDMGR_OPTS 2>&1 > /dev/null + fi + touch /var/lock/subsys/pcmcia 2>&1 > /dev/null +} + +stop() { + if [ -s /var/run/cardmgr.pid ] ; then + PID=`cat /var/run/cardmgr.pid` + kill $PID + echo -n " cardmgr" + # Give cardmgr a few seconds to handle the signal + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null + fi + killall -q "CardBus Watcher" + if fgrep -q "ds " /proc/modules ; then + echo -n " modules" + /sbin/rmmod ds + /sbin/rmmod $PCIC + /sbin/rmmod pcmcia_core + fi + rm -f /var/lock/subsys/pcmcia +} + +restart() { + stop + start +} + +doservice ${@} + diff --git a/sys-kernel/linux/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff new file mode 100644 index 000000000000..db555693924c --- /dev/null +++ b/sys-kernel/linux/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff @@ -0,0 +1,11 @@ +--- pcmcia-cs-3.1.25/cardmgr/cardinfo.c~ Wed Feb 14 04:25:48 2001 ++++ pcmcia-cs-3.1.25/cardmgr/cardinfo.c Fri May 4 11:43:32 2001 +@@ -40,7 +40,7 @@ + #include <fcntl.h> + #include <errno.h> + #include <signal.h> +-#include <sys/time.h> ++#include <time.h> + #include <sys/ioctl.h> + #include <sys/stat.h> + #include <sys/file.h> |