LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-02-2005, 04:36 PM   #1
komuthan
Member
 
Registered: Sep 2005
Distribution: Slackware 10.2
Posts: 58

Rep: Reputation: 15
How to make kernel package???


I tried to compile 2.6 kernel several times but anyone success
Then I install the 2.6 serieskernel package in test direction it was very easy but Im using a centrino laptop and that kernel does not support acpid and intel speedstep so these features are so important then I decided to make a kernel package that includes ipw2200 driver speedstep support and acpi support.The important point is here...
HOW CAN I DO THİS OR CAN ANYONE DO THİS FOR ME AND ANYOTHERS LİKE ME
 
Old 10-02-2005, 05:02 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
The first thing to do is to compile the kernel to your specifications. Then you'll need to copy all the binaries and other stuff (don't forget the modules) to an out of the way directory, write the install, configuration, and onlyonce scripts, and then run makepkg to bundle it up. You can read the makepkg man page for more details.
 
Old 10-02-2005, 09:06 PM   #3
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Well, you probably should learn how to make build scripts if your going to use Slackware. They come in handy. I make my own kernel packages as well and I guess I could post mine. I group kernel-ide and kernel-modules into one package (kernel+)... It's not the true Slackware way of making kernel packages.. I just prefer it this way.

Don't prematurely kill the script with the if/then's still there. It will leave your system non-bootable unless you rename those directories... You'll need your .config in the same directory only named config-$VERSION. I'm not going to break it down any further. This is just meant as an example of how you COULD do it...

Code:
#!/bin/sh

CWD=`pwd`
TMP=/tmp
BUILDDIR=/usr/src
PKGKERNEL=$TMP/package-kernel+
PKGSOURCE=$TMP/package-source
VERSION=2.6.13.2
SOURCEBUILD=1
KERNELBUILD=1
SOURCEARCH=noarch
KERNELARCH=i486
# This is where we retrieve our bzImage from
# $BUILDDIR/linux-$VERSION/arch/$KERNELPLATFORM/boot
KERNELPLATFORM=i386

rm -rf $PKGKERNEL
rm -rf $PKGSOURCE
mkdir -p $PKGKERNEL/{boot,install,lib/modules}
mkdir -p $PKGSOURCE/{install,usr/src}


if [ -d /usr/src/linux-$VERSION ]; then
  mv $BUILDDIR/linux-$VERSION $BUILDDIR/linux-$VERSION.orig
fi

if [ -d /lib/modules/$VERSION ]; then
  mv /lib/modules/$VERSION /lib/modules/$VERSION.orig
fi

# I also like to hide /boot from the kernel (config reasons):
mv /boot /boot.tmp

cd $BUILDDIR
echo
echo "linux-$VERSION.tar.bz2 is now extracting..."
echo
tar -xjf $CWD/linux-$VERSION.tar.bz2
cd linux-$VERSION
make distclean
# Only root users should be messing with the kernel
chown -R root.root .

echo "Making the kernel source package..."
echo
sleep 2
install -m 644 $CWD/config-$VERSION	$BUILDDIR/linux-$VERSION/.config
make oldconfig > /dev/null
make bzImage
make clean
rm -f .version
echo
echo "Moving source into package..."
echo
cd $PKGSOURCE/usr/src
cp -Ra $BUILDDIR/linux-$VERSION $PKGSOURCE/usr/src
# This is said to no longer be required. Until somebody points out
# that it actually hurts anything, It'll stay here.
ln -sf linux-$VERSION linux

cat << EOF > $PKGSOURCE/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in.  You must make
# exactly 11 lines for the formatting to be correct.  It's also customary to
# leave one space after the ':'.

             |-----handy-ruler------------------------------------------------------|
kernel-source: linux-$VERSION (kernel source)
kernel-source:
kernel-source: Source code for Linus Torvalds' Linux kernel.
kernel-source:
kernel-source: This is the complete source code for the Linux kernel.
kernel-source:
kernel-source:
kernel-source:
kernel-source:
kernel-source:
kernel-source:
EOF

cd $PKGSOURCE
makepkg -l y -c n $TMP/kernel-source-$VERSION-$SOURCEARCH-$SOURCEBUILD.tgz

echo
echo "Making the kernel+ package..."
echo
sleep 2

cd $BUILDDIR/linux-$VERSION
make bzImage
make modules
make modules_install
rm -rf /lib/modules/$VERSION/{build,source}
mv /lib/modules/$VERSION $PKGKERNEL/lib/modules/$VERSION
cat System.map > $PKGKERNEL/boot/System.map.$VERSION
cat arch/$KERNELPLATFORM/boot/bzImage > $PKGKERNEL/boot/vmlinuz-$VERSION
cat .config > $PKGKERNEL/boot/config-$VERSION
( cd $PKGKERNEL/boot
  ln -sf System.map.$VERSION System.map
  ln -sf vmlinuz-$VERSION vmlinuz )
