You are not logged in.

#1 2015-03-31 14:30:55

emraldinho
Member
Registered: 2015-02-10
Posts: 7

Custom Kernel Build Help + Errors

Hi,

I hope everyone is doing well. I am a newbie and I have been trying to create a custom Kernel with the following steps

1-  sudo pacman -Syu
2- reboot
3- download https://www.kernel.org/pub/linux/kernel … .37.tar.xz
4- tar -xvJf linux-3.14.37.tar.xz
5- sudo pacman -S bc
6- make mrproper
7- zcat /proc/config.gz > .config
8- make menuconfig -->
                                      General setup  --->
                                                                append to kernel release 'emraldinho'
9- make -j4
10- sudo make modules_install

After step 10 I get the following error:

  DEPMOD  3.14.37-emraldinho
depmod: ERROR: Module 'hci_vhci' has devname (vhci) but lacks major and minor information. Ignoring.


Any ideas what's going on here? I tried doing it over a few times, but it does not seem to help

Thanks in advance!

Offline

#2 2015-03-31 14:42:07

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: Custom Kernel Build Help + Errors

First hit on a Google search was thread on these forums https://bbs.archlinux.org/viewtopic.php?id=177465.  You might brush up on your search technique.
I think you can ignore the warning.  See the link to the bug tracker on the thread I linked

Your steps look correct; but don't forget that you  still need to copy the kernel to your boot directory and add an entry for it to your boot loader.   This is pretty much the method I use when I use a custom kernel (old habits from my Gentoo background)

Last edited by ewaller (2015-03-31 14:43:09)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2015-03-31 14:49:16

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Custom Kernel Build Help + Errors

I highly encourage you to use ABS and modify the linux-lts package to suit your needs.

Offline

#4 2015-03-31 17:42:48

emraldinho
Member
Registered: 2015-02-10
Posts: 7

Re: Custom Kernel Build Help + Errors

Thank you for the responses.

I want to write a bash script that does this, is there anything specific that I have to pay attention to, or can I just echo these commands one by one?

Thanks!

Offline

#5 2015-03-31 18:15:14

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Custom Kernel Build Help + Errors

Use a PKGBUILD to automate this.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2015-03-31 18:28:05

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Custom Kernel Build Help + Errors

You're reinventing the wheel if you try a bash script.  Just use ABS and makepkg (which is a bash script itself tongue).

Offline

#7 2015-03-31 18:35:51

snakeroot
Member
Registered: 2012-10-06
Posts: 177

Re: Custom Kernel Build Help + Errors

emraldinho wrote:

Thank you for the responses.

I want to write a bash script that does this, is there anything specific that I have to pay attention to, or can I just echo these commands one by one?

Thanks!

Here's what I use; note that it is for a somewhat non-standard gummiboot install and has a few other peculiarities, but hopefully you may find it vaguely useful. Obviously, you break your system, you keep the pieces.

#!/bin/bash

MKFLG="-j5"

cp -r "$(pwd)" /tmp
cd /tmp/"$(basename $(pwd))"

make kernelrelease
kn=$(make kernelrelease)
gb="/mnt/sda1/loader/entries"
ko=$(uname -r)
usl="/usr/src/${kn}"
ax="arch/x86"
uslax="${usl}/${ax}"

time make $MKFLG all 
sudo make modules_install
# make headers_install

sudo install -v -m=644 arch/x86/boot/bzImage /boot/vmlinuz-"${kn}".efi
sudo install -v -m=644 System.map "/boot/System.map-${kn}"
sudo install -v -m=644 .config /boot/config-"${kn}"
sudo mkinitcpio -k "${kn}" -g /boot/initramfs-"${kn}".img
sudo cp -v /boot/System.map-"${kn}" /boot/System.map 

sudo cp -v "${gb}/Arch_${ko}.conf" "${gb}/Arch_${kn}.conf"
sudo sed -i -e "s:${ko}:${kn}:g" "${gb}/Arch_${kn}.conf" 

sudo mkdir -pv "${usl}"
for i in "Makefile" "kernel/Makefile" ".config"; do
	sudo install -Dv -m644 "${i}" "${usl}/${i}"
done
sudo mkdir -pv "${usl}/include"
for i in acpi asm-generic config crypto drm generated linux math-emu \
		media net scsi sound trace uapi video xen; do
	sudo cp -a include/${i} "${usl}/include/"
done
sudo mkdir -pv "${uslax}"
sudo cp -a "${ax}/include" "${uslax}/"

sudo cp Module.symvers "${usl}"

sudo cp -a scripts "${usl}"
sudo chmod og-w -R "${usl}/scripts"

sudo mkdir -p "${usl}/.tmp_versions"

sudo mkdir -p "${uslax}/kernel"
sudo cp "${ax}/Makefile" "${uslax}/"

sudo cp "${ax}/kernel/asm-offsets.s" "${uslax}/kernel/"

sudo install -D -m644 Documentation/DocBook/Makefile "${uslax}/Documentation/DocBook/Makefile"

