CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
de0f6adf3e26cb67a4b115e754584fc23eaadda1
[kernel/raspberrypi2.git] / README
1 Crux-arm RaspberryPi2 Linux Kernel
2
3 NOTE: This README is wip. Some instructions are either vague or missing.
4
5 upstream sources:
6 https://www.kernel.org/pub/linux/kernel/v4.x
7 git://git.kernel.org/pub/scm/linux/kernel/git/statble/linux-stable.git
8 https://github.com/raspberrypi/linux
9
10 Type make or make all to build kernel image, the device tree files/overlays,
11 modules and related files. You may also find some of the other targets useful;
12 either for rebuilding only a certain target or possibly downloading files for
13 later offline build. These currently include:
14
15 all: build all targets
16 clean: clean out built files/directories
17 distclean: clean, plus remove even downloaded files also
18 files: download all remote files
19 config: unpatch the kernel and copy the default config into the kernel tree
20 image: build zImage and rpi2 prep'd kernel image files
21 dtb: build device tree database/overlay files, tarball
22 modules: build kernel modules, tarball
23 menuconfig: run menuconfig for kernel, starting with default kernel config
24
25 For booting the kernel, you will also need to download these addition files:
26 bootcode.bin: https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
27 start.elf: https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
28 fixup.dat: https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
29
30 (Two other files are needed in the boot partition: config.txt and cmdline.txt.
31 I will add more about these files next edit, as well as provide links to
32 existing official/semi-official documentation for this files)
33
34 my current config.txt:
35 disable_splash=1
36 gpu_mem=256
37 kernel=kernel7-4.5.4.img
38 avoid_warnings=2
39 dtoverlay=vc4-kms-v3d
40
41 my current cmdline.txt:
42 dwg_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty root=/dev/mmcblk0p3 rootfstype=ext4 rootwait
43
44 For the above two files, bare in mind that my sd card partition layout is as follows:
45 mmcblk0p1: fat32, boot files (mounted to /boot in fstab)
46 mmcblk0p2: swap
47 mmcblk0p3: ext4, root filesystem
48
49 Sd card layout (as found on most howtos in the wild):
50
51 first partition, boot (fat32):
52 kernel-$version.img, System.map-$version, bootcode.bin, start.elf, config.txt, cmdline.txt
53 Untar the dtb tarball (dtb-$version.tar.*) to the boot partition.
54
55 second partition, root (ext{2,3,4}, xfs, btrfs, etc):
56 Untar the modules tarball (modules-$version.tar.*) to the root partition.
57 Untar all the package files created by crossrootfs and raspberrypi2-arm to
58 the root partition.
59
60 Generating the kernel patch:
61
62 This is a stripped down description of how I generated the kernel patch.
63 It is based on how I thought it might have been done by Alpine Linux for
64 there raspberrypi kernel.
65
66 git clone -b rpi-4.5.y https://github.com/raspberrypi/linux.git linux-rpi
67 cd linux-rpi
68 git remote add -b linux-4.5.y stable-4.5 \
69 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
70 git pull stable-4.5
71 git diff linux-4.5.y..rpi-4.5.y > ../linux-4.5.y-rpi-$(date +%Y%m%d).patch