Skip to contentSkip to conversation

grub-fstest: debug tool for filesystem driver

PATCH Bean 2 participants 16 messages Jan 2, 2008 – Feb 4, 2008 Kbuild

lore
Share & tools
lore

Bean

author
#0 lore raw

Hi,

I've written a new tool grub-fstest which can be useful in debuging filesystem drivers. To build grub-fstest, you must use option --enable-grub-fstest:

./configure --enable-grub-fstest

Usage:

fstest [OPTIONS] IMAGE_PATH COMMANDS

IMAGE_PATH is the absolute path to an image file, COMMANDS is one of the following commands:

ls PATH
list files in PATH

cp SRC DEST
copy file SRC in the image file to DEST in the local system.

cmp SRC DEST
compare file SRC in the image file with DEST in the local system.

dump FILE
hexdump FILE in the image file

blst FILE
display the blocklist of FILE in the image file

Options:
-s, --skip=N
set the number of bytes to skip in command cp, cmp and dump.

-n, --length=N
set the number of bytes to process in command cp, cmp and dump.

-r, --raw
disable auto decompression

-p, --part=N
if IMAGE_FILE contain partition map, use the option to select partition.

Examples:

./grub-fstest /path/aa.iso ls /
List files in aa.iso

./grub-fstest -p 1 /path/aa.dsk cp /bb cc
Copy file /bb in the first partition of aa.dsk to cc in the current directory

./grub-fstest -p 1 /path/aa.dsk cmp /bb cc
Compare file /bb in the first partition of aa.dsk with cc in the current directory

./grub-fstest -s 10 -n 20 /path/aa.tar dump /bb Hexdump file /bb in aa.tar, skip 10 bytes, print 20 bytes.

./grub-fstest /path/aa.iso blst /bb
display the blocklist of file /bb in aa.iso

Signature · 1 line
Bean
Makefile.in +1 -0
index c6a04c9..c4b8835 100644
@@ -79,6 +79,7 @@ UNIFONT_HEX = @UNIFONT_HEX@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
+enable_grub_fstest = @enable_grub_fstest@
 
 ### General variables.
 
conf/common.rmk +13 -0
index 4773f7d..45dfeef 100644
@@ -44,6 +44,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_set
 	rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
 DISTCLEANFILES += grub_setup_init.c
 
+# For grub-fstest.
+grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES))
+	rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
+DISTCLEANFILES += grub_fstest_init.lst
+
+grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh
+	rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
+DISTCLEANFILES += grub_fstest_init.h
+
+grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h
+	rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
+DISTCLEANFILES += grub_fstest_init.c
+
 # For update-grub
 update-grub: util/update-grub.in config.status
 	./config.status --file=$@:$<
conf/i386-pc.rmk +15 -0
index 2638ee5..a25dd76 100644
@@ -59,6 +59,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -121,6 +124,18 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c	\
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
+# For grub-fstest.
+util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c 	\
+	kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c	\
+	disk/host.c disk/loopback.c commands/hexdump.c io/gzio.c	\
+	commands/blocklist.c fs/fat.c fs/ext2.c kern/parser.c		\
+	kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c 	\
+	fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/ntfs.c kern/fs.c	\
+	kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c	\
+	fs/ntfscomp.c fs/iso9660.c fs/cpio.c disk/lvm.c disk/raid.c	\
+	grub_fstest_init.c
+
 # Scripts.
 sbin_SCRIPTS = grub-install
 bin_SCRIPTS = grub-mkrescue
configure +12 -1
index bd2d745..8ca04d5 100755
@@ -695,6 +695,7 @@ TARGET_CPPFLAGS
 TARGET_LDFLAGS
 LIBCURSES
 enable_grub_emu
+enable_grub_fstest
 LIBOBJS
 LTLIBOBJS'
 ac_subst_files=''
