Freenix
Freenix forum

Home » Community » General Info and Discussion » Scripts to build (kernel packages)
Scripts to build [message #44] Mon, 04 March 2019 15:11 Go to next message
locutus is currently offline  locutus
Messages: 16
Registered: January 2018
Location: US
Junior Member
Looking to build the following
kernel-source.txz
kernel-image.txz
kernel-headers.txz
using the scripts from https://freenix.net/fxp/freeslack64-14.2/source/fxp/build/linux-libre/linux-libre-source.SlackBuild
having trouble to build
Could anyone give me a step by step guides to building these packages, so I could find my mistakes?
Re: Scripts to build [message #45 is a reply to message #44] Tue, 05 March 2019 18:25 Go to previous messageGo to next message
samtux is currently offline  samtux
Messages: 3
Registered: January 2017
Location: Germany
Junior Member
Here are the steps that worked for me to build the kernel package for Freenix 14.2. I'm not sure which is the recommended way how to do it, though.

1. Download the build scripts from the command line prompt as non-root user:
lftp -c "open https://freenix.net/fxp/freeslack64-14.2/source/fxp/build/; mirror linux-libre" && cd linux-libre
curl https://freenix.net/fxp/freeslack64-14.2/source/fxp/build/linux-libre/README > README.TXT

2. Get the source of the latest 4.4.x kernel version and install it manually, without building a package:
Set a variable for the download path we use later on:
SRC_URL=http://linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-4.4.N
Find the latest 4.4.x kernel source and put it to another variable:
SRC_ARCH=`curl -s $SRC_URL/ | egrep -o "linux-libre-4\.4\.[0-9]+-gnu.tar.bz2" | head -n1`
Set a version variable:
VERSION=`egrep -o "4\.4\.[0-9]+" <<<$SRC_ARCH`
Download the source archive:
wget $SRC_URL/$SRC_ARCH
Unpack the source archive to /usr/src/:
su -c "cd /usr/src; tar -xvf "`pwd`"/$SRC_ARCH && ln -sv linux-$VERSION linux"

3. Copy the downloaded config files to /usr/src/:
su -c "cp -v config-generic-4.4.*.x64 /usr/src/linux/config-generic && cp -v config-huge-4.4.*.x64 /usr/src/linux/config-huge"

4. Build the kernel image package:
su - -c "cd "`pwd`"; bash linux-libre-image.SlackBuild"

5. Read the downloaded README.TXT for instructions on further installation steps.

I didn't use the linux-libre-source.SlackBuild script, since it doesn't extract the kernel source archive but only copies it to /usr/src/, and I don't know what's the benefit of installing a Package, which copies an archive that isn't used by any program or script, and only becomes usable after extracting it manually, and also other steps are needed, like copying the config files and the README.TXT, in order to work with the image build script.

I hope this helps.
Re: Scripts to build [message #46 is a reply to message #45] Wed, 06 March 2019 12:04 Go to previous message
locutus is currently offline  locutus
Messages: 16
Registered: January 2018
Location: US
Junior Member
Thx for the assist
I prep my system like this:
1)
su - root
cd /usr/src
wget http://linux-libre.fsfla.org/pub/linux-libre/releases/4.4.176-gnu/linux-libre-4.4.176-gnu.tar.xz
tar -xvpf linux-4.4.176.tar.xz
2)
cd linux-4.4.176
zcat /proc/config.gz > .config
make olddefconfig
3)
make -j4 bzImage
4)
make -j4 modules && make modules_install
5)
cp arch/x86/boot/bzImage /boot/vmlinuz-generic-4.4.176
cp System.map /boot/System.map-generic-4.4.176
cp .config /boot/config-generic-4.4.176
####Also cp for rebuilding the iso
cp arch/x86/boot/bzImage /root/kernel/huge.s
etc
6)
cd /boot
rm System.map
rm config
ln -s System.map-generic-4.4.176 System.map
ln -s config-generic-4.4.176 config
7)
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.176
/sbin/lilo then reboot then start the package building process
Previous Topic: Install on X200
Next Topic: Thoughts on Freenix64-15.0
Goto Forum:
  


Current Time: Thu Mar 28 20:54:02 EDT 2024

Total time taken to generate the page: 0.01430 seconds