wok-next annotate linux/stuff/devtools/README @ rev 20465

Up LibreOffice (6.0.2), TiMidity++, jack, zstd (1.3.3)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Mar 07 23:09:42 2018 +0200 (2018-03-07)
parents
children
rev   line source
al@19595 1 SliTaz Linux Kernel Readme
al@19595 2 ==========================
al@19595 3
al@19595 4 1. Updating the Kernel version
al@19595 5 ------------------------------
al@19595 6
al@19595 7 There's a tiny tool called `up-linux.sh`: just update $VERSION in the main
al@19595 8 "linux" receipt and then run this script. Versions in the all the related
al@19595 9 packages will be updated. We can do it easy because we have defined variables
al@19595 10 in the "linux" package receipt:
al@19595 11
al@19595 12 * SPLIT: list of packages that use files compiled with the "linux" package;
al@19595 13 * SIBLINGS: list of packages that builds using the same sources, but with
al@19595 14 the different purpose (to build man pages, API headers, config tool, etc).
al@19595 15
al@19595 16
al@19595 17 2. Updating the Kernel config
al@19595 18 -----------------------------
al@19595 19
al@19595 20 You can use your old `.config` to build newer Kernels: it'll forgive you some
al@19595 21 inconsistency in the configuration doing it's best. Note, using old `.config`
al@19595 22 you'll lack the new possibilities provided by the new Kernel, while some older
al@19595 23 options may no longer be used.
al@19595 24
al@19595 25 To update the configuration options you may use your old `.config` as the base
al@19595 26 (see `stuff/linux-slitaz.config`) with the tool provided in the "slitaz-dev"
al@19595 27 package (please, read it's description).
al@19595 28
al@19595 29 Some useful links provided by Thomas Hinterberger (a.k.a. Kult-ex) where you
al@19595 30 can get examples of configs used in the different Linus distributions:
al@19595 31
al@19595 32 * Opensuse: https://github.com/openSUSE/kernel-source/blob/master/config/i386/default
al@19595 33 * Fedora: http://pkgs.fedoraproject.org/cgit/rpms/kernel.git/refs/
al@19595 34 * Alpine: https://github.com/alpinelinux/aports/blob/master/main/linux-vanilla/config-vanilla.x86
al@19595 35 * Manjaro: https://github.com/manjaro/packages-core/blob/master/linux49/config
al@19595 36
al@19595 37 It is strongly NOT recommended to just edit `.config` as text file (unless you
al@19595 38 know all the consequences):
al@19595 39
al@19595 40 Automatically generated file; DO NOT EDIT.
al@19595 41
al@19595 42 You may make mistakes. Geven module can't be builtin (=y) if it depends on the
al@19595 43 loadable module (=m). Switching some options on (=y) and off (# ... is not set)
al@19595 44 will add or remove a bunch of other options. Switching some option on may
al@19595 45 automatically switch some other option on, as described in the Kconfig* files:
al@19595 46
al@19595 47 * selecting CONFIG_BLOCK will auto-select CONFIG_SBITMAP too
al@19595 48 (see $src/block/Kconfig);
al@19595 49 * CONFIG_SND_HDA_I915 depends on CONFIG_DRM_I915 and CONFIG_SND_HDA_CORE
al@19595 50 (see $src/sound/hda/Kconfig).
al@19595 51
al@19595 52 It's (near to) impossible to track all that dependencies in mind.
al@19595 53
al@19595 54 How do you know it's time to reconfigure your Kernel? Check cooking log for the
al@19595 55 "(NEW)" items. The greater their number the stronger you need to reconfigure it.
al@19595 56
al@19595 57
al@19595 58 3. Splitting the Kernel modules
al@19595 59 -------------------------------
al@19595 60
al@19595 61 Yet another big task is to split Kernel modules into different "linux-*"
al@19595 62 packages. We need to keep the main "linux" package light, splitting rarely used
al@19595 63 options into another packages.
al@19595 64
al@19595 65 We need to keep balance between number of "linux-*" packages and the number of
al@19595 66 the modules inside them. Package with the only one module, as well as package
al@19595 67 with the thousands of modules are not a good solution. User will not need the
al@19595 68 most of the modules in the package thanks to the great variety of sound cards,
al@19595 69 network cards and other hardware that performs a similar function, but which
al@19595 70 can not be present simultaneously in one configuration of the user equipment.
al@19595 71
al@19595 72 Since Linux Kernel 4.9 we use special rules to find and split the modules into
al@19595 73 the different "linux-*" packages, as well as to find modules that should be
al@19595 74 inside the base "linux" package (please, see $stuff/split.rules). Rules format
al@19595 75 is simple: one rule on line; each rule composed from two parts separating
al@19595 76 spaces:
al@19595 77
al@19595 78 * ruleset name: we use "acpi" for "linux-acpi" package, "crypto" for
al@19595 79 "linux-crypto" package, etc. We use just "linux" for the base "linux"
al@19595 80 package. Note, we may use the same rules for the "linux64-*" and
al@19595 81 "linux-libre-*" packages as well as for "linux-*" packages.
al@19595 82 * rule itself: it's just the job for the `find` command making you free to
al@19595 83 add/remove modules more frequently than changing the rules itself. It save
al@19595 84 you from listing all the thousands of modules here. Three different examples
al@19595 85 of the rules itself showing their simplicity, strength and flexibility:
al@19595 86
al@19595 87 * `drivers/net/tun.ko.xz`: find and copy given module;
al@19595 88 * `net/bluetooth`: find and copy all the modules inside the given directory
al@19595 89 as well as from all including sub-directories;
al@19595 90 * `net/ipv4/*.ko.xz`: the same as above but only in the given directory,
al@19595 91 skipping all including sub-directories.
al@19595 92
al@19595 93 Processing rules also automatically finds all the module dependencies to copy
al@19595 94 all them too. So there's impossible situation with the missing dependencies.
al@19595 95
al@19595 96 The goal is to copy each module to one or another package. Sometimes you need
al@19595 97 to tweak existing rules or add new one. Please, make the rule as easier as you
al@19595 98 can. If possible, avoid the particular module names, using directories names
al@19595 99 instead. You'll see in the end of the cooking log if there's unpackaged modules.
al@19595 100
al@19595 101 Also, there's little tool called `check-split.sh`. It produces a big bold table
al@19595 102 containing all the modules with the information of packages where they lives now
al@19595 103 and description provided with the certain module. You can run this script after
al@19595 104 the splitting is over (after the "linux" package is done).
al@19595 105
al@19595 106 You can open the table on the wide screen in the text editor, or convert it to
al@19595 107 html using command `sundown modules.split > modules.split.html` and open it in
al@19595 108 the web browser.
al@19595 109
al@19595 110 Analizing the table will help you split the modules. If the certain module
al@19595 111 belongs to two, three or more packages, it tells us that we need to put this
al@19595 112 module to the base "linux" package: each "linux-*" package depends on the
al@19595 113 "linux" package. But note, the single module may attract the bunch of other
al@19595 114 modules as dependencies to the "linux" package, while this behavior may be
al@19595 115 undesirable. Note, in some cases you may make the module builtin (=y).
al@19595 116
al@19595 117 If the number of the packages belongs to two packages (for example to bigger
al@19595 118 "linux-media" and to smaller "linux-radio") and we can easily differentiate
al@19595 119 them, consider to use $DEPENDS on one of the receipt (the bigger one): package
al@19595 120 "linux-media" is depends on "linux-radio" and all that common modules belongs
al@19595 121 only to "linux-radio" package.
al@19595 122
al@19595 123 Packages receipts are mostly generic, while all the splitting job is done by
al@19595 124 script `$stuff/tools/copy_modules.sh` using the `$stuff/split.rules`.
al@19595 125
al@19595 126 Steps to make split perfect:
al@19595 127
al@19595 128 1. Cook "linux" with all "linux-*" packages being cooking automatically too.
al@19595 129 2. Run `check-split.sh` and analize the modules table. Finish if you are
al@19595 130 satisfied with the result.
al@19595 131 3. Change `split.rules`.
al@19595 132 4. Run the command `cook linux --pack` to re-pack the "linux" and "linux-*"
al@19595 133 package using new rules.
al@19595 134 5. Examine the packing log: http://slitaz/cooker/cooker.cgi?log=linux-pack.log
al@19595 135 6. Proceed to step 2.