Skip to contentSkip to conversation

probe command

PATCH In review Vladimir 'phcoder' Serbinenko 2 participants 6 messages Jun 9, 2009 – Jun 15, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 probe command

Following Pavel's suggestion to make uuid command I implemented probe command similar to grub-probe

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
ChangeLog +15 -0
index 34c5bc1..f22780f 100644
@@ -1,3 +1,18 @@
+2009-06-08  Vladimir Serbinenko  <[email protected]>
+
+	probe command
+
+	* commands/probe.c: new file
+	* conf/common.rmk (pkglib_MODULES): add probe.mod
+	(probe_mod_SOURCES): new variable
+	(probe_mod_CFLAGS): likewise
+	(probe_mod_LDFLAGS): likewise
+	* conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c
+	* conf/i386-ieee1275.rmk: likewise
+	* conf/i386-pc.rmk: likewise
+	* conf/powerpc-ieee1275.rmk: likewise
+	* conf/sparc64-ieee1275.rmk: likewise
+	
 2009-06-09  Oliver Henshaw <[email protected]>
 
         * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after 
commands/probe.c new file +160 -0

160 lines not on this page · raw message

conf/common.rmk +7 -1
index 9780341..b75f50e 100644
@@ -354,7 +354,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod	\
 	terminfo.mod test.mod blocklist.mod hexdump.mod		\
 	read.mod sleep.mod loadenv.mod crc.mod parttool.mod	\
 	pcpart.mod memrw.mod boot.mod normal.mod sh.mod lua.mod	\
-	gptsync.mod true.mod
+	gptsync.mod true.mod probe.mod
 
 # For gptsync.mod.
 gptsync_mod_SOURCES = commands/gptsync.c
@@ -491,6 +491,11 @@ true_mod_SOURCES = commands/true.c
 true_mod_CFLAGS = $(COMMON_CFLAGS)
 true_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For probe.mod.
+probe_mod_SOURCES = commands/probe.c
+probe_mod_CFLAGS = $(COMMON_CFLAGS)
+probe_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For normal.mod.
 normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \
 	normal/autofs.c normal/handler.c \
@@ -585,3 +590,4 @@ gzio_mod_LDFLAGS = $(COMMON_LDFLAGS)
 bufio_mod_SOURCES = io/bufio.c
 bufio_mod_CFLAGS = $(COMMON_CFLAGS)
 bufio_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
conf/i386-coreboot.rmk +1 -1
index 2f768c0..f2e0dc6 100644
@@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/configfile.c commands/echo.c commands/help.c		\
 	commands/handler.c commands/ls.c commands/test.c 		\
 	commands/search.c commands/blocklist.c commands/hexdump.c	\
-	commands/gptsync.c						\
+	commands/gptsync.c commands/probe.c				\
 	lib/hexdump.c commands/i386/cpuid.c				\
 	disk/host.c disk/loopback.c					\
 	\
conf/i386-ieee1275.rmk +1 -1
index 961e616..817a266 100644
@@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/handler.c commands/ls.c commands/test.c 		\
 	commands/search.c commands/blocklist.c commands/hexdump.c	\
 	lib/hexdump.c commands/halt.c commands/reboot.c			\
-	commands/gptsync.c commands/i386/cpuid.c			\
+	commands/gptsync.c commands/probe.c commands/i386/cpuid.c	\
 	disk/host.c disk/loopback.c					\
 	\
 	fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c			\
conf/i386-pc.rmk +1 -1
index 0af07f9..e9496f6 100644
@@ -127,7 +127,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/handler.c commands/ls.c commands/test.c 		\
 	commands/search.c commands/blocklist.c commands/hexdump.c	\
 	lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c		\
-	commands/gptsync.c commands/i386/cpuid.c			\
+	commands/gptsync.c commands/probe.c commands/i386/cpuid.c	\
 	disk/host.c disk/loopback.c disk/scsi.c				\
 	fs/fshelp.c 	\
 	\
