View previous topic :: View next topic |
Author |
Message |
Are`awn n00b
Joined: 02 Feb 2003 Posts: 38
|
Posted: Sun May 28, 2006 12:47 pm Post subject: Kernel Building & buildpkg |
|
|
I have 8 identical servers. One of my servers is setup as my local portage repository. This server's make.conf is configured with buildpkg. So I basically use this one server to build out binary packages that the other 7 server 'feed' on.
I would like to do the same thing for Kernels, but I do not see an obvious way to do this. I thought genkern could produce kernel packages that I could use, but I do not see an option for that. Will I just have to write an ebuild, that pulls the sources, applies patches, and compiles kernel based on supplied .config ?
Any ideas, pointers, or help is much appreciated. |
|
Back to top |
|
|
acfreeman n00b
Joined: 27 Feb 2005 Posts: 41 Location: UK
|
Posted: Sun May 28, 2006 2:38 pm Post subject: |
|
|
Well, I have a similar situation with 4 servers and I don't bother with package compiling.
I have one /usr/portage and /usr/src on one server, and they are shared over nfs. All of the servers mount these directories to theire /usr/portage and /usr/src. I have distcc installed on them, when I update portage or kernel, it uses all of the processors in my network for compiling.
The base machines /boot directory is also shared, but not automatically mounted on the other servers.
I have this script on the BASE MACHINE:
Code: | # cat /etc/cron.daily/gentoo-sync
#!/bin/sh
/usr/bin/emerge --sync > /var/log/gentoo-sync.log # Syncronising portage
/usr/bin/emerge -ufDN world >> /var/log/gentoo-sync.log # Downloads sources without compiling
eclean-dist -f -t 12w # Checks and clears old sources from /usr/portage/distfiles
|
And this one on the TARGET MACHINES
Code: | # cat /etc/cron.daily/gentoo-sync
#!/bin/sh
/usr/bin/emerge -ufDN world >> /var/log/gentoo-sync.log
|
For compiling I use distcc by this config file:
Code: | # cat /etc/conf.d/distccd
DISTCCD_OPTS="--jobs 3 --daemon"
DISTCCD_EXEC="/usr/bin/distccd"
DISTCCD_PIDFILE="/var/run/distccd/distccd.pid"
DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632"
DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical"
DISTCCD_OPTS="${DISTCCD_OPTS} --allow <IP ADDRESS> --allow <IP Address2> and so on ...."
DISTCCD_NICE="19"
|
This is on the BASE MACINE for compiling with genkernel:
Code: | # cat /etc/genkernel.conf
MENUCONFIG="yes"
CLEAN="no"
MRPROPER="no"
BOOTSPLASH="no"
# ARCH_OVERRIDE="x86"
MOUNTBOOT="yes"
SAVE_CONFIG="yes"
USECOLOR="yes"
CLEAR_CPIO_CACHE="no"
CLEAR_CACHE_DIR="no"
GK_SHARE="/usr/share/genkernel"
# Location of helper-scripts
#GK_BIN="${GK_SHARE}/bin"
GK_BIN="${GK_SHARE}"
# Location of the default cache
CACHE_DIR="${GK_SHARE}/pkg/%%ARCH%%"
# Log output file
DEBUGFILE="/var/log/genkernel.log"
# Debug Level
DEBUGLEVEL=2
# Default location of kernel source
DEFAULT_KERNEL_SOURCE="/usr/src/linux"
# Default kernel config (only use to override using %%ARCH%%/kernel-config-${VER}.${PAT} !)
# DEFAULT_KERNEL_CONFIG="${GK_SHARE}/%%ARCH%%/kernel-config"
# Configuration file for busybox
BUSYBOX_CONFIG="${GK_SHARE}/%%ARCH%%/busy-config"
# BusyBox Version
BUSYBOX_VER="1.00-rt-mdstart.plasmaroo"
# Busybox bin-cache location, to store pre-compiled busybox
# binary is just a bzip2 busybox executable
BUSYBOX_BINCACHE="%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.bz2"
# Location of BusyBox source tarball
BUSYBOX_SRCTAR="${GK_SHARE}/pkg/busybox-${BUSYBOX_VER}.tar.bz2"
# Directory created after busybox tarball is extracted
BUSYBOX_DIR="busybox-${BUSYBOX_VER}"
MODULE_INIT_TOOLS_VER="0.9.15-pre4"
MODULE_INIT_TOOLS_SRCTAR="${GK_SHARE}/pkg/module-init-tools-${MODULE_INIT_TOOLS_VER}.tar.bz2"
MODULE_INIT_TOOLS_DIR="module-init-tools-${MODULE_INIT_TOOLS_VER}"
MODULE_INIT_TOOLS_BINCACHE="%%CACHE%%/insmod-%%ARCH%%-static-2.6.bz2"
MODUTILS_VER="2.4.26"
MODUTILS_SRCTAR="${GK_SHARE}/pkg/modutils-${MODUTILS_VER}.tar.bz2"
MODUTILS_DIR="modutils-${MODUTILS_VER}"
MODUTILS_BINCACHE="%%CACHE%%/insmod-%%ARCH%%-static-2.4.bz2"
DIETLIBC_VER="0.27"
DIETLIBC_SRCTAR="${GK_SHARE}/pkg/dietlibc-${DIETLIBC_VER}.tar.bz2"
DIETLIBC_DIR="dietlibc-${DIETLIBC_VER}"
DIETLIBC_BINCACHE="%%CACHE%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%.tar.bz2"
DIETLIBC_BINCACHE_TEMP="%%CACHE%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%-tempdir"
DEVFSD_VER="1.3.25-dietlibc-kernel25"
DEVFSD_SRCTAR="${GK_SHARE}/pkg/devfsd-${DEVFSD_VER}.tar.bz2"
DEVFSD_DIR="devfsd"
DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2"
DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2"
UDEV_VER="077"
UDEV_DIR="udev-${UDEV_VER}"
UDEV_SRCTAR="${GK_SHARE}/pkg/udev-${UDEV_VER}.tar.bz2"
UDEV_BINCACHE="%%CACHE%%/udev-${UDEV_VER}-%%ARCH%%.tar.bz2"
KLIBC_VER="1.2.1"
KLIBC_DIR="klibc-${KLIBC_VER}"
KLIBC_SRCTAR="${GK_SHARE}/pkg/klibc-${KLIBC_VER}.tar.bz2"
KLIBC_BINCACHE="%%CACHE%%/klibc-${KLIBC_VER}-%%ARCH%%.tar.bz2"
DEVICE_MAPPER_VER="1.00.17"
DEVICE_MAPPER_DIR="device-mapper.${DEVICE_MAPPER_VER}"
DEVICE_MAPPER_SRCTAR="${GK_SHARE}/pkg/device-mapper.${DEVICE_MAPPER_VER}.tgz"
DEVICE_MAPPER_BINCACHE="%%CACHE%%/device-mapper-${DEVICE_MAPPER_VER}-%%ARCH%%.tar.bz2"
LVM2_VER="2.00.25"
LVM2_DIR="LVM2.${LVM2_VER}"
LVM2_SRCTAR="${GK_SHARE}/pkg/LVM2.${LVM2_VER}.tgz"
LVM2_BINCACHE="%%CACHE%%/LVM2.${LVM2_VER}-%%ARCH%%.tar.bz2"
DMRAID_VER="1.0.0.rc10"
DMRAID_DIR="dmraid/${DMRAID_VER}"
DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2"
DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2"
UNIONFS_VER="1.1.4"
UNIONFS_DIR="unionfs-${UNIONFS_VER}"
UNIONFS_SRCTAR="${GK_SHARE}/pkg/unionfs-${UNIONFS_VER}.tar.gz"
UNIONFS_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-tools-%%ARCH%%.tar.bz2"
UNIONFS_MODULES_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-modules-%%KV%%-%%ARCH%%.tar.bz2"
E2FSPROGS_VER="1.38"
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
E2FSPROGS_SRCTAR="${GK_SHARE}/pkg/e2fsprogs-${E2FSPROGS_VER}.tar.gz"
BLKID_BINCACHE="%%CACHE%%/blkid-${E2FSPROGS_VER}-%%ARCH%%.bz2"
|
In summary:
1. Then, I start this, to compile a kernel on the BASE MACHINE:
Code: | # genkernel --kernel-config=<hostname>-kernel-config --kernname=<hostname> --kernel-cc=distcc --kernel-cc=distcc |
2. I log in the TARGET MACHINE, then I copy the kernel to its /boot directory, for example:
Code: |
cp /baseboot/kernel-hostname /boot
cp /baseboot/initrd-hostname /boot
|
3. Edit grub.conf on the TARGET MACHINE, if it is neccessary, but you can only copy the kernel and initrd with the same name everytime to avoid this.
4. Whenever I want to update a portage just log in the TARGET MACHINE over ssh and start "nice -n 19 emerge -uDN world", without waiting for syncronising or downloading.
5. Then angle of the dangle |
|
Back to top |
|
|
Are`awn n00b
Joined: 02 Feb 2003 Posts: 38
|
Posted: Tue May 30, 2006 8:23 pm Post subject: |
|
|
Well I thank you for your indepth post. That isn't the method I was hoping for. I would much prefer having a binary package of the kernel to be able to distribute.
Seems my only alternative it to work at learning the ebuild system more, and getting my kernel built into a package that way. It is just a shame, since it seems that genkern has almost all the functionality, except building a kernel package. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|