I'm trying to compile a kernel module for TCL10 (32-bit).
If I run linux-kernel-sources-env.sh as regular user (as per the .info file), it doesn't work due to insufficient permissions (multiple "Permission denied"):
$ tce-load -wi linux-kernel-sources-env
$ linux-kernel-sources-env.sh
Script will prepare kernel sources and deps
for a 10.x x86 compile environment.
////////////////////////////////////////////////////////////////////////////////
compiletc.tcz loaded
glibc_apps.tcz loaded
automake.tcz loaded
findutils.tcz loaded
bash.tcz loaded
ncursesw-dev.tcz loaded
autoconf.tcz loaded
perl5.tcz loaded
xz.tcz loaded
bc.tcz loaded
checking repo for linux-4.19.10-patched.tar.xz
Connecting to www.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
checking repo for linux-4.19.10-patched.txz
Connecting to www.tinycorelinux.net (89.22.99.37:80)
Cleaning up previous builds
/usr/src cleaned
Searching for src files...
Verifying src files...
linux-4.19.10-patched.txz ready
config-4.19.10-tinycore ready
Module.symvers-4.19.10-tinycore.gz ready
preparing kernel src...
extracting kernel src... tar: can't make dir linux-4.19.10: Permission denied
tar: can't create directory 'linux-4.19.10': Permission denied
tar: can't make dir linux-4.19.10/virt: No such file or directory
tar: can't create directory 'linux-4.19.10/': Permission denied
tar: can't make dir linux-4.19.10/: Permission denied
tar: can't create directory 'linux-4.19.10/': Permission denied
tar: can't open 'linux-4.19.10/': Is a directory
/usr/local/bin/linux-kernel-sources-env.sh: cd: line 224: can't cd to /usr/src/linux-4.19.10: No such file or directory
Step 1 "make mrproper"... make: *** No rule to make target 'mrproper'. Stop.
cp: can't create '/usr/src/linux-4.19.10/.config': Path does not exist
/usr/local/bin/linux-kernel-sources-env.sh: cd: line 231: can't cd to /usr/src/linux-4.19.10: No such file or directory
Step 2 "make oldconfig" make: *** No rule to make target 'oldconfig'. Stop.
Step 3 "make prepare" make: *** No rule to make target 'prepare'. Stop.
Step 4 "make modules_prepare" make: *** No rule to make target 'modules_prepare'. Stop.
cp: can't create '/usr/src/linux-4.19.10/Module.symvers': Path does not exist
/usr/local/bin/linux-kernel-sources-env.sh: cd: line 246: can't cd to /usr/src/linux-4.19.10: No such file or directory
make: *** No targets specified and no makefile found. Stop.
Set ownership...
make symlinks to source...
ln: failed to create symbolic link '/lib/modules/build': File exists
ln: failed to create symbolic link '/lib/modules/4.19.10-tinycore/build': File exists
kernel src files ready
////////////////////////////////////////////////////////////////////////////////
Finished
If I try running the script with sudo then I can get a bit farther, but the wget error persists and I also notice that the "extracting kernel src" step and all subsequent steps fail:
$ sudo linux-kernel-sources-env.sh
Script will prepare kernel sources and deps
for a 10.x x86 compile environment.
////////////////////////////////////////////////////////////////////////////////
compiletc.tcz loaded
glibc_apps.tcz loaded
automake.tcz loaded
findutils.tcz loaded
bash.tcz loaded
ncursesw-dev.tcz loaded
autoconf.tcz loaded
perl5.tcz loaded
xz.tcz loaded
bc.tcz loaded
checking repo for linux-4.19.10-patched.tar.xz
Connecting to www.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
checking repo for linux-4.19.10-patched.txz
Connecting to www.tinycorelinux.net (89.22.99.37:80)
Cleaning up previous builds
/usr/src cleaned
Searching for src files...
Verifying src files...
linux-4.19.10-patched.txz ready
config-4.19.10-tinycore ready
Module.symvers-4.19.10-tinycore.gz ready
preparing kernel src...
extracting kernel src... tar: corrupted data
tar: short read
Step 1 "make mrproper"... make: *** No rule to make target 'mrproper'. Stop.
Step 2 "make oldconfig" make: *** No rule to make target 'oldconfig'. Stop.
Step 3 "make prepare" make: *** No rule to make target 'prepare'. Stop.
Step 4 "make modules_prepare" make: *** No rule to make target 'modules_prepare'. Stop.
Module.symvers-4.19.10-tinycore copied
make: *** No targets specified and no makefile found. Stop.
Set ownership...
make symlinks to source...
kernel src files ready
////////////////////////////////////////////////////////////////////////////////
Finished
It seems to me these are the possible explanations:
- a necessary file is missing from the server
- the downloaded tarball is corrupt
- the script has a bug
- I'm doing something wrong
Please help.