@@ -1290,6 +1291,8 @@ Optional Features:
   --disable-largefile     omit support for large files
   --enable-mm-debug       include memory manager debugging
   --enable-grub-emu       build and install the `grub-emu' debugging utility
+  --enable-grub-fstest    build and install the `grub-fstest' debugging
+                          utility
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -8141,6 +8144,13 @@ done
 fi
 
 
+# Check whether --enable-grub-fstest was given.
+if test "${enable_grub_fstest+set}" = set; then
+  enableval=$enable_grub_fstest;
+fi
+
+
+
 # Output files.
 ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"
 
@@ -8854,11 +8864,12 @@ TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim
 TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim
 LIBCURSES!$LIBCURSES$ac_delim
 enable_grub_emu!$enable_grub_emu$ac_delim
+enable_grub_fstest!$enable_grub_fstest$ac_delim
 LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
configure.ac +5 -0
index fb6e026..451230f 100644
@@ -319,6 +319,11 @@ AC_ARG_ENABLE([grub-emu],
 [fi]
 AC_SUBST([enable_grub_emu])
 
+AC_ARG_ENABLE([grub-fstest],
+	      [AS_HELP_STRING([--enable-grub-fstest],
+                             [build and install the `grub-fstest' debugging utility])])
+AC_SUBST([enable_grub_fstest])
+
 # Output files.
 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
 	include/grub/machine:include/grub/$target_cpu/$platform])
util/grub-fstest.c new file +540 -0

540 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Bean

blst FILE
display the blocklist of FILE in the image file

Is this blst' analogous to the blocklist' command we already have? In that case, I'd suggest giving it the same name.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
author
#2 lore raw
Quoted 6 lines · Robert Millan
Quoted 2 lines · Bean

blst FILE
display the blocklist of FILE in the image file

Is this blst' analogous to the blocklist' command we already have? In that case, I'd suggest giving it the same name.

yep, it's the same.

Signature · 1 line
Bean
author
#3 lore raw
Quoted 9 lines · Bean
Quoted 6 lines · Robert Millan
Quoted 2 lines · Bean

blst FILE
display the blocklist of FILE in the image file

Is this blst' analogous to the blocklist' command we already have? In that case, I'd suggest giving it the same name.

yep, it's the same.

Change command names:

dump -> hex
blst -> blocklist

Also replace grub_file_open with grub_file_open_ex from my latest filehook patch.

Signature · 1 line
Bean

2008-01-05 Bean <[email protected]>

* Makefile.in (enable_grub_fstest): New variable.

* conf/common.rmk (grub_fstest_init.lst): New rule. (grub_fstest_init.h): Likewise. (grub_fstest_init.c): Likewise.

* i396-pc.rmk (util/grub-fstest.c_DEPENDENCIES): New variable. (grub_fstest_SOURCES): Likewise.

* configure.ac (enable_grub_fstest): New test.

* util/grub-fstest.c: New file.

Makefile.in +1 -0
index c6a04c9..c4b8835 100644
@@ -79,6 +79,7 @@ UNIFONT_HEX = @UNIFONT_HEX@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
+enable_grub_fstest = @enable_grub_fstest@
 
 ### General variables.
 
conf/common.rmk +13 -0
index 4773f7d..45dfeef 100644
@@ -44,6 +44,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_set
 	rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
 DISTCLEANFILES += grub_setup_init.c
 
+# For grub-fstest.
+grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES))
+	rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
+DISTCLEANFILES += grub_fstest_init.lst
+
+grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh
+	rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
+DISTCLEANFILES += grub_fstest_init.h
+
+grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h
+	rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
+DISTCLEANFILES += grub_fstest_init.c
+
 # For update-grub
 update-grub: util/update-grub.in config.status
 	./config.status --file=$@:$<
conf/i386-pc.rmk +15 -0
index 2638ee5..a25dd76 100644
@@ -59,6 +59,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -121,6 +124,18 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c	\
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
+# For grub-fstest.
+util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c 	\
+	kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c	\
+	disk/host.c disk/loopback.c commands/hexdump.c io/gzio.c	\
+	commands/blocklist.c fs/fat.c fs/ext2.c kern/parser.c		\
+	kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c 	\
+	fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/ntfs.c kern/fs.c	\
+	kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c	\
+	fs/ntfscomp.c fs/iso9660.c fs/cpio.c disk/lvm.c disk/raid.c	\
+	grub_fstest_init.c
+
 # Scripts.
 sbin_SCRIPTS = grub-install
 bin_SCRIPTS = grub-mkrescue
configure +12 -1
index bd2d745..8ca04d5 100755
@@ -695,6 +695,7 @@ TARGET_CPPFLAGS
 TARGET_LDFLAGS
 LIBCURSES
 enable_grub_emu
+enable_grub_fstest
 LIBOBJS
 LTLIBOBJS'
 ac_subst_files=''
@@ -1290,6 +1291,8 @@ Optional Features:
   --disable-largefile     omit support for large files
   --enable-mm-debug       include memory manager debugging
   --enable-grub-emu       build and install the `grub-emu' debugging utility
+  --enable-grub-fstest    build and install the `grub-fstest' debugging
+                          utility
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -8141,6 +8144,13 @@ done
 fi
 
 
+# Check whether --enable-grub-fstest was given.
+if test "${enable_grub_fstest+set}" = set; then
+  enableval=$enable_grub_fstest;
+fi
+
+
+
 # Output files.
 ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"
 
@@ -8854,11 +8864,12 @@ TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim
 TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim
 LIBCURSES!$LIBCURSES$ac_delim
 enable_grub_emu!$enable_grub_emu$ac_delim
+enable_grub_fstest!$enable_grub_fstest$ac_delim
 LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
configure.ac +5 -0
index fb6e026..451230f 100644
@@ -319,6 +319,11 @@ AC_ARG_ENABLE([grub-emu],
 [fi]
 AC_SUBST([enable_grub_emu])
 
+AC_ARG_ENABLE([grub-fstest],
+	      [AS_HELP_STRING([--enable-grub-fstest],
+                             [build and install the `grub-fstest' debugging utility])])
+AC_SUBST([enable_grub_fstest])
+
 # Output files.
 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
 	include/grub/machine:include/grub/$target_cpu/$platform])
util/grub-fstest.c new file +540 -0

540 lines not on this page · raw message

#4 lore raw

Would be nice if you could include inline attachments without base64 encoding; that'd make it easier for context-reply. At least in mutt.

Quoted 27 lines · Bean
Quoted 9 lines · Bean
Quoted 6 lines · Robert Millan
Quoted 2 lines · Bean

blst FILE
display the blocklist of FILE in the image file

Is this blst' analogous to the blocklist' command we already have? In that case, I'd suggest giving it the same name.

yep, it's the same.

Change command names:

dump -> hex
blst -> blocklist

Also replace grub_file_open with grub_file_open_ex from my latest filehook patch.

Signature · 7 lines
Bean


_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
author
#5 lore raw
Quoted 4 lines · Robert Millan

Would be nice if you could include inline attachments without base64 encoding; that'd make it easier for context-reply. At least in mutt.

ok, here is it.

2008-01-05 Bean <[email protected]>

* Makefile.in (enable_grub_fstest): New variable.

* conf/common.rmk (grub_fstest_init.lst): New rule. (grub_fstest_init.h): Likewise. (grub_fstest_init.c): Likewise.

* i396-pc.rmk (util/grub-fstest.c_DEPENDENCIES): New variable. (grub_fstest_SOURCES): Likewise.

* configure.ac (enable_grub_fstest): New test.

* util/grub-fstest.c: New file.

Makefile.in +1 -0
index c6a04c9..c4b8835 100644
@@ -79,6 +79,7 @@ UNIFONT_HEX = @UNIFONT_HEX@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
+enable_grub_fstest = @enable_grub_fstest@
 
 ### General variables.
 
conf/common.rmk +0 -0
index 4773f7d..45dfeef 100644
@@ -44,6 +44,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out

grub_setup_init.c,$(grub_set
rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
DISTCLEANFILES += grub_setup_init.c

+# For grub-fstest.
+grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES))
+ rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
+DISTCLEANFILES += grub_fstest_init.lst
+
+grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh
+ rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
+DISTCLEANFILES += grub_fstest_init.h
+
+grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h
+ rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
+DISTCLEANFILES += grub_fstest_init.c
+
# For update-grub
update-grub: util/update-grub.in config.status
./config.status --file=$@:$<

conf/i386-pc.rmk +3 -0
index 2638ee5..a25dd76 100644
@@ -59,6 +59,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -121,6 +124,18 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c

commands/cmp.c \

grub_emu_LDFLAGS = $(LIBCURSES)

+# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \
+ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \
+ disk/host.c disk/loopback.c commands/hexdump.c io/gzio.c \
+ commands/blocklist.c fs/fat.c fs/ext2.c kern/parser.c \
+ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \
+ fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/ntfs.c kern/fs.c \
+ kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \
+ fs/ntfscomp.c fs/iso9660.c fs/cpio.c disk/lvm.c disk/raid.c \
+ grub_fstest_init.c
+
# Scripts.
sbin_SCRIPTS = grub-install
bin_SCRIPTS = grub-mkrescue

configure +10 -0
index bd2d745..8ca04d5 100755
@@ -695,6 +695,7 @@ TARGET_CPPFLAGS
 TARGET_LDFLAGS
 LIBCURSES
 enable_grub_emu
+enable_grub_fstest
 LIBOBJS
 LTLIBOBJS'
 ac_subst_files=''
@@ -1290,6 +1291,8 @@ Optional Features:
   --disable-largefile     omit support for large files
   --enable-mm-debug       include memory manager debugging
   --enable-grub-emu       build and install the `grub-emu' debugging utility
+  --enable-grub-fstest    build and install the `grub-fstest' debugging
+                          utility
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -8141,6 +8144,13 @@ done
 fi
 
 
+# Check whether --enable-grub-fstest was given.
+if test "${enable_grub_fstest+set}" = set; then
+  enableval=$enable_grub_fstest;
+fi
+
+
+
 # Output files.
 ac_config_links="$ac_config_links

include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"

@@ -8854,11 +8864,12 @@ TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim
TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim LIBCURSES!$LIBCURSES$ac_delim enable_grub_emu!$enable_grub_emu$ac_delim
+enable_grub_fstest!$enable_grub_fstest$ac_delim
LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF

-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then

break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

configure.ac +3 -0
index fb6e026..451230f 100644
@@ -319,6 +319,11 @@ AC_ARG_ENABLE([grub-emu],
 [fi]
 AC_SUBST([enable_grub_emu])
 
+AC_ARG_ENABLE([grub-fstest],
+	      [AS_HELP_STRING([--enable-grub-fstest],
+                             [build and install the `grub-fstest'

debugging utility])])
+AC_SUBST([enable_grub_fstest])
+
# Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
include/grub/machine:include/grub/$target_cpu/$platform])

util/grub-fstest.c new file +540 -0

540 lines not on this page · raw message

Signature · 1 line
Bean
#6 lore raw
Quoted 33 lines · Bean
conf/i386-pc.rmk +15 -0
index 2638ee5..a25dd76 100644
@@ -59,6 +59,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -121,6 +124,18 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c
 commands/cmp.c	\
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
+# For grub-fstest.
+util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c 	\
+	kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c	\
+	disk/host.c disk/loopback.c commands/hexdump.c io/gzio.c	\
+	commands/blocklist.c fs/fat.c fs/ext2.c kern/parser.c		\
+	kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c 	\
+	fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/ntfs.c kern/fs.c	\
+	kern/env.c fs/fshelp.c fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c	\
+	fs/ntfscomp.c fs/iso9660.c fs/cpio.c disk/lvm.c disk/raid.c	\
+	grub_fstest_init.c
+
 # Scripts.
 sbin_SCRIPTS = grub-install
Quoted 1 line

bin_SCRIPTS = grub-mkrescue

Can we move this to common.rmk ? AFAICT, there's nothing i386-pc-specific about this.

As for the list of filesystems, please reuse the filesystem chunk used on other commands; this will improve readability, ensure there are no missing components (as it has happened before), and overall improve maintainability:

	\
	fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c         \
	fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c           \
	fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c          \
	fs/ufs.c fs/xfs.c                                       \
	\
Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
author
#7 lore raw
Quoted 7 lines · Robert Millan

Can we move this to common.rmk ? AFAICT, there's nothing i386-pc-specific about this.

As for the list of filesystems, please reuse the filesystem chunk used on other commands; this will improve readability, ensure there are no missing components (as it has happened before), and overall improve maintainability:

Quoted 6 lines
        \
        fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c         \
        fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c           \
        fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c          \
        fs/ufs.c fs/xfs.c                                       \
        \

ok. i also change a few things, now the program should work better.

Makefile.in +1 -0
index 84b4e9c..ba07577 100644
@@ -79,6 +79,7 @@ UNIFONT_HEX = @UNIFONT_HEX@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
+enable_grub_fstest = @enable_grub_fstest@
 
 ### General variables.
 
conf/common.rmk +0 -0
index c1f367b..6e06a3e 100644
@@ -44,6 +44,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out

grub_setup_init.c,$(grub_set
rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
DISTCLEANFILES += grub_setup_init.c

+# For grub-fstest.
+grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES))
+ rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
+DISTCLEANFILES += grub_fstest_init.lst
+
+grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh
+ rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
+DISTCLEANFILES += grub_fstest_init.h
+
+grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h
+ rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
+DISTCLEANFILES += grub_fstest_init.c
+
# For update-grub
update-grub: util/update-grub.in config.status
./config.status --file=$@:$<

conf/i386-pc.rmk +3 -0
index ff02332..5902608 100644
@@ -61,6 +61,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -139,6 +142,22 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c

commands/cmp.c \

grub_emu_LDFLAGS = $(LIBCURSES)

+# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \
+ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \
+ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \
+ io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \
+ \
+ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
+ fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \
+ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
+ fs/ufs.c fs/xfs.c \
+ \
+ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \
+ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \
+ grub_fstest_init.c
+
# Scripts.
sbin_SCRIPTS = grub-install
bin_SCRIPTS = grub-mkrescue

configure +10 -0
index d272ea6..d1918ca 100755
@@ -695,6 +695,7 @@ TARGET_CPPFLAGS
 TARGET_LDFLAGS
 LIBCURSES
 enable_grub_emu
+enable_grub_fstest
 LIBOBJS
 LTLIBOBJS'
 ac_subst_files=''
@@ -1290,6 +1291,8 @@ Optional Features:
   --disable-largefile     omit support for large files
   --enable-mm-debug       include memory manager debugging
   --enable-grub-emu       build and install the `grub-emu' debugging utility
+  --enable-grub-fstest    build and install the `grub-fstest' debugging
+                          utility
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -8142,6 +8145,13 @@ done
 fi
 
 
+# Check whether --enable-grub-fstest was given.
+if test "${enable_grub_fstest+set}" = set; then
+  enableval=$enable_grub_fstest;
+fi
+
+
+
 # Output files.
 ac_config_links="$ac_config_links

include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"

@@ -8855,11 +8865,12 @@ TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim
TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim LIBCURSES!$LIBCURSES$ac_delim enable_grub_emu!$enable_grub_emu$ac_delim
+enable_grub_fstest!$enable_grub_fstest$ac_delim
LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF

-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then

break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

configure.ac +3 -0
index b3f73e0..3546cc0 100644
@@ -320,6 +320,11 @@ AC_ARG_ENABLE([grub-emu],
 [fi]
 AC_SUBST([enable_grub_emu])
 
+AC_ARG_ENABLE([grub-fstest],
+	      [AS_HELP_STRING([--enable-grub-fstest],
+                             [build and install the `grub-fstest'

debugging utility])])
+AC_SUBST([enable_grub_fstest])
+
# Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
include/grub/machine:include/grub/$target_cpu/$platform])

util/grub-fstest.c new file +548 -0

548 lines not on this page · raw message

Signature · 1 line
Bean
#8 lore raw

util/grub-fstest.c line 43

Quoted 7 lines · Bean
util/grub-fstest.c new file +7 -0
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define _GNU_SOURCE	1
+#include <getopt.h>

I suspect this wouldn't work in practice, because any system header can drag <features.h> in.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
author
#9 lore raw
Quoted 11 lines · Robert Millan

util/grub-fstest.c line 43

Quoted 7 lines · Bean
util/grub-fstest.c new file +7 -0
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define _GNU_SOURCE  1
+#include <getopt.h>

I suspect this wouldn't work in practice, because any system header can drag <features.h> in.

i'm not sure about this, in fact, the line is copied from grub-probe.c, perhaps i should remove it.

Signature · 1 line
Bean
#10 lore raw
Quoted 13 lines · Bean
Quoted 11 lines · Robert Millan

util/grub-fstest.c line 43

Quoted 7 lines · Bean
util/grub-fstest.c new file +7 -0
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define _GNU_SOURCE  1
+#include <getopt.h>

I suspect this wouldn't work in practice, because any system header can drag <features.h> in.

Quoted 2 lines

i'm not sure about this, in fact, the line is copied from grub-probe.c, perhaps i should remove it.

Sure. If it was needed, removing it would break build on Glibc.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
author
#11 lore raw

Some changes in this new patch:

Remove the _GNU_SOURCE line.
Partition number is now string, so that you can use bsd sub partition. Code cleanup for function fstest.

2008-01-29 Bean <[email protected]>

* Makefile.in (enable_grub_fstest): New variable.

* conf/common.rmk (grub_fstest_init.lst): New rule. (grub_fstest_init.h): Likewise. (grub_fstest_init.c): Likewise.

* i396-pc.rmk (util/grub-fstest.c_DEPENDENCIES): New variable. (grub_fstest_SOURCES): Likewise.

* configure.ac (enable_grub_fstest): New test.

* util/grub-fstest.c: New file.

Makefile.in +1 -0
index 84b4e9c..ba07577 100644
@@ -79,6 +79,7 @@ UNIFONT_HEX = @UNIFONT_HEX@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
+enable_grub_fstest = @enable_grub_fstest@
 
 ### General variables.
 
conf/common.rmk +0 -0
index c1f367b..6e06a3e 100644
@@ -44,6 +44,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out

grub_setup_init.c,$(grub_set
rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
DISTCLEANFILES += grub_setup_init.c

+# For grub-fstest.
+grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES))
+ rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
+DISTCLEANFILES += grub_fstest_init.lst
+
+grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh
+ rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
+DISTCLEANFILES += grub_fstest_init.h
+
+grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h
+ rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
+DISTCLEANFILES += grub_fstest_init.c
+
# For update-grub
update-grub: util/update-grub.in config.status
./config.status --file=$@:$<

