Table of Contents
aboot
aboot is the Linux boot loader for Alpha systems with the SRM console. It loads a Linux kernel, optionally with an initial ramdisk, from an ext2, ext3, ext4, XFS, ISO 9660, or UFS file system or from raw disk blocks, and supports a configuration file, /etc/aboot.conf. 1) Systems with the ARC or AlphaBIOS firmware use MILO instead. 2)
aboot is free software under the GNU GPL. 3) The current source repository is https://github.com/alphalinux/aboot.
Installing
Packages
Debian packages aboot as aboot, which holds the tools such as swriteboot, and aboot-base, which installs the boot loader itself as /boot/bootlx; the version in unstable is 1.0~pre20200212. 4) 5) Gentoo packages aboot 2.0 as sys-boot/aboot, which also installs /boot/bootlx. 6)
Building
make builds bootlx and the tools, and make install copies bootlx to /boot and swriteboot, abootconf, e2writeboot, and isomarkboot to /sbin; the root make variable sets a different prefix. 7) make netabootwrap builds netabootwrap, which is not part of the default target. 8)
The Makefile cross-compiles by default: bootlx is built with the compiler named by CROSS_COMPILE, by default alpha-unknown-linux-gnu-, while the tools are built with HOSTCC for the machine doing the build. 9) 10) On an Alpha, CROSS_COMPILE is set to nothing; elsewhere it names the installed cross compiler (see Toolchains: Cross compilers):
git clone https://github.com/alphalinux/aboot.git cd aboot make CROSS_COMPILE= # native build on an Alpha make CROSS_COMPILE=alpha-linux-gnu- # cross build with Debian's cross compiler
include/config.h sets the default partition for /etc/aboot.conf, which can also be changed later with abootconf. 11)
Disklabels
A disk booted from SRM must use a BSD disklabel, not an MBR or GPT partition table, because a PC partition table occupies the same place in the first sector as the SRM boot block. 12) 13) Other disks in the system can use any partition table. A BSD disklabel stores each partition's offset and size as a 32-bit count of sectors, so with 512-byte sectors it cannot describe more than 2 TiB of a disk. 14)
Current fdisk from util-linux cannot create BSD disklabels; parted creates one with mktable bsd (see Installation: Partitioning). 15) ARC and AlphaBIOS cannot read BSD disklabels, so a disk cannot be booted from both SRM and AlphaBIOS. 16)
aboot only tries the file system drivers that match the partition type in the disklabel. ext2, ext3, ext4, and XFS use type 8, and UFS type 7. ISO 9660 is only found on devices without a disklabel, such as CDs. 17) Recycled disks with an old PC partition table can confuse installers; erasing the old signatures first, with wipefs -a, avoids this. 18)
swriteboot
swriteboot writes aboot (bootlx) to the start of a disk and updates the boot block: 19) 20)
swriteboot [-f1-8] [-c1-8] [-v] disk bootfile [kernel] swriteboot -c2 /dev/sda /boot/bootlx
- The target is the whole disk (e.g.
/dev/sda), not a partition. 21) - The space before the first partition must be free; starting the first partition at 1 MiB leaves enough room for aboot. 22) If a partition overlaps aboot,
swritebootstops with "bootcode overlaps with partition #n. If you really want this, use -fn". 23) On a disklabel with a whole-diskcpartition, whichparteddoes not create,-f3is needed. 24)-fcan be given more than once. 25) Alternatively, a small first partition can reserve the space, with aboot written over it using-f1. 26) 27) -csets the partition that holds/etc/aboot.conf. Without it,swritebootkeeps the setting of an aboot already on the disk. 28)- On a disk shared with Tru64 UNIX, installing aboot makes the first and third partitions unusable, since they must start at offset 0. 31)
abootconf
abootconf disk [partition] shows or sets the partition that aboot searches for /etc/aboot.conf. 32) The device is the drive, e.g. /dev/sda, and the setting is stored in the aboot image on the disk. 33) swriteboot -c does the same. A newly built aboot searches partition 1. 34) 35)
CDs
isomarkboot image bootlx [root.bin] makes an ISO 9660 image bootable, which works because files on ISO 9660 are contiguous. 36) For example, a rescue CD: 37)
cp -L /vmlinuz /initrd.img /boot/bootlx iso-root/ cp /etc/aboot.conf iso-root/etc/ mkisofs -r -J -o rescue.iso iso-root/ isomarkboot rescue.iso /bootlx
Floppies
e2writeboot writes aboot as a contiguous file on an ext2 floppy and points the boot block at it, 38) and srmbootfat does the same for a file on a FAT floppy. 39)
Booting
aboot takes its arguments from the SRM boot command: 40) 41)
>>> boot dka0 -file 1/vmlinuz -flags "root=/dev/sda3 console=ttyS0" >>> boot dka0 -flags 0 >>> boot dka0 -flags "1:1 single" >>> boot dka0 -flags i
-flagswith kernel arguments passes them to the kernel. The quotes are required when there are spaces. 45)-flagsn boots entry n from/etc/aboot.confon the configured partition.-flagsp:n readsaboot.conffrom partition p instead. Extra kernel arguments can follow after a space. 46) Some SRM versions allow only 8 or 16 characters in the option string, so keeping the kernel arguments inaboot.confand only the entry number in the flags is more robust. 47)-flags i, or empty flags, starts the interactive prompt. If a kernel fails to load, aboot also falls back to the prompt. 48)- Unattended booting is set up with the SRM variables described in Installation: Booting the installed system. 49) Pressing Ctrl+C repeatedly during startup returns to the SRM prompt. 50)
aboot.conf
aboot searches the configured partition for /etc/aboot.conf, /aboot.conf, /etc/aboot.cfg, and /aboot.cfg, in that order. 51) Each line is a single-character label, a colon, a partition and path, and kernel arguments. A # starts a comment, and a line starting with - ends the file. 52) 53)
Paths are relative to the root of the partition. In the following example, /boot is a separate first partition, so the file is /boot/etc/aboot.conf and a kernel installed as /boot/vmlinuz is given as 1/vmlinuz, with the root file system on partition 3: 54)
0:1/vmlinuz root=/dev/sda3 console=ttyS0 1:1/vmlinuz root=/dev/sda3 console=ttyS0 single 2:1/vmlinuz.old root=/dev/sda3 console=ttyS0 3:1/vmlinuz initrd=/initrd.img root=/dev/sda3 console=ttyS0
aboot.conf has no default entry. The default is chosen with the SRM variable boot_osflags. 55) 56)
Interactive mode
The interactive prompt accepts these commands: 57)
| Command | Description |
|---|---|
h, ? | Display the command summary |
q | Halt and return to SRM |
p 1-8 | Use this partition for aboot.conf and kernels |
l | List the entries in aboot.conf |
d dir | List a directory |
b file args | Boot a kernel with arguments; - for a kernel written after aboot |
i file | Use a file as the initial ramdisk |
0-9 | Boot an aboot.conf entry |
For example, b 1/vmlinuz root=/dev/sda3 single. 58)
initrd
An initial ramdisk is given with initrd=path in the flags, or with the i command. It is loaded from the same partition as the kernel, as high in memory as possible. 59) The option must be inside the -flags string, e.g.: 60)
>>> boot dka0 -file 1/vmlinuz -flags "initrd=/initrd.img root=/dev/sda3 console=ttyS0"
Kernel images
aboot loads a kernel that is a 64-bit little-endian Alpha ELF executable, such as the kernel's vmlinux, either uncompressed or compressed with gzip. 61) 62) make boot in the kernel tree builds the gzip-compressed arch/alpha/boot/vmlinux.gz. 63) aboot first tries a file as uncompressed ELF and then as gzip, except that a file whose name ends in .gz is only tried as gzip. 64) Other compression formats, such as bzip2 or xz, are not supported, and fail with "unknown compression method". 65) A kernel written directly after aboot must be uncompressed (see swriteboot).
Network booting
SRM fetches a network boot image itself with BOOTP and TFTP, e.g. boot ewa0 -protocols bootp. 66) Setting ewa0_protocols to bootp makes BOOTP the default instead of MOP. 67) The image is not an ordinary kernel. aboot builds one, containing aboot, a compressed kernel, an initrd, and default arguments, with netabootwrap: 68)
netabootwrap -t netboot.img -k vmlinux.gz -i initrd.gz -a "root=/dev/sda3 console=ttyS0"
Debian built all its netboot installer images this way. 69) The kernel can also build a BOOTP image without aboot, with make bootpfile or, compressed, make bootpzfile, which produce arch/alpha/boot/bootpfile and bootpzfile. 70) Setting the make variable INITRD to a file appends it as an initrd. 71) 72)
The server side needs a DHCP or BOOTP server that gives the system an address, the TFTP server's address, and the image's file name, and a TFTP server that serves the image. With ISC dhcpd, for example: 73)
host alpha {
hardware ethernet 08:00:2B:E7:94:9B;
fixed-address alpha.example.org;
filename "netboot.img";
next-server 192.168.1.1;
}
dnsmasq can provide both servers. It answers BOOTP requests only from hosts given a fixed address with dhcp-host (unless bootp-dynamic is set), and needs a dhcp-range to enable its DHCP server; with enable-tftp, dhcp-boot needs only the file name, which is served from tftp-root: 74)
dhcp-range=192.168.1.100,192.168.1.200 dhcp-host=08:00:2b:e7:94:9b,192.168.1.50,alpha dhcp-boot=netboot.img enable-tftp tftp-root=/srv/tftp
The system then boots with boot ewa0 -flags "", taking the file name from the DHCP server. 75)
File systems
| File system | Notes |
|---|---|
| ext2 | |
| ext3 | Read as ext2, without replaying the journal. 76) |
| ext4 | Extents stored in the inode only; see below. 77) 78) |
| ISO 9660 | Rock Ridge long names and symbolic links are supported. 79) 80) |
| UFS (BSD FFS) | "Not well exercised and may be broken". 81) |
| XFS | Versions 4 and 5. 82) |
aboot does not read Btrfs, FAT, ReiserFS, or Tru64 AdvFS. 83)
aboot 2.0 refuses ext4 file systems with features it cannot read safely, including meta_bg, bigalloc, quota, and more than 2^32 blocks. It only reads extents stored directly in the inode, not deeper extent trees, so a kernel file split into more than four extents cannot be loaded. 84) 85) aboot then prints "Extent tree depth n not supported" or "n extents exceeds the 4 that fit inline". 86) The number of extents in a file can be checked beforehand with filefrag from e2fsprogs, e.g. filefrag /boot/vmlinuz; -v gives more detail. 87) ext2 and ext3 file systems, which map blocks through indirect blocks instead of extents, do not have this limit. 88)
Recovering an unbootable disk
If aboot starts but the kernel fails, boot with -flags i gives aboot's prompt, from which another aboot.conf entry, or a kernel with different arguments, can be booted (see Interactive mode). If SRM instead reports that block 0 of the disk "is not a valid boot block", 89) the disk has no boot block pointing to aboot (see How it works), and aboot has to be written again:
- Boot the installation CD (see Installation: Booting the installer) and get to a shell, e.g. the rescue mode of the installer. 90)
- Run
swritebooton the whole disk, with-cnaming the partition that holdsaboot.conf(see swriteboot). With the layout from Installation: Partitioning, where/bootis partition 1, this ismount /dev/sda1 /mntfollowed byswriteboot -c1 /dev/sda /mnt/bootlx.
Known issues
- Serial console: aboot writes through the SRM console, so with the SRM
consolevariable set toserialits messages and prompt appear on the serial port and nothing appears on the screen. 98) 99) Linux needsconsole=ttyS0in its arguments to use the same port, orconsole=srmon the Marvel systems (ES47, ES80, and GS1280); see Using the SRM Console: Serial console. - UFS and network booting: the aboot 2.0 README describes both as "not well exercised and may be broken". Reading
aboot.conffrom UFS can hang if the entry is not found. 100) - SRM without support for the boot controller: aboot can only boot from devices that SRM can read. Alternatives are a network boot, or aboot and the kernel on a disk on a supported controller. 101)
How it works
The SRM console does not read file systems or partition tables. The first sector of the disk holds the size of the secondary boot loader in 512-byte blocks at offset 480, its starting sector at offset 488, a flag word at offset 496, and a checksum of the first 63 quadwords at offset 504. SRM loads the loader at virtual address 0x20000000 and jumps to it. 102) swriteboot writes aboot starting at sector 2. 103)
aboot then:
- switches from the console PALcode to the OSF/1 PALcode, 104)
- reads the boot device, file, and flags from the SRM environment, 105)
- reads the disk through the SRM console callbacks, 106)
- finds the partition in the BSD disklabel, mounts its file system, and loads the kernel and initrd, 107)
- and jumps to the kernel.
aboot does no low-level hardware setup of its own and relies entirely on the SRM console's services. 108) Errors such as c000000000000000 when opening the boot device therefore come from SRM, not aboot. 109) Because SRM hides the differences between systems, a single aboot binary works on every SRM system. 110)
History
aboot is based on the kernel's own SRM boot loader in arch/alpha/boot, extended by David Mosberger and Michael Schwingen with a prompt for arguments and the /etc/aboot.conf file. 111) Mosberger added file system support, Schwingen the default command line handling, and Dave Larson network booting. 112) The ISO 9660 code came from MILO. 113) David Huggins-Daines merged the patches carried by Red Hat, Debian, and SuSE in version 0.6 in March 2000. 114) Will Woods maintained aboot from 2001 to 2004; his last snapshot was 1.0_pre20040408, and there was never a final 1.0. 115) The alphalinux/aboot repository added cross-compilation, ext4 support (first added in 2017, and extended by Magnus Lindholm with 64-bit group descriptors and multi-extent reads), 116) and XFS support by Jan-Jaap van der Heijden and Lindholm, and was tagged as version 2.0 in September 2026. 117) 118) 119)
Versions
Conflicting information
The following sources conflict with each other or with the account given above. They are listed here for further investigation.
- Space to reserve before the first partition
- swriteboot(8): "It is therefore suggested to reserve the first 512 sectors of a harddisk for boot purposes."
- SRM Firmware Howto, v0.8.1: "We suggest that the disk be partitioned such that the first partition starts at an offset of 2048 sectors."
- "Re: Boot via SRM on poweron", Jay Estabrook, axp-list, 20 Oct 1996: "aboot fits fine in front of partition 1 if you offset the start of partition 1, say 512-1024 sectors"
- Whether the kernel position limit was fixed
- README, aboot 0.9: "Failure to boot when kernel was past the 2GB boundary on ext2 fs fixed"
- "aboot size limitation in Woody", Bob Lindell, debian-alpha, 12 Jul 2004: "I could get aboot to fail to read either the /etc/aboot.conf file or the kernel images if they were too far into the 20GB partition."
- Whether aboot reads ReiserFS
- "reiserfs on all my SRM-alpha drives: how I did it", James D. Freels, debian-alpha, 27 Oct 2001: "aboot does not understand reiserfs"
- "Re: need help with milo and repartitioning", James D. Freels, debian-alpha, 2 Nov 2001: "Therefore, the aboot has read the kernel from a reiserfs."
- Whether network booting works
- SRM Firmware Howto, v0.8.1: "Netboot using the aboot sources is currently broken"
- "Re: [BUG] 2.6.23-rc3 won't boot on alpha (fwd)", Steve Langasek, debian-alpha, 21 Aug 2007, describes
netabootwrapimages as what Debian used for all its netboot installer images.
Documentation
| Document | Part number | Date |
|---|---|---|
| SRM Firmware Howto, v0.8.1 by Rich Payne and David Huggins-Daines, in the aboot repository | February 2004 | |
| Man pages for aboot, aboot.conf, abootconf, swriteboot, e2writeboot, isomarkboot, netabootwrap, and sdisklabel | ||
| README.md (aboot 2.0) | ||
| ChangeLog and README from before aboot 2.0, with the history of versions 0.1 to 1.0_pre20040408 |
See also SRM console: Booting Linux.