conf/powerpc-ieee1275.rmk +1 -1
index 8b5be2b..b8a0309 100644
@@ -45,7 +45,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c 	\
 	commands/search.c commands/handler.c commands/test.c 		\
 	commands/ls.c commands/blocklist.c commands/hexdump.c		\
 	lib/hexdump.c commands/halt.c commands/reboot.c 		\
-	commands/gptsync.c 			\
+	commands/gptsync.c commands/probe.c 			\
 	disk/loopback.c							\
 	\
 	fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c			\
conf/sparc64-ieee1275.rmk +1 -0
index d16501b..5700937 100644
@@ -101,6 +101,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c 	\
 	commands/configfile.c commands/help.c				\
 	commands/search.c commands/handler.c commands/test.c 		\
 	commands/ls.c commands/blocklist.c commands/hexdump.c		\
+	commands/probe.c						\
 	lib/hexdump.c commands/halt.c commands/reboot.c			\
 	disk/loopback.c							\
 	\
#1 lore raw
Quoted 2 lines · Vladimir 'phcoder' Serbinenko

Following Pavel's suggestion to make uuid command I implemented probe command similar to grub-probe

Great! Please remove trailing whitespace. Please add missing space after "=" on line 64 in probe.c.

The help doesn't look right (no space before "print filesystem module"). I can have a look how to fix it if you don't find a way. Actually, I would prefer separate options for targets, as in "search". That would be:

-l --label
-u --fs_uuid
-p --partmap
-d --driver (instead of "provider")

--target=partmap doesn't work on whole disks.

Signature · 2 lines
Regards,
Pavel Roskin
#2 lore raw

Review

Quoted 8 lines

I can have a look how to fix it if you don't find a way.  Actually, I would prefer separate options for targets, as in "search".  That would be:

(quoted diff) +0 -4
-l --label
-u --fs_uuid
-p --partmap
-d --driver (instead of "provider")

I was inspired by grub-probe but this way it's ok too

Quoted 2 lines

--target=partmap doesn't work on whole disks.

It was the intent. I'm norking on nested partitions and consider the following situation:
hd0 is subdivided by pc partmap into
hd0,1 - linux
hd0,2 - solaris which is subdivided by sun partmap into hd0,2,1 - root
hd0,2,2 - swap
Then
probe -p hd0 gives "none"
probe -p hd0,2 gives "pc"
probe -p hd0,2,2 gives "sun"
another possibility would be
probe -p hd0 gives "pc"
probe -p hd0,2 gives "sun"
probe -p hd0,2,2 gives "none"
I don't have strong preference for one or other option but it can't say "pc" on both hd0 and hd0,1
P.S. could you improve & commit your target libc patch?

Quoted 11 lines

--
Regards,
Pavel Roskin

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
ChangeLog +15 -0
index 3eb4bfd..556b17d 100644
@@ -1,3 +1,18 @@
+2009-06-08  Vladimir Serbinenko  <[email protected]>
+
+	probe command
+
+	* commands/probe.c: new file
+	* conf/common.rmk (pkglib_MODULES): add probe.mod
+	(probe_mod_SOURCES): new variable
+	(probe_mod_CFLAGS): likewise
+	(probe_mod_LDFLAGS): likewise
+	* conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c
+	* conf/i386-ieee1275.rmk: likewise
+	* conf/i386-pc.rmk: likewise
+	* conf/powerpc-ieee1275.rmk: likewise
+	* conf/sparc64-ieee1275.rmk: likewise
+	
 2009-06-09  Michel Hermier  <[email protected]>
 
 	* fs/i386/pc/pxe.c (grub_pxefs_read): Fix returned values.
commands/probe.c new file +160 -0

160 lines not on this page · raw message

conf/common.rmk +7 -1
index 9780341..b75f50e 100644
@@ -354,7 +354,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod	\
 	terminfo.mod test.mod blocklist.mod hexdump.mod		\
 	read.mod sleep.mod loadenv.mod crc.mod parttool.mod	\
 	pcpart.mod memrw.mod boot.mod normal.mod sh.mod lua.mod	\
