]> git.ozlabs.org Git - yaboot.git/log
yaboot.git
12 years agoBe explicit in order of evaluation in the reiserfs code
Tony Breeds [Tue, 10 Feb 2009 03:11:23 +0000 (14:11 +1100)]
Be explicit in order of evaluation in the reiserfs code

GCC Has helpfully pointed out that we're doing some strange things:

second/fs_reiserfs.c: In function ‘block_read’:
second/fs_reiserfs.c:219: warning: operation on ‘journal_table’ may be undefined
second/fs_reiserfs.c:219: warning: operation on ‘journal_table’ may be undefined
second/fs_reiserfs.c:219: warning: operation on ‘journal_table’ may be undefined
second/fs_reiserfs.c: In function ‘next_key’:
second/fs_reiserfs.c:619: warning: operation on ‘depth’ may be undefined

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
12 years agoUse explicit casts when dumping config data
Tony Breeds [Tue, 10 Feb 2009 03:00:28 +0000 (14:00 +1100)]
Use explicit casts when dumping config data

GCC pointes out that we're in a gray area

second/cfg.c: In function ‘cfg_reset’:
second/cfg.c:437: warning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘void *’
second/cfg.c:442: warning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘void *’

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
12 years agophandle != int in prom.c
Tony Breeds [Tue, 10 Feb 2009 02:54:17 +0000 (13:54 +1100)]
phandle != int in prom.c

GCC this pointed out:
second/prom.c: In function ‘prom_get_netinfo’:
second/prom.c:692: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘prom_handle’

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
12 years agoAdd/Correct libgcc function prototypes
Tony Breeds [Tue, 10 Feb 2009 03:37:44 +0000 (14:37 +1100)]
Add/Correct libgcc function prototypes

Add a prototype for ffs() from libgcc.
Instead of using log2 in reisrfs which has a different prototype to the
one libgcc, call the function reiser_log2()

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
12 years agoSave arguments as well as image name for CAS reboot
Paul Mackerras [Thu, 13 Oct 2011 18:01:12 +0000 (18:01 +0000)]
Save arguments as well as image name for CAS reboot

We were saving the image name that the user had typed (or had been
selected by default) in the "boot-last-label" property, but we were
losing any extra arguments that the user had typed after the image
name.  On a pSeries machine, if the firmware decides to do a reboot
at the client-architecture-support call, we were then rebooting to
the right image but without any extra arguments that the user typed.

This fixes the problem by saving the arguments in boot-last-label,
separated from the image name by a space.  When we use the value
of boot-last-label, we now call word_split to separate it into the
image name and arguments again.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
12 years agomake: Add correct quotes to the VERSION define to allow spaces in the version.
Tony Breeds [Tue, 18 Oct 2011 04:06:08 +0000 (15:06 +1100)]
make: Add correct quotes to the VERSION define to allow spaces in the version.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
12 years agoForce yaboot to always build 32-bit.
Tony Breeds [Thu, 4 Aug 2011 05:02:04 +0000 (15:02 +1000)]
Force yaboot to always build 32-bit.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
12 years agoyaboot does not compile against new e2fsprogs release
Tony Breeds [Thu, 6 Jan 2011 17:32:13 +0000 (17:32 +0000)]
yaboot does not compile against new e2fsprogs release

Add some "hacky" workarounds for missing libc functions required by
e2fsprogs.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoTreat iSCSI targets as block devices. yaboot-1.3.17-rc1
Roman Rakus [Thu, 5 Aug 2010 05:04:46 +0000 (15:04 +1000)]
Treat iSCSI targets as block devices.

Currently iSCSI targets are treated as network devices, this doesn't always
work firmware is capable of treating them like block devices which seems more
reliable.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAvoid stack smash in parseing the vendor specific options.
Tony Breeds [Fri, 16 Jul 2010 06:16:20 +0000 (16:16 +1000)]
Avoid stack smash in parseing the vendor specific options.

