| 1 | = Extlinux for CLFS Builds = |
| 2 | |
| 3 | == Needed Files == |
| 4 | Syslinux [[http://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/syslinux-3.73-pre7.tar.bz2]][[BR]] |
| 5 | |
| 6 | Everything below is only Needed if your following the boot method of the build. |
| 7 | |
| 8 | NASM [[http://voxel.dl.sourceforge.net/sourceforge/nasm/nasm-2.05.01.tar.bz2]][[BR]] |
| 9 | |
| 10 | == Changes for Cross-Tools Section == |
| 11 | |
| 12 | This build is only required if your using the Boot Method of the build. |
| 13 | |
| 14 | === Build Nasm === |
| 15 | |
| 16 | ./configure --prefix=/cross-tools &&[[BR]] |
| 17 | make &&[[BR]] |
| 18 | make install[[BR]] |
| 19 | |
| 20 | == Changes for Boot Section == |
| 21 | |
| 22 | This build is only required if your using the Boot Method of the build. |
| 23 | You can also skip the building of Grub or Lilo. |
| 24 | |
| 25 | === Build Syslinux === |
| 26 | |
| 27 | make CROSS_COMPILE=${CLFS_TARGET}- installer&&[[BR]] |
| 28 | install -d -m 755 /cross-tools/usr/bin&&[[BR]] |
| 29 | install -m 755 mtools/syslinux /cross-tools/usr/bin&&[[BR]] |
| 30 | install -d -m 755 /cross-tools/sbin&&[[BR]] |
| 31 | install -m 755 extlinux/extlinux /cross-tools/sbin&&[[BR]] |
| 32 | install -d -m 755 /cross-tools/usr/share/syslinux&&[[BR]] |
| 33 | install -m 644 mbr/mbr.bin /cross-tools/usr/share/syslinux[[BR]] |
| 34 | |
| 35 | === Configure Extlinux === |
| 36 | |
| 37 | First we erase the current MBR on the disk, next we will install the MBR for Extlinux on |
| 38 | the Primary Boot rive. I will assume the Primary Boot Drive is /dev/sda.[[BR]] |
| 39 | |
| 40 | dd if=/dev/zero of=/dev/sda bs=446 count=1[[BR]] |
| 41 | dd if=/cross-tools/usr/share/syslinux/mbr.bin of=/dev/sda[[BR]] |
| 42 | |
| 43 | Second we will installed the Extlinux.sys file for bootup. This is the bootloader.[[BR]] |
| 44 | install -d ${CLFS}/boot[[BR]] |
| 45 | extlinux --install ${CLFS}/boot[[BR]] |
| 46 | |
| 47 | Now we will create our extlinux.conf file. Change root_device to your root partition of your |
| 48 | Primary Boot Drive.[[BR]] |
| 49 | |
| 50 | cat >> ${CLFS}/boot/extlinux.conf << "EOF"[[BR]] |
| 51 | default boot[[BR]] |
| 52 | prompt 0[[BR]] |
| 53 | timeout 10[[BR]] |
| 54 | [[BR]] |
| 55 | label boot[[BR]] |
| 56 | kernel clfskernel-boot[[BR]] |
| 57 | append rw root=root_device[[BR]] |
| 58 | EOF[[BR]] |
| 59 | |
| 60 | == Changes for Final-System Section == |
| 61 | |
| 62 | === Build Nasm === |
| 63 | |
| 64 | ./configure --prefix=/usr&&[[BR]] |
| 65 | make &&[[BR]] |
| 66 | make install[[BR]] |
| 67 | |
| 68 | |
| 69 | === Build Syslinux === |
| 70 | |
| 71 | Now we will build the final version of the Syslinux, and we will copy the menu.c32 file |
| 72 | over so we can have a menu at bootup. |
| 73 | |
| 74 | make installer&&[[BR]] |
| 75 | make install&&[[BR]] |
| 76 | cp -ar /usr/share/syslinux/menu.c32 /boot[[BR]] |
| 77 | |
| 78 | === Configure Extlinux === |
| 79 | |
| 80 | First we erase the current MBR on the disk, next we will install the MBR for Extlinux on |
| 81 | the Primary Boot rive. I will assume the Primary Boot Drive is /dev/sda. We repeat this |
| 82 | step from above. Reinstalling this ensures us that we are using the currently built |
| 83 | version of the file. When Syslinux is cross-compiled, some files are not made and |
| 84 | the premade ones are. This will ensure that we use the ones we just built.[[BR]] |
| 85 | |
| 86 | dd if=/dev/zero of=/dev/sda bs=446 count=1[[BR]] |
| 87 | dd if=/usr/share/syslinux/mbr.bin of=/dev/sda[[BR]] |
| 88 | |
| 89 | Second we will installed the Extlinux.sys file for bootup. This is the bootloader.[[BR]] |
| 90 | extlinux --install /boot[[BR]] |
| 91 | |
| 92 | Now we will create our extlinux.conf file. Change root_device to your root partition of your |
| 93 | Primary Boot Drive.[[BR]] |
| 94 | |
| 95 | cat >> /boot/extlinux.conf << "EOF"[[BR]] |
| 96 | default menu.c32[[BR]] |
| 97 | prompt 0[[BR]] |
| 98 | menu title CLFS Boot Menu[[BR]] |
| 99 | [[BR]] |
| 100 | timeout 60[[BR]] |
| 101 | [[BR]] |
| 102 | label linux[[BR]] |
| 103 | menu label CLFS Kernel {kernel_version}[[BR]] |
| 104 | menu default[[BR]] |
| 105 | kernel clfskernel-{kernel_version}[[BR]] |
| 106 | append rw root=root_device[[BR]] |
| 107 | [[BR]] |
| 108 | label boot[[BR]] |
| 109 | menu label CLFS Boot Stage Kernel[[BR]] |
| 110 | kernel clfskernel-boot[[BR]] |
| 111 | append rw root=root_device[[BR]] |
| 112 | EOF[[BR]] |
| 113 | |