conf/i386-pc.rmk +3 -0
index ff02332..5902608 100644
@@ -61,6 +61,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -139,6 +142,22 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c

commands/cmp.c \

grub_emu_LDFLAGS = $(LIBCURSES)

+# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \
+ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \
+ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \
+ io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \
+ \
+ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
+ fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \
+ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
+ fs/ufs.c fs/xfs.c \
+ \
+ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \
+ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \
+ grub_fstest_init.c
+
# Scripts.
sbin_SCRIPTS = grub-install
bin_SCRIPTS = grub-mkrescue

configure +10 -0
index d272ea6..d1918ca 100755
@@ -695,6 +695,7 @@ TARGET_CPPFLAGS
 TARGET_LDFLAGS
 LIBCURSES
 enable_grub_emu
+enable_grub_fstest
 LIBOBJS
 LTLIBOBJS'
 ac_subst_files=''
@@ -1290,6 +1291,8 @@ Optional Features:
   --disable-largefile     omit support for large files
   --enable-mm-debug       include memory manager debugging
   --enable-grub-emu       build and install the `grub-emu' debugging utility
+  --enable-grub-fstest    build and install the `grub-fstest' debugging
+                          utility
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -8142,6 +8145,13 @@ done
 fi
 
 
+# Check whether --enable-grub-fstest was given.
+if test "${enable_grub_fstest+set}" = set; then
+  enableval=$enable_grub_fstest;
+fi
+
+
+
 # Output files.
 ac_config_links="$ac_config_links

