# cannot make install kernel (SOLVED)

## essexer

When I compile the gentoo-sources, after 

```
make && make modules_install
```

 I failed to run 

```
make install
```

It gives the error  *Quote:*   

> sh /usr/src/linux-2.6.29-gentoo-r5/arch/x86/boot/install.sh 2.6.29-gentoo-r5 arch/x86/boot/bzImage System.map "/boot"
> 
> Cannot find LILO

 

But I'm using grub. Could you tell me what's happening please?

SimonLast edited by essexer on Fri Jul 24, 2009 4:07 pm; edited 1 time in total

----------

## vincent-

Try cleaning first with

```
make mrproper
```

and then

```
make menuconfig
```

```
make && make modules_install
```

----------

## cach0rr0

there shouldn't be any need to run a 'make install'

if you follow the handbook, it tells you how to do everything by hand, step by step

```

make && make modules_install

```

then make sure /boot is mounted (you should have mounted it before you chrooted)

```

cp /usr/src/linux/arch/x86/boot/bzImage /boot/kernel-new

```

then edit /boot/grub/grub.conf to have

```

title Gentoo 

root (hd0,0)

kernel /boot/kernel-new root=/dev/sda3

```

Replace 'sda3' with whatever is appropriate for your root partition

as well in some cases it wont be hd0,0, but something else

No need to do `make install` - the above is the correct procedure for building and deploying a new kernel in most gentoo installations

Once you've done that

```

emerge grub

grub-install --no-floppy /dev/sda

```

(replacing sda with whatever is appropriate)

If you're lost, consult the handbook, as all of the above is documented there  :Smile: 

----------

## cach0rr0

also should point out, you need to have populated /etc/mtab (as per the handbook) before doing grub-install

Mine is below, however it will look considerably different from yours, as I'm using LVM && dmcrypt, with only small partitions for root and boot

```

/dev/sda2 / reiserfs rw,noatime 0 0

proc /proc proc rw,nosuid,nodev,noexec 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0

udev /dev tmpfs rw,nosuid,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0

/dev/mapper/crypt-usr /usr reiserfs rw,noatime 0 0

/dev/mapper/crypt-home /home xfs rw,noatime,logbufs=8 0 0

/dev/mapper/crypt-opt /opt xfs rw,noatime,logbufs=8 0 0

/dev/mapper/crypt-var /var reiserfs rw,noatime 0 0

/dev/mapper/crypt-tmp /tmp reiserfs rw,noatime 0 0

shm /dev/shm tmpfs rw,noexec,nosuid,nodev 0 0

usbfs /proc/bus/usb usbfs rw,noexec,nosuid,devmode=0664,devgid=85 0 0

binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0

nfsd /proc/fs/nfsd nfsd rw,noexec,nosuid,nodev 0 0

/dev/sda1 /boot ext2 rw,noatime 0 0

```

For most, your /etc/mtab should look something like

```

/dev/sda3 / reiserfs rw,noatime 0 0

proc /proc proc rw,nosuid,nodev,noexec 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0

udev /dev tmpfs rw,nosuid,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0

shm /dev/shm tmpfs rw,noexec,nosuid,nodev 0 0

usbfs /proc/bus/usb usbfs rw,noexec,nosuid,devmode=0664,devgid=85 0 0

binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0

/dev/sda1 /boot ext2 rw,noatime 0 0

```

if you use my examples, adjust sda1/sda3 as is appropriate for your installation

----------

## cyrillic

 *essexer wrote:*   

> 
> 
> ```
> make install
> ```
> ...

 

Have you updated sys-apps/debianutils recently ?