-	gptsync.mod true.mod
+	gptsync.mod true.mod probe.mod
 
 # For gptsync.mod.
 gptsync_mod_SOURCES = commands/gptsync.c
@@ -491,6 +491,11 @@ true_mod_SOURCES = commands/true.c
 true_mod_CFLAGS = $(COMMON_CFLAGS)
 true_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For probe.mod.
+probe_mod_SOURCES = commands/probe.c
+probe_mod_CFLAGS = $(COMMON_CFLAGS)
+probe_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For normal.mod.
 normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \
 	normal/autofs.c normal/handler.c \
@@ -585,3 +590,4 @@ gzio_mod_LDFLAGS = $(COMMON_LDFLAGS)
 bufio_mod_SOURCES = io/bufio.c
 bufio_mod_CFLAGS = $(COMMON_CFLAGS)
 bufio_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
conf/i386-coreboot.rmk +1 -1
index 2f768c0..f2e0dc6 100644
@@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/configfile.c commands/echo.c commands/help.c		\
 	commands/handler.c commands/ls.c commands/test.c 		\
 	commands/search.c commands/blocklist.c commands/hexdump.c	\
-	commands/gptsync.c						\
+	commands/gptsync.c commands/probe.c				\
 	lib/hexdump.c commands/i386/cpuid.c				\
 	disk/host.c disk/loopback.c					\
 	\
conf/i386-ieee1275.rmk +1 -1
index 961e616..817a266 100644
@@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/handler.c commands/ls.c commands/test.c 		\
 	commands/search.c commands/blocklist.c commands/hexdump.c	\
 	lib/hexdump.c commands/halt.c commands/reboot.c			\
-	commands/gptsync.c commands/i386/cpuid.c			\
+	commands/gptsync.c commands/probe.c commands/i386/cpuid.c	\
 	disk/host.c disk/loopback.c					\
 	\
 	fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c			\
conf/i386-pc.rmk +1 -1
index 0af07f9..e9496f6 100644
@@ -127,7 +127,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/handler.c commands/ls.c commands/test.c 		\
 	commands/search.c commands/blocklist.c commands/hexdump.c	\
 	lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c		\
-	commands/gptsync.c commands/i386/cpuid.c			\
+	commands/gptsync.c commands/probe.c commands/i386/cpuid.c	\
 	disk/host.c disk/loopback.c disk/scsi.c				\
 	fs/fshelp.c 	\
 	\
conf/powerpc-ieee1275.rmk +1 -1
index 8b5be2b..b8a0309 100644
@@ -45,7 +45,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c 	\
 	commands/search.c commands/handler.c commands/test.c 		\
 	commands/ls.c commands/blocklist.c commands/hexdump.c		\
 	lib/hexdump.c commands/halt.c commands/reboot.c 		\
-	commands/gptsync.c 			\
+	commands/gptsync.c commands/probe.c 			\
 	disk/loopback.c							\
 	\
 	fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c			\
conf/sparc64-ieee1275.rmk +1 -0
index d16501b..5700937 100644
@@ -101,6 +101,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c 	\
 	commands/configfile.c commands/help.c				\
 	commands/search.c commands/handler.c commands/test.c 		\
 	commands/ls.c commands/blocklist.c commands/hexdump.c		\
+	commands/probe.c						\
 	lib/hexdump.c commands/halt.c commands/reboot.c			\
 	disk/loopback.c							\
 	\
#3 lore raw
Quoted 10 lines · Vladimir 'phcoder' Serbinenko
Quoted 1 line

--target=partmap doesn't work on whole disks.

It was the intent. I'm norking on nested partitions and consider the following situation:
hd0 is subdivided by pc partmap into
hd0,1 - linux
hd0,2 - solaris which is subdivided by sun partmap into hd0,2,1 - root
hd0,2,2 - swap
Then
probe -p hd0 gives "none"

Quoted 8 lines