For yaboot we only really care about DHCP options that are alos IPv4
addresses.  Limit the memcpy() to 32bits.

Also we don't use the DHCP_DNS tag so remove it from the enum.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove old '0arch-timestamps0' file
Tony Breeds [Fri, 16 Jul 2010 06:02:23 +0000 (16:02 +1000)]
Remove old '0arch-timestamps0' file

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoLink yaboot at 1MB
Anton Blanchard [Thu, 8 Jul 2010 19:03:44 +0000 (19:03 +0000)]
Link yaboot at 1MB

Give ourselves another 1MB of available space by moving yaboot
down to 1MB. With load-base at 0x4000, our yaboot image would have to
be 1MB-0x4000 before we should encounter problems (because firmware
would have issues relocating us from 0x4000 to 1MB).

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAllocate kernel and ramdisk as low as possible
Anton Blanchard [Thu, 8 Jul 2010 19:03:43 +0000 (19:03 +0000)]
Allocate kernel and ramdisk as low as possible

We currently start the search for free memory for the kernel at
12MB. This made sense back when firmware (real-base) was always
12MB, but it doesn't now it is often at 32MB.

In light of this and now we have fixed the initrd load issues,
just try and allocate the kernel as low as possible.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAllocate tftp temporary buffer from top of address space
Anton Blanchard [Thu, 8 Jul 2010 19:03:42 +0000 (19:03 +0000)]
Allocate tftp temporary buffer from top of address space

We want the kernel and initrd to be as low as possible in the
address space. Allocate the temporary tftp region at the top
of the address space.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAllocate malloc region with prom_claim_chunk_top
Anton Blanchard [Thu, 8 Jul 2010 19:03:41 +0000 (19:03 +0000)]
Allocate malloc region with prom_claim_chunk_top

We want the kernel and initrd to be as low as possible in the
address space. Allocate the temporary malloc region at the top
of the address space.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAdd prom_claim_chunk_top
Anton Blanchard [Thu, 8 Jul 2010 19:03:40 +0000 (19:03 +0000)]
Add prom_claim_chunk_top

We want temporary allocations to be taken from the top of our address
space so the kernel and initrd can be loaded as low as possible. The
very early kernel code uses the top of the initrd as the low watermark
for memory allocations so the lower this is the better.

We currently see a number of fails where a large initrd causes us
to run out of space in a 128MB RMO region. Allocating the temporary
areas up high and therefore the initrd lower fixes it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoBump PROM_CLAIM_MAX_ADDR to 256MB
Anton Blanchard [Thu, 8 Jul 2010 19:03:39 +0000 (19:03 +0000)]
Bump PROM_CLAIM_MAX_ADDR to 256MB

A number of machines are failing to boot because firmware takes up a
significant amount of the first 128MB. Bump our maximum to 256MB since these
boxes almost always have a 256MB RMO region.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAdd claim/release runtime debug output
Anton Blanchard [Thu, 8 Jul 2010 19:03:38 +0000 (19:03 +0000)]
Add claim/release runtime debug output

Create prom_debug and use it in the claim and release routines.
Clean up the debug and error messages in the area.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoprint available ranges under control of linux, yaboot-debug property
Anton Blanchard [Thu, 8 Jul 2010 19:03:37 +0000 (19:03 +0000)]
print available ranges under control of linux, yaboot-debug property

Debugging yaboot failures is difficult because we often have to retest with a
yaboot built with debug enabled. As a first step to fixing this, look for a
linux,yaboot-debug property and dump the available ranges when it is non zero.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoUse ino_size if available
Anton Blanchard [Thu, 8 Jul 2010 19:03:36 +0000 (19:03 +0000)]
Use ino_size if available

If ino_size is available and returns > 0, then use it to allocate
the initrd. This allows us to claim it in one chunk and avoid
all the issues around requiring back to back claims to be
contiguous.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAdd optional ino_size filesystem backend function
Anton Blanchard [Thu, 8 Jul 2010 19:03:35 +0000 (19:03 +0000)]
Add optional ino_size filesystem backend function