It is possible that /sbin/installkernel (used by the kernel's "make install") no longer supports old versions of grub.

I currently use grub2, and "make install" continues to be my preferred way to install a new kernel.

----------

## cach0rr0

 *cyrillic wrote:*   

> 
> 
> I currently use grub2, and "make install" continues to be my preferred way to install a new kernel.

 

Is there any advantage to this, or is it a matter of familiarity?

----------

## RedSquirrel

 *cach0rr0 wrote:*   

>  *cyrillic wrote:*   
> 
> I currently use grub2, and "make install" continues to be my preferred way to install a new kernel. 
> 
> Is there any advantage to this, or is it a matter of familiarity?

 

Try it yourself sometime and see. Running 'make install' automatically manages symlinks under /boot: vmlinuz and vmlinuz.old (among other things). If you setup grub.conf to use these symlinks, you never have to touch grub.conf again.

Here are my grub stanzas, for example:

```
title Gentoo Linux

root (hd0,0)

kernel /boot/vmlinuz root=/dev/sda3 vga=0x317 video=vesafb:mtrr:3,ywrap,vtotal:32

title Gentoo Linux (backup kernel)

root (hd0,0)

kernel /boot/vmlinuz.old root=/dev/sda3 vga=0x317 video=vesafb:mtrr:3,ywrap,vtotal:32
```

----------

## doctork

 *essexer wrote:*   

> When I compile the gentoo-sources, after 
> 
> ```
> make && make modules_install
> ```
> ...

 

If you look at the install.sh script in the above quote, you'll see that Simon doesn't have /sbin/installkernel installed.  It's part of "debian-utils."  Despite the "Cannot ...." message, the kernel and System.map files should have been installed in /boot, since the script just does cp/cat if it can't find "installkernel.".

--

doc

----------

## hoacker

 *essexer wrote:*   

>  *Quote:*   sh /usr/src/linux-2.6.29-gentoo-r5/arch/x86/boot/install.sh 2.6.29-gentoo-r5 arch/x86/boot/bzImage System.map "/boot"
> 
> Cannot find LILO 
> 
> 

 

I don't use this make install stuff, but just one thought: /boot is mounted properly when you make install?

----------

## essexer

The make install is convenient as far as I know. And I have been using it for quite a long time. It generates automatically the symbolic links in /boot. 

I installed debainutils, it removed the error complaining "cannot find lilo", but the symbolic links are still not generated. I tried to install grub2, but failed when emerge. 

The boot is mounted.

----------

## doctork

 *essexer wrote:*   

> The make install is convenient as far as I know. And I have been using it for quite a long time. It generates automatically the symbolic links in /boot. 
> 
> I installed debainutils, it removed the error complaining "cannot find lilo", but the symbolic links are still not generated. I tried to install grub2, but failed when emerge. 
> 
> The boot is mounted.

 

It turns out the /sbin/installkernel is a  bit too smart for its own good.  It won't create the symbolic links unless one already exists.  Here's the comment:

```
    # The presence of "$dir/$1" is unusual in modern intallations, and

    # the results are mostly unused.  So only recreate them if they

    # already existed.

```

You should be able to fool it by manually creating a set of links to the currently running kernel before running "make install."  You'd need something like this to be present in /boot:

```
vmlinuz -> vmlinuz-2.6.30-gentoo-r3

config -> config-2.6.30-gentoo-r3

System.map -> System.map-2.6.30-gentoo-r3
```

Pretty damn ugly that you need to go through that, but I too find "make install" to be very convenient.  I'm guessing that earlier versions of debian-utils didn't have that stupid (IMHO) check on the existence of those links.

--

doc

----------

## essexer

Yes, after create the initial symbolic links, the make install works fully (copy the kernel to /boot, and create appropriate symbolic links). Thank you all for the help.

----------

## cyrius

The problem is coming from the use flag "installkernel" unset on debianutils.

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] sys-apps/debianutils-4.11.1::gentoo  USE="installkernel* -static" 0 KiB

[ebuild  N     ] sys-kernel/installkernel-gentoo-2::gentoo 

when set, all will be ok.

----------

## Chain

 *cyrius wrote:*   

> The problem is coming from the use flag "installkernel" unset on debianutils.
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> ...

 

Thank you! I unset it ages ago and wondered why the hell the kernel isn't installed properly. Well, mistery solved!

----------