cat << EOF > $PKGKERNEL/install/doinst.sh
( cd lib/modules/$VERSION ; rm -rf build )
( cd lib/modules/$VERSION ; ln -sf ../../../usr/src/linux-$VERSION build )
( cd lib/modules/$VERSION ; rm -rf source )
( cd lib/modules/$VERSION ; ln -sf ../../../usr/src/linux-$VERSION source )
# A good idea whenever kernel modules are added or changed:
if [ -x sbin/depmod ]; then
  chroot . /sbin/depmod -a 1> /dev/null 2> /dev/null
fi
EOF

cat << EOF > $PKGKERNEL/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in.  You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

       |-----handy-ruler------------------------------------------------------|
kernel+: kernel+ (kernel and modules)
kernel+:
kernel+: A kernel module is a piece of object code that can be dynamically
kernel+: loaded into the Linux kernel to provide new kernel functions.
kernel+: Most of these modules provide support for devices such as CD-ROM
kernel+: drives, tape drives, and ethernet cards.
kernel+: 
kernel+: This package also contains the built kernel or bzImage that is
kernel+: used to boot your system.
kernel+:
kernel+:
EOF

cd $PKGKERNEL
makepkg -l y -c n $TMP/kernel+-$VERSION-$KERNELARCH-$KERNELBUILD.tgz

echo
echo "Cleaning up..."

# Restore the original directories
rm -rf $BUILDDIR/linux-$VERSION
if [ -d $BUILDDIR/linux-$VERSION.orig ]; then
  mv $BUILDDIR/linux-$VERSION.orig $BUILDDIR/linux-$VERSION
fi
if [ -d /lib/modules/$VERSION.orig ]; then
  mv /lib/modules/$VERSION.orig /lib/modules/$VERSION
fi

mv /boot.tmp /boot

cd $TMP
rm -rf $PKGKERNEL
rm -rf $PKGSOURCE

echo
echo "All Done!"
echo "Your packages are in $TMP"
echo

Last edited by jong357; 10-03-2005 at 02:13 PM.
 
Old 10-02-2005, 09:07 PM   #4
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Here is a good how-to, I use it myself:

http://xushi.co.uk/guides/kernel.php
 
Old 10-02-2005, 11:23 PM   #5
komuthan
Member
 
Registered: Sep 2005
Distribution: Slackware 10.2
Posts: 58

Original Poster
Rep: Reputation: 15
@SqdnGuns
The link is broken
@jong357
I thing it's so comlicated and ý cant do this and ý have a question
Is There Anybody To Do This Job For Me and Others like me (PLEASEee)?
Last question : When ý boot my freshly compiled kernel it stops and the last line is "mac adress A0 B2 bla blaa" where ý am wrong
How did I build my kernel
1. copy the kernelsource to usr/src
2.extract it
3.ln -s linux2.6.. /linux
4.cd linux
5.make mrproper
6.copy the existing config file to source dir
7.make menuconfig (add speedstep and acpi support)
8.make -j5 bzImage
9.make -j5 modules
10. make modules install
11.
/usr/src/linux# cp System.map /boot/System.map-2.6.13
/usr/src/linux# cp .config /boot/config-2.6.13
/usr/src/linux# cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.6.13
12.
/boot# rm System.map
/boot# rm config
/boot# rm vmlinuz
13.
/boot# ln -s System.map-2.6.13 System.map
/boot# ln -s config-2.6.13 config
/boot# ln -s vmlinuz-2.6.13 vmlinuz
and last boot# generate-modprobe.conf /etc/modprobe.conf

ofcourse I chanced my liloconf and then run lilo
where is the problem ý did all of theese steps but....
 
Old 10-03-2005, 01:15 AM   #6
heltreko
Member
 
Registered: Mar 2005
Location: Stockholm, Sweden
Distribution: Slackware, Zenwalk
Posts: 141

Rep: Reputation: 15
I think you should do

Code:
make oldconfig
after copying config to your source directory (i.e. between 6 and 7 in your list).
 
Old 10-03-2005, 11:23 AM   #7
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Quote:
Originally posted by komuthan
@SqdnGuns
The link is broken
Weird, just cleared my cache to be sure and I get right into it............
 
Old 10-03-2005, 02:04 PM   #8
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Seems you have to copy/paste that link into your address bar...

Quote:
I thing it's so comlicated and ý cant do this and ý have a question
Is There Anybody To Do This Job For Me and Others like me (PLEASEee)?
I had a feeling you were going to say that. That script isn't complicated at all. They are just regular commands that one might type into a terminal. Your probably looking at the entire thing instead of reading it line by line. Variables tend to confuse people who are new to bash as well. So... I did just do it for you. All you have to do is copy/paste all of that into gedit or kwrite and then save it as "kernel.SlackBuild". Copy/paste your config in the same directory with the name of "config-2.6.13.12" and make sure the kernel source is in the same directory as well. Then "sh kernel.SlackBuild". Doesn't get much easier than that. I'll even edit it so it will work for you...

After this, you aught to browse thru some Slackware build scripts and try to understand them... It will help you in the long run.
 
Old 10-03-2005, 02:18 PM   #9
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Also...

Quote:
When ý boot my freshly compiled kernel it stops and the last line is "mac adress A0 B2 bla blaa" where ý am wrong
That happens when you don't have your network setup properly. It didn't freeze. Give it some time. You need patience my man... Patience... It takes up to a minute sometimes before dhcpd will give up on trying to find an IP address...
 
Old 10-03-2005, 06:02 PM   #10
komuthan
Member
 
Registered: Sep 2005
Distribution: Slackware 10.2
Posts: 58

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by jong357

That happens when you don't have your network setup properly. It didn't freeze. Give it some time. You need patience my man... Patience... It takes up to a minute sometimes before dhcpd will give up on trying to find an IP address...
I thjing you mean Iam a patienceness man but I wait 3 or 4 minutes and ctrl+c didnot work so I tought it was freeze
and one more thing ; I installed ipw2200 driver before compiling the new kernel and edited initrd to use dhcp
you mean the problem was becouse of this

Iam sory about the link it's working
And thanks for the link
 
Old 10-03-2005, 06:13 PM   #11
komuthan
Member
 
Registered: Sep 2005
Distribution: Slackware 10.2
Posts: 58

Original Poster
Rep: Reputation: 15
I decide to compile the kernel last time by the link and i need a good .config file for my hardware
my hardware is MSI M510A notebook
centrino 1.6
ipw2200 wireless
rodeon 9700 64mb ram
..
...
 
Old 10-04-2005, 11:46 AM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Use the standard kernel config file and just add in the support you need, instead of starting from scratch.
 
Old 10-05-2005, 01:53 AM   #13
komuthan
Member
 
Registered: Sep 2005
Distribution: Slackware 10.2
Posts: 58

Original Poster
Rep: Reputation: 15
today I tried to compile the kernel(by the guide of xushi) again
I used default .config file and add ssome features like centrino support,ntfs support acpi support pcmci and mmccard support......
but again and again the same problem what is it???

fatal modul agpgart not found
fatal modul psmouse not found
last line:mac adress a0 b3 ....

Last edited by komuthan; 10-05-2005 at 09:57 PM.
 
Old 10-06-2005, 01:37 AM   #14
komuthan
Member
 
Registered: Sep 2005
Distribution: Slackware 10.2
Posts: 58

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by jong357
Seems you have to copy/paste that link into your address bar...



I had a feeling you were going to say that. That script isn't complicated at all. They are just regular commands that one might type into a terminal. Your probably looking at the entire thing instead of reading it line by line. Variables tend to confuse people who are new to bash as well. So... I did just do it for you. All you have to do is copy/paste all of that into gedit or kwrite and then save it as "kernel.SlackBuild". Copy/paste your config in the same directory with the name of "config-2.6.13.12" and make sure the kernel source is in the same directory as well. Then "sh kernel.SlackBuild". Doesn't get much easier than that. I'll even edit it so it will work for you...

After this, you aught to browse thru some Slackware build scripts and try to understand them... It will help you in the long run.
I made the package by using your slackbuild script
and i installed it
but the problem is same
I thing its abaut .config file
i need a config file
 
Old 10-06-2005, 10:36 AM   #15
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
I would say there is nothing wrong with your config except that you should probably build the PS2 mouse module into the kernel. I have to do that as well or my mouse won't work as a module.

It sounds to me as if this is an ipw issue. I don't have one of those cards so I can't help you out. Do you need firmware or anything to go along with the driver? Is the driver in the kernel or are you using the sourceforge version? It has to be with that if it's stopping on your MAC address. Can't be anything else... Diasable your network from coming up on boot and it will probably start up fine. Then try working on your problem from within the new kernel.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ho I can make a simple debian package linx win Debian 1 10-29-2005 07:22 PM
package compiling from source, make & make install concepts shujja Linux - Newbie 2 09-20-2005 12:18 AM
How to make deb package chrisstooss Debian 6 09-16-2005 05:21 PM
make my own package cd (or sarge cd) drawhla Debian 4 12-21-2004 01:36 AM
How to use kdevelop3 to make a source package? tx-cary Programming 3 07-27-2004 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration