Index: BOOK/boot/x86_64-64-chapter.xml
===================================================================
--- BOOK/boot/x86_64-64-chapter.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/boot/x86_64-64-chapter.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -23,5 +23,7 @@
-
+
+
+
@@ -30,5 +32,5 @@
-
+
Index: BOOK/boot/x86_64-64/bin86.xml
===================================================================
--- BOOK/boot/x86_64-64/bin86.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/boot/x86_64-64/bin86.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,63 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+ Bin86-&bin86-version;
+
+
+ Bin86
+ boot
+
+
+
+
+
+ Installation of Bin86
+
+ We are building bin86 so that we can compile lilo.
+ Both as86 and ld86 need to
+ run on the host system to assemble x86_64 code. We cannot
+ compile the whole package like this, but fortunately these two
+ programs are the only parts we require.
+
+
+
+
+
+ The Bin86 package does not contain a configure
+ script. Natively compile only the necessary parts with:
+
+
+make CC=gcc -C as as86
+make CC=gcc -C ld ld86
+
+ Install the assembler and linker where they will be on
+ the PATH when we build lilo, using prefixes to show that their
+ output is not for a native system.
+
+install -v -m 755 -s as/as86 /cross-tools/bin/${LFS_TARGET}-as86
+install -v -m 755 -s ld/ld86 /cross-tools/bin/${LFS_TARGET}-ld86
+
+
+
+
+
+
+ Details on this package are located in
+
+
+
+
Index: BOOK/boot/x86_64-64/bootloaders.xml
===================================================================
--- BOOK/boot/x86_64-64/bootloaders.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/boot/x86_64-64/bootloaders.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,36 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+ Building a bootloader
+
+ On x86 and x86_64 (multilib) architectures, the preferred
+ bootloader is Grub. Unfortunately, Grub doesn"t work on x86_64
+ Pure64 - the stage2 files can be correctly built as 32-bit, but the
+ grub shell is a 64-bit program, and tries to execute some of the
+ stage2 routines - this results in a segmentation fault. Therefore,
+ in the final system we use Lilo as the bootloader.
+
+
+ If you already have a bootloader, such as Grub, installed on
+ the system then you should use that to make your new kernel bootable.
+
+
+
+ We will now cross-compile Bin86 and Lilo - these instructions
+ assume you are using an x86_64 machine (e.g. booted fron a Live CD),
+ either pure64 or multilib. This approach will not work if you are
+ running the machine as i686, because a 32-bit kernel will not be
+ able to execute a 64-bit binary to install the bootloader. If that
+ is the case, you will need to install an i686 bootloader on the
+ host system.
+
+
+
+
Index: OK/boot/x86_64-64/grub-build.xml
===================================================================
--- BOOK/boot/x86_64-64/grub-build.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ (revision )
@@ -1,85 +1,0 @@
-
-
- %general-entities;
-]>
-
-
-
-
- GRUB-&grub-version;
-
-
- GRUB
- boot
-
-
-
-
-
- Installation of GRUB
-
-
-
-
-
-
-
-
-
-
-
-
-
-./configure --prefix=/usr --host=${LFS_TARGET}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Details on this package are located in
-
-
-
-
Index: BOOK/boot/x86_64-64/lilo-build.xml
===================================================================
--- BOOK/boot/x86_64-64/lilo-build.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/boot/x86_64-64/lilo-build.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,53 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+ Lilo-&lilo-version;
+
+
+ Lilo
+ boot
+
+
+
+
+
+ Installation of Lilo
+
+ The following patch forces lilo to use our cross-compiler
+ (except for a couple of utilities which run during the compile),
+ and to look for as86 and ld86 under the names by which we installed
+ them.
+
+patch -Np1 -i ../&lilo-cross-x86_64-patch;
+
+ Compile the program which installs the loader, linking
+ it statically so that it does not have to link to host libraries
+ when it runs:
+
+make lilo-static
+
+ Install only the parts we need:
+
+install -v -m755 lilo-static /tools/bin
+install -v -m755 keytab-lilo.pl /tools/bin
+
+
+
+
+
+
+ Details on this package are located in
+
+
+
+
Index: BOOK/boot/x86_64-64/lilo.xml
===================================================================
--- BOOK/boot/x86_64-64/lilo.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/boot/x86_64-64/lilo.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,115 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+ Making the LFS System Bootable
+
+
+ Lilo
+ configuring
+
+
+ You are nearly ready to boot to the new temporary system.
+ One of the last things to do is to ensure that the system can be booted.
+ The instructions below apply only to x86_64 machines on which lilo is going
+ to be installed. Information on using a pre-installed Grub on machines
+ currently running as x86 or x86_64 multilib should be available in the
+ usual resource-specific locations for those architectures. If you have
+ installed an x86 version of lilo, these instructions should be modified
+ to refer to the lilo and keytab-lilo.pl
+ commands you installed on the host system.
+
+
+
+ If you have multiple systems on your machine using a different
+ bootloader such as grub, you may prefer to use that instead - consult the
+ appropriate documentation. The rest of this section assumes you are going
+ to use lilo.
+
+ Earlier, we compiled and installed the Lilo boot loader software
+ in preparation for this step. The procedure involves writing a boot image to
+ a specific location on the hard drive. If you have a floppy disk drive, or
+ if you have installed a cd recording program, we highly recommend using
+ mkrescue to create a Lilo boot floppy, or CD (using e.g. dvdrecord from
+ dvdrtools) as a test and as a backup.
+
+ Normally, you interact with lilo by using the cursor and enter
+ keys to select from the available option(s), but sometimes it is necessary to
+ add other boot options, such as e.g. 'init=/bin/bash' to debug boot failures.
+ The more your keyboard layout differs from the US qwerty layout, the harder
+ it will be to type boot options unless lilo knows about your keyboard layout.
+ So, we will create a key table for Lilo (.ktl) file - at one point in the
+ documentation these are referred to as .klt files, which may be a typo, but
+ has been followed by some distros. The name, and location, are not important
+ but it is conventional to put these in /boot with the name representing the
+ key layout. For a British keyboard layout, the following command will
+ achieve this:
+
+keytab-lilo.pl uk >i${LFS}/boot/uk.ktl
+
+ The argument to the command is the name of the keymap, or if
+ necessary you can specify the full path to the keymap. Use whatever
+ is appropriate for your keyboard.
+
+ The next step is to create /etc/lilo.conf
+
+cat > ${LFS}/etc/lilo.conf << "EOF"
+# Begin /etc/lilo.conf
+# lilo.conf
+#
+# global options
+boot=/dev/<bootdisk>
+keytable=/boot/<keytable>
+lba32
+map=/boot/map
+prompt
+
+# set the name of the default image to boot
+default=lfs
+
+# define an image
+image=/boot/lfskernel
+ label=lfs
+ root=/dev/<partition>
+ read-only
+# optionally add parameters to pass, e.g.
+# append="video=radeonfb:1024x768-16@70"
+
+# if you had an existing system, you could
+# add its details here.
+EOF
+
+
+ Replace <bootdisk> with the name of the disk (or
+ partition) on which the boot sector is to be written, e.g. sda. Replace
+ <keytable> with the name of the keytable file you created, and
+ <partition> with the name of the root partition for the new
+ system.
+
+
+
+ The following command will overwrite any current boot loader.
+ Do not run the command if this is not desired. If you have
+ cross-compiled on a different machine from the target, you must
+ install the bootloader on the target machine, the installed boot
+ block is not a file which can be copied with tar.
+
+
+
+ Run Lilo:
+
+/tools/bin/lilo-static -v
+
+
+
+
Index: BOOK/bootable/x86_64-64-chapter.xml
===================================================================
--- BOOK/bootable/x86_64-64-chapter.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/bootable/x86_64-64-chapter.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,19 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+
+ Making the LFS System Bootable
+
+
+
+
+
+
+
Index: BOOK/bootable/x86_64-64/lilo.xml
===================================================================
--- BOOK/bootable/x86_64-64/lilo.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/bootable/x86_64-64/lilo.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,136 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+ Making the LFS System Bootable
+
+
+ Lilo
+ configuring
+
+
+ Your shiny new LFS system is almost complete. One of the
+ last things to do is to ensure that the system can be properly
+ booted. The instructions below apply only to computers using lilo,
+ which in the context of this book means x86_64 Pure64 systems.
+ Information on boot loading
for other architectures
+ should be available in the usual resource-specific locations for
+ those architectures.
+
+
+
+ If you have multiple systems on your machine using a
+ different bootloader such as Grub, you may prefer to use that
+ instead - consult the appropriate documentation. The rest of
+ this section assumes you are going to use Lilo.
+
+ Earlier, we compiled and installed the Lilo boot loader
+ software in preparation for this step. The procedure involves
+ writing a boot image to a specific location on the hard drive.
+ We highly recommend using mkrescue to create a Lilo boot CD
+ (using e.g. dvdrecord from dvdrtools) as a backup (this requires
+ loopback block device support in the kernel).
+
+ Normally, you interact with lilo by using the cursor
+ and enter keys to select from the available
+ option(s), but sometimes it is necessary to add other boot
+ options, such as e.g. 'init=/bin/bash' to debug boot failures.
+ The more your keyboard layout differs from the US qwerty layout,
+ the harder it becomes to type boot options unless lilo knows
+ about your keyboard layout. So, we will create a key table for
+ Lilo (.ktl) file - at one point in the documentation these are
+ referred to as .klt files, which may be a typo, but has been
+ followed by some distros. The name, and location, are not
+ important but it is conventional to put these in /boot with
+ the name representing the key layout. For a British keyboard
+ layout, the following command will achieve this:
+
+keytab-lilo.pl uk >/boot/uk.ktl
+
+ The argument to the command is the name of the keymap,
+ or if necessary you can specify the full path to the keymap. Use
+ whatever is appropriate for your keyboard.
+
+ When the x86 LFS book used to include Lilo, it
+ advised against running it from chroot in case the MBR became
+ corrupted. Provided you have /proc mounted and have device special
+ files for the disks, it seems to be safe to run recent versions of
+ Lilo in chroot, although it is always possible that an updated
+ bootloader, or defective configuration file, may render the system
+ unbootable.
+
+ The next step is to create /etc/lilo.conf
+
+cat > /etc/lilo.conf << "EOF"
+# Begin /etc/lilo.conf
+# lilo.conf
+#
+# global options
+boot=/dev/<bootdisk>
+keytable=/boot/<keytable>
+lba32
+map=/boot/map
+prompt
+
+# set the name of the default image to boot
+default=lfs
+
+# define an image
+image=/boot/lfskernel
+ label=lfs
+ root=/dev/<partition>
+ read-only
+# optionally add parameters to pass, e.g.
+# append="video=radeonfb:1024x768-16@70"
+
+# repeat for any other kernel images
+
+# optionally, add legacy operating systems
+# see man lilo.conf for examples
+EOF
+
+
+ Replace <bootdisk> with the name of the disk (or
+ partition) on which the boot sector is to be written, e.g. sda.
+ Replace <keytable> with the name of the keytable file you
+ created, and <partition> with the name of the root partition
+ for the new system.
+
+
+
+ The following command will overwrite the current boot loader.
+ Do not run the command if this is not desired.
+
+
+ Run Lilo:
+
+/sbin/lilo -v
+
+
+ People who have been used to GRUB need to be aware that
+ lilo works differently - in particular, you cannot edit the
+ available choices as you can in the grub shell, and lilo records
+ the block addresses of the kernels into the boot blocks each time
+ /sbin/lilo is run. This means that when you compile a new kernel,
+ you have to add it to /etc/lilo.conf and rerun /sbin/lilo. It
+ also means that if you recompile an existing kernel and save it
+ to the same name you still have to rerun /sbin/lilo in case it now
+ occupies different blocks on the filesystem.
+
+
+ If you are running multiple systems on this box and
+ using lilo, it is a good idea to ensure that each system is running
+ the same version of lilo, otherwise an old version may not be able
+ to overwrite the bootloader from a newer version. You will also
+ need to ensure that the copies of /etc/lilo.conf on each system are
+ kept synchronised.
+
+
Index: BOOK/final-system/x86_64-64-chapter.xml
===================================================================
--- BOOK/final-system/x86_64-64-chapter.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/final-system/x86_64-64-chapter.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -66,5 +66,6 @@
-
+
+
Index: BOOK/final-system/x86_64-64/bin86.xml
===================================================================
--- BOOK/final-system/x86_64-64/bin86.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/final-system/x86_64-64/bin86.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,127 @@
+
+
+ %general-entities;
+]>
+
+
+
+ Bin86-&bin86-version;
+
+
+ Bin86
+
+
+
+
+
+ The Bin86 package contains an assembler and linker to produce
+ 16 or 32-bit 8086 machine code.
+
+
+ &dependencies;
+
+
+ Bash, Binutils, Coreutils, GCC, Glibc, Make
+
+
+
+
+
+
+
+
+ Installation of Bin86
+
+ We are building bin86 because it is required to
+ compile lilo, and at the moment no other bootloader builds and runs
+ on a pure64 system. If your machine has multiple systems (i.e. x86
+ or multilib) you may prefer to use the bootloader from those
+ systems, such as grub.
+
+ This patch updates bin86 to compile on x86_64:
+
+patch -Np1 -i ../&bin86-x86_64-patch;
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make PREFIX=/usr install
+
+
+
+
+ Contents of Bin86
+
+
+ Installed programs
+
+
+ as86, ld86, nm86, objdump86, size86
+
+
+
+
+ Short Descriptions
+
+
+
+
+ as86
+
+ An 8086 assembler
+
+ as86
+
+
+
+
+
+ ld86
+
+ A linker for the object files produced by as86
+
+ ld86
+
+
+
+
+
+ nm86
+
+ Symbolic link to objdump86
+
+ nm86
+
+
+
+
+
+ objdump86
+
+ A utility to examine and report on the output from as86 and ld86
+
+ objdump86
+
+
+
+
+
+ size86
+
+ Symbolic link to objdump86
+
+ size86
+
+
+
+
+
+
+
+
+
Index: OK/final-system/x86_64-64/grub.xml
===================================================================
--- BOOK/final-system/x86_64-64/grub.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ (revision )
@@ -1,75 +1,0 @@
-
-
- %general-entities;
-]>
-
-
-
- GRUB-&grub-version;
-
-
- GRUB
-
-
-
-
-
- Installation of GRUB
-
-
-
- This patch updates grub to work in a Pure64 environment:
-
-patch -Np1 -i ../&grub-pure64-patch;
-
- Make the source package aware of the patch:
-
-autoreconf
-
-
-
-./configure --prefix=/usr --host=$(LFS_TARGET)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: BOOK/final-system/x86_64-64/lilo.xml
===================================================================
--- BOOK/final-system/x86_64-64/lilo.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
+++ BOOK/final-system/x86_64-64/lilo.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -0,0 +1,121 @@
+
+
+ %general-entities;
+]>
+
+
+
+ Lilo-&lilo-version;
+
+
+ Lilo
+
+
+
+
+
+ The Lilo package contains the Linux Loader, a bootloader.
+
+ We have chosen to use lilo because at the moment no other
+ bootloader builds and runs on a pure64 system. If your machine has
+ multiple systems (i.e. x86 or multilib) you may prefer to use the
+ bootloader from the other system, such as grub.
+
+
+ &dependencies;
+
+
+ Bash, Bin86, Binutils, Coreutils, GCC, Glibc, Make, Sed
+
+
+
+
+
+
+
+
+ Installation of Lilo
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make install
+
+ At the end of the installation the make install process will
+ print a message stating that /sbin/lilo has to be executed to
+ complete the update. Don"t do this as it has no use. The
+ /etc/lilo.conf isn"t present yet. We will complete the
+ installation of lilo in chapter 12.
+
+
+
+
+ Contents of Lilo
+
+
+ Installed programs
+
+
+ diag1.img, lilo, mkrescue, keytab-lilo.pl
+
+
+
+
+ Short Descriptions
+
+
+
+
+ diag1.img
+
+ A diagnostic disk boot image.
+
+ diag1.img
+
+
+
+
+
+ lilo
+
+ Lilo installs the Linux boot loader which is used to start
+ a Linux system.
+
+ lilo
+
+
+
+
+
+ mkrescue
+
+ A script to make a bootable floppy or CD image using the
+ default settings from the configuration file.
+
+ mkrescue
+
+
+
+
+
+ keytab-lilo.pl
+
+ A perl script to create a keyboard translation table to
+ allow the bootloader to process keystrokes to match your
+ keyboard layout.
+
+ keytab-lilo.pl
+
+
+
+
+
+
+
+
+
Index: BOOK/general.ent
===================================================================
--- BOOK/general.ent (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/general.ent (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -1,5 +1,5 @@
-
+
@@ -16,5 +16,5 @@
-
+
Index: BOOK/introduction/x86_64-64/changelog.xml
===================================================================
--- BOOK/introduction/x86_64-64/changelog.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/introduction/x86_64-64/changelog.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -33,4 +33,13 @@
-->
+
+ March 12, 2006
+
+
+ [ken] - Use Lilo, because the grub shell segfaults.
+
+
+
+
Index: BOOK/materials/x86_64-64/packages.xml
===================================================================
--- BOOK/materials/x86_64-64/packages.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/materials/x86_64-64/packages.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -14,7 +14,14 @@
- GRUB (&grub-version;) - &grub-size;:
+ Bin86 (&bin86-version;) - &bin86-size;:
-
+
+
+
+
+
+ Lilo (&lilo-version;) - &lilo-size;:
+
+
@@ -22,5 +29,5 @@
- Total size of these packages: about 38 MB
+ Total size of these packages: about 469 KB
Index: BOOK/materials/x86_64-64/patches.xml
===================================================================
--- BOOK/materials/x86_64-64/patches.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/materials/x86_64-64/patches.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -12,4 +12,12 @@
+
+
+ Bin86 x86_64 Patch - 2 KB:
+
+
+
+
-
- Grub Pure 64 Patch - 4 KB:
+
+ Lilo x86_64 Cross Compile Patch - 1 KB:
+ url="&patches-root;lilo/&lilo-cross-x86_64-patch;"/>
Index: BOOK/packages.ent
===================================================================
--- BOOK/packages.ent (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/packages.ent (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -24,4 +24,8 @@
+
+
+
+
@@ -153,4 +157,8 @@
+
+
+
+
Index: BOOK/patches.ent
===================================================================
--- BOOK/patches.ent (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/patches.ent (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -74,4 +74,10 @@
+
+
+
+
+
+
Index: BOOK/x86_64-64-index.xml
===================================================================
--- BOOK/x86_64-64-index.xml (revision 59622b9652ccf3c11fb552829e7b0aa38d082c6a)
+++ BOOK/x86_64-64-index.xml (revision 48b28abb908fefb4a7bbe5da54ce9678c1798148)
@@ -62,5 +62,5 @@
-
+