Building A Reiser4-Patched Development Linux Kernel Package 'The Debian Way'.
IMPORTANT NOTE 01/07/2017: although this procedure worked fairly well at time of publication, especially for development kernels, it has been superseded by Revisiting: Build Reiser4-patched Debian Linux Kernel to Generate UDEB d-i Components. at Nahui Ollin: UDEB Components to Supercharge a Debian Installer (d-i) for a Native Reiser4 Installation on AMD64.
The following notes are but a fragment of a larger personal effort to include a Reiser4-patched Linux kernel into the Debian Installer (d-i) netboot. After uncountable stumbles, I realized that I needed to create UDEBs -- which are slimmed down versions of Debian package DEBs -- and this applied especially to creating a UDEB of the Reiser4 kernel module needed by the Debian Installer procedure. I also had to create UDEBs for Reiser4Progs utilities -- to format and check Reiser4 partitions and filesystems during a Debian installation. Notwithstanding, my Reiser4 Debian Installer effort was halted due to the non-existence of a Reiser4 patch for GNU Parted; this is needed as it is the base for Debian Installer libparted. Hence, this post is also a call to action for anyone who may be interested in creating and contributing a Reiser4 patch for GNU Parted. At least one member of the Debian Installer team is willing to include the Reiser4 patch for GNU Parted into the Debian packaging -- and I would much appreciate it!
Update 12/18/2015: I have successfully created Initial Reiser4 'patch against git://git.sv.gnu.org/parted.git master which adds the ability to detect existing reiser4 partitions' based on Bart Hakvoort 2004 work.
Reiser4 patch against GNU Parted from git may also be obtained at Reiser4 file system for Linux OS repository -- although with a Parted 3.2 specific version label.
Mictlanteuhctli and Quetzalcoatl-Ehecatl: Making Some Sense Out of 'The Debian Way' Chaos.
First, we need to download utilities and fulfill kernel build dependencies to achieve our task:
Shell
apt-get update | |
apt-get install build-essential libncurses5-dev libdebconfclient0-dev libssl-dev libpci-dev libwrap0-dev libusbip-dev asciidoc quilt git rsync fakeroot devscripts kernel-wedge libelf-dev libperl-dev python-dev libnuma-dev libaudit-dev libunwind-dev libdw-dev libudev-dev libiberty-dev usbip libusbip-dev linux-tools dh-exec | |
apt-get build-dep linux |
Subsequently, we download the Debian packaging:
Shell
git clone -b sid --single-branch https://anonscm.debian.org/git/kernel/linux.git |
Please note that I selected to clone Debian Unstable, a.k.a. Sid. After the process finishes, you will find -- at your current filesystem location -- a linux directory with a single subdirectory, thus: linux/debian
I proceed to download linux upstream source and patches:
Shell
apt-get source -d linux |
We see that, in addition to our linux directory, we have three(3) new files. Please make a note of Linux kernel source version (in strong italics) below:
- linux_4.2.5-1.debian.tar.xz
- linux_4.2.5-1.dsc
- linux_4.2.5.orig.tar.xz
We change into the linux directory:
Shell
cd linux |
And unpack the upstream source (i.e., the recently downloaded resources) and merge it with the existing Debian Packaging, by typing the following directive:
Shell
debian/rules orig |
Now, we need to add and/or edit the following file system resources to generate the additional UDEB for the Reiser4 module that is needed for our Debian Installer (d-i):
- Add debian/installer/amd64/modules/amd64/reiser4-modules
- Add debian/installer/modules/reiser4-modules
- Edit /usr/share/kernel-wedge/package-list
- Edit debian/installer/amd64/package-list
- Edit debian/installer/package-list
- Edit debian/config/amd64/defines
- Make sure downloaded Linux kernel source version MATCHES the version listed in debian/changelog
We are going to follow the above numbered sequence in guidelines below: Accordingly, the first two are additional files that we will create and edit; whereas the remaining ones are edits of already existing files.
Use a text editor like vi or a vi-clone like elvis, vim, etc. to create the following file:
Shell
elvis debian/installer/amd64/modules/amd64/reiser4-modules |
and write this single directive as the very first entry:
#include <reiser4-modules>
Save your newly created file and proceed to create the next one:
Shell
elvis debian/installer/modules/reiser4-modules |
again as the very first entry, write this other directive: reiser4
Save your changes to this other newly created file.
Now we will edit the remaining four(4) above-listed files. Please note that next file to be edited is outside of your current filesystem location thus I use an absolute path; truly, you may also need root permission to open and modify:
Shell
elvis /usr/share/kernel-wedge/package-list |
After the jfs-modules block entry, add the following Reiser4-specific lines:
Package: reiser4-modules
Depends: kernel-image, crc-modules
Priority: extra
Description: Reiser4 filesystem support
This package contains the Reiser4 filesystem module for the kernel.
Save your modifications to the file. And proceed to edit similar-named file but this time relative to your current filesystem location:
Shell
elvis debian/installer/amd64/package-list |
Add the following two directives before the Package: fat-modules directive:
Package: reiser4-modules
Priority: standard
Proceed to open to modify the next file:
Shell
elvis debian/installer/package-list |
insert the following lines just one blank line below the Package: jfs-modules
Package: reiser4-modules
Depends: kernel-image, crc-modules
Priority: extra
Description: Reiser4 filesystem support
This package contains the Reiser4 filesystem module for the kernel.
The next edit is to turn debug to false; otherwise we will use more than 10Gb during the kernel build:
Shell
elvis debian/config/amd64/defines |
Modify the default setting from true to:
debug-info: false
We are done with sequence of steps listed above; thus we proceed along to the next phase.
Applying Reiser4 Port To The Linux 4.2 Kernel
Shell
debian/rules debian/control |
We may expect a couple of errors -- just this time -- as debian/control.md5sum has just been created for the first time:
[...]
This target is made to fail intentionally, to make sure
that it is NEVER run during the automated build. Please
ignore the following error, the debian/control file has
been generated SUCCESSFULLY.exit 1
debian/rules:89: recipe for target 'debian/control-real' failed
make[1]: *** [debian/control-real] Error 1
make[1]: Leaving directory '/mnt/sda8-tekitl/usr/src/linux'
debian/rules:79: recipe for target 'debian/control' failed
make: *** [debian/control] Error 2
NOTE: If you get similar error:
make[1]: Entering directory '/usr/src/linux'
debian/bin/gencontrol.py
Traceback (most recent call last):
File "debian/bin/gencontrol.py", line 523, in <module>
Gencontrol()()
File "debian/lib/python/debian_linux/gencontrol.py", line 89, in __call__
self.do_main(packages, makefile)
File "debian/lib/python/debian_linux/gencontrol.py", line 109, in do_main
self.do_main_recurse(packages, makefile, vars, makeflags, extra)
File "debian/lib/python/debian_linux/gencontrol.py", line 123, in do_main_recurse
self.do_arch(packages, makefile, arch, vars.copy(), makeflags.copy(), extra)
File "debian/lib/python/debian_linux/gencontrol.py", line 151, in do_arch
self.do_arch_packages(packages, makefile, arch, vars, makeflags, extra)
File "debian/bin/gencontrol.py", line 181, in do_arch_packages
udeb_packages = read_control(io.TextIOWrapper(kw_proc.stdout, 'utf-8'))
File "debian/lib/python/debian_linux/utils.py", line 72, in read_control
e[last] = '\n'.join(lines)
File "debian/lib/python/debian_linux/debian.py", line 416, in __setitem__
value = cls(value)
File "debian/lib/python/debian_linux/debian.py", line 213, in __init__
short, long = value.split(u"\n", 1)
ValueError: need more than 1 value to unpack
debian/rules:89: recipe for target 'debian/control-real' failed
make[1]: *** [debian/control-real] Error 1
make[1]: Leaving directory '/usr/src/linux'
debian/rules:79: recipe for target 'debian/control' failed
make: *** [debian/control] Error 2
go back to editing 10 and 12, above, and make sure to insert a space
before directive (reprinted below for illustrative purposes):
⇒This package contains the Reiser4 filesystem module for the kernel.
End of NOTE.
The next directive may be redundant, but apply anyhow:
Shell
fakeroot debian/rules source |
Now we are ready to appy our currently available Reiser4-patch; download appropriate port version from Reiser4 file system for GNU/Linux OS
assuming we have it at our home directory, we apply the patch thus:
Shell
gzip -dc ~/reiser4-for-4.2.2.patch.gz | quilt fold |
Needless to say, the procedure should end with no errors.
Now we edit:
- debian/config/defines
Shell
elvis -R debian/config/defines |
WRITE DOWN and increase the abi directive -- in this specific case from 1 to 2 -- and save our modification.
Note: When we modify abi, i.e., this last resource above, we must execute command:
Shell
fakeroot debian/rules debian/control-real |
It is normal to expect only one error:
[...]
This target is made to fail intentionally, to make sure
that it is NEVER run during the automated build. Please
ignore the following error, the debian/control file has
been generated SUCCESSFULLY.exit 1
debian/rules:89: recipe for target 'debian/control-real' failed
make: *** [debian/control-real] Error 1
IMPORTANT! Now go back to shell command 17, edit debian/config/defines by changing the abi directive back to its original value -- in this specific case from 2 back to 1 -- and save our modification. Repeat shell command 18 above and disregard single error.
We continue by changing the configuration for our AMD64 target:
Shell
fakeroot make -f debian/rules.gen setup_amd64_none_amd64 |
We open the menu driven .config editor/manipulator:
Shell
make -C debian/build/build_amd64_none_amd64 menuconfig |
And enable Reiser4 support for our kernel as a U/DEB module from File systems menu: M
Totally optional but you may want to enable IBM OS/2 HPFS filesystem support
File systems -> Miscellaneous filesystems:
Save modifications to the .config file as you exit menuconfig.
We then I build all architecture-dependent packages by running:
Shell
fakeroot debian/rules binary-arch |
The procedure takes a while to complete. You may want to enjoy an oldie song by Gregory Abbott embodied in Мария Букшеванная [Maria Bukshevannaya]: Nenetl -- which means Girl in Nahuatl, Mexico's language par excellence.
T̶h̶i̶s̶ ̶v̶i̶d̶e̶o̶ ̶i̶s̶ ̶a̶g̶e̶-̶r̶e̶s̶t̶r̶i̶c̶t̶e̶d̶ ̶a̶n̶d̶ ̶o̶n̶l̶y̶ ̶a̶v̶a̶i̶l̶a̶b̶l̶e̶ ̶o̶n̶ ̶Y̶o̶u̶T̶u̶b̶e̶ Fuck Youtube CEO Polish CENSOR and ex-sister-in-law to Google's co-founder8!
...just suggesting, of course, but you might as well get busy doing some other tasks...
NOTWITHSTANDING on certain occasions it may stop in the last phase of the routine with similar error as the following:
debian/rules.real:165: recipe for target 'debian/stamps/build_amd64_none_amd64_plain' failed
make[2]: Leaving directory '/mnt/sda8-tekitl/usr/src/linux'
debian/rules.gen:25: recipe for target 'binary-arch_amd64_none_amd64_real' failed
make[1]: Leaving directory '/mnt/sda8-tekitl/usr/src/linux'
debian/rules:42: recipe for target 'binary-arch' failed
In that case, and observing the nature of the error in our logging file, we may nudge the procedure along with the following:
Shell
touch debian/stamps/build_amd64_none_amd64_plain |
And then repeat the build directive:
Shell
fakeroot debian/rules binary-arch |
After the procedure successfully comes to completion, you will find -- amongst the generated Debian Installer resources -- the elusive but valued additional Reiser4 UDEB:
../reiser4-modules-4.2.0-1-amd64-di_4.2.5-1_amd64.udeb
Huelmati [Enjoy]!
References:
1. Mictlanteuhctli & Quetzalcoatl Glyph by Princess Shadyk
2. 4.3 Building a development version of the Debian kernel package
3. Integrate fully partman-reiser4 into d-i
4. "No kernel modules were found" netboot d-i with custom reiser4 kernel.
5. Building kernel the Debian way fails
6. The elvis vi-clone (written by Steve Kirkendall)
7. Github: mbert/Elvis
8"Her sister Anne is the founder of the genetic-testing company 23andMe and was married to Google co-founder Sergey Brin." via NeoMcCarthyism as a smoke screen to hide the crisis of neoliberalism
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 who executes 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 support on 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.
2 comments
Comment from: hans Visitor
Comment from: Jordi L'Escala Visitor
On my installation of Metztli, I found using the deadline scheduler and turning off all swap really sped things up with no stability issues.
In terminal as root:
1 echo deadline > /sys/block/sda/queue/scheduler
2 swapoff -a
It would be nice if you could give some pronunciation hints for any words in this Linux in Nahuatl, the Aztec language.
Having used it, I think Reiser4 will be an important and uniquely useful Linux file system. Thank you for your contribution and congrats.
thanks! per http://serverfault.com/questions/740456/lightweight-transparent-compression-filesystem , it seems reiser4 is a viable option ^^