Skip to contentSkip to conversation

Sendkey, activate, bash

PATCH Vladimir Serbinenko 1 participant 1 message Aug 1, 2005

lore
Share & tools
lore
#0 lore raw

I send a new version of my patch. Sendkey is now a variable and also there are
the variables kb_*. The disadvantages are that sendkey is not loaded automatically, the
number of variables and unavailability to see the help. Could someone propose how to fix it?
At hte same time I discovered that grub and bash parse quotes and doublequotes differently.
Example to set sendkey to "h e l l o". it doesn't work if you write:
sendkey="h e l l o"
You must write:
"sendkey=h e l l o"
I changed the way that grub parses the " and '. And now it does like bash.

Also I wrote new module: activate. It's also pc-specific. It's analog of makeactive but with
other syntax:

active PARTITION.

like:

activate (hd0,2)

Vladimir Serbinenko
2005-08-01 Vladimir Serbinenko <[email protected]>

Sendkey and activate modules(pc) and preboots

* commands/boot.c: Added support for preboot functions
* conf/i386.rmk (sendkey): new module
(activate): Likewise
* commands/i386/pc/activate.c: new file
* include/grub/normal.h: new headers and types for preboots
* commands/i386/pc/activate.c: new file
* kern/misc.c (grub_split_cmdline): more bash-like quotes and doublequotes handle

ChangeLog +13 -0
diff -urpN grub2um/ChangeLog grub2m/ChangeLog
@@ -1,3 +1,16 @@
+2005-08-01  Vladimir Serbinenko <[email protected]>
+
+	Sendkey and activate modules(pc) and preboots
+	
+	* commands/boot.c: Added support for preboot functions
+	* conf/i386.rmk (sendkey): new module
+	(activate): Likewise
+	* commands/i386/pc/activate.c: new file
+	* include/grub/normal.h: new headers and types for preboots
+	* commands/i386/pc/activate.c: new file
+	* kern/misc.c (grub_split_cmdline): more bash-like quotes and
+	doublequotes handle
+
 2005-07-31  Yoshinori K. Okuji  <[email protected]>
 
 	* loader/i386/pc/multiboot.c (grub_multiboot_is_elf32): New
commands/boot.c +50 -0

69 lines not on this page · raw message

commands/i386/pc/activate.c +114 -0

114 lines not on this page · raw message

commands/i386/pc/sendkey.c +394 -0

394 lines not on this page · raw message

conf/i386-pc.mk +102 -1

115 lines not on this page · raw message

conf/i386-pc.rmk +10 -1
diff -urpN grub2um/conf/i386-pc.rmk grub2m/conf/i386-pc.rmk
@@ -102,7 +102,8 @@ pkgdata_MODULES = _chain.mod _linux.mod 
 	font.mod _multiboot.mod ls.mod boot.mod cmp.mod cat.mod		\
 	terminal.mod fshelp.mod chain.mod multiboot.mod amiga.mod	\
 	apple.mod pc.mod sun.mod loopback.mod reboot.mod halt.mod	\
-	help.mod default.mod timeout.mod configfile.mod
+	help.mod default.mod timeout.mod configfile.mod sendkey.mod     \
+	activate.mod
 
 # For _chain.mod.
 _chain_mod_SOURCES = loader/i386/pc/chainloader.c
@@ -163,6 +164,14 @@ normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
 hello_mod_SOURCES = hello/hello.c
 hello_mod_CFLAGS = $(COMMON_CFLAGS)
 
+# For sendkey.mod.
+sendkey_mod_SOURCES = commands/i386/pc/sendkey.c
+sendkey_mod_CFLAGS = $(COMMON_CFLAGS)
+
+# For activate.mod.
+activate_mod_SOURCES = commands/i386/pc/activate.c
+activate_mod_CFLAGS = $(COMMON_CFLAGS)
+
 # For boot.mod.
 boot_mod_SOURCES = commands/boot.c
 boot_mod_CFLAGS = $(COMMON_CFLAGS)
include/grub/normal.h +5 -0
diff -urpN grub2um/include/grub/normal.h grub2m/include/grub/normal.h
@@ -44,6 +44,9 @@
 /* Not loaded yet. Used for auto-loading.  */
 #define GRUB_COMMAND_FLAG_NOT_LOADED	0x20
 
+/* Preboot function declaration.  */
+typedef void (*grub_prebootfn_t) (void); 
+
 /* The command description.  */
 struct grub_command
 {
@@ -178,6 +181,8 @@ grub_context_t grub_context_get (void);
 grub_menu_t grub_context_get_current_menu (void);
 grub_menu_t grub_context_push_menu (grub_menu_t menu);
 void grub_context_pop_menu (void);
+grub_err_t grub_preboot_add (grub_prebootfn_t fn);
+grub_err_t grub_preboot_remove (grub_prebootfn_t fn);
 
 #ifdef GRUB_UTIL
 void grub_normal_init (void);
kern/misc.c +37 -36

85 lines not on this page · raw message