Building a custom kernel RPM with FUSE support on YDL 6

This guide explains how to build and install a custom kernel RPM with FUSE support on Yellow Dog Linux 6. The guide is written based on my experience with YDL on an Apple XServe G4 using kernel-2.6.23-9 on ppc architecture. If your system is different then adjust the guide as required.


Follow all the commands as a normal user, NOT root!

1) Create an rpm build environment

cd ~
mkdir ~/rpmbuild
mkdir ~/rpmbuild/BUILD
mkdir ~/rpmbuild/RPMS
mkdir ~/rpmbuild/SOURCES
mkdir ~/rpmbuild/SPECS
mkdir ~/rpmbuild/SRPMS

echo "%_topdir /home/`whoami`/rpmbuild" > ~/.rpmmacros

2) Download and install the source rpm of the current kernel.

Note: this is not the kernel-source rpm!

wget http://www.mirrorservice.org/sites/ftp.yellowdoglinux.com/pub/yellowdog/releases/yellowdog-6.0/SRPMS/kernel-2.6.23-9.ydl6.1.src.rpm
rpm -ivh kernel-2.6.23-9.ydl6.1.src.rpm

3) Prepare the kernel source tree

cd ~/rpmbuild/SPECS
rpmbuild -bp --target=`uname -m` kernel.spec

4) Configure the kernel

cd ~/rpmbuild/BUILD/kernel-2.6.23/linux-2.6.23.9/
cp configs/kernel-2.6.23-ppc.config .config
make oldconfig
make menuconfig

Using the down arrow key navigate to “File systems” then press Enter and then scroll down to “Filesystem in Userspace support” and press “M” to select it as a module. Press Tab to select Exit in the bottom bar, then do it again, then press Y when prompted to save the configuration.

Copy the config file to ~/rpmbuild/SOURCES/:

cp .config ~/rpmbuild/SOURCES/kernel-2.6.23-ppc.config

5) Prepare the build files

cd ~/rpmbuild/SPECS

Open up the kernel.spec file for editing and ensure the kernel has a unique name by changing the following line (line 32)

%define release %{subrev}.ydl6.%{rpmrev}

to

%define release %{subrev}.ydl6fuse.%{rpmrev}

6) Build the new kernel

rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` kernel.spec

The build process takes a long time to complete. A lot of messages will be printed to the screen. These messages can be ignored, unless the build ends with an error. If the build completes successfully, the new kernel packages in the ~/rpmbuild/RPMS directory.

7) Install the new kernel

cd ~/rpmbuild/RPMS/ppc
su -c "rpm -ivh kernel-2.6.23-9.ydl6fuse.1.ppc.rpm kernel-headers-2.6.23-9.ydl6fuse.1.ppc.rpm --oldpackage"

8) Make the new kernel boot by default

As root, open up /boot/etc/yaboot.conf for editing. You should now see two kernel images listed as boot options. Change the label of the ydl6fuse image to something friendly like “linuxfuse”. Now change the “default” line to the same.

For example:

default=linuxfuse
image=/vmlinux-2.6.23-9.ydl6fuse.1
label=linuxfuse
read-only
initrd=/initrd-2.6.23-9.ydl6fuse.1.img
append="root=LABEL=/"

image=/vmlinux-2.6.23-9.ydl6.1
label=linux
read-only
initrd=/initrd-2.6.23-9.ydl6.1.img
append="root=LABEL=/"

Important: Ensure you also have a line that says “delay=5” (or a greater number) so if your new kernel won’t boot you can still access the yaboot menu to boot your old kernel!

Save and exit the file.

Now run “ybin” (again, as root) to commit the changes. Reboot!

9) Load the fuse module

su -
modprobe fuse

To make the fuse module load on boot. Create the file /etc/sysconfig/modules/my.modules and give it the following contents:

#!/bin/sh
modprobe fuse >/dev/null 2>&1

Save and exit. Now make it executable:

chmod +x /etc/sysconfig/modules/my.modules

10) Finished!

Your kernel now supports FUSE. Now you can use any of the various userspace tools to mount the various filesystems supported by FUSE.

1 thought on “Building a custom kernel RPM with FUSE support on YDL 6

  1. Pingback: Apple » Building a custom kernel RPM with FUSE support on YDL 6

Comments are closed.