include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"

@@ -8855,11 +8865,12 @@ TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim
TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim LIBCURSES!$LIBCURSES$ac_delim enable_grub_emu!$enable_grub_emu$ac_delim
+enable_grub_fstest!$enable_grub_fstest$ac_delim
LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF

-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then

break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

configure.ac +3 -0
index b3f73e0..3546cc0 100644
@@ -320,6 +320,11 @@ AC_ARG_ENABLE([grub-emu],
 [fi]
 AC_SUBST([enable_grub_emu])
 
+AC_ARG_ENABLE([grub-fstest],
+	      [AS_HELP_STRING([--enable-grub-fstest],
+                             [build and install the `grub-fstest'

debugging utility])])
+AC_SUBST([enable_grub_fstest])
+
# Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
include/grub/machine:include/grub/$target_cpu/$platform])

util/grub-fstest.c new file +514 -0

514 lines not on this page · raw message

if no other problems, i'd like to check it in.

Signature · 1 line
Bean
#12 lore raw
Quoted 23 lines · Bean
conf/i386-pc.rmk +9 -0
@@ -61,6 +61,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -139,6 +142,22 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c
 commands/cmp.c	\
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
+# For grub-fstest.
+util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c 	\
+	kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c	\
+	disk/host.c disk/loopback.c  normal/arg.c normal/misc.c		\
+	io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \

conf/i386-pc.rmk grub_emu_SOURCES = commands/boot.c commands/cat.c · line 161

Quoted 10 lines
conf/i386-pc.rmk +10 -0
+	\
+	fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c			\
+	fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c			\
+	fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c			\
+	fs/ufs.c fs/xfs.c						\
+	\
+	kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c 	\
+	kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c	\
+	grub_fstest_init.c
+

Can this be in common.rmk ?

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
author
#13 lore raw
Quoted 29 lines · Robert Millan
Quoted 27 lines · Bean
conf/i386-pc.rmk +13 -0
@@ -61,6 +61,9 @@ sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe
 ifeq ($(enable_grub_emu), yes)
 sbin_UTILITIES += grub-emu
 endif
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -139,6 +142,22 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c
 commands/cmp.c        \
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
+# For grub-fstest.
+util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c   \
+     kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c    \
+     disk/host.c disk/loopback.c  normal/arg.c normal/misc.c         \
+     io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \
+     \
+     fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c                 \
+     fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c                   \
+     fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c                  \
Quoted 8 lines

conf/i386-pc.rmk grub_emu_SOURCES = commands/boot.c commands/cat.c · line 161

Quoted 6 lines
conf/i386-pc.rmk +6 -0
+     fs/ufs.c fs/xfs.c                                               \
+     \
+     kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c     \
+     kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \
+     grub_fstest_init.c
+

Can this be in common.rmk ?

it seems so, all the required modules are platform independent.

Signature · 1 line
Bean
author
#14 lore raw

Hi,

Some change in this version:

Move grub-fstest.c_DEPENDENCIES and grub_fstest_SOURCES to common.rmk. Add new option -d for grub-fstest, it's used to set the debug environment variable.

This could be the final version, if nobody objects, i will check it in.

2008-02-03 Bean <[email protected]>

* Makefile.in (enable_grub_fstest): New variable.

* conf/common.rmk (grub_fstest_init.lst): New rule. (grub_fstest_init.h): Likewise. (grub_fstest_init.c): Likewise. (util/grub-fstest.c_DEPENDENCIES): New variable. (grub_fstest_SOURCES): Likewise.

* configure.ac (enable_grub_fstest): New test.

* util/grub-fstest.c: New file.

Makefile.in +1 -0
index 84b4e9c..ba07577 100644
@@ -79,6 +79,7 @@ UNIFONT_HEX = @UNIFONT_HEX@
 
 # Options.
 enable_grub_emu = @enable_grub_emu@
+enable_grub_fstest = @enable_grub_fstest@
 
 ### General variables.
 
conf/common.rmk +0 -0
index 4722ac1..ec4c663 100644
@@ -61,6 +61,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out

grub_setup_init.c,$(grub_set
rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
DISTCLEANFILES += grub_setup_init.c

+# For grub-fstest.
+grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES))
+ rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
+DISTCLEANFILES += grub_fstest_init.lst
+
+grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh
+ rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
+DISTCLEANFILES += grub_fstest_init.h
+
+grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h
+ rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
+DISTCLEANFILES += grub_fstest_init.c
+
# For update-grub
update-grub: util/update-grub.in config.status
./config.status --file=$@:$<
@@ -331,3 +344,23 @@ gzio_mod_LDFLAGS = $(COMMON_LDFLAGS)
read_mod_SOURCES = commands/read.c read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+ifeq ($(enable_grub_fstest), yes)
+bin_UTILITIES += grub-fstest
+endif
+
+# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
+grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \
+ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \
+ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \
+ io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \
+ \
+ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
+ fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \
+ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
+ fs/ufs.c fs/xfs.c \
+ \
+ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \
+ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \
+ grub_fstest_init.c

configure +0 -1
index e5912e2..eced238 100755
@@ -311,7 +311,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME

PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu enable_grub_fstest LIBOBJS LTLIBOBJS'
ac_subst_files=''

# Initialize some variables set by options.
@@ -857,6 +857,8 @@ Optional Features:

   --disable-largefile     omit support for large files
   --enable-mm-debug       include memory manager debugging
   --enable-grub-emu       build and install the `grub-emu' debugging utility
+  --enable-grub-fstest    build and install the `grub-fstest' debugging
+                          utility

Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -7510,6 +7512,13 @@ done
fi

+# Check whether --enable-grub-fstest or --disable-grub-fstest was given. +if test "${enable_grub_fstest+set}" = set; then
+ enableval="$enable_grub_fstest"
+
+fi;
+
+
# Output files.
ac_config_links="$ac_config_links
include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"

@@ -8182,6 +8191,7 @@ s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t
s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t s,@LIBCURSES@,$LIBCURSES,;t t s,@enable_grub_emu@,$enable_grub_emu,;t t
+s,@enable_grub_fstest@,$enable_grub_fstest,;t t
s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF

configure.ac +3 -0
index 1f9ca46..73f6087 100644
@@ -320,6 +320,11 @@ AC_ARG_ENABLE([grub-emu],
 [fi]
 AC_SUBST([enable_grub_emu])
 
+AC_ARG_ENABLE([grub-fstest],
+	      [AS_HELP_STRING([--enable-grub-fstest],
+                             [build and install the `grub-fstest'

debugging utility])])
+AC_SUBST([enable_grub_fstest])
+
# Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
include/grub/machine:include/grub/$target_cpu/$platform])

util/grub-fstest.c new file +522 -0

522 lines not on this page · raw message

Signature · 1 line
Bean
author
#15 lore raw

Committed.

Signature · 1 line
Bean