Our initrd loader is very fragile and the main reason is that it doesn't
know the size of the initrd. We end up claiming 1MB at a time and failing
completely if the new region isn't contiguous with the previous one.

Now that firmware is often at 32MB (real-base), and kernels have grown
much bigger (CONFIG_FUNCTION_TRACER and CONFIG_RELOCATABLE are two big
reasons), we see this failure a lot.

Create a function ino_size (similar to the silo bootloader) and
implement it for tftp and ext2 backends.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove second zero of BSS
Anton Blanchard [Thu, 8 Jul 2010 19:03:34 +0000 (19:03 +0000)]
Remove second zero of BSS

We zero the BSS in two places: once in _start() and then
again in yaboot_start(). The second time we actually get
it wrong and zero 1/4 of the BSS (since we subtract two
pointers).

Since this second zeroing is superfluous and buggy, remove
it.

While here, fix the comments in _start. It claims we aren't
clearing the BSS when we are.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoUse prom_claim_chunk to allocate malloc area
Anton Blanchard [Thu, 8 Jul 2010 19:03:33 +0000 (19:03 +0000)]
Use prom_claim_chunk to allocate malloc area

prom_claim_chunk does the same thing as this loop, so we can
use it instead.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove unused MAX_VAR_NAME define
Anton Blanchard [Thu, 8 Jul 2010 19:03:31 +0000 (19:03 +0000)]
Remove unused MAX_VAR_NAME define

MAX_VAR_NAME isn't used anywhere, remove it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoFix incorrect comparision in get_params
Anton Blanchard [Sat, 10 Apr 2010 18:06:57 +0000 (18:06 +0000)]
Fix incorrect comparision in get_params

We were comparing the first character of manualinitrd with a string. Not sure
how this ever worked.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoAvoid gcc j_len unused warning
Anton Blanchard [Sat, 10 Apr 2010 18:06:34 +0000 (18:06 +0000)]
Avoid gcc j_len unused warning

gcc is spewing an unused warning about j_len. We initialise it in both
cases of the if statement, but initialise it to 0 anyway to avoid the warning.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove unused variable
Anton Blanchard [Sat, 10 Apr 2010 18:06:15 +0000 (18:06 +0000)]
Remove unused variable

ignore_entry isn't used, remove it to avoid a compiler warning.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoprom_getchar eats characters
Anton Blanchard [Sat, 10 Apr 2010 18:05:59 +0000 (18:05 +0000)]
prom_getchar eats characters

This bug has been annoying me for a long time. If you copy and paste a
string into the yaboot prompt, or even type too fast, characters get
dropped.

