The time to complete the ELF transition has come.
More to the point,
progress has stopped and there is no sign of things getting going and
finishing off the remaining rough edges without a bit more of a shove.
Please read this through carefully before getting out the flamethrowers
or starting a reply.
There are some known problems and rough edges still. They are not getting
fixed because not enough of the developers are using it. Note that
people installing 3.0-RELEASE get ELF by default, and 3.0.1 will have
an ELF kernel too. We need to get the remaining developers (kicking
and screaming if necessary) onto the bandwagon or the current outstanding
problems are going to be present in 3.0.1 as well.
The state of the ELF world today is that just about everything important
works for just about everybody.
Specifically:
- The userland builds, installs and runs "just fine" as ELF, and has done
so for a long time (I believe over a year).
- a.out binaries and libraries work unmodified. There is no need
to toss out /usr/local/bin. The libraries get moved to
/usr/local/lib/aout so there are no naming conflicts and the ldconfig
paths can handle this.
- The kernel builds and runs as an ELF file.
- /boot/loader can load static aout and elf kernels, as well as do
KLD preloading for ELF. a.out and ELF kernels have had KLD enabled
in them for over a month.
- The new bootblocks default to /boot/loader, but there are some problems
for some people still. This needs to be fixed, and either the new
bootblocks need fixing or the old bootblocks need a cutdown and
modified to fire up /boot/loader by default.
- The new bootblocks can load an a.out and ELF /kernel directly without
/boot/loader. (handy if you happen to break it or want to revert to
/boot/loader.old :-).
- KLD's work and are a superset of LKM's. You can build a.out and ELF
KLD modules. You can load a.out KLD's on an ELF kernel and ELF KLD's on
an a.out kernel without noticing the difference.
In all, we're about as ready as we're ever going to be without getting
more people bashing at the code.
However, the problems and risks:
- OLD bootblocks apparently cannot load /boot/loader. We do not yet know
why. We need to know why and preferably what to change in /boot/loader's
headers to make it work. This seems to affect only systems installed
with 2.0.x, 2.1.x and early 2.2.x bootblocks that have never had them
upgraded.
- 'make aout-to-elf' is known to have a few bumps when coming from some
versions of 2.2.x and some -current builds from the last few months.
There are other ways of ELF bootstrapping if building the source
proves too difficult or takes too much space. I personally have upgraded
two machines by installing a new binary bindist and then doing a normal
'make world' on the now ELF system to clean up the loose ends and bring it
up to date. I didn't have a.out binaries to worry about though.
- currently existing a.out LKM's will be truely dead. This may be a problem
for the one known 3rd party binary LKM, namely OSS. (No, we don't have
something against sound drivers, in spite of what it looks like :-).
- A 'make install' by an unwary -current user could install an ELF
/kernel and strand themselves if they have got OLD bootblocks that cannot
load /boot/loader, or if they do not know to just type "/boot/loader" at
the boot: prompt to get out of the jam.
The plan:
January 6 becomes The Day. (E2-day? E-squared day? :-)
On that day, 'make world' to build an a.out would will be blocked. Not
destroyed, not removed, just blocked. I would like it to be sufficiently
crippled so that it isn't too hard to get going again in an emergency or
if somebody is really badly affected. Perhaps something like:
make -DYES_I_KNOW_THIS_IS_ON_BORROWED_TIME world
or requiring the
src/Makefile* file to be edited to remove the block. It would be a waste
if 95% of people reflexively turned on a hook in /etc/make.conf out of
laziness, resistance to change, whatever, if it's too easy to take the
'do nothing' option. People must then do a 'make aout-to-elf' or install
an ELF binary dist or something.
On the same day, the default kernel format would get changed to ELF..
People can do an
echo /boot/loader > /boot.config
or install new bootblocks
(disklabel -B da0 / wd0 etc). As insurance to try and avoid feet getting
blown off and people getting stranded with unbootable systems, either
use a small bootblock reader to check that new bootblocks are in place,
or force the user to manually set a flag to signify that they have done
something about the bootstrap issue.
Barring any really major showstoppers, this will go ahead in the early
hours of January 6 (in the USA) and later in the day for the rest of the
world due to timezone differences.
What you can do right now:
- Test the /boot/loader on your system from the boot: prompt to make sure
it loads up and doesn't crash or reboot on the spot.
- Prepare some emergency boot floppies now, in case. Get the 3.0 boot
and fixit floppies from CD or from ftp.freebsd.org in /pub/FreeBSD/3.0-RELEASE/floppies/
- You might try downloading this gzipped dd image,
gunzip it, and write it to a formatted floppy:
gunzip newboot.dd.gz
dd if=newboot.dd of=/dev/rfd0 bs=18k
This is a 1.44MB floppy, with the new bootblocks and /boot/loader. It
also has a GENERIC kernel.gz, so you can see it loading plain .gz files
as well.
- If you are feeling like a little more fun, try building new floppy with the new bootblocks, new boot loader and see that
it works with your kernel on your system. To do this:
- get a formatted floppy ready
- disklabel -Brw -b /boot/boot1 -s /boot/boot2 /dev/rfd0.1440 fd1440
- newfs -T fd1440 /dev/rfd0.1440
- mount /dev/fd0.1440 /mnt
- mkdir /mnt/boot
- cp /boot/loader /mnt/boot/loader
- cp /kernel /mnt/kernel
- touch /mnt/boot/boot.conf
- umount /mnt
And try it out. Display the "twiddle" character and then pause for about
three seconds. If you press a key on the keyboard, the stage2 loader
will pause and give you the usual boot: prompt.
Anyway, It should initiate /boot/loader a few seconds later, and the
3rd stage loader should start. It should say "starting /kernel in
10 seconds" and do a countdown. If this works and it loads the kernel
from floppy, then you are clear. (Yes, the kernel is expected to panic
since it doesn't have a real rootfs or /sbin/init).
You can abort the autostart and have a play around. You can do things
like:
set currdev=disk1s1a (hard disk root)
load /kernel (your real kernel)
boot -s (start in single user).
- You can also try typing "/kernel" at the first boot: prompt.
- You may also like to try building an ELF kernel
cd compile/FOO; make KERNFORMAT=elf depend; make KERNFORMAT=elf
and copy that somewhere that you can try it out.
- If you are happy that the new bootblocks work, update your bootblocks
on your hard disk. MAKE SURE YOU HAVE A FALLBACK IF YOU GET STRANDED!
Ideally have the sysinstall boot/fixit floppy handy at all times.
- Also, have a peek at Robert Nordier's page on the new bootblocks.
This is what a successful boot looks like using the new bootblocks and
/boot/loader. (Yes, this loader and kernel is a little old, but it shows
just how long this stuff has been sitting in limbo)
>> FreeBSD/i386 BOOT
Default: 0:da(0,a)/boot/loader
boot:
text=0x1000 data=0x1b000 bss=0x0 symbols=[+0x0]
entry=0x100000
Console: serial port
BIOS drive A: is disk0
BIOS drive C: is disk1
FreeBSD/i386 bootstrap loader, Revision 0.2 639/64512kB
(root@beast.netplex.com.au, Fri Oct 16 23:15:13 WST 1998)
> set bootfile=/kernel
> autoboot 10
Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/kernel] in 9 seconds...
Booting [/kernel]...
/kernel text=0xe1348 data=0x12994+0x1b9f0 syms=[0x4+0x191b0+0x4+0x14fa5]
BIOS basemem: 639K, extmem: 64512K (from 0xe801 call)
Copyright (c) 1992-1998 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
FreeBSD 3.0-CURRENT #263: Sat Dec 5 18:29:39 WST 1998
peter@beast.netplex.com.au:/home/src/sys/compile/BEAST
Timecounter "i8254" frequency 1193182 Hz
CPU: Pentium Pro (686-class CPU)
Origin = "GenuineIntel" Id = 0x619 Stepping=9
Features=0xfbff
real memory = 67108864 (65536K bytes)
config> quit
avail memory = 62861312 (61388K bytes)
Programming 24 pins in IOAPIC #0
FreeBSD/SMP: Multiprocessor motherboard
cpu0 (BSP): apic id: 0, version: 0x00040011, at 0xfec08000
cpu1 (AP): apic id: 12, version: 0x00040011, at 0xfec08000
io0 (APIC): apic id: 13, version: 0x00170011, at 0xfec00000
Preloaded elf kernel "kernel" at 0xf0240000.
Probing for devices on PCI bus 0:
[..]
Note the 'preloaded elf kernel' bit. This is the in-kernel linker (KLD)
finding itself in the tables that the /boot/loader prepared for it.
Finally.. Try a
make aout-to-elf-build and make sure it works. If it
does, make sure you've backed up any critical data and try a
make aout-to-elf-install and see how you go.
Note that on a pre-3.0 system, the 'make aout-to-elf' and
'make aout-to-elf-install' scripts require that you manually
convert your kernel config to 3.0 level and
place it as src/sys/i386/conf/GENERICupgrade. Copy the plain GENERIC and
start from that if necessary. WARNING: The ELF upgrade process WILL ask to reboot your machine at the end!
Note that aout-to-elf will not install an ELF kernel for you! Just
do one thing at a time, ie: get an ELF binary world running. Once you've
got that sorted out, then try building an updated ELF kernel.
If you need to make comments or ask questions, please send mail to the
current@FreeBSD.org mailing list. Both success and failure
reports are welcome.