psionl0 |
02-18-2013 11:51 AM |
Quote:
Originally Posted by T3slider
(Post 4893452)
I use a few scripts to automate compiling myself.
|
At last! Somebody who doesn't think this is a pointless idea. Obviously, I would prefer to do my first ever kernel build as somebody other than root. Eric's instructions are clear enough but you can still do a lot of harm if you are the root user - especially if you have made a mistake and have to trawl through the system directories removing the stuff you just installed.
Quote:
Originally Posted by T3slider
(Post 4893452)
To keep things clean, run
Code:
make bzImage modules
instead of just make, and copy the bzImage to the packaging directory instead of doing a potentially messy `make install`. For installing the modules, use
Code:
INSTALL_MOD_PATH="/path/to/directory" make modules_install
Note that some (all?) kernel versions will still dump stuff in /path/to/directory/lib/firmware for no reason with `make modules_install` so you will have to remove that directory before creating a Slackware package. If you do use INSTALL_MOD_PATH it will still create bad symlinks to the kernel source as it was when building. You can just hack those into place...
Code:
cd $PKG/lib/modules/*
rm -rf source build
ln -sf /usr/src/linux-$VERSION source
ln -sf /usr/src/linux-$VERSION build
Then makepkg will remove the symlinks and add their creation to doinst.sh.
|
That all seems clear. It is consistent with Eric's instructions and I actually discovered the INSTALL_MOD_PATH when examining the Makefile. I wouldn't have thought to delete the $PKG/lib/firmware as I would have assumed that was an important part of the process (Eric doesn't say to do that).
Interesting the bit about symlinks. Previously when making SlackBuilds, I have been creating my own doinst.sh to deal with symlinks. Now I know that makepkg will do that for me (you never stop learning when you are a Slacker ;)).
Quote:
Originally Posted by T3slider
(Post 4893452)
I make packaging directories for {kernel,kernel-modules,kernel-source} and package them appropriately. Hacking the symlinks in the modules package also allows me to compile as a non-root user -- I just `chown -R root:root` each packaging directory before makepkg'ing each package. (FYI I do a permissions verification step to make sure the file permissions are OK for each packaging directory before packaging them up...) Of course, I don't actually run these commands...I have a building script to run as a user, a verification script also run as a user, and a packaging script run as root.
|
I don't think I need 3 separate scripts. My usual strategy is, once I am satisfied that the SlackBuild works properly when I run it as a user, I then run it as root. The SlackBuild template (available from SlackBuilds.org) actually includes instructions to make sure all files are owned by root and all permissions are 755 or 644 (naturally I have to comment out the chown instructions when I am not root).
Quote:
Originally Posted by T3slider
(Post 4893452)
In short, nothing is preventing you from writing a script to do all that you want. However, Pat may manually massage certain kernel builds before packaging so there isn't an official do-all SlackBuild. (Note: that is merely speculation)
|
That's good advice. Once I have a SlackBuild script, it should work for any kernel (I can even make it work for generic and huge kernels) but after any Slackware upgrades, I should examine Patrick's kernel SlackBuilds just in case he has added some new tricks (it all looks standard for 14.0).
Quote:
Originally Posted by gnashley
(Post 4893478)
|
Quote:
Originally Posted by GazL
(Post 4893541)
You're welcome to use mine.
|
Ah! It looks like I am re-inventing the wheel. Both these scripts will be immensely helpful when I am doing my own SlackBuild. I could of course, used them as is but one of the reasons I became a Slacker is that I like tinkering.
Since a kernel.SlackBuild seems to be straight forward enough, I will mark this thread as solved.
|