It turns out we were asking OF for 4 characters, but only using the first one.
There is strange logic to look for \e[, and then oring the third character with
0x100. I haven't been able to find anyone that knows why that was there in the
first place, so just remove it and fix this bug once and for all.

Automated test infrastructures the world over will thank us for fixing this
bug!

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove MAX_HEADERS check
Anton Blanchard [Sat, 10 Apr 2010 18:05:21 +0000 (18:05 +0000)]
Remove MAX_HEADERS check

The comparison against MAX_HEADERS doesn't match the error message and
we are dynamically allocating memory for the program headers, so there
should not be a limit.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove some stale code
Anton Blanchard [Sat, 10 Apr 2010 18:04:48 +0000 (18:04 +0000)]
Remove some stale code

Remove some old commented out code.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove magic numbers in print_message_file
Anton Blanchard [Sat, 10 Apr 2010 18:04:27 +0000 (18:04 +0000)]
Remove magic numbers in print_message_file

Create a define instead of using a magic number in print_message_file.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove some DEBUG code.
Anton Blanchard [Sat, 10 Apr 2010 18:03:21 +0000 (18:03 +0000)]
Remove some DEBUG code.

The test_bss and test_data debug printfs are of little use, so remove them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove quik bootloader code
Anton Blanchard [Sat, 10 Apr 2010 18:02:56 +0000 (18:02 +0000)]
Remove quik bootloader code

Has booting yaboot out of quik ever worked? The fact we do nothing with
quik_fip makes me suspect it hasn't. Remove the code.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoRemove sysmap support
Anton Blanchard [Sat, 10 Apr 2010 18:02:26 +0000 (18:02 +0000)]
Remove sysmap support

We have had in kernel kallsyms for years, and the less code that has to deal
with our fragile memory map the better.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoMerge branch 'devel'
Tony Breeds [Fri, 16 Jul 2010 05:11:38 +0000 (15:11 +1000)]
Merge branch 'devel'

13 years agoextract_netinfo_args() should be a void function.
Tony Breeds [Sat, 6 Mar 2010 03:59:04 +0000 (14:59 +1100)]
extract_netinfo_args() should be a void function.

If there is no "netinfo" packet, extract_netinfo_args() will fail and cause
parse_device_path() to abort.  This basically meant that yaboot will fail to
load any kernel/initrd under those circumstances.

This fix changes extract_netinfo_args() to be a void function.

Signed-off-by: Tony Breeds <tonyb@au1.ibm.com>
13 years agoMerge branch 'netboot'
Tony Breeds [Fri, 16 Jul 2010 04:56:12 +0000 (14:56 +1000)]
Merge branch 'netboot'

13 years agoYaboot 1.3.16 yaboot-1.3.16
Tony Breeds [Fri, 9 Jul 2010 02:18:17 +0000 (12:18 +1000)]
Yaboot 1.3.16

13 years agoAdd "Developers Certificate of Origin"
Tony Breeds [Fri, 9 Jul 2010 02:16:35 +0000 (12:16 +1000)]
Add "Developers Certificate of Origin"

All further patch contributions will need to adhere to this document,
based on the linux kernel's process.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
13 years agoVersion 1.3.15 yaboot-1.3.15
Tony Breeds [Fri, 9 Jul 2010 02:14:10 +0000 (12:14 +1000)]
Version 1.3.15

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoCheck each partition for swapspace before other filesystems.
Tony Breeds [Fri, 23 Oct 2009 03:05:50 +0000 (14:05 +1100)]
Check each partition for swapspace before other filesystems.

Swapspace isn't guaranteed to be on a partition tagged as such, add a
little defensive programming in that case.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoDo not of_open() LINUX_NATIVE partitions.
Tony Breeds [Thu, 22 Oct 2009 05:20:47 +0000 (16:20 +1100)]
Do not of_open() LINUX_NATIVE partitions.

If for some reason a partition is LINUX_NATIVE but is not handled by one
of the existing filesystem drivers, of_open() /may/ appear to succeed,
but infact the ihandle is garbage.

Make sure we skip LINUX_NATIVE partitions.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoMerge branch 'birecs' into devel
Tony Breeds [Thu, 22 Oct 2009 05:17:10 +0000 (16:17 +1100)]
Merge branch 'birecs' into devel

14 years agoHandle ipv6 boot parameters for POWER architecture.
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>
14 years agoParse the subnetmask from bootpath and DHCP options
Tony Breeds [Thu, 22 Oct 2009 04:46:37 +0000 (15:46 +1100)]
Parse the subnetmask from bootpath and DHCP options

Some power6 machines need to have the subnetmask to correctly open()
the network device.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoUse an empty server address for "older" firmwares.
Tony Breeds [Thu, 7 May 2009 03:07:21 +0000 (13:07 +1000)]
Use an empty server address for "older" firmwares.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoCheck for valid "looking" IPs before saving them.
Tony Breeds [Wed, 6 May 2009 06:05:46 +0000 (16:05 +1000)]
Check for valid "looking" IPs before saving them.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoAdd parseing for Vendor options aka DHCP options.
Tony Breeds [Tue, 5 May 2009 06:14:20 +0000 (16:14 +1000)]
Add parseing for Vendor options aka DHCP options.

If we have DHCP options process them.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoRemove Bootinfo (BIRECS).
Tony Breeds [Fri, 2 Oct 2009 05:55:33 +0000 (15:55 +1000)]
Remove Bootinfo (BIRECS).

The are not used and can scribble on kernel memory.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
14 years agoUp LOAD_BUFFER_SIZE to 25Mb.
Tony Breeds [Tue, 5 May 2009 00:52:02 +0000 (10:52 +1000)]
Up LOAD_BUFFER_SIZE to 25Mb.

20MB is already too small for some distro installers.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
15 years agoEnhance the parseing of IPv4 information.
Tony Breeds [Thu, 5 Mar 2009 04:04:47 +0000 (15:04 +1100)]
Enhance the parseing of IPv4 information.

Pull information out of the bootp-reply (or similar) property.  This
successfully netboots in a wider variety of OF "boot" lines.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
15 years agoMove ipv4 arguments handling to a separate function. No fucntional change.
Chandra Seetharaman [Fri, 9 Jan 2009 13:59:18 +0000 (05:59 -0800)]
Move ipv4 arguments handling to a separate function. No fucntional change.

This is just in preparation for the next patch which adds supports for
ipv6.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---

15 years agoFix netboot fucntionality to use the parameters specified.
Chandra Seetharaman [Fri, 9 Jan 2009 13:57:44 +0000 (05:57 -0800)]
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)

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---

