Yaboot uses "block-size" with disk-label packages.
This patch add block-size to all partitions packages.
Signed-off-by: Laurent Vivier Laurent@lvivier.info
--- modules/disk-label.c | 20 +++++++++++++++++++- modules/mac-parts.c | 7 +++++++ modules/pc-parts.c | 7 +++++++ modules/sun-parts.c | 7 +++++++ 4 files changed, 40 insertions(+), 1 deletion(-)
Index: openbios-devel/modules/disk-label.c =================================================================== --- openbios-devel.orig/modules/disk-label.c 2008-12-18 21:20:37.000000000 +0100 +++ openbios-devel/modules/disk-label.c 2008-12-18 21:21:43.000000000 +0100 @@ -200,12 +200,30 @@ PUSH(0); }
+static void +dlabel_block_size( dlabel_info_t *di ) +{ + xt_t xt; + + if( !di->part_ih ) + goto no_handler; + + xt = find_ih_method("block-size", di->part_ih); + if ( !xt ) + goto no_handler; + + call_package( xt , di->part_ih ); + return; +no_handler: + PUSH(512); +} + NODE_METHODS( dlabel ) = { { "open", dlabel_open }, { "close", dlabel_close }, { "offset", dlabel_offset }, { "load", dlabel_load }, - + { "block-size", dlabel_block_size }, { "read", dlabel_read }, { "write", dlabel_write }, { "seek", dlabel_seek }, Index: openbios-devel/modules/mac-parts.c =================================================================== --- openbios-devel.orig/modules/mac-parts.c 2008-12-18 21:20:37.000000000 +0100 +++ openbios-devel/modules/mac-parts.c 2008-12-18 21:21:43.000000000 +0100 @@ -119,6 +119,12 @@ }
static void +macparts_block_size( __attribute__((unused))macparts_info_t *di ) +{ + PUSH(512); +} + +static void macparts_initialize( macparts_info_t *di ) { fword("register-partition-package"); @@ -128,6 +134,7 @@ { "probe", macparts_probe }, { "open", macparts_open }, { "get-info", macparts_get_info }, + { "block-size", macparts_block_size }, { NULL, macparts_initialize }, };
Index: openbios-devel/modules/pc-parts.c =================================================================== --- openbios-devel.orig/modules/pc-parts.c 2008-12-18 21:20:37.000000000 +0100 +++ openbios-devel/modules/pc-parts.c 2008-12-18 21:21:43.000000000 +0100 @@ -186,6 +186,12 @@ }
static void +pcparts_block_size( __attribute__((unused))pcparts_info_t *di ) +{ + PUSH(512); +} + +static void pcparts_initialize( pcparts_info_t *di ) { fword("register-partition-package"); @@ -195,6 +201,7 @@ { "probe", pcparts_probe }, { "open", pcparts_open }, { "get-info", pcparts_get_info }, + { "block-size", pcparts_block_size }, { NULL, pcparts_initialize }, };
Index: openbios-devel/modules/sun-parts.c =================================================================== --- openbios-devel.orig/modules/sun-parts.c 2008-12-18 21:20:37.000000000 +0100 +++ openbios-devel/modules/sun-parts.c 2008-12-18 21:21:43.000000000 +0100 @@ -173,6 +173,12 @@ }
static void +sunparts_block_size( __attribute__((unused))sunparts_info_t *di ) +{ + PUSH(512); +} + +static void sunparts_initialize( __attribute__((unused))sunparts_info_t *di ) { fword("register-partition-package"); @@ -182,6 +188,7 @@ { "probe", sunparts_probe }, { "open", sunparts_open }, { "get-info", sunparts_get_info }, + { "block-size", sunparts_block_size }, { NULL, sunparts_initialize }, };