This is the first in a tentative sequence of nahui [four] posts where I will show how to patch and build the Reiser4 UDEB components required to modify a stable vanilla Debian-Installer. Accordingly, we will hack the Linux kernel and actual Debian Installer (d-i) itself; subsequently we'll integrate all Reiser4 components into the d-i hierarchy tree; finally, I will build a mini netboot ISO image suitable for a native Debian on AMD64 partitioning, formatting, and installation onto a Reiser4 root disk partition.
Revisiting: Build Reiser4-patched Debian Linux Kernel to Generate UDEB d-i Components.
Although Building A Reiser4-Patched Development Linux Kernel Package 'The Debian Way' worked fairly well at the time, the fast pace of development has rendered some steps obsolete. Accordingly -- and for brevity's sake -- I will be applying a patch that I created to simply the procedures that ensue below.
We start in a Reiser4 fresh install environment of Jessie on AMD64 from my SourceForge custom netinstall Debian-Reiser4 repository. After the installation is complete, I login and, as in prior post, select and install the specified packages below.
Note that if during above Debian installation you forgot to allow the installer to add the Jessie backports repository, open the file
/etc/apt/sources.list and add the following two directives:
deb http://ftp.debian.org/debian jessie-backports main
deb-src http://ftp.debian.org/debian jessie-backports main
You will need them as we are gonna build a reiser4 -patched relatively recent backported kernel.
End of note.
Now proceed with:
Now we create a tekitl (work, in Nahuatl directory for our custom reiser4 Debianiazed Linux kernel build:
and we download the latest Jessie backport Linux kernel source:
Sometimes we are lucky and Jessie Backports has the Sid (latest) Linux kernel source, as in this particular case:
linux_4.8.11-1~bpo8+1.debian.tar.xz linux_4.8.11-1~bpo8+1.dsc linux_4.8.11.orig.tar.xz
then we clone Jessie Backports Debian packaging:
Be patient as the Linux kernel Debian packaging takes a while to download.
Once the download is finished, you will have similar to:
You may want to create a backup of the Debian packaging, i.e., linux directory above -- in case we make an error and need to start over from a pristine download snapshot.
Patching Debian Packaging to Generate Reiser4 Modules from Reiser4-patched Linux Source
Note below the crossed-out entry from previous Debian package patch-instructions is irrelevant now:
- Add debian/installer/amd64/modules/amd64/reiser4-modules
- Add debian/installer/modules/reiser4-modules
- Edit debian/installer/amd64/package-list
- Edit debian/installer/package-list
- Edit debian/config/amd64/defines
In order to patch the remaining resources in the just download debian packaging, I developed a patch a while back that will direct the Debian build procedure to generate modules for AMD64: 0001-Reiser4-support-for-Debian-AMD64.patch
Of course, you may manually edit and modify the above resources as shown in Building A Reiser4-Patched Development Linux Kernel Package 'The Debian Way'.
We test whether the patch will apply; if it does, then we apply it with quilt
Now since we are building a Reiser4 -enabled custom kernel, we override default module signing, by disabling feature; otherwise our build will fail since, at least myself, are not an official Debian maintainer I also disable real time (rt) feature but you may decide otherwise.
We open for editing
debian/config/amd64/defines and add/modify relevant specifications below:
NOTE for i386 Reiser4 Debian packaging preparation.
Although untested if you will be building Reiser4 support for i386 as well, edit debian/config/i386/defines similarly as above, i.e.,
proceed to copy a reiser4-modules node file into its i386 equivalent:
and edit debian/installer/i386/package-list by adding the following two(2) directives below:
End of NOTE for i386 Reiser4 Debian packaging preparation
We continue, and execute:
Since this is pristine instance of Debian packaging for its Linux kernel, it is 'normal' we get a couple of errors -- as seen below:
and proceed with
If real time (rt) feature was priorly selected, across your shell screen rt-patching will scroll by.
Now we will download the corresponding Reiser4 for Linux kernel 4.8.0 patch to patch our linux source tree;
in this particular case, I had to use reiser4-for-4.9.0.patch since the previous kernel minor version number generated an error in file fs/reiser4/plugin/inode_ops.o and halted the build routine. But...
To avoid build error:
CC [M] fs/reiser4/plugin/cluster.o
CC [M] fs/reiser4/plugin/txmod.o
CC [M] fs/reiser4/plugin/inode_ops.o
/mnt/ephemeral/usr/src/build/tekitl/linux/fs/reiser4/plugin/inode_ops.c: In function ‘reiser4_setattr_common’:
/mnt/ephemeral/usr/src/build/tekitl/linux/fs/reiser4/plugin/inode_ops.c:448:2: error: implicit declaration of function ‘inode_change_ok’ [-Werror=implicit-function-declaration]
result = inode_change_ok(inode, attr);
cc1: some warnings being treated as errors
make: *** [fs/reiser4/plugin/inode_ops.o] Error 1
/mnt/ephemeral/usr/src/build/tekitl/linux/scripts/Makefile.build:294: recipe for target 'fs/reiser4/plugin/inode_ops.o' failed
make: *** [fs/reiser4] Error 2
/mnt/ephemeral/usr/src/build/tekitl/linux/scripts/Makefile.build:445: recipe for target 'fs/reiser4' failed
make: *** [fs] Error 2
/mnt/ephemeral/usr/src/build/tekitl/linux/Makefile:974: recipe for target 'fs' failed
make: *** [sub-make] Error 2
Makefile:150: recipe for target 'sub-make' failed
make: *** [__sub-make] Error 2
Makefile:24: recipe for target '__sub-make' failed
make: Leaving directory '/mnt/ephemeral/usr/src/build/tekitl/linux/debian/build/build_amd64_none_amd64'
make: *** [debian/stamps/build_amd64_none_amd64] Error 2
debian/rules.real:188: recipe for target 'debian/stamps/build_amd64_none_amd64' failed
make: Leaving directory '/mnt/ephemeral/usr/src/build/tekitl/linux'
make: *** [binary-arch_amd64_none_amd64_real] Error 2
debian/rules.gen:25: recipe for target 'binary-arch_amd64_none_amd64_real' failed
make: Leaving directory '/mnt/ephemeral/usr/src/build/tekitl/linux'
make: *** [binary-arch] Error 2
debian/rules:55: recipe for target 'binary-arch' failed
dpkg-buildpackage: error: fakeroot debian/rules binary-arch gave error exit status 2
Assuming your downloaded patch is at current directory location, 'fix it' with this one liner:
gzip -dc reiser4-for-4.8.0.patch.gz | \
sed 's/inode_change_ok(inode/setattr_prepare(dentry/' | \
gzip -9 - > reiser4-for-4.8.11+.patch.gz
As usual we first test if patch will apply and if it does, we use quilt to implement it:
Then I concatenate relevant Reiser4 text-string +reiser4.0.1 to abi by editing file debian/config/defines:
And since this is a Reiser4-enabled custom kernel, I modify debian/changelog with dch. Once relevant text editor is selected, I modify and concatenate the above +reiser4.0.1 text-string at its proper location, as shown below:
then proceed once again with:
Note that in the first directive I will still get two(2) errors because I modified the debian/config/defines and debian/changelog files. Notwithstanding, in the last command I should only get one(1) default error, as below:
At this point I define my Debian Linux kernel build for AMD64 (nevertheless, although untested, you may define for i388, instead):
Subsequently proceed to specify reiser4 as a module in kernel configuration file:
by selecting from menu File Systems
Yes, optional, but I do add OS/2 HPFS support from Miscellaneous File Systems:
Save modifications. Now we are ready to build our kernel the 'Debian way.
In the directive that ensues, I specified -j8 because
Number of jobs allowed to be run simultaneously, number of jobs matching the number of online processors
Of course, please adjust to your particular computing environment:
Go out and have some fun -- inhale some fresh air!
After a couple of hours the build procedure is over and we find our custom Reiser4 UDEB module freshly generated with the 'official' ones from the maintainer(s).
Paquilizcayolli [Congratulations]! We are ready to engage the second phase of our Reiser4-Installer adventure in ensuing blog entry in the sequence
DISCLAIMER although due diligence has been applied, this resource is made available for testing/evaluation purposes on an AS IS basis. The procedure only reflects my own modifications, my limited testing, and the potential user(s) who execute(s) the procedures assumes all risks.
Please do not hold me or Metztli Information Technology (and/or its associates) responsible if the information provided here does not achieve the desired result. The information is provided AS IS and with the hope that it may be useful to the Internet community --especially those interested in Reiser4 -patched kernel/modules to be embedded in Debian Installer (d-i).
Notwithstanding, There is no implicit or explicit guarantee that the information presented here is accurate --even though due diligence was exercised during the procedure. Accordingly, if an user(s) decide to implement the procedure or shell commands described here she, he, or them, do so at her, his, or their own risk. You have been forewarned.