15 years agoPrepare for netboot fix(following patch). No Functional change.
Chandra Seetharaman [Fri, 9 Jan 2009 13:56:40 +0000 (05:56 -0800)]
Prepare for netboot fix(following patch). No Functional change.

This patch just replaces the arguments "char *dev_name" and "char *file_name"
with "struct boot_fspec_t fspec".

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---

15 years agoIncrease the LOAD_BUFFER_SIZE to 20MiB.
Tony Breeds [Tue, 17 Feb 2009 23:20:12 +0000 (10:20 +1100)]
Increase the LOAD_BUFFER_SIZE to 20MiB.

As installers add more features initrd's get bigger.  Lets try to
accommodate them.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
15 years agolong append="..." causes yaboot to reject entire yaboot.conf (MAX_TOKEN too small) 1.3.15-merge yaboot-1.3.15-rc
Will Woods [Thu, 13 Nov 2008 00:59:43 +0000 (00:59 +0000)]
long append="..." causes yaboot to reject entire yaboot.conf (MAX_TOKEN too small)

yaboot's second/cfg.c has:
  #define MAX_TOKEN 200

When yaboot parses its config file, if it encounters a quoted string (like
append="...") longer than MAX_TOKEN, it rejects the entire config.

Typical preupgrade usage uses ~250 chars, which means preupgrade currently
renders ppc systems unbootable without this patch.

Suggest increasing MAX_TOKEN to.. let's say 511. cfg.c does "char
buf[MAX_TOKEN+1]", and everyone loves powers of 2.

Signed-off-by: Roman Rakus <rrakus@redhat.com>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
15 years agoybin --bootonce doesn't work
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>
15 years agoRevert "Let prom_claim_chunk do the work for tftp images to support larger images."
Tony Breeds [Fri, 13 Feb 2009 02:51:03 +0000 (13:51 +1100)]
Revert "Let prom_claim_chunk do the work for tftp images to support larger images."

This reverts commit c8b04c614770870d75825c19bcd4729cc779b84a.

This fixes the regression described in:
https://bugzilla.redhat.com/show_bug.cgi?id=468492

Signed-off-by: Roman Rakus <rrakus@redhat.com>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
15 years agoybin succeeds but returns error code
Anton Blanchard [Thu, 5 Feb 2009 14:19:26 +0000 (14:19 +0000)]
ybin succeeds but returns error code

Hi,

On a System p box, ybin returns an error even though it succeeds:

# ybin
# echo $?
1

The patch below fixes it:

# ybin
# echo $?
0

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
15 years agoAllow yaboot to load relocatable kernel
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>
16 years agoPegasos and partition numbering
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.

16 years agouse public interface to detect CAS reboots (take 2)
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.

-------

16 years agoThe CAS (Client-Architecture Support) call tells firmware what capabilities the
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.

Patch from: Mike Wolf <mjw@linux.vnet.ibm.com>

16 years agoRevert "The attached patch adds support for writing the nvram using the nvram"
Paul Nasrat [Thu, 3 Jan 2008 19:21:44 +0000 (19:21 +0000)]
Revert "The attached patch adds support for writing the nvram using the nvram"

This reverts commit ac8fbd5ad52b43b820973f1828a29f85bed13a1d.

16 years agoRevert "Fix shell syntax"
Paul Nasrat [Thu, 3 Jan 2008 19:21:22 +0000 (19:21 +0000)]
Revert "Fix shell syntax"

This reverts commit 24679e706305e0910f181a9640b8b88a30662d03.

16 years agoFix shell syntax
Paul Nasrat [Thu, 3 Jan 2008 19:07:50 +0000 (19:07 +0000)]
Fix shell syntax

16 years agoThe attached patch adds support for writing the nvram using the nvram
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.

Patch from: Emanuele Giaquinta (exg@gentoo.org)

16 years agoForce build to be ppc32
Paul Nasrat [Mon, 3 Dec 2007 14:21:11 +0000 (14:21 +0000)]
Force build to be ppc32

16 years agoFix typo
Paul Nasrat [Mon, 3 Dec 2007 14:14:42 +0000 (14:14 +0000)]
Fix typo

16 years agoFix typo in patch porting
Paul Nasrat [Mon, 3 Dec 2007 14:13:54 +0000 (14:13 +0000)]
Fix typo in patch porting

16 years agoFix partition numbering handling with bplan firmware
Paul Nasrat [Mon, 3 Dec 2007 14:05:48 +0000 (14:05 +0000)]
Fix partition numbering handling with bplan firmware
Patch based on Fedora patch by dwmw2@infradead.org

16 years agoTry harder to allocate malloc region
Paul Nasrat [Mon, 3 Dec 2007 13:17:33 +0000 (13:17 +0000)]
Try harder to allocate malloc region
Patch from dwmw2@infradead.org

16 years agoPrint version-release of yaboot
Paul Nasrat [Mon, 3 Dec 2007 13:13:23 +0000 (13:13 +0000)]
Print version-release of yaboot
Patch from dwmw2@infradead.org

16 years agoLet prom_claim_chunk do the work for tftp images to support larger images.
Paul Nasrat [Mon, 3 Dec 2007 13:04:19 +0000 (13:04 +0000)]
Let prom_claim_chunk do the work for tftp images to support larger images.

Patch from: Leonardo Rangel <lrangel@linux.vnet.ibm.com>

16 years agoThese patch provides the function of load a alternative initrd file
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>
16 years agomove the tftp load space and use prom_claim_chunk to claim the memory.
Paul Nasrat [Mon, 3 Dec 2007 12:39:06 +0000 (12:39 +0000)]
move the tftp load space and use prom_claim_chunk to claim the memory.
Growing kernels mean that the 6MB that was allotted is not enough.

Patch from Scott Moser

16 years agoThe patch from Scott Moser moves the "search-for-prom_claim'able" routine that
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.

Scott Moser ssmoser@us.ibm.com

16 years agoRelease 1.3.14 yaboot-1.3.14
Paul Nasrat [Fri, 17 Aug 2007 14:29:26 +0000 (15:29 +0100)]
Release 1.3.14

16 years agoOn some of the larger kernels we are starting to see a space squeeze.
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.

Signed-off-by: Jake Moilanen <moilanen@austin.ibm.com>
16 years agoFix typo courtesy of Kenichi Nagai
Paul Nasrat [Thu, 26 Jul 2007 08:27:58 +0000 (09:27 +0100)]
Fix typo courtesy of Kenichi Nagai

