From: Gordon Matzigkeit <[EMAIL PROTECTED]>
Subject: Re: the size restrictions for FAT and ext2fs stage1.5
Date: 06 Mar 1999 10:38:48 -0600
> The main thing that bugs me is that the ffs stage1.5 already seems to
> be too big for the FFS boot blocks (by about 200 bytes), and it isn't
> even full-featured yet (no symlink support). :(
The following patch makes it less than 6500 bytes. I'm using
gcc-2.7.2.3 and binutils-2.9.1.0.20. Probably it's possible to make it
more small.
diff -urN grub/shared_src/disk_io.c grub.new/shared_src/disk_io.c
--- grub/shared_src/disk_io.c Thu Mar 4 13:38:23 1999
+++ grub.new/shared_src/disk_io.c Sun Mar 7 13:05:51 1999
@@ -542,6 +542,7 @@
}
+#ifndef NO_FANCY_STUFF
/* XX used for device completion in 'set_device' and 'print_completions' */
static int incomplete, disk_choice;
static enum
@@ -650,6 +651,7 @@
return retval;
}
+#endif /* NO_FANCY_STUFF */
/*
@@ -702,6 +704,7 @@
#endif /* NO_FANCY_STUFF */
+#ifndef NO_FANCY_STUFF
static char *
setup_part (char *filename)
{
@@ -746,6 +749,7 @@
return filename;
}
+#endif /* NO_FANCY_STUFF */
#ifndef NO_FANCY_STUFF
@@ -850,8 +854,10 @@
set it to zero before returning if opening a file! */
filepos = 0;
+#ifndef NO_FANCY_STUFF
if (!(filename = setup_part (filename)))
return 0;
+#endif /* NO_FANCY_STUFF */
#ifndef NO_BLOCK_FILES
block_file = 0;
@@ -1054,8 +1060,10 @@
compressed_file = 0;
#endif /* NO_DECOMPRESSION */
+#ifndef NO_FANCY_STUFF
if (!(dirname = setup_part (dirname)))
return 0;
+#endif /* NO_FANCY_STUFF */
if (*dirname != '/')
errnum = ERR_BAD_FILENAME;
@@ -1066,8 +1074,10 @@
if (errnum)
return 0;
+#ifndef NO_FANCY_STUFF
/* set "dir" function to list completions */
print_possibilities = 1;
+#endif /* NO_FANCY_STUFF */
return (*(fsys_table[fsys_type].dir_func)) (dirname);
}
diff -urN grub/shared_src/fsys_ffs.c grub.new/shared_src/fsys_ffs.c
--- grub/shared_src/fsys_ffs.c Mon Mar 1 03:37:39 1999
+++ grub.new/shared_src/fsys_ffs.c Sun Mar 7 13:05:25 1999
@@ -243,6 +243,7 @@
dp = (struct direct *) (FSYS_BUF + off);
loc += dp->d_reclen;
+#ifndef NO_FANCY_STUFF
if (dp->d_ino && print_possibilities && ch != '/'
&& (!*dirname || substring (dirname, dp->d_name) <= 0))
{
@@ -251,6 +252,7 @@
printf (" %s", dp->d_name);
}
+#endif /* NO_FANCY_STUFF */
}
while (!dp->d_ino || (substring (dirname, dp->d_name) != 0
|| (print_possibilities && ch != '/')));