[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

BSE 0.2 -- ext3 patch for 3.0.9 ready



Hello,
I created a new set of my Special Edition boot floppies with kernel
2.4.7, ext3 flavor and integrated GNU parted. The compiled version will
be uploaded to http://people.debian.org/~blade/bf-ext3/ when ready and I
could provide a user HOWTO. They install fine on my testing system.

I tried make the changes compatible with the main boot floppy branch, so
here is a patch to make the boot floppies ext3-aware. I will comment
some parts here, the diff file is in the attachment.

| --- boot-floppies-3.0.9.orig/debian/changelog
| +++ boot-floppies-3.0.9/debian/changelog
| @@ -1,3 +1,18 @@
| +boot-floppies (3.0.9-0.2.blade) unstable; urgency=low
| +
| +  * new upstream release
| +  * new kernel image with newer ext3
| +  * fixed ext3 decission in baseconfig.c, should insert ext3 for / in fstab now
| +  * still using the braindead solution choosing 2.4.7-ext3 in 'config' and
| +    disabling other variants. To use kernel 2.2.x, change it back in 'config',
| +    enable all other version in the Makefile again and provide
| +    kernel-image-2.2.X-ext3

When we are going to release woody with kernel-2.2.19 (or even 20?),
someone should package kernel-image-2.2.19-ext3. Is anyone willing too
or should I approach this task?

| +  * removed resize_reiserfs, reiserfsck (no sence and no disk space)

Either there are this binaries, or the parted stuff. If you don't like
this, strip the changes in scripts/rootdisk/* files from this patch.

| +  * rewrote user interaction after discussion with ext3 upstream
| +  * mke2fs -j created ext3 know, droped tune2fs
| +
| + -- Eduard Bloch <blade@debian.org>  Wed,  8 Aug 2001 18:21:22 +0200
| +
|  boot-floppies (3.0.9) unstable; urgency=low
|  
|    * Falk Hueffner
| @@ -58,6 +73,15 @@
| --- boot-floppies-3.0.9.orig/common.sh
| +++ boot-floppies-3.0.9/common.sh
| @@ -91,7 +91,7 @@
|          # package name might  have '=' or /', so get rid of that
|          pkg=${pkg%%[/=]*}
|          # force files in the 'updates' dir to alway override

As wrotten in a previous mail, I don't see any sence in this [^a-zA-Z],
removing it.

| -	for j in `pwd`/updates/${pkg}_[^a-zA-Z]*.deb; do
| +	for j in `pwd`/updates/${pkg}_*.deb; do
|              if [ -f "$j" ]; then
|  		f="$f $j"
|              fi
| --- boot-floppies-3.0.9.orig/config
| +++ boot-floppies-3.0.9/config
| @@ -17,7 +17,9 @@
|      kver	:= 2.4.5
|  endif
|  ifeq "$(architecture)" "i386"
| -    kver	:= 2.2.19

To revert if we use kernel-image-2.2.19-ext3 along with other
kernel-image-2.2.19-* flavors

| +# changed this to 2.4.7 branch because of newer ext3
| +#    kver	:= 2.2.19
| +    kver	:= 2.4.7
|  endif
|  ifeq "$(architecture)" "m68k"
|      kver	:= 2.2.19
| --- boot-floppies-3.0.9.orig/rootdisk.sh
| +++ boot-floppies-3.0.9/rootdisk.sh
| @@ -627,6 +627,8 @@
|      else
|  	mklibs=$scripts/mklibs.sh
|      fi
| +    # hack, overwritting test result.
| +    mklibs=$scripts/mklibs.py

Yes, with the current function, mklibs.sh is used on i386, even if
mklibs.py is MUCH faster and works fine.

|      $mklibs $vflag -L $E/lib:$E/usr/lib:/lib:/usr/lib --dest-dir $R/lib $EXECUTABLES
|      /usr/sbin/chroot $R /sbin/ldconfig $vflag
|  else
| --- boot-floppies-3.0.9.orig/documentation/README-ext3
| +++ boot-floppies-3.0.9/documentation/README-ext3

The README is to be improved, once the patch is adopted.

| --- boot-floppies-3.0.9.orig/make/i386.rules
| +++ boot-floppies-3.0.9/make/i386.rules
| @@ -17,11 +17,11 @@
|  root1440%.bin: 	resc1440%.bin
|  
|  rootide.bin:		rootdisk.sh moduleside.tgz

I had to increase the ramdisk size to get parted on it. Strip this out
from the patch if parted is not used.

| -	$(ROOTCMD) ./rootdisk.sh "ide" $(archive) 3200 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
| +	$(ROOTCMD) ./rootdisk.sh "ide" $(archive) 4000 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
|  
|  rootidepci.bin:		rootdisk.sh modulesidepci.tgz
| -	$(ROOTCMD) ./rootdisk.sh "idepci" $(archive) 3200 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
| +	$(ROOTCMD) ./rootdisk.sh "idepci" $(archive) 4000 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
|  
|  rootcompact.bin:	rootdisk.sh modulescompact.tgz
| -	$(ROOTCMD) ./rootdisk.sh "compact" $(archive) 3200 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
| +	$(ROOTCMD) ./rootdisk.sh "compact" $(archive) 4000 $(debianversion) "" $(LINGUA) "$(FONT)" $(SFONT)
|  
| --- boot-floppies-3.0.9.orig/scripts/dos/install-ext3.bat
| +++ boot-floppies-3.0.9/scripts/dos/install-ext3.bat
| @@ -0,0 +1 @@
| +..\dosutils\loadlin linux root=/dev/ram initrd=../images-1.44/ext3/root.bin disksize=1.44 flavor=ext3

Like above, this was changed for parted. Strip this out from the patch
if parted is not to be included.

| --- boot-floppies-3.0.9.orig/scripts/rootdisk/EXTRACT_LIST_all
| +++ boot-floppies-3.0.9/scripts/rootdisk/EXTRACT_LIST_all
| @@ -6,11 +6,15 @@
...
| +libncurses5
...
| +libparted1.4
| +libreadline4
...
| +parted
...
| --- boot-floppies-3.0.9.orig/scripts/rootdisk/SMALL_BASE_LIST_all
| +++ boot-floppies-3.0.9/scripts/rootdisk/SMALL_BASE_LIST_all
...
| --- boot-floppies-3.0.9.orig/utilities/dbootstrap/baseconfig.c
| +++ boot-floppies-3.0.9/utilities/dbootstrap/baseconfig.c
| @@ -273,6 +273,8 @@
|  	else
|  	{
|  	  fsname = "ext2";

Chooses the right fs-type for /, tested, works.

| +     if(is_fstype("/target", "ext3") == 1)
| +        fsname = "ext3";
|  	  fsopts="defaults,errors=remount-ro";
|  	  pass = 1;
|  	}
| --- boot-floppies-3.0.9.orig/utilities/dbootstrap/choose_medium.c
| +++ boot-floppies-3.0.9/utilities/dbootstrap/choose_medium.c
| @@ -35,7 +35,7 @@
|  #if #cpu(sparc) || #cpu(powerpc)
|  const char *fs_type_tab[] = { "ext2", NULL };
|  #else

Probe more FS types on floppies, I droped msdos support from my kernel
and used vfat instead.

| -const char *fs_type_tab[] = { "msdos", "ext2", NULL };
| +const char *fs_type_tab[] = { "msdos", "vfat", "fat", "ext2", NULL };
|  #endif
|  
|  /* Return Values:

In following files, ext3 is included similar to reiserfs.

| --- boot-floppies-3.0.9.orig/utilities/dbootstrap/extract_kernel.c
| +++ boot-floppies-3.0.9/utilities/dbootstrap/extract_kernel.c
| @@ -17,7 +17,7 @@
|  extern int patidx;
|  
|  char *driver_filenames[] = { "drv12", "drv14", "drv14compact", "drv14idepci", 
| -	"drv14ide", "drv14reiserfs", "drv14pmac", "drv14chrp", "drv14prep", 
| +	"drv14ide", "drv14reiserfs", "drv14ext3", "drv14pmac", "drv14chrp", "drv14prep", 
|  	"drv14apus", "drv14-sun4cdm", "drv14-sun4u", "drv14-sun4dm-pci",
|          "drv14generic", "drv14jensen", "drv14nautilus", NULL };
|  
| --- boot-floppies-3.0.9.orig/utilities/dbootstrap/partition_config.c
| +++ boot-floppies-3.0.9/utilities/dbootstrap/partition_config.c
| @@ -11,6 +11,7 @@
|  #include "notail.h"
|  
|  #define is_rfs (bootargs.flavor && !strcmp ("reiserfs", bootargs.flavor))
| +#define is_e3 (bootargs.flavor && !strcmp ("ext3", bootargs.flavor))
|  
|  int check_for_native_partition (struct fdisk_disk **d, int first);
|  
| @@ -59,7 +60,7 @@
|  int partition_disk (void) {
|    struct fdisk_disk *d;
|    struct fdisk_partition *p;
| -  char *mounts, *swaps, *tmpbuf; 
| +  char *mounts, *swaps, *tmpbuf, *myfdisk; 
|    int root_on_disk=0, status=0;
|    struct stat statbuf;
|  
| @@ -135,6 +136,21 @@
|      }
|      free (swaps);
|    }

Some autodetection, use parted if we have it, otherwise act as usual
(invoke cfdisk).

| +  if(fopen("/sbin/parted", "r")) { /* check whether we have parted */
| +     if(twoButtonBox( _("This set of boot floppies has varios programs for partitioning of the harddisk. However, to partition with other programs then cfdisk (default) is dangerous, you should not try them if you are not an expert or if you don't exactly know what you are doing. Which way do you want to go?"), _("CFDISK or Expert mode?"), _("default"), _("expert only"), 1) == DLG_YES)
| +        myfdisk="/sbin/cfdisk";
| +     else {
| +        if(twoButtonBox( _("Now you have the choice between: fdisk and parted. Fdisk is the old program, but allows to do some tricks with the partition table. GNU parted is new, not complete and not 100\% stable, but has features like fs resizing and moving of the partitions. Which one should be invoked now?"), _("fdisk or parted?"), _("fdisk"), _("parted"), 2) == DLG_YES)
| +           myfdisk="/sbin/fdisk";
| +        else
| +           myfdisk="/sbin/parted";
| +     }
| +  }
| +  else { /* no parted present, use default cfdisk */
| +     myfdisk="/sbin/cfdisk";
| +  }
| +     
| +  
|  #if #cpu(i386)
|    if (! bootargs.isquiet)
|      wideMessageBox(_(
| @@ -215,7 +231,7 @@
|  #endif
|  
|      INFOMSG("running cfdisk to partition %s", d->name);
| -    sprintf(prtbuf, "cfdisk %s", d->name);
| +    sprintf(prtbuf, "%s %s", myfdisk, d->name);
|      status = fullscreen_execlog(prtbuf);
|  #ifdef pc_use_cfdisk_err_ret_switch
|      switch (status) {
| @@ -470,7 +486,6 @@
|          addnotail (partition->name);
|          addnotail (real_mount_point);
|        }
| -
|        sprintf(prtbuf, _("Mounting %s on %s"), 
|            partition->name, mount_point);
|        pleaseWaitBox (prtbuf);
| @@ -484,15 +499,16 @@
|      }
|      else  /* ext2  - with reiserfs aware kernel */
|      { /* this block is the same as the one below */

To let the decission up to kernel the easiest way to choose between ext2
and ext3. Worked fine in my tests.

| -      sprintf(prtbuf, "mount -t %s %s %s",
| -	  type, partition->name, real_mount_point);
| +      sprintf(prtbuf, "mount -t auto %s %s",
| +	  partition->name, real_mount_point);
|        status = execlog(prtbuf, LOG_INFO);
|      }
|    }
|    else /* ext2 */
| -  { /* this block is the same as the one above */
| -    sprintf(prtbuf, "mount -t %s %s %s",
| -	  type, partition->name, real_mount_point);
| +  { /* this block is the same as the one above
| +     will detect ext3 or ext2 automaticaly */
| +    sprintf(prtbuf, "mount -t auto %s %s",
| +	   partition->name, real_mount_point);
|      status = execlog(prtbuf, LOG_INFO);
|    }
|  
| @@ -579,14 +595,25 @@
|  
|  int init_linux (void) {
|    struct fdisk_partition *p;
| -  int Oflag, cflag, status;
| -
| +  int Oflag, e3flag = DLG_NO, cflag, status;
| +  
|    if (is_rfs)
|    {
|      if (!twoButtonBox (_("Ext2 is the defacto standard filesystem for GNU/Linux. It is well tested and proven. It supports extended file attributes, and has more maintenance utilities.\n\nReiserFS is newer, faster, more space efficient, and has meta-data journalling.\n\nIf in doubt, use Ext2.\n\nWould you like to create an Ext2 or a ReiserFS filesystem?"), _("Choose Filesystem Type"), _("Ext2"), _("ReiserFS"), 1))
|      return (init_reiser());
|    }
| -	  
| +

Some code for the future, may be used when supporting reiserfs _and_
ext3.

| +/* This is only a template. Currently, I didn't manage to get both reiserfs and
| + * ext3 at the same time into a kernel. Patches for 2.2.x conflict with each
| + * other, and linux-2.4.x kernel becomes too big. It could be possible if I
| + * create a compact kernel with less built-in drivers, e.g. without drivers for
| + * SCSI adapters
| +  if (is_e3 && has_rfs)
| +  {
| +    if (!twoButtonBox (_("Ext2 is the defacto standard filesystem for GNU/Linux. It is well tested and proven. It supports extended file attributes, and has more maintenance utilities.\n\nExt3 is a new but compatible variant of Ext2. It is faster and has meta-data journaling.\n\nReiserFS is newer, faster, more space efficient, and has meta-data journalling.\n\nIf in doubt, use Ext2.\n\nWould you like to create an Ext2, Ext3 or a ReiserFS filesystem?"), _("Choose Filesystem Type"), _("Ext2 or Ext3"), _("ReiserFS"), 1))
| +    return (init_reiser());
| +  }
| +	 */ 
|    sync();
|    p = select_not_mounted(_("Please select the partition to initialize as a Linux \"ext2\" filesystem.") ,_("Select Partition"),1,FSTYPE_EXT2);
|    if (! p)
| @@ -598,10 +625,13 @@
|    if (! bootargs.isquiet) {
|  #if #cpu(arm)
|      /* ARM wants ext2 from kernel 2.0 for the boot-loader */

In following boxes I changed the text, it is not fixed to 2.2 (we use
2.4 too).

| -    Oflag = yesNoBox(_("This 2.2 version of the Linux kernel has new \"ext2\" filesystem features not present in earlier kernel versions. Using these features, however, means that you will not be able to use this filesystem with earlier kernels, such as Linux 2.0 or with the Netwinder firmware.\n\nDo you want to retain Linux kernel 2.0 compatibility?"), _("Pre-2.2 Linux Kernel Compatibility?"));
| +    Oflag = yesNoBox(_("This version of the Linux kernel has new \"ext2\" filesystem features not present in kernel versions prior to 2.2.x. Using these features, however, means that you will not be able to use this filesystem with earlier kernels, such as Linux 2.0 or with the Netwinder firmware.\n\nDo you want to retain Linux kernel 2.0 compatibility?"), _("Pre-2.2 Linux Kernel Compatibility?"));
|  #else
|      /* nobody else needs the old linux 2.0 version ext2 */
| -    Oflag = twoButtonBox( _("This 2.2 version of the Linux kernel has new \"ext2\" filesystem features not present in earlier kernel versions. Using these features, however, means that you will not be able to use this filesystem with earlier kernels, such as Linux 2.0.\n\nDo you want to retain Linux kernel 2.0 compatibility?"), _("Pre-2.2 Linux Kernel Compatibility?"), _("Yes"), _("No"), 2);
| +    if(is_e3) {
| +      e3flag = twoButtonBox( _("This set of boot floppies has support for the new Journaling Extension for the Ext2 filesystem, also known as Ext3. Journaling means faster recovery process after crashes and better performance in certain conditions.\n\nEnable Ext3 support and create Journal on this filesystem?\n"), _("Ext3 Journaling support?"), _("Yes"), _("No"), 1);
| +    }
| +    Oflag = twoButtonBox( _("This version of the Linux kernel has new \"ext2\" filesystem features not present in kernel versions prior to 2.2.x. Using these features, however, means that you will not be able to use this filesystem with earlier kernels, such as Linux 2.0.\n\nDo you want to retain Linux kernel 2.0 compatibility?"), _("Pre-2.2 Linux Kernel Compatibility?"), _("Yes"), _("No"), 2);
|  #endif
|    } else {
|      /* be quiet and pick the right default */
| @@ -609,36 +639,38 @@
|      Oflag = DLG_YES;
|  #else
|      Oflag = DLG_NO;

I am not sure at this point: should ext3 be used by default if the user
doesn't care?

| +    /* we don't keep compatibility, so why not try journaling? */
| +    e3flag = DLG_YES;
|  #endif
|    }
|  
|    cflag = get_cflag(p->name);
|  

Following changes are cosmetic. Presents ext2 or ext3 depending on the
choice.

|    if (! bootargs.isquiet) {
| -    sprintf(prtbuf,_("You have chosen to initialize %s as a Linux \"ext2\" filesystem. This will permanently erase any data on this partition. Are you sure you want to do this?"),
| -	    p->name);
| +    sprintf(prtbuf,_("You have chosen to initialize %s as a Linux \"ext%s\" filesystem. This will permanently erase any data on this partition. Are you sure you want to do this?"),
| +	    p->name, (e3flag == DLG_YES) ? "3" : "2");
|      if (yesNoBox(prtbuf, _("Are You Sure?")) == DLG_NO)
|        return 1;
|    }
|  
| -  INFOMSG("formatting partition %s as ext2 for kernel %s or better", 
| -          p->name, 
| -          ( Oflag == DLG_NO ? "2.2" : "2.0"));
| +  INFOMSG("formatting partition %s as ext%s for kernel %s or better", 
| +          p->name, (e3flag == DLG_YES) ? "3" : "2", ( Oflag == DLG_NO ? "2.2" : "2.0"));
|  #if #cpu(alpha)
|    /* Alpha-specific workaround for MILO's failure to support 4k blocks */
|    if (!(srm_boot || strcmp(Arch2, "nautilus") == 0))


Appending -j option for ext3.

| -    sprintf(prtbuf, "mkfs.ext2 -O none -b 1024 %s %s",
| -	    ( cflag ? "-c" : ""), p->name);
| +    sprintf(prtbuf, "mkfs.ext2 -O none -b 1024 %s %s %s",
| +	    ( cflag ? "-c" : ""), (e3flag == DLG_YES) ? "-j" : "", p->name);
|    else
|  #endif
| -  sprintf(prtbuf, "mkfs.ext2 %s %s %s", ( Oflag == DLG_NO ? "" : "-O none"),
| -	  ( cflag ? "-c" : ""), p->name);
| +  sprintf(prtbuf, "mkfs.ext2 %s %s %s %s", ( Oflag == DLG_NO ? "" : "-O none"),
| +	  ( cflag ? "-c" : ""),  (e3flag == DLG_YES) ? "-j" : "", p->name);
|    boxSuspend();
|    printf(CLEAR);
|    if ( Oflag == DLG_YES )

Cosmetic changes.

| -    printf(_("Creating filesystem (with 2.0 kernel compatibility)...\n"));
| +    printf(_("Creating filesystem (with 2.0 kernel compatibility%s)...\n"),
| +          (e3flag == DLG_YES) ? " and Journaling" : "");
|    else
| -    printf(_("Creating filesystem (for 2.2 kernels only)...\n"));
| +    printf(_("Creating filesystem%s (for 2.2 and newer kernels only)...\n"), (e3flag == DLG_YES) ? " with Journaling" : "");
|    DEBUGMSG("make filesystem with '%s'", prtbuf);
|    status = system(prtbuf);
|    boxResume();
| @@ -647,6 +679,7 @@
|      problemBox(_("The filesystem was not created."), _("Problem"));
|      return 1;
|    }
| +   
|    return mount_partition(p);
|  }

Gruss/Regards,
Eduard.
-- 
Wie währs mit Windows CE auf einer Kaffeemaschiene?
Nachdem der Kaffee zur Hälfte gekocht ist, stürzt die
Kaffeemaschiene ab.        (Ulrich Eckhardt in dcolm)

Attachment: boot-floppies_3.0.9-0.2.blade.diff.gz
Description: Binary data


Reply to: