t2linux/wiki

Guides: Write dedicated compile guide

Closed this issue · 6 comments

Currently distributions/ubuntu/building is used as the patching and compiling a kernel guide. Besides that not being easy to discover by a user, the article also makes a lot of assumptions and gives instructions without much explentation of the steps.

This could work to install newer versions of linux-mbp-arch on systems without pacman, instead of having everyone build it. Manual building would still be needed for https://github.com/jamlam/mbp-16.1-linux-wifi

I haven't tested this yet, it might delete/overwrite things it shouldn't, or not work at all.

VER=5.11.22-1
cd /
sudo wget https://dl.t2linux.org/archlinux/mbp/x86_64/linux-mbp-$VER-x86_64.pkg.tar.zst
sudo wget https://dl.t2linux.org/archlinux/mbp/x86_64/linux-mbp-headers-$VER-x86_64.pkg.tar.zst
sudo tar -xf linux-mbp-headers-$VER-x86_64.pkg.tar.zst
sudo tar -xf linux-mbp-$VER-x86_64.pkg.tar.zst
tar -tf linux-mbp-$VER-x86_64.pkg.tar.zst > ~/linuxMBPFileList
tar -tf linux-mbp-headers-$VER-x86_64.pkg.tar.zst >> ~/linuxMBPFileList
rm .MTREE .PKGINFO .BUILDINFO linux-mbp-$VER-x86_64.pkg.tar.zst linux-mbp-headers-$VER-x86_64.pkg.tar.zst

To uninstall (and hopefully not delete important stuff)

cd /
sudo rm $(cat ~/linuxMBPFileList) # only removes files
sudo rmdir $(~/linuxMBPFileList)  # only removes empty directories

Its a bit hackish but will probably work, although in the future its probably best to just have multiple repositories for multiple distributions as well as just a plain tar.

Its probably good to also have both a guide for compiling the kernel manually (like described in the first comment of this issue) as well as one for just installing a binary (or maybe that could even be merged into one, depending on the length)

What do you think of sourcing the PKGBUILD and using it's functions? The directory it installs to can be specified like this pkgdir=/tmp/test-dir, if that's unset, then it'll install to /.

git clone https://github.com/aunali1/linux-mbp-arch
cd linux-mbp-arch
source PKGBUILD
wget https://www.kernel.org/pub/linux/kernel/v${pkgver//.*}.x/linux-${pkgver}.tar.xz
tar -xf $_srcname.tar.xz
prepare
make all
cd ..
sudo _package
cd ..
sudo _package-headers

I don't know how different distros handle moving the kernel image to /boot, so scripting that could be an issue. The same is true for configuring bootloaders.

yep that looks fine

Would it be better to have a "kernel" guide with both those scripts, or a "kernel compile" guide with just the compile script (and possibly the other script at the end), or something else?

I think a kernel guide with both self compiling and using binaries is fine for now, if distribution specific steps make it too large then it can still be split