Tony Breeds [Thu, 22 Oct 2009 04:53:00 +0000 (15:53 +1100)]
Handle ipv6 boot parameters for POWER architecture.
This is implementation derived.
This follows the semantics defined in section 4.3.1 of
http://www.power.org/apps/org/workgroup/parch/download.php/2380/latest
(It is under the Members area of TSC - Platform Architecture committee).
[ Fixed merge conflicts in second/file.c and second/fs_of.c ]
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Fix netboot fucntionality to use the parameters specified.
Currently, yaboot works properly when there is a tftp boot server serving
the broadcast requests sent in the network.
If the user specifies siaddr, ciaddr, and other arguments in the command
line, it is not handled appropriately.
This patch changes that behavior and make yaboot work properly in both cases.
The semantics specified in section 4.1 of
http://playground.sun.com/1275/practice/obp-tftp/tftp1_0.pdf is followed.
([bootp,]siaddr,filename,ciaddr,giaddr,bootp-retries,tftp-retries)
Will Woods [Fri, 14 Nov 2008 04:55:53 +0000 (04:55 +0000)]
ybin --bootonce doesn't work
1) It inverts the logic of a test to see if nvram is available, and
2) It assumes the output of 'nvsetenv VARNAME' will be 'VARNAME=VALUE', rather
than just 'VALUE' (as it is when using the "nvram" utility).
From bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=471425
The attached patch fixes these problems and makes --bootonce work as expected.
Signed-off-by: Roman Rakus <rrakus@redhat.com> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Mohan Kumar M [Fri, 12 Dec 2008 03:31:38 +0000 (03:31 +0000)]
Allow yaboot to load relocatable kernel
PPC64 relocatable kernels (built with CONFIG_RELOCATABLE=y) have the type of
ET_DYN. But yaboot code won't load the kernel if the ELF type is not
ET_EXEC. Attached patch adds support to yaboot to load relocatable kernels
also (ie load ET_DYN type also)
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
David Woodhouse [Fri, 28 Mar 2008 00:04:02 +0000 (00:04 +0000)]
Pegasos and partition numbering
The whole bplan partition numbering thing is a clusterfuck, but it
shouldn't be as crappy as it is.
We can _cope_ with the fact that firmware is broken and has an
off-by-one in its partition numbering. All we need to do in yaboot is
add 1 to the partition numbers we infer from in /chosen/boot-device, if
we detect that we're on an afflicted machine. That's all we need to do,
and all we ever _should_ have done. And is already in yaboot. Yaboot
does its own block device handling, including partitions, and doesn't
ever care about the firmware's problems (in that respect, at least).
It doesn't affect the installer at _all_, because the installer can't
set up the firmware's boot-device anyway and it has to be done by hand.
All it affects is the release notes telling the user how to make it
bootable.
Unfortunately, we didn't make it that simple when we first supported the
Pegasos. For reasons which aren't entirely clear to me, we ended up with
Amiga partition table support in yaboot with the _same_ off-by-one
error, to match the firmware. And thus we have hacks in the installer to
use amiga partitions for Pegasos, and to cope with the off-by-one crap.
It's only after avoiding all this crap purely by accident on Efika, by
using DOS partition tables, that I realise how stupid I was to blindly
copy the crap that other people were doing, and to believe that Pegasos
would only work with Amiga partition tables.
I'd like to get rid of the off-by-one bug in yaboot's Amiga partition
handling. At the moment, our simple 'if bplan, partition++' in
yaboot_main() is wrong when we have Amiga partitions, although it's fine
for other partition types.
Actually, I'd also like to make that same increment conditional on
!conf_given, so that if someone specifies 'conf=hd:1,/yaboot.conf' on
the command line, that partition number _isn't_ incremented.
So any time you see a proper path specified as 'dev:part,/path/name' you
know it's a real one with proper partition numbers. Remember, the bplan
firmware doesn't allow that form, and takes a space between the
'dev:part' bit and the filename:
boot hd:0 /yaboot/yaboot conf=hd:1,/yaboot/yaboot.conf
Fixing the off-by-one bug in the Amiga partition handling means that
upgrades might break. I suppose we could have a 'noamigaoffbyone'
configuration option which all newly-written yaboot.conf files would
have, which controls this behaviour. But to be honest I just don't think
it's worth it.
Mike Wolf [Tue, 15 Jan 2008 20:33:51 +0000 (14:33 -0600)]
use public interface to detect CAS reboots (take 2)
This is the second pass of this patch. The fw variable name is changed
to use ibm,client-architecture-support-reboot field which is already present
in the firmware. Please disregard the previous patch.
The firmware field used to detect CAS reboots (ibm,fw-nbr-reboots) is
really a private field that could change without warning. A new field
ibm,#reconfig-reboots will be added as a public interface intended to
be used for this detection. The patch will first check for
ibm,client-architecture-support-reboot if that is not found it will see
if ibm,fw-nbr-reboots is present and will use that instead.
Paul Nasrat [Fri, 4 Jan 2008 13:00:19 +0000 (13:00 +0000)]
The CAS (Client-Architecture Support) call tells firmware what capabilities the
OS has. These capabilities result in different modes which the device-tree is
configured in, as well as what processor capabilities are presented. So, if
the capabilities are different from what was previously booted, firmware has to
reboot to reconfigure the device-tree. The second boot will have the updated
device-tree and we can boot as normal.
When this firmware initiated reboot occurs yaboot will now boot the same kernel
as the previous boot attempt with no action by the user needed. I have
successfully booted on POWER5 and POWER6 machines using various levels of the
kernel.
Paul Nasrat [Tue, 4 Dec 2007 08:43:32 +0000 (08:43 +0000)]
The attached patch adds support for writing the nvram using the nvram
utility from the new powerpc-utils pkg from IBM; it also simplify a bit
the code.
Paul Nasrat [Mon, 3 Dec 2007 12:41:42 +0000 (12:41 +0000)]
These patch provides the function of load a alternative initrd file
specified by the user via Yaboot prompt. To load the new file, just use
the "initrd=<name_of_file>" command. The <name_of_file> could include
all the directory path to the file.
Using only the "initrd" command, Yaboot will load the default kernel
specified in the configuration file and the initrd file specified by the
user. The user can, also, specify an initrd file to any other label of
the configuration file, just adding the "initrd" command before the
label's name.
Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
Paul Nasrat [Mon, 3 Dec 2007 12:37:10 +0000 (12:37 +0000)]
The patch from Scott Moser moves the "search-for-prom_claim'able" routine that
was present in load_elf64 and load_elf32 to a function named
prom_claim_chunk. This reduces the code-snippit duplication and makes
the function available for of_net_open.
Paul Nasrat [Fri, 17 Aug 2007 14:22:00 +0000 (15:22 +0100)]
On some of the larger kernels we are starting to see a space squeeze.
The kernel is currently being put at 20MBs and on some of the newer
pSeries systems we are getting real-bases at 32MBs (plus AIX 5.3 has
real-base at 32MB, so if AIX is ever booted, everything gets shifted).
If the uncompressed kernel+initrd is larger than 12MBs then we see
truncation (typical on install kernels).
This patch moves the KERNELADDR to 0x00C00000 (12MB). If real-base is
12MB and is loaed there, yaboot will keep going up by a megabyte until
prom_claim finds space. And the uncompressed kernel should be
indifferent where it's loaded because there's nothing at 32MB (ie it
will operate as it does today). If OF is loaded at 32MB then the 12MB
region is free and the uncompressed kernel will have more space to grow.
I have tested this on numerous pSeries boxes. I have not tested on
anything else.
Paul Nasrat [Thu, 17 May 2007 12:54:20 +0000 (13:54 +0100)]
Netboot fixes:
- the ARRAY_SIZE macro is no more needed here,
- use of cfgpath to have the actual config path to apply for mac *and* ip
lookup,
- no need to free a buffer big enough, and besides malloc(9) was not
enough ("/etc/" missed),
- use of intermediate length variables to avoid unneeded calls to strlen()
and strrchr().
benoit.guillon <benoit.guillon@tele2.fr>
Paul Nasrat [Tue, 15 May 2007 13:24:06 +0000 (14:24 +0100)]
load_my_config_file() modifications in yaboot.c
This second part, deletes the netbooting like PXE algorithm from
yaboot.c (reallocated in prom.c) and sets the use of prom_get_netinfo(),
prom_get_mac (), prom_get_ip () functions in load_my_config_file()
function to netbooting work like before the changes.
Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
Paul Nasrat [Tue, 15 May 2007 13:23:26 +0000 (14:23 +0100)]
prom functions
This first part creates the prom_get_netinfo (), prom_get_mac (),
prom_get_ip () functions, and some structures to get the necessary
information about the MAC and IP addresses.
Actually, this is a reallocation of netbooting like PXE algorithm wrote
by Benoit Guillon [1], to be used by any other part of Yaboot to get the
netbooting information.
Paul Nasrat [Tue, 15 May 2007 13:14:43 +0000 (14:14 +0100)]
User-specified config file on Yaboot's prompt
This patch clears out the kernel image list before loading a new config file.
Leonardo Rangel lrangel at linux.vnet.ibm.com
Paul Nasrat [Thu, 19 Apr 2007 09:14:24 +0000 (10:14 +0100)]
ybin userland interface for specifying bootonce
Add an option to ybin called "--bootonce" that takes exactly one
argument, the label of the kernel to boot exactly once, on next reboot.
Do some sanity checking. Grep through the yaboot config file to make
sure that label=WHATEVER exists somewhere, bail if not. Try to prune
out comment lines. Perhaps this might be implemented better. It worked
will in my testing, though.
Set the boot-once OF environment variable to the --bootonce value. Due
to the previously mentioned nvsetenv bug, this will fail silently if
you're trying to set boot-once on a system where boot-once doesn't
already exist in nvram. Thus, immediately after doing the set, try and
read it back out of nvsetenv and make sure it landed there. Bail if
not.
Paul Nasrat [Thu, 19 Apr 2007 09:13:43 +0000 (10:13 +0100)]
yaboot menu user interface
This patch allows for denoting a kernel label as a "boot-once" label
when printing the menu of labels.
The label flagged as default is marked with an asterisk (*). If a label
matches the global bootoncelabel, I'm marking it with an ampersand (&).
I'm ambivalent about the symbol used here, or even if it is. But I
found this bit useful when debugging and testing the functionality, and
it's trivial to add cleanly. I chose ampersand because it's immediately
left of the asterisk on my keyboard.
Paul Nasrat [Thu, 19 Apr 2007 09:12:22 +0000 (10:12 +0100)]
read boot-once, zero out, set bootoncelabel as default
This patch reads the boot-once environment variable from Open Firmware
and stores in a global variable, "bootoncelabel".
It then unconditionally zeros out the boot-once environment variable.
*** Note that according to 1275, setprop will create a specified
environment variable if it doesn't already exist. A bug in nvsetenv
causes it to fail silently if you try to set an OF environment variable
that does not already exist. However, simply booting a system running a
yaboot with this patch set compiled in will in fact create the boot-once
environment variable, which nvsetenv can later set and reset.
Paul Nasrat [Thu, 19 Apr 2007 09:11:19 +0000 (10:11 +0100)]
prom setprop primatives
This patch creates the prom_set_options() and prom_setprop() functions.
These are precise mirrors of their read-only brothers,
prom_get_options() and prom_getprop(), implemented as defined in the
Open Firmware 1275 spec.
The prom_set_options() function will be used to zero out the boot-once
label unconditionally after reading it.
Paul Nasrat [Fri, 2 Mar 2007 16:26:18 +0000 (16:26 +0000)]
Certain levels of IBM firmware will allow the system to boot from an
iscsi target. System OFW accomplishes this by setting up a virtual
disk device with parameters. These parameters, when passed back to
OFW by yaboot, directs the FW to use virtual device over the ethernet
port that will then access iscsi target as a block device. This patch
extracts those parameters from the property of the virtual device and
passes them back to OFW to indicate the kernel is to be retrieved via
the iscsi protocol.
Signed-off-by: Doug Maxey <dwm@austin.ibm.com> Cc: Ben Herrenscmidt <benh@kernel.crashing.org> Cc: Mike Christie <michaelc@cs.wisc.edu>
* second/file.c: Replace bootpath parser for netboot cases, the new
one should (hopefully) correctly handle most/all netboot
situations. (Nathan Lynch)
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-88
Ethan Benson [Wed, 3 Aug 2005 03:12:29 +0000 (03:12 +0000)]
Bugfix to patch-83
* Correct dereference of NULL in RAID partition patch (patch-83).
(Patch from Dustin).
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-85
* Pretend like we actually manage memory properly by calling free() on
things which were malloc()'ed or strdup()'ed.
(Patch from Dustin Kirkland).
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-84
* Support reading of type RAID partitions, except from fs_of.
This only works on x86 partition tables, Pmac partition tables will
need alternate methods. (Patch from Dustin Kirkland).
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-83
* ybin/ofpath: Remove check for broken-by-BootX device-tree, it no
longer works under current 2.6 kernels and nobody attempts to use
BootX anymore.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-82
* ybin/ybin: Allow for multiple bootstrap partitions. Patch by Dustin
Kirkland. May not fully work on PMAC hardware.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-81
* second/fs_of.c: increase tftp buffer to 6MB. This is as far as it
can go.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-73
* ybin/yabootconfig: Add support for LABEL= and UUID= in
/etc/fstab. (Colin Watson)
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-72
Ethan Benson [Sat, 8 May 2004 22:04:51 +0000 (22:04 +0000)]
Add additional check on /dev/nvram to avoid misleading error message
* ybin/ybin: Add additional check on /dev/nvram, if we cannot read a
couple bytes report it as broken. This avoids misleading
`Incompatible nvsetenv' message on kernels without /dev/nvram support.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-71
Ethan Benson [Sat, 8 May 2004 06:38:44 +0000 (06:38 +0000)]
Fix several ofpath error messages going to stdout rather then stderr
* ybin/ofpath: Fix several error messages mistakenly written to stdout
rather then stderr. (Thanks to Colin Watson for noticing)
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-70
* ybin/yabootconfig: If detected kernel appears to have a corresponding
initrd image then include an initrd= line in generated yaboot.conf.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-69
Ethan Benson [Sun, 28 Mar 2004 05:02:03 +0000 (05:02 +0000)]
Fix ofpath SATA support and sysfs detection
* ybin/ofpath: Support newwer kernels which call the driver sata_svw,
instead of ata-k2.
* ybin/ofpath: Detect sysfs mount correctly.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-67
Ethan Benson [Sun, 22 Feb 2004 13:15:30 +0000 (13:15 +0000)]
Add caveat regarding UFS to yaboot howto
* Add caveat regarding UFS to temporary bootloader setup chapter of
the yaboot-howto (Thanks to Brian Sammon, and to Stefan Pfetzing for
the German translation).
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-65