注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Extlinux"

From Funtoo
Jump to navigation Jump to search
Line 1: Line 1:
== What is extlinux? ==
== What is extlinux? ==
{{Warning|with e2fsprogs-1.43, mke2fs have the metadata_csum and 64bit features enabled by default. Extlinux does not support this. Users have to edit <code>/etc/mke2fs.conf</code> to disable this features '''before''' partioning drive. Otherwise, extlinux will not boot. Ref. [1], [2].}}
{{Warning|with e2fsprogs-1.43, mke2fs have the metadata_csum and 64bit features enabled by default. Extlinux does not support booting from partitions formatted with 64-bit ext4. Users have to edit <code>/etc/mke2fs.conf</code> to disable this features '''before''' partioning drive. Otherwise, extlinux will not boot. Ref. [1], [2].}}
extlinux is a simple and modern systemloader bundled with the syslinux tools. Installation is simple and fast, in Funtoo the configuration is easily automated.
extlinux is a simple and modern systemloader bundled with the syslinux tools. Installation is simple and fast, in Funtoo the configuration is easily automated.



Revision as of 14:22, September 8, 2016

What is extlinux?

   Warning

with e2fsprogs-1.43, mke2fs have the metadata_csum and 64bit features enabled by default. Extlinux does not support booting from partitions formatted with 64-bit ext4. Users have to edit /etc/mke2fs.conf to disable this features before partioning drive. Otherwise, extlinux will not boot. Ref. [1], [2].

extlinux is a simple and modern systemloader bundled with the syslinux tools. Installation is simple and fast, in Funtoo the configuration is easily automated.

Installing extlinux

root # emerge syslinux

with that you have the complete syslinux tools installed. Another helpful tool you should merge with syslinux is slashbeast's lazykernel tool, so let us merge it too:

root # emerge lazykernel

Installing extlinux

to install extlinux just follow these steps:

root # install -d /boot/extlinux
root # extlinux --install /boot/extlinux

The next steps are different depending on if you use an MBR or GPT setup and the HDD you installed on and want to boot from. Let us assume that /dev/sda is the drive you will be booting from.

MBR

If you set up your disk with a MBR partition scheme, run the following:

root # dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sda
root # cp /usr/share/syslinux/menu.c32 /boot/extlinux/
root # cp /usr/share/syslinux/libutil.c32 /boot/extlinux/
root # touch /boot/extlinux/extlinux.conf

GPT

On the other hand, if you te up your disk using GPT, run these commands:

root # sgdisk /dev/sda --attributes=1:set:2
root # sgdisk /dev/sda --attributes=1:show
1:2:1 (legacy BIOS bootable)
root # dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda
root # cp /usr/share/syslinux/menu.c32 /boot/extlinux/
root # cp /usr/share/syslinux/libutil.c32 /boot/extlinux/
root # touch /boot/extlinux/extlinux.conf

Setting up the Kernel

Now if you followed our advice to install lazykernel we have a pretty nice way to solve all the setup with a bit of prework and finish it then. If not you should go to the manual part. :)

lazykernel way

Edit /etc/lazykernel.conf:

   /etc/lazykernel.conf
# After configuring, hash or remove line below.
#CONFIGUREFIRST

# Number of the kernels to keep so `lazykernel clean` will not propose to remove them. Default: 3
keep_kernels=5

# Sort kernels by 'version' (biggest version first) or by 'mtime' (latest images first). Default: mtime
# Sorting by version may fail and 3.3.0-rc2 will be marked as newer than 3.3.0.
#sort_by='version'
sort_by=mtime

# The name for menu entry.
menu_entry_name="Funtoo Linux"

# Specify what initramfs image to use, if any. (Optional)
initramfs='initramfs.cpio.gz'

# Append kernel params, usualy you use it to specify rootfs device, but you can use it to pass switches to initramfs as well. 
kernel_params="rootfstype=ext4 luks enc_root=/dev/sdb3 lvm root=/dev/mapper/vg-root uswsusp resume=/dev/mapper/vg-swap"
   Note
Please make sure to comment out or delete the second line of the config file...else it will spit out an error.

Now let us setup our kernel with lazykernel. If you have a manual kernel just run:

root # cd <kernel build dir>
root # lazykernel auto

This will generate the modules for you. Copy your kernel form /usr/src/linux to /boot and generate the /boot/extlinux/extlinux.conf. The manual kernel will be the only one supported by lazykernel.

manual extlinux.conf

For other kernels, like those created by genkernel or by the binary USE-flag you need to edit your config by yourself. Just open /boot/extlinux/extlinux.conf in your favorite editor:

   /boot/extlinux/extlinux.conf
TIMEOUT 30
UI menu.c32

MENU TITLE Boot Menu
MENU COLOR title        1;37;40
MENU COLOR border       30;40
MENU COLOR unsel        37;40

LABEL funtoo1
        MENU LABEL Funtoo Linux KERNEL-VERSION
        LINUX /<kernel>
        INITRD /<initramfs>
        APPEND rootfstype=ext4 luks enc_root=/dev/sdb3 lvm root=/dev/mapper/vg-root uswsusp resume=/dev/mapper/vg-swap

That's all. You are now ready for boot. You can also define several LABELs in that list to have multiple kernel selections to choose from before booting.