16 years agoPrepare 1.3.14
Paul Nasrat [Thu, 19 Jul 2007 13:16:30 +0000 (14:16 +0100)]
Prepare 1.3.14

16 years agoNetboot fixes:
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>

16 years agoCorrect return type
Paul Nasrat [Thu, 17 May 2007 10:30:59 +0000 (11:30 +0100)]
Correct return type
Leonardo Rangel <lrangel@linux.vnet.ibm.com>

16 years agoAdd missing includes
Paul Nasrat [Thu, 17 May 2007 10:29:29 +0000 (11:29 +0100)]
Add missing includes
Leonardo Rangel <lrangel@linux.vnet.ibm.com>

16 years agoFix compilation warnings by using return not exit.
Paul Nasrat [Thu, 17 May 2007 10:28:19 +0000 (11:28 +0100)]
Fix compilation warnings by using return not exit.
Leonardo Rangel <lrangel@linux.vnet.ibm.com>

16 years agoNow we stop truncating characters for pxelinux style boot at the directory seperator.
Paul Nasrat [Thu, 17 May 2007 10:27:23 +0000 (11:27 +0100)]
Now we stop truncating characters for pxelinux style boot at the directory seperator.
Leonardo Rangel <lrangel@linux.vnet.ibm.com>

16 years agoUpdate ChangeLog from git yaboot-1.3.14rc2
Paul Nasrat [Wed, 16 May 2007 09:22:59 +0000 (10:22 +0100)]
Update ChangeLog from git

16 years agouse of cfg_set_default_by_mac() function in yaboot.c
Paul Nasrat [Tue, 15 May 2007 13:28:02 +0000 (14:28 +0100)]
use of cfg_set_default_by_mac() function in yaboot.c

This last part calls the cfg_set_default_by_mac() function in yaboot.c
by load_config_file() function.

Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
16 years agoThis part creates the cfg_set_default_by_mac() function.
Paul Nasrat [Tue, 15 May 2007 13:25:55 +0000 (14:25 +0100)]
This part creates the cfg_set_default_by_mac() function.

This function sets the default cf_option if there is an image label if
the same MAC address of the machine is netbooting.

Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
16 years agoload_my_config_file() modifications in yaboot.c
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>
16 years agoprom functions
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.

[1] http://ozlabs.org/pipermail/yaboot-devel/2006-December/000062.html

Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
16 years agoThis patch fixes OF netbooting on pSeries
Paul Nasrat [Tue, 15 May 2007 13:18:33 +0000 (14:18 +0100)]
This patch fixes OF netbooting on pSeries
Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
16 years agoUser-specified config file on Yaboot's prompt
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

17 years agoEnable user to supply config from yaboot command line.
Paul Nasrat [Thu, 19 Apr 2007 09:27:05 +0000 (10:27 +0100)]
Enable user to supply config from yaboot command line.

Leonardo Rangel <lrangel@linux.vnet.ibm.com>

17 years agoThe following patch fix reverts removal of some lines for the netboot patch.
Paul Nasrat [Thu, 19 Apr 2007 09:25:28 +0000 (10:25 +0100)]
The following patch fix reverts removal of some lines for the netboot patch.

Signed-off-by: Paulo Ricardo Paz Vital <vital@br.ibm.com>
17 years agoybin userland interface for specifying bootonce
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.

Signed-off-by: Dustin Kirkland <dustin.kirkland@us.ibm.com>
17 years agoyaboot menu user interface
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.

17 years agoread boot-once, zero out, set bootoncelabel as default
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.

Signed-off-by: Dustin Kirkland <dustin.kirkland@us.ibm.com>
17 years agoprom setprop primatives
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.

Signed-off-by: Dustin Kirkland <dustin.kirkland@us.ibm.com>
17 years agoLoading a different config file (confarg feature) origin
Paul Nasrat [Wed, 18 Apr 2007 13:27:59 +0000 (14:27 +0100)]
Loading a different config file (confarg feature)
Origin: Paulo Ricardo Paz Vital <vital@br.ibm.com>