From 63162c5eb23b6ba4a00b4b4e18ffbcdba52b1e2e Mon Sep 17 00:00:00 2001 From: Ethan Benson Date: Wed, 27 Mar 2002 13:22:23 +0000 Subject: [PATCH] Commit yaboot 1.3.5-pre2 Commit yaboot 1.3.5-pre2. git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-10 --- ChangeLog | 14 ++++++++++ Makefile | 3 ++- changelog | 5 ++-- man.patch | 24 ++++++++--------- man/yaboot.conf.5 | 10 +++++--- second/fs_ext2.c | 2 -- second/prom.c | 4 +-- second/yaboot.c | 65 ++++++++++++++++++++++++++++++++++++++++++++--- ybin/ybin | 2 +- 9 files changed, 103 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2abf395..61bd514 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,20 @@ # tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3 # +2002-03-27 13:22:23 GMT Ethan Benson patch-10 + + Summary: + Commit yaboot 1.3.5-pre2 + Revision: + yaboot--devel--1.3--patch-10 + + Commit yaboot 1.3.5-pre2. + + modified files: + ChangeLog Makefile changelog man.patch man/yaboot.conf.5 + second/fs_ext2.c second/prom.c second/yaboot.c ybin/ybin + + 2002-03-26 15:11:26 GMT Ethan Benson patch-9 Summary: diff --git a/Makefile b/Makefile index 62dc58a..b8b02c7 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ include Config -VERSION = 1.3.5pre1 +VERSION = 1.3.5pre2 # Debug mode (spam/verbose) DEBUG = 0 # make install vars @@ -144,6 +144,7 @@ clean: find . -name '#*' | xargs rm -f find . -name '.#*' | xargs rm -f find . -name '*~' | xargs rm -f + find . -name '*.swp' | xargs rm -f -gunzip man/*.gz rm -rf man.deb chmod 755 ybin/ybin ybin/ofpath ybin/yabootconfig diff --git a/changelog b/changelog index e4946fa..7ddea3a 100644 --- a/changelog +++ b/changelog @@ -1,11 +1,12 @@ -2001-10-24 Ethan Benson +2001-10-25 Ethan Benson - * Version 1.3.5pre1 + * Version 1.3.5pre2 * yaboot: - XFS fixes for large partitions (Brendan O'Dea) - Upgrade libext2fs to 1.25, this adds full ext3 support to yaboot. - Reiserfs fixes (Jeff Mahoney) + - Implement the message= configuration option (see yaboot.conf man page). 2001-10-13 Ethan Benson diff --git a/man.patch b/man.patch index 24557e9..707668a 100644 --- a/man.patch +++ b/man.patch @@ -1,6 +1,6 @@ -diff -urN -X CVS man/mkofboot.8 man.deb/mkofboot.8 +diff -urN -x CVS man/mkofboot.8 man.deb/mkofboot.8 --- man/mkofboot.8 Thu May 24 04:32:54 2001 -+++ man.deb/mkofboot.8 Tue Sep 25 05:38:42 2001 ++++ man.deb/mkofboot.8 Thu Oct 25 05:06:35 2001 @@ -94,7 +94,7 @@ .TP .BR \-i ,\ \-\-install\ \fIboot-file @@ -30,9 +30,9 @@ diff -urN -X CVS man/mkofboot.8 man.deb/mkofboot.8 \fBmkofboot\fR) it is thus critical that it not be writable by anyone but root. It is also critical that \fI/etc/yaboot.conf\fR not be writable by anyone but root since a different \fIofboot\fR script could be -diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 ---- man/yaboot.conf.5 Tue Sep 25 05:20:03 2001 -+++ man.deb/yaboot.conf.5 Tue Sep 25 05:38:42 2001 +diff -urN -x CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 +--- man/yaboot.conf.5 Thu Oct 25 05:06:22 2001 ++++ man.deb/yaboot.conf.5 Thu Oct 25 05:06:35 2001 @@ -136,7 +136,7 @@ boot=/dev/hda2 device=hd: @@ -51,7 +51,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 loader for yaboot. It is capable of presenting a dual boot menu for GNU/Linux, MacOS and MacOSX. If dual booting is not required or configured it will simply load yaboot directly. You must specify this -@@ -301,7 +301,7 @@ +@@ -305,7 +305,7 @@ When you define this option you will be presented with a simple menu at bootup allowing you to hit L to boot GNU/Linux or B to boot BSD (along with other choices if configured). This will only work if you are @@ -60,7 +60,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. .TP -@@ -310,7 +310,7 @@ +@@ -314,7 +314,7 @@ partition. When you define this option you will be presented with a simple menu at bootup allowing you to hit L to boot GNU/Linux or M to boot MacOS (along with other choices if configured). This will only @@ -69,7 +69,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 script. When this is set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. -@@ -320,7 +320,7 @@ +@@ -324,7 +324,7 @@ When you define this option you will be presented with a simple menu at bootup allowing you to hit L to boot GNU/Linux or X to boot MacOSX (along with other choices if configured). This will only work if you @@ -78,7 +78,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 this is set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. -@@ -341,7 +341,7 @@ +@@ -345,7 +345,7 @@ When you define this option you will be presented with a simple menu at bootup allowing you to hit L to boot GNU/Linux or D to boot Darwin (along with other choices if configured). This will only work if you @@ -87,7 +87,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 this is set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. -@@ -589,8 +589,8 @@ +@@ -593,8 +593,8 @@ root=/dev/hda3 partition=3 timeout=20 @@ -98,9 +98,9 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 fgcolor=black bgcolor=green default=Linux -diff -urN -X CVS man/ybin.8 man.deb/ybin.8 +diff -urN -x CVS man/ybin.8 man.deb/ybin.8 --- man/ybin.8 Thu May 24 04:33:16 2001 -+++ man.deb/ybin.8 Tue Sep 25 05:38:42 2001 ++++ man.deb/ybin.8 Thu Oct 25 05:06:35 2001 @@ -109,7 +109,7 @@ .TP .BR \-i ,\ \-\-install\ \fIboot-file diff --git a/man/yaboot.conf.5 b/man/yaboot.conf.5 index f42ff42..b1371bf 100644 --- a/man/yaboot.conf.5 +++ b/man/yaboot.conf.5 @@ -6,7 +6,7 @@ .\" This program is distributed according to the Gnu General Public License. .\" See the file COPYING in the ybin source distribution. .\" -.TH YABOOT.CONF 5 "25 September 2001" "GNU/Linux PowerPC" "File Formats" +.TH YABOOT.CONF 5 "25 October 2001" "GNU/Linux PowerPC" "File Formats" .SH NAME .B yaboot.conf \- Configuration file format used by @@ -247,8 +247,12 @@ darwin. This is only relevant if you have \fIbsd=\fR, \fImacos=\fR, \fImacosx=\fR, or \fIdarwin=\fR options defined. .TP .BI "message=" message_filename -Specifies a file containing a message that is displayed before the boot -prompt. [CURRENTLY UNIMPLEMENTED] +Specifies a file containing a message that is displayed before the +boot prompt. You may specify either a plain pathname, in which case +the default device and partition will be derived from the +\fIdevice=\fR and \fIpartition=\fR lines in the global section of +\fByaboot.conf\fR, or you can specify a full OpenFirmware device +path. Note: only the first 2000 bytes of this file will be read. .TP .BI "password=" password Protect booting by a password. The password is given in either diff --git a/second/fs_ext2.c b/second/fs_ext2.c index b2ef127..5aa9585 100644 --- a/second/fs_ext2.c +++ b/second/fs_ext2.c @@ -134,12 +134,10 @@ ext2_open( struct boot_file_t* file, DEBUG_OPEN; if (opened) { - prom_printf("ext2_open() : fs busy\n"); DEBUG_LEAVE(FILE_ERR_FSBUSY); return FILE_ERR_FSBUSY; } if (file->device_kind != FILE_DEVICE_BLOCK) { - prom_printf("Can't open ext2 filesystem on non-block device\n"); DEBUG_LEAVE(FILE_ERR_BADDEV); return FILE_ERR_BADDEV; } diff --git a/second/prom.c b/second/prom.c index 037c738..c89182c 100644 --- a/second/prom.c +++ b/second/prom.c @@ -414,7 +414,7 @@ prom_puts (prom_handle file, char *s) void prom_vfprintf (prom_handle file, char *fmt, va_list ap) { - static char printf_buf[1536]; + static char printf_buf[2048]; vsprintf (printf_buf, fmt, ap); prom_puts (file, printf_buf); } @@ -422,7 +422,7 @@ prom_vfprintf (prom_handle file, char *fmt, va_list ap) void prom_vprintf (char *fmt, va_list ap) { - static char printf_buf[1536]; + static char printf_buf[2048]; vsprintf (printf_buf, fmt, ap); prom_puts (prom_stdout, printf_buf); } diff --git a/second/yaboot.c b/second/yaboot.c index 68440aa..b52b927 100644 --- a/second/yaboot.c +++ b/second/yaboot.c @@ -255,6 +255,66 @@ check_color_text_ui(char *color) } #endif /* CONFIG_COLOR_TEXT */ + +void print_message_file(char *filename) +{ + char *msg = NULL; + char *p, *endp; + char *defdev = boot.dev; + int defpart = boot.part; + char msgpath[1024]; + int opened = 0; + int result = 0; + int n; + struct boot_file_t file; + struct boot_fspec_t msgfile; + + defdev = cfg_get_strg(0, "device"); + if (!defdev) + defdev = boot.dev; + p = cfg_get_strg(0, "partition"); + if (p) { + n = simple_strtol(p, &endp, 10); + if (endp != p && *endp == 0) + defpart = n; + } + + strncpy(msgpath, filename, sizeof(msgpath)); + if (!parse_device_path(msgpath, defdev, defpart, "/etc/yaboot.msg", &msgfile)) { + prom_printf("%s: Unable to parse\n", msgpath); + goto done; + } + + result = open_file(&msgfile, &file); + if (result != FILE_ERR_OK) { + prom_printf("%s:%d,", msgfile.dev, msgfile.part); + prom_perror(result, msgfile.file); + goto done; + } else + opened = 1; + + msg = malloc(2001); + if (!msg) + goto done; + else + memset(msg, 0, sizeof(*msg)); + + if (file.fs->read(&file, 2000, msg) <= 0) + goto done; + else + prom_printf("%s", msg); + +done: + if (opened) + file.fs->close(&file); + if (msg) + free(msg); + if (p) + free(p); + if (endp) + free(endp); +} + /* Currently, the config file must be at the root of the filesystem. * todo: recognize the full path to myself and use it to load the * config file. Handle the "\\" (blessed system folder) @@ -359,11 +419,10 @@ load_config_file(char *device, char* path, int partition) p = cfg_get_strg(0, "init-message"); if (p) prom_printf("%s\n", p); -#if 0 + p = cfg_get_strg(0, "message"); if (p) print_message_file(p); -#endif result = 1; @@ -653,7 +712,7 @@ int get_params(struct boot_param_t* params) "press to boot it.\n\n" "To boot any other label simply type its name and press .\n\n" "To boot a kernel image which is not defined in the yaboot configuration \n" - "file, enter the kernel image name as [device:][partno],/path, where \n" + "file, enter the kernel image name as [[device:][partno],]/path, where \n" "\"device:\" is the OpenFirmware device path to the disk the image \n" "resides on, and \"partno\" is the partition number the image resides on.\n" "Note that the comma (,) is only required if you specify an OpenFirmware\n" diff --git a/ybin/ybin b/ybin/ybin index 0a01856..7a0ea80 100755 --- a/ybin/ybin +++ b/ybin/ybin @@ -28,7 +28,7 @@ if [ -n "$PATH_PREFIX" ] ; then fi PRG="${0##*/}" SIGINT="$PRG: Interrupt caught ... exiting" -VERSION=1.3.5pre1 +VERSION=1.3.5pre2 DEBUG=0 VERBOSE=0 TMP="${TMPDIR:-/tmp}" -- 2.39.2