VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Pages: 1 [2] 3 4 ... 11

Author Topic: Backup a custom kernel installation...  (Read 29215 times)

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Backup a custom kernel installation...
« Reply #15 on: October 08, 2008, 07:56:27 pm »

the modules should be in /Lib/modules/$(uname -r)
To can use "find /lib/modules/$(uname -r) -name aufs.ko"
Logged

Cariboo

  • Vectorite
  • ***
  • Posts: 289
Re: Backup a custom kernel installation...
« Reply #16 on: October 08, 2008, 10:39:08 pm »

When I type this command
To can use "find /lib/modules/$(uname -r) -name aufs.ko"

I get error prompt:
Quote
bash: uname -r: command not found
(same for find squashfs.ko)

When I 'cd' to /lib/modules I find two directories:
2.6.22.14 and 2.6.22.19

 ???
Logged
Life is full of setbacks; Success is measured by the way you deal with them!

newt

  • Vectorian
  • ****
  • Posts: 1132
Re: Backup a custom kernel installation...
« Reply #17 on: October 08, 2008, 10:46:35 pm »

perhaps: find /lib/modules/`uname -r` -name aufs.ko
Logged

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Backup a custom kernel installation...
« Reply #18 on: October 09, 2008, 06:29:43 am »

not sure how or why you are missing the uname command here is my output

Quote
uel:$ find /lib/modules/$(uname -r) -name aufs.ko
/lib/modules/2.6.25.15/kernel/fs/aufs/aufs.ko
Logged

Cariboo

  • Vectorite
  • ***
  • Posts: 289
Re: Backup a custom kernel installation...
« Reply #19 on: October 09, 2008, 08:16:53 am »

not sure how or why you are missing the uname command here is my output

I'm so sorry.... The bloody typo thing hit me ....(uname-r) instead of (uname -r)  ;D

So anyway, there is no output to this command for both aufs.ko and squashfs.ko.
Logged
Life is full of setbacks; Success is measured by the way you deal with them!

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Backup a custom kernel installation...
« Reply #20 on: October 09, 2008, 05:21:38 pm »

Cariboo,

you need to build those modules for your kernel.
there should be source for them in your /usr/src dir
let me know if you need help with that.

Uelsk8s
Logged

Cariboo

  • Vectorite
  • ***
  • Posts: 289
Re: Backup a custom kernel installation...
« Reply #21 on: October 09, 2008, 05:54:56 pm »

Uelsk8s

thanks for offering help...
You thought me how to configure the kernel using "make menuconfig".
Would this be the command I would have to use?
If yes, what would I have to look for and what would I have to do?

Cariboo
Logged
Life is full of setbacks; Success is measured by the way you deal with them!

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Backup a custom kernel installation...
« Reply #22 on: October 09, 2008, 08:32:36 pm »

these modules are built outside of the kernel.
I will post the commands to build them below.
You can run them 1 at a time or copy the block and paste it into a script(text file) and run them all at once.

Code: [Select]
cd /usr/src/build-kernel-22.19
VER=2.6.22.19
KERNEL=linux-$VER
CURDIR=$(pwd)
TMP=/usr/src
K=$(echo $TMP/$KERNEL | sed -r s/'\/'/'\\\\\/'/g)
cd $TMP
tar -xf $CURDIR/aufs.tar.bz2
tar -xf $CURDIR/squashfs3.3.tar.gz
tar -C lzma449 -xf $CURDIR/lzma449.tar.bz2
tar -xf $CURDIR/patches/squashfs/sqlzma.tar.bz2

patch -p0 < $TMP/sqlzma1-449.patch
patch -p0 < $TMP/sqlzma2k-3.3.patch
patch -p0 < $TMP/sqlzma2u-3.3.patch
cd $TMP/squashfs3.3/squashfs-tools
patch -p0 < $CURDIR/patches/squashfs/mksquashfs.quiet.patch

cd $TMP/$AUFS
cat local.mk \
 | grep -v "^CONFIG_AUFS_DEBUG =" \
 | grep -v "^CONFIG_AUFS_COMPAT =" \
 | grep -v "^CONFIG_AUFS_BRANCH_MAX_127 =" \
 | grep -v "^CONFIG_AUFS_HINOTIFY =" \
 | grep -v "^CONFIG_AUFS_EXPORT =" \
 | grep -v "^CONFIG_AUFS_AS_BRANCH =" \
 | grep -v "^CONFIG_AUFS_DLGT =" \
 | sed -r "s/KDIR = .*/KDIR = $K/" \
 | sed "s/CONFIG_AUFS_BRANCH_MAX_1023 =/CONFIG_AUFS_BRANCH_MAX_1023 = y/" \
 | sed "s/CONFIG_AUFS_KSIZE_PATCH =/CONFIG_AUFS_KSIZE_PATCH = y/" >Makefile
make
mkdir -p /lib/modules/2.6.22.19/kernel/fs/aufs/
cp $TMP/$AUFS/aufs.ko /lib/modules/2.6.22.19/kernel/fs/aufs/

cd $TMP
cat Makefile | sed -r "s/KDir = .*/KDir = $K/" \
             | sed -r "s/SqFs = .*/SqFs = $K\/fs\/squashfs\//" \
             | sed -r "s/C=1/C=0/" >Makefile2
cat Makefile2 >Makefile
make
mkdir -p /lib/modules/2.6.22.19/kernel/fs/squashfs/
cp $TMP/lzma449/C/Compress/Lzma/kmod/{un,sq}lzma.ko k/lib/modules/2.6.22.19/ernel/fs/squashfs/
cp $TMP/$KERNEL/fs/squashfs/squashfs.ko /lib/modules/2.6.22.19/kernel/fs/squashfs/

after you are done you can run the find from before and see if the modules are there now
Logged

Cariboo

  • Vectorite
  • ***
  • Posts: 289
Re: Backup a custom kernel installation...
« Reply #23 on: October 11, 2008, 12:06:59 pm »

Thank you for the instructions...
I started today and got no Errors until this after entering the 10th line:
Quote
vector://usr/src
root:# tar -C lzma449 -xf $CURDIR/lzma449.tar.bz2    <--- enter command of the 10th line
tar: lzma449: Cannot chdir: No such file or directory    <--- prompt
tar: Error is not recoverable: exiting now                       <--- prompt


What is to do  ???         
Logged
Life is full of setbacks; Success is measured by the way you deal with them!

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Backup a custom kernel installation...
« Reply #24 on: October 11, 2008, 01:23:18 pm »

run mkdir lzma449 before line 10
Logged

Cariboo

  • Vectorite
  • ***
  • Posts: 289
Re: Backup a custom kernel installation...
« Reply #25 on: October 11, 2008, 01:50:04 pm »

run mkdir lzma449 before line 10

Do I start all over again..?
or just run 'mkdir lzma449'....but being at what location  then?

Also,
it would be interesting to know how to do this in which editor:
...copy the block and paste it into a script(text file) and run them all at once.
« Last Edit: October 11, 2008, 06:52:08 pm by Cariboo »
Logged
Life is full of setbacks; Success is measured by the way you deal with them!

Masta

  • Global Moderator
  • Vectorian
  • *****
  • Posts: 725
Re: Backup a custom kernel installation...
« Reply #26 on: October 12, 2008, 11:41:34 am »

Any text editor would be fine. You'll want to make it a shell script by adding
Code: [Select]
#!/bin/bashas the very first line.
Then paste the contents uelsk8s gave you. Save the file, and rename from .txt to .sh

It should look like this:
Code: [Select]
#!/bin/bash
cd /usr/src/build-kernel-22.19
VER=2.6.22.19
KERNEL=linux-$VER
CURDIR=$(pwd)
TMP=/usr/src
K=$(echo $TMP/$KERNEL | sed -r s/'\/'/'\\\\\/'/g)
cd $TMP
tar -xf $CURDIR/aufs.tar.bz2
tar -xf $CURDIR/squashfs3.3.tar.gz
mkdir lzma449
tar -C lzma449 -xf $CURDIR/lzma449.tar.bz2
tar -xf $CURDIR/patches/squashfs/sqlzma.tar.bz2

patch -p0 < $TMP/sqlzma1-449.patch
patch -p0 < $TMP/sqlzma2k-3.3.patch
patch -p0 < $TMP/sqlzma2u-3.3.patch
cd $TMP/squashfs3.3/squashfs-tools
patch -p0 < $CURDIR/patches/squashfs/mksquashfs.quiet.patch

cd $TMP/$AUFS
cat local.mk \
 | grep -v "^CONFIG_AUFS_DEBUG =" \
 | grep -v "^CONFIG_AUFS_COMPAT =" \
 | grep -v "^CONFIG_AUFS_BRANCH_MAX_127 =" \
 | grep -v "^CONFIG_AUFS_HINOTIFY =" \
 | grep -v "^CONFIG_AUFS_EXPORT =" \
 | grep -v "^CONFIG_AUFS_AS_BRANCH =" \
 | grep -v "^CONFIG_AUFS_DLGT =" \
 | sed -r "s/KDIR = .*/KDIR = $K/" \
 | sed "s/CONFIG_AUFS_BRANCH_MAX_1023 =/CONFIG_AUFS_BRANCH_MAX_1023 = y/" \
 | sed "s/CONFIG_AUFS_KSIZE_PATCH =/CONFIG_AUFS_KSIZE_PATCH = y/" >Makefile
make
mkdir -p /lib/modules/2.6.22.19/kernel/fs/aufs/
cp $TMP/$AUFS/aufs.ko /lib/modules/2.6.22.19/kernel/fs/aufs/

cd $TMP
cat Makefile | sed -r "s/KDir = .*/KDir = $K/" \
             | sed -r "s/SqFs = .*/SqFs = $K\/fs\/squashfs\//" \
             | sed -r "s/C=1/C=0/" >Makefile2
cat Makefile2 >Makefile
make
mkdir -p /lib/modules/2.6.22.19/kernel/fs/squashfs/
cp $TMP/lzma449/C/Compress/Lzma/kmod/{un,sq}lzma.ko k/lib/modules/2.6.22.19/ernel/fs/squashfs/
cp $TMP/$KERNEL/fs/squashfs/squashfs.ko /lib/modules/2.6.22.19/kernel/fs/squashfs/
Save as "script.sh" or whatever-name.sh
Then open terminal and execute it like:
Code: [Select]
sh script.sh
I've added the new line for you, sobasically all you need to do is copy the entire code and paste :)
P.S.
       I dont think you'll need to start over, just start the script, if that doesn't work, then maybe start over.
Logged

Cariboo

  • Vectorite
  • ***
  • Posts: 289
Re: Backup a custom kernel installation...
« Reply #27 on: October 12, 2008, 02:49:04 pm »

Thank you, Masta,
I got another Error message and I apologize for bothering you again...but I just don't know enough to fix it...
Quote
root:# sh BuildModules.sh
patching file lzma449/C/Compress/Lzma/kmod.mk
patching file lzma449/C/Compress/Lzma/sqlzma.mk
patching file lzma449/C/Compress/Lzma/testflags.c
patching file lzma449/C/Compress/Lzma/uncomp.c
patching file lzma449/C/Compress/Lzma/kmod/Makefile
patching file lzma449/C/Compress/Lzma/kmod/module.c
patching file lzma449/CPP/7zip/Compress/LZMA_Alone/comp.cc
patching file lzma449/CPP/7zip/Compress/LZMA_Alone/sqlzma.mk
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: linux-2.6.23/fs/squashfs/Makefile
|===================================================================
|RCS file: linux-2.6.23/fs/squashfs/Makefile,v
|retrieving revision 1.1
|retrieving revision 1.2
|diff -u -p -r1.1 -r1.2
|--- linux-2.6.23/fs/squashfs/Makefile  4 Nov 2007 13:21:40 -0000       1.1
|+++ linux-2.6.23/fs/squashfs/Makefile  5 Nov 2007 05:43:36 -0000       1.2
--------------------------
File to patch:
what do I have to do with 'File to patch:'   ???
Logged
Life is full of setbacks; Success is measured by the way you deal with them!

Masta

  • Global Moderator
  • Vectorian
  • *****
  • Posts: 725
Re: Backup a custom kernel installation...
« Reply #28 on: October 12, 2008, 05:41:33 pm »

Thank you, Masta,
I got another Error message and I apologize for bothering you again...but I just don't know enough to fix it...
Quote
root:# sh BuildModules.sh
patching file lzma449/C/Compress/Lzma/kmod.mk
patching file lzma449/C/Compress/Lzma/sqlzma.mk
patching file lzma449/C/Compress/Lzma/testflags.c
patching file lzma449/C/Compress/Lzma/uncomp.c
patching file lzma449/C/Compress/Lzma/kmod/Makefile
patching file lzma449/C/Compress/Lzma/kmod/module.c
patching file lzma449/CPP/7zip/Compress/LZMA_Alone/comp.cc
patching file lzma449/CPP/7zip/Compress/LZMA_Alone/sqlzma.mk
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: linux-2.6.23/fs/squashfs/Makefile
|===================================================================
|RCS file: linux-2.6.23/fs/squashfs/Makefile,v
|retrieving revision 1.1
|retrieving revision 1.2
|diff -u -p -r1.1 -r1.2
|--- linux-2.6.23/fs/squashfs/Makefile  4 Nov 2007 13:21:40 -0000       1.1
|+++ linux-2.6.23/fs/squashfs/Makefile  5 Nov 2007 05:43:36 -0000       1.2
--------------------------
File to patch:
what do I have to do with 'File to patch:'   ???

It is no bother at all  :)
Seems to me that the patch missed, perhaps wrong patch version? Anyway, without looking at line 9, I can't help much from there, so I'll pass the ball over to one of the other Gurus
Logged

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: Backup a custom kernel installation...
« Reply #29 on: October 12, 2008, 06:05:56 pm »

Cariboo,
I am building a new kernel that I would like you to try.
I will post it as soon as its uploaded.

Uelsk8s
Logged
Pages: 1 [2] 3 4 ... 11