sudo mkdir -p "${uslax}/drivers/md"
sudo cp drivers/md/*.h "${uslax}/drivers/md"

# mkdir -p "${usl}/include/linux"
# cp include/linux/inotify.h "${us}/include/linux/"

sudo mkdir -p "${usl}/fs/xfs"
sudo mkdir -p "${usl}/mm"
sudo cp fs/xfs/xfs_sb.h "${usl}/fs/xfs/xfs_sb.h"

for i in $(find . -name 'Kconfig*'); do
	sudo mkdir -p "${usl}/$(echo ${i} | sed 's|/Kconfig.*||')"
	sudo cp ${i} "${usl}/${i}"
done

sudo chown -R root.root "${usl}"
sudo find "${usl}" -type d -exec chmod 755 {} \;


sudo find "${usl}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
	case "$(file -bi "${binary}")" in
 		*application/x-sharedlib*) # Libraries (.so)
			sudo /usr/bin/strip ${STRIP_SHARED} "${binary}";;
		*application/x-archive*) # Libraries (.a)
			sudo /usr/bin/strip ${STRIP_STATIC} "${binary}";;
		*application/x-executable*) # Binaries
			sudo /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
	esac
done

for i in source build; do
	sudo rm -r "/usr/lib/modules/${kn}/${i}"
	sudo ln -sf "${usl}" "/usr/lib/modules/${kn}/${i}"
done 

Offline

#8 2015-03-31 19:11:03

emraldinho
Member
Registered: 2015-02-10
Posts: 7

Re: Custom Kernel Build Help + Errors

Thank you. I am trying to get it done for my own learning I guess.

I was thinking if I just echoed each command one by one, would that not get it done?

I guess I have to check if any of the commands are puking out an error though





snakeroot wrote:
emraldinho wrote:

Thank you for the responses.

I want to write a bash script that does this, is there anything specific that I have to pay attention to, or can I just echo these commands one by one?

Thanks!

Here's what I use; note that it is for a somewhat non-standard gummiboot install and has a few other peculiarities, but hopefully you may find it vaguely useful. Obviously, you break your system, you keep the pieces.

#!/bin/bash

MKFLG="-j5"

cp -r "$(pwd)" /tmp
cd /tmp/"$(basename $(pwd))"

make kernelrelease
kn=$(make kernelrelease)
gb="/mnt/sda1/loader/entries"
ko=$(uname -r)
usl="/usr/src/${kn}"
ax="arch/x86"
uslax="${usl}/${ax}"

time make $MKFLG all 
sudo make modules_install
# make headers_install

sudo install -v -m=644 arch/x86/boot/bzImage /boot/vmlinuz-"${kn}".efi
sudo install -v -m=644 System.map "/boot/System.map-${kn}"
sudo install -v -m=644 .config /boot/config-"${kn}"
sudo mkinitcpio -k "${kn}" -g /boot/initramfs-"${kn}".img
sudo cp -v /boot/System.map-"${kn}" /boot/System.map 

sudo cp -v "${gb}/Arch_${ko}.conf" "${gb}/Arch_${kn}.conf"
sudo sed -i -e "s:${ko}:${kn}:g" "${gb}/Arch_${kn}.conf" 

sudo mkdir -pv "${usl}"
for i in "Makefile" "kernel/Makefile" ".config"; do
	sudo install -Dv -m644 "${i}" "${usl}/${i}"
done
sudo mkdir -pv "${usl}/include"
for i in acpi asm-generic config crypto drm generated linux math-emu \
		media net scsi sound trace uapi video xen; do
	sudo cp -a include/${i} "${usl}/include/"
done
sudo mkdir -pv "${uslax}"
sudo cp -a "${ax}/include" "${uslax}/"

sudo cp Module.symvers "${usl}"

sudo cp -a scripts "${usl}"
sudo chmod og-w -R "${usl}/scripts"

sudo mkdir -p "${usl}/.tmp_versions"

sudo mkdir -p "${uslax}/kernel"
sudo cp "${ax}/Makefile" "${uslax}/"

sudo cp "${ax}/kernel/asm-offsets.s" "${uslax}/kernel/"

sudo install -D -m644 Documentation/DocBook/Makefile "${uslax}/Documentation/DocBook/Makefile"

sudo mkdir -p "${uslax}/drivers/md"
sudo cp drivers/md/*.h "${uslax}/drivers/md"

# mkdir -p "${usl}/include/linux"
# cp include/linux/inotify.h "${us}/include/linux/"

sudo mkdir -p "${usl}/fs/xfs"
sudo mkdir -p "${usl}/mm"
sudo cp fs/xfs/xfs_sb.h "${usl}/fs/xfs/xfs_sb.h"

for i in $(find . -name 'Kconfig*'); do
	sudo mkdir -p "${usl}/$(echo ${i} | sed 's|/Kconfig.*||')"
	sudo cp ${i} "${usl}/${i}"
done

sudo chown -R root.root "${usl}"
sudo find "${usl}" -type d -exec chmod 755 {} \;


sudo find "${usl}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
	case "$(file -bi "${binary}")" in
 		*application/x-sharedlib*) # Libraries (.so)
			sudo /usr/bin/strip ${STRIP_SHARED} "${binary}";;
		*application/x-archive*) # Libraries (.a)
			sudo /usr/bin/strip ${STRIP_STATIC} "${binary}";;
		*application/x-executable*) # Binaries
			sudo /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
	esac
done

for i in source build; do
	sudo rm -r "/usr/lib/modules/${kn}/${i}"
	sudo ln -sf "${usl}" "/usr/lib/modules/${kn}/${i}"
done 

Offline

#9 2015-03-31 19:45:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Custom Kernel Build Help + Errors

emraldinho wrote:

I was thinking if I just echoed each command one by one, would that not get it done?

No. Seriously, write a PKGBUILD or use the ABS.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB