Kernel Compiling - Kernel-kit

discuss compiling applications for Puppy
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

Kernel Compiling - Kernel-kit

#1 Post by 01micko »

Preface

This kit is designed to make it easy to compile a kernel.

For about a year now, nearly all puppy kernels have been compiled using build scripts. Barry has his own scripts which you can find at http://bkhome.org/sources (user,pass required). This kit was originally designed by Iguleder.

A limitation of Barry's way is that a full install is required. Any type of install should work with this as long as the script is run on a Linux filesystem.

This kit will download,patch (aufs and others) and compile the kernel, extract the headers, make the kernel and install it into a directory ready for manual running of dir2pet and build the kernel source sfs without manual intervention.

History

A bit over a year ago, Iguleder introduced kernel-kit. Myself and pemasu have been using it to produce kernels for Slacko, Dpup-Exprimo, Upup and Saluki ever since. We have both added our own refinements and it has evolved to the point where almost anyone can compile a kernel for Puppy.

Prerequisites
  • * you must be comfortable with scripts and command line usage
    * a late model Puppy install (YMMV with older pups, but it may work)
    * deps: gcc, git, mksquashfs
    * patience
Hardware
  • * at least 512 RAM (may work with less)
    * any architecture supported by Puppy
    * at least 2 GB disk space
--------------------------------------------------------------------------------------------------------

from the README;
version 0.1.2

gpl3, see /usr/share/doc/legal

THIS KIT COMES WITH ABSOLUTELY NO WARRANTY, USE ENTIRELY AT OWN RISK
NO RESPONSIBILITY ACCEPTED. YOU HAVE BEEN WARNED

ABOUT
-----
This kit is designed to make it easy to compile a kernel for Puppy Linux.
The packages produced are compatible with Woof/Woof2.
See Barry's Blog .. bkhome.org/blog
This kit assumes you are comfortable with shell scripts and command line usage.


DEPENDENCIES
------------
This kit is designed for Puppy Linux. A late model build is
recommended, such as Wary, Racy, Slacko, Precise, Dpup-Exprimo.
Be aware that for best results you should compile in a host
distro which is compatible with the target distro.

REQUIRED:
gcc - for compilation
git - for aufs sources
mksquashfs - for compressing the kernel source sfs, will build without

CREDIT
------
Much credit has to go to BarryK, for inventing Puppy Linux,
Iguleder, the original designer of this kit, pemasu for input and bugfixes,
and various testers on the Murga-Linux/puppy forum
Please read the rest of the README before you begin.

Thanks to BarryK for Puppy, Iguleder for the original concept and pemasu for hours of testing.

Have fun!

Changelog
---------
31-03-13 v0.1.3
added link to version.h - pemasu
added extra location for aufs.h - pemasu
added ability to compile aufs-utils from git - 01micko
added axtra configs for k3.8xx
Attachments
kernel-kit-3.series-0.1.3.tar.bz2
latest version
(101.91 KiB) Downloaded 1843 times
kernel-kit-3.series-0.1.2.tar.bz2
(74.95 KiB) Downloaded 1831 times
Last edited by 01micko on Sun 31 Mar 2013, 02:22, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#2 Post by mavrothal »

Hi Mick,
I believe the aufs lopback patch is not needed some time now (ref 1, ref 2)
Actually XO kernels run fine without it.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#3 Post by 01micko »

Hi mavrothal

One time there I was not including that patch. I think it was beta testing for one of the slacko versions, forget which, but on Barry's advice I put it back. It was after the dates of your references.

ref1: From: <sfjro@us...> - 2010-07-25 23:48

ref2: From: <sfjro@us...> - 2010-03-23 09:03, From: Barry Kauler <bkauler@gm...> - 2010-03-24 00:04

Barry's patch in Precise:2011-05-11

Code: Select all