probe -p hd0,2 gives "pc"
probe -p hd0,2,2 gives "sun"
another possibility would be
probe -p hd0 gives "pc"
probe -p hd0,2 gives "sun"
probe -p hd0,2,2 gives "none"
I don't have strong preference for one or other option but it can't say "pc" on both hd0 and hd0,1

I think it the concept is not obvious to the user, maybe we could omit that functionality? Are you going to use it anywhere?

Quoted 1 line

P.S. could you improve & commit your target libc patch?

I'm looking at it now, but it will take some time. I've just noticed that I didn't post another patch that is required for correct implementation (AC_CHECK_FUNCS doesn't work if the target headers are missing). Also, I want to eliminate GRUB_SOURCE, at least from the configuration scripts.

Signature · 2 lines
Regards,
Pavel Roskin
#4 lore raw
Quoted 21 lines · Pavel Roskin
Quoted 10 lines · Vladimir 'phcoder' Serbinenko
Quoted 1 line

--target=partmap doesn't work on whole disks.

It was the intent. I'm norking on nested partitions and consider the following situation:
hd0 is subdivided by pc partmap into
hd0,1 - linux
hd0,2 - solaris which is subdivided by sun partmap into hd0,2,1 - root
hd0,2,2 - swap
Then
probe -p hd0 gives "none"

Quoted 8 lines

probe -p hd0,2 gives "pc"
probe -p hd0,2,2 gives "sun"
another possibility would be
probe -p hd0 gives "pc"
probe -p hd0,2 gives "sun"
probe -p hd0,2,2 gives "none"
I don't have strong preference for one or other option but it can't say "pc" on both hd0 and hd0,1

Quoted 2 lines

I think it the concept is not obvious to the user, maybe we could omit that functionality?  Are you going to use it anywhere?

The idea was to give the scriptwriters more possibilities for autoconfig. There is normally no reason for an end user to use this functionality at all but it may be useful in writing automated scripts for usage on e.g. rescue CD

Quoted 19 lines
Quoted 2 lines

P.S. could you improve & commit your target libc patch?

I'm looking at it now, but it will take some time.  I've just noticed that I didn't post another patch that is required for correct implementation (AC_CHECK_FUNCS doesn't work if the target headers are missing).  Also, I want to eliminate GRUB_SOURCE, at least from the configuration scripts.

--
Regards,
Pavel Roskin

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
#5 lore raw

Comitted

Quoted 54 lines · Vladimir 'phcoder' Serbinenko
Quoted 21 lines · Pavel Roskin
Quoted 10 lines · Vladimir 'phcoder' Serbinenko
Quoted 1 line

--target=partmap doesn't work on whole disks.

It was the intent. I'm norking on nested partitions and consider the following situation:
hd0 is subdivided by pc partmap into
hd0,1 - linux
hd0,2 - solaris which is subdivided by sun partmap into hd0,2,1 - root
hd0,2,2 - swap
Then
probe -p hd0 gives "none"

Quoted 8 lines

probe -p hd0,2 gives "pc"
probe -p hd0,2,2 gives "sun"
another possibility would be
probe -p hd0 gives "pc"
probe -p hd0,2 gives "sun"
probe -p hd0,2,2 gives "none"
I don't have strong preference for one or other option but it can't say "pc" on both hd0 and hd0,1

Quoted 2 lines

I think it the concept is not obvious to the user, maybe we could omit that functionality?  Are you going to use it anywhere?

The idea was to give the scriptwriters more possibilities for autoconfig. There is normally no reason for an end user to use this functionality at all but it may be useful in writing automated scripts for usage on e.g. rescue CD

Quoted 14 lines
Quoted 2 lines

P.S. could you improve & commit your target libc patch?

I'm looking at it now, but it will take some time.  I've just noticed that I didn't post another patch that is required for correct implementation (AC_CHECK_FUNCS doesn't work if the target headers are missing).  Also, I want to eliminate GRUB_SOURCE, at least from the configuration scripts.

--
Regards,
Pavel Roskin

Quoted 5 lines

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

--
Regards
Vladimir 'phcoder' Serbinenko

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko