Hi! I’m running a fully up-to-date TC 4.7.7.
For a month or so, I haven’t been able to compile a working kernel, whereas my script worked before.
The script actually follows the wiki (
http://wiki.tinycorelinux.net/wiki:custom_kernel):
# prepare
tce-load -il /etc/sysconfig/tcedir/optional/compiletc.tcz
tce-load -il /etc/sysconfig/tcedir/optional/perl5.tcz
cd /work/path
wget "http://repo.tinycorelinux.net/4.x/x86/release/src/kernel/linux-3.0.21-patched.txz"
wget "http://repo.tinycorelinux.net/4.x/x86/release/src/kernel/config-3.0.21-tinycore"
mkdir mod_path
xz -d <linux-3.0.21-patched.txz | tar -xf -
cd linux-3.0.21
cp -f ../config-3.0.21-tinycore .config
# patch
sed -i '/^#define[[:blank:]]*HID_MAX_USAGES[[:blank:]]/ s/12288/65535/' include/linux/hid.h
# make
make oldconfig
make bzImage
make modules
make INSTALL_MOD_PATH="/work/path/mod_path" modules_install firmware_install
mv arch/x86/boot/bzImage /work/path/vmlinuz-new
Then I take care of the core.gz file:
# prepare
tce-load -il /etc/sysconfig/tcedir/optional/advcomp.tcz
cd /work/path
wget "http://repo.tinycorelinux.net/4.x/x86/release/distribution_files/core.gz"
sudo mkdir "core-new"
cd "core-new"
gzip -dc ../core.gz | sudo cpio -i
# patch
find lib/modules/3.0.21-tinycore/ ! -type d -print \
| while read f; do if [ -f ../mod_path/"${f%.gz}"* ]; then
sudo rm -f "$f"
sudo cp -fa ../mod_path/"${f%.gz}"* "$(dirname "$f")/"
fi; done
# make
sudo chroot . depmod -a
find . | sudo cpio -H newc -o | gzip -9 >../core-new.gz
cd ..
advdef -z4 core-new.gz
First time I compiled my own kernel, I was very surprised to find out that my modules did not look the same as those from the standard TC core.gz (not the same files, compressed on one side, not on the other…), so I went what I thought was the safe route, considering the fact that my kernel is still
very similar to the standard one: I pick from my new modules tree only those that already exist in the original modules tree and then do the replacement, taking the difference of compression into account where the filenames are concerned.
This worked well for me for several months. Not anymore, even though the base files (patched kernel and config) did not change: now, such a core-new.gz leads to a plain black screen: in Grub2 I select TinyCore with my new boot files, and then the screen simply goes black and does not respond to either CtrlAltDel, nor AltSysRq… I only can switch the power off :-(
Note that my -new kernel with TC’s standard core.gz works, but then I loose the effect of my patch…
Can someone tell me the right way to apply such a simple patch, and end-up with a working kernel of similar size and modules?