diff -rupN aufs2.1-32-git100511-orig//fs/aufs/loop.c aufs2.1-32-git100511/fs/aufs/loop.c
--- aufs2.1-32-git100511-orig//fs/aufs/loop.c	2011-05-11 11:27:21.922000014 +0200
+++ aufs2.1-32-git100511/fs/aufs/loop.c	2011-05-11 11:28:00.310000011 +0200
@@ -28,6 +28,9 @@
  */
 int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding)
 {
+	/* allow Squashfs file systems to be used as Aufs branches */
+	return 0;
+	
 	struct super_block *h_sb;
 	struct loop_device *l;
 
My patch is near identical: 2011-11-08 15:54:01

So, I'm not sure what to make of it. I know J. R. Okajima believes the patch is unnecessary, but why has Barry still got it?
Puppy Linux Blog - contact me for access

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#4 Post by Iguleder »

Thanks for sharing, 01micko!

While I'm waiting for my Raspberry Pi to arrive, I'm doing some automation work and I think it would be nice to have a kernel building kit for kernel 3.2.x, since the Raspberry Pi guys maintain a tree with all the modifications required for it.

Since it's a LTS kernel (and because the next Slacko is going to use it), it's a great fit for Puppy.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#5 Post by pemasu »

build.sh script for compiling 3.7.X kernel.
It needed modification to the aufs_type.h files, to copy them into 2 locations in kernel source.
Attachments
build.sh.gz
(10.31 KiB) Downloaded 1607 times

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#6 Post by anikin »

Is there a way to inject CFLAGS into this kit?

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#7 Post by 01micko »

anikin wrote:Is there a way to inject CFLAGS into this kit?
Why? What exactly do you want to do?

You should be able to take care of everything in the configuration.

Anyway, a new kit is posted, compliant with k3.7 and onward plus it now compiles aufs-utils directly from git.
Puppy Linux Blog - contact me for access

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#8 Post by anikin »

I want to compile the kernel with a list of predefined, machine specific CFLAGS - "march=native etc, etc,(as a noob, I have a long and dangerous list)." So that every bit of performance could be squeezed out of my equipment. Is there a way to "stick" the CFLAGS and make them permanent in this kit and ideally for any compilation task? Do once and forget about it approach?

Thank you in advance

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#9 Post by 01micko »

anikin


When you run ./build.sh, after the sources are downloaded, extracted and patched you are given the option to alter the configuration. It may take some time, but I recommend the first option which gives a dialog interface to configuration. Go through it fastidiously and check all the things related to your processor and what hardware you want supported. You can get a very specific kernel this way tuned exactly how you want. The configs supplied are very general to support as much hardware as possible.

------------------------------------------------------------------------------------------------------------

For anyone interested, I have found patches for k3.7 that support f2fs. They apply cleanly. Just put them into the patches directory in the kit. Attached also is a config I used. Vary it how you want. I haven't yet tested the resulting kernel. Soon.

Apparently patches can be applied to k3.6 for f2fs, but I didn't find them. They will be around somewhere, maybe even these ones will work. Probably not on anything earlier though.

Here is the original source of the patches. I only had to edit patch 16 because it didn't know about aufs, only 1 line.

EDIT: patches and config removed, while the kernel worked fine, f2fs was failing to mount, so stick to >= 3.8x if you want f2fs file system.
Puppy Linux Blog - contact me for access

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#10 Post by oldyeller »

Hello Mick,

I have tried doing a kernel but it would not compile. What do I need? I have the devx, Do I need the kernel-sources.sfs as well? I got the Dot-config for kernel 3.9.11 from Barryk site along with the source sfs. I want to compile kernel 3.12.

Since this is Barryk's DOT_config do I need to do this with a full install?

User avatar
Hesse James
Posts: 106
Joined: Mon 08 Feb 2010, 18:41

#11 Post by Hesse James »

Hi Oldyeller
What do you mean by "it would not compile" ? ->e.g. "Error: failed to add Aufs to the kernel sources" ?
This occurs with Kernel 3.12 since 3.12.7 for some reasons. So 3.12.6 could be compiled by you. This desired version number has to be written down in the build.conf file in line 20.
I use a local install of Puppy which was recommended elsewhere for this purpose (I use a virtual machine) and of course the latest release of woof-CE-master kernel kit. Included is a .config file for 3.12.2 which could be used for your compilation purpose. Please save your changes as .config before you exit the kernel configuration program. The compilation results in a SFS file. The PET-file you are looking forward is not generated directly. How to get this PET-file is described in detail in the Readme file.
Good luck.
Christian

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#12 Post by oldyeller »

I get Error: failed to compile kernel_sources

User avatar
Hesse James
Posts: 106
Joined: Mon 08 Feb 2010, 18:41

#13 Post by Hesse James »

Hi Oldyeller
I tested a kernel compilation with a setup I assume it is comparable to yours:
- Fluxpup with installed DEVX only,
- fresh frugal installation
- Savefile on EXT4-partition
(for sure one difference: everything is located in virtual machine).
I used the latest kernel-kit of woof-CE-master.
Two modifications as I mentioned before:
- build.conf modified so that kernel 3.12.6 can be downloaded and compiled (higher than 3.12.6 gives error)
- DOTconfig file from kernel-kit -> configs-extra for 3.12.2 used as basis.

Both files are attached. Then the compilation starts with ./build.sh and runs until "Done !". Kernel-source SFS is generated, PET for woofing builds has to be generated by dir2pet of the relevant folder which is also there (see readme).
Good luck.
Christian
Attachments
DOTconfig.tar.gz
(31.39 KiB) Downloaded 1149 times
build.conf.tar.gz
(941 Bytes) Downloaded 1174 times

gcmartin

#14 Post by gcmartin »

Seen earlier, that kernel 3.14 is now released. There, it seems that ZRAM has been added back. Does the problem exhibited by 3.12.7+ also apply in latest kernel? Is this a continuing problem?

User avatar
Hesse James
Posts: 106
Joined: Mon 08 Feb 2010, 18:41

#15 Post by Hesse James »

Hi
I just tried to compile 3.14. For some reasons the compilation worked out of the box. Interested to use the results ? I have no need to build up a system with it.
Christian

User avatar
HoerMirAuf
Posts: 255
Joined: Tue 22 Jan 2008, 12:11
Location: Würzburg

#16 Post by HoerMirAuf »

Also tryed to compile 3.14.4... always get a error :( Anybody got a working dotconfig for a 3.14.4 kernel?

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

compile trial of k-3.14.4 on wheezy

#17 Post by charlie6 »

Hi,
@christian
I just tried to compile 3.14. For some reasons the compilation worked out of the box. Interested to use the results ?
thanks! for sure it's interesting :D ! either you'r are lucky or you have somewhat digged into the build.sh to get it compiling 3.14.4 !

kernel compile (first time i'm doing this ! :? ) on wheezy-3.5.2.11 using kernel-kit-3.series-0.1.3:
material used:
aufs3-14-git270514.tar.bz2: 146 K
linux-3.14.4.tar.xz: 75 M
note: had to download and place linux-3.14.4.tar.xz in /dist/sources/vanilla/ as the download step did not work.
I also had to edit line 176 of build.sh this way:

Code: Select all

# extract the kernel
echo "Extracting the kernel sources"
tar xvJf dist/sources/vanilla/linux-$kernel_version.tar.xz >> build.log 2>&1
if [ $? -ne 0 ]; then
	echo "Error: failed to extract the kernel sources."
	exit 1
fi
so that the tar.xz could be extracted.

upon the firs trial, the error message told to use

Code: Select all

make oldconfig
, i did it inside the "linux-3.14.4" folder and subsequently had to manualy set the kernel compile options (see DOTconfig attached);
did

Code: Select all

# cp .../kernel-kit-3.series-0.1.3/linux-3.14.4/.config /kernel-kit-3.series-0.1.3/configs_extra/DOTconfig-3.14.4_1-dpup
;

then ran build.sh again and got the following error message while compiling the kernel: i cannot fix that as i did not find anything relevant into fs/aufs/aufs.h.
patching file fs/aufs/loop.c
Hunk #1 succeeded at 29 with fuzz 2 (offset 1 line).
linux-3.14.4/
linux-3.14.4/.gitignore
linux-3.14.4/.mailmap
linux-3.14.4/COPYING
linux-3.14.4/CREDITS
...
CC fs/ioprio.o
CC fs/proc_namespace.o
LD fs/aufs/built-in.o
CC [M] fs/aufs/module.o
In file included from fs/aufs/aufs.h:44:0,
from fs/aufs/module.c:24:
fs/aufs/file.h: In function ‘au_vm_prfile_set’:
fs/aufs/file.h:304:5: error: ‘struct vm_area_struct’ has no member named ‘vm_prfile’
make[2]: *** [fs/aufs/module.o] Error 1
make[1]: *** [fs/aufs] Error 2
make: *** [fs] Error 2
i gave up at that point ...

HTH
Charlie
Attachments
DOTconfig.tar.gz
(27.04 KiB) Downloaded 826 times

User avatar
HoerMirAuf
Posts: 255
Joined: Tue 22 Jan 2008, 12:11
Location: Würzburg

#18 Post by HoerMirAuf »

Hi charlie6

... use the kernel-kit from woof-ce. It will just compile youre kernel.

https://github.com/puppylinux-woof-CE/w ... master.zip

My 3.14.4 kernel works on a full installation. Only only on a frugal one, it will not store a savefile and also not translate the initrd (no acces to the drives?) seems i have to build one more time ....

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#19 Post by oldyeller »

Do you compile the kernel in full install or can you compile the kernel in a frugal install?

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#20 Post by 666philb »

hi oldyeller,

frugal is fine ....with the kernel kit from woof CE https://github.com/puppylinux-woof-CE/w ... esting.zip
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

Post Reply