LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Arch (https://www.linuxquestions.org/questions/arch-29/)
-   -   mkinitcpio - some clarification needed (https://www.linuxquestions.org/questions/arch-29/mkinitcpio-some-clarification-needed-458321/)

Ipsofacto 06-26-2006 12:00 AM

mkinitcpio - some clarification needed
 
I thought i'd have a go at using this. Can anyone advise on what's the best way to configure hooks for optimal booting speed?

Below are the important bits of my /etc/mkinitcpio.conf

Code:

MODULES="generic via82cxxx ext3 ide_disk"

HOOKS="base autodetect ide filesystems"

Do I need to include 'ide' and 'filesystems' as I have specified those in the modules section?

Also, what's the deal with the Beyond kernel? I can boot my Beyond kernel if I change my initrd entry via /boot/grub/menu.lst to the following, but I dont see the advantages to be had, as the image was created using /etc/mkinitcpio.conf - there's not a /etc/mkinitcpio-beyond.conf.

Here's my /boot/grub/menu.lst

Code:

title Arch Linux BEYOND
root (hd0,1)
kernel /boot/vmlinuz26beyond root=/dev/hda2 video=vesafb:ywrap,mtrr,1280x1024-32@60 splash=silent,theme:darch console=tty1 quiet ro
initrd /boot/initramfs-beyond.img

# (0) Arch Linux - stock kernel & cpio
title  Arch Linux
root  (hd0,1)
kernel /boot/vmlinuz26 root=/dev/hda2 ro quiet vga=0x31a
initrd /boot/kernel26.img

# (0) Arch CPIO - beyond & cpio
title  Arch CPIO
root  (hd0,1)
kernel /boot/vmlinuz26beyond root=/dev/hda2 video=vesafb:ywrap,mtrr,1280x1024-32@60 splash=silent,theme:darch console=tty1 quiet ro
initrd /boot/initcpio.img

I hope the above makes sense. Would be grateful for some clarification!

JunctaJuvant 06-26-2006 10:31 AM

Interesting stuff! I don't use mkinitcpio (yet), but have you read the Configuring mkinitcpio page on the ArchWiki? AFAICT, you should *not* remove the 'ide' and 'filesystems' hooks. Unfortunately, I am not entirely sure what the deal is with "beyond", but according to the wiki there should exist a /boot/mkinitcpio-kernel26beyond.conf file with default settings. So perhaps that is why no /etc/mkinitcpio-beyond.conf is required? Sorry, I'm a bit out of my depth here. Hope that helps anyway.

Ipsofacto 06-26-2006 12:27 PM

Thanks for the reply.

As I understand it, the info on the wiki tends to be a bit contradictory, eg this:

Quote:

There will be 2 images created during kernel installation/upgrade:
- kernel26
- kernel26beyond (2.6.17 not yet available)
Seems to contradict this:

Quote:

You can use mkinitcpio with any kernel, so kernel26 and kernel26-beyond users are encouraged to try it.
I have successfully booted the stock kernal using only the 'base' and 'autodetect' parameter as I have specified my modules. And this from /etc/mkinitcpio.conf:

Quote:

'filesystems' is _required_ unless you specify your fs modules in MODULES
@Junctajuvant
Quote:

according to the wiki there should exist a /boot/mkinitcpio-kernel26beyond.conf file with defaults
Afraid not - here's what I have in mine:
Code:

ls /boot/
System.map26            grub                  initrd26-full.img  kernel26-fallback.img    vmlinuz26beyond
System.map26beyond      initcpio.img          initrd26.img      kernel26.img
diag1.img                initramfs-ARCH.img    kconfig26          mkinitcpio-kernel26.conf
fbsplash-darch-1024x768  initramfs-beyond.img  kconfig26beyond    vmlinuz26

As you can see, I have the stock kernel & beyond kernel; the original initrd26.img, my beyond initramfs-beyond.img; and the *new* stock kernel image 'kernel26.img' and the initcpio.img but no arch26beyond.img.

So, I guess my original questions still stand, eg when will there be an upgrade - if that's what is gonna happen - so that theres a /etc/mkinitcpio-beyond.conf which will create a kernel26beyond.img, and what are the best hook parameters to specify for optimal booting?

Yikes, this is giving me a headache....

ethics 06-27-2006 07:07 PM

Code:

total 22080
-rw-r--r-- 1 root root  687101 2006-06-20 11:35 System.map26
-rw-r--r-- 1 root root  694028 2006-06-26 03:20 System.map26beyond
drwxr-xr-x 2 root root    4096 2006-06-28 00:17 grub
-rw-r--r-- 1 root root 2628308 2006-06-27 23:13 initramfs-beyond.img
-rw-r--r-- 1 root root 3488904 2006-06-28 00:11 initrd26-full.img
-rw-r--r-- 1 root root 2672725 2006-06-28 00:11 initrd26.img
-rw-r--r-- 1 root root  60058 2006-06-28 00:10 kconfig26
-rw-r--r-- 1 root root  60379 2006-06-27 23:12 kconfig26beyond
-rw-r--r-- 1 root root 3390987 2006-06-28 00:11 kernel26-fallback.img
-rw-r--r-- 1 root root 1146294 2006-06-28 00:11 kernel26.img
-rw-r--r-- 1 root root 3270112 2006-06-27 23:12 kernel26beyond-fallback.img
-rw-r--r-- 1 root root 1168490 2006-06-27 23:12 kernel26beyond.img
-rw-r--r-- 1 root root    2263 2006-06-20 11:36 mkinitcpio-kernel26.conf
-rw-r--r-- 1 root root    2263 2006-06-26 03:21 mkinitcpio-kernel26beyond.conf
-rw-r--r-- 1 root root 1734586 2006-06-20 11:35 vmlinuz26
-rw-r--r-- 1 root root 1523540 2006-06-26 03:20 vmlinuz26beyond

that is my /boot directory after the latest upgrades including mkinitcpio it created the images for stock and beyond right off the bat (maybe because i was updating from the beyond kernel boot?)

It updated mine fine it seems, my mkinitcpio-kernel26beyond.conf is as follows if yo uwant to use it as a guide

Code:

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#    MODULES="piix ide_disk reiserfs"
MODULES=""

# BINARIES
# This setting includes, into the CPIO image, and additional
# binaries a given user may wish.  This is run first, so may
# be used to override the actual binaries used in a given hook.
# (Existing files are NOT overwritten is already added)
# BINARIES are dependancy parsed, so you may safely ignore libraries
#BINARIES=""

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in anyway.  This is useful for config files.
# Some users may wish to include modprobe.conf for custom module options,
# like so:
#    FILES="/etc/modprobe.conf"
FILES=""

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'modload' may be used in place of 'udev', but is not recommended
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
#    This setup specifies all modules in the MODULES setting above.
#    No raid, lvm, or encrypted root is needed.
#    HOOKS="base"
#
#    This setup will autodetect all modules for your system and should
#    work as a sane default
#    HOOKS="base udev autodetect ide scsi sata filesystems"
#
#    This setup will generate a 'full' image which supports most systems.
#    No autodetection is done.
#    HOOKS="base udev ide scsi sata usb filesystems"
#
#    This setup assembles an ide raid array with an encrypted root FS.
#    Note: See 'mkinitcpio -H raid' for more information on raid devices.
#    HOOKS="base udev ide filesystems raid encrypt"
#
#    This setup loads an LVM volume group on a usb device.
#    HOOKS="base udev usb filesystems lvm"
HOOKS="base udev ide scsi sata usbinput filesystems"

Note: i have not tweaked myinitcpio atall, it still has the default hooks

Ipsofacto 06-28-2006 08:53 AM

Ethics - thanks for this.

In light of my original post, I realise that I misread the wiki (wouldnt be a first). I thought that the mkinitcpio-kernel26beyond.conf file was situated in /etc, but on rereading the wiki that file should be in /boot. :tisk:

Quote:

Note: i have not tweaked myinitcpio atall, it still has the default hooks
When you have tweaked your mkinitcpio, I would be interested to see how you have set up your hooks.


Edit - just after posting this I noticed the wiki updated. Syu'd and above files now generated. All good.


All times are GMT -5. The time now is 07:21 PM.