How to compile the mainline Kernel the Manjaro way

This sounds a little bit wrong. Because the kernel you downloaded and extracted will not be used. It doesn’t matter if it is there, so it is not really wrong but unnecessary.

Just create a folder, put all files form the Gitlab page in there (or just do a git clone) and edit all files you want to change. For example the PKGBUILD file if you don’t want all the Manjaro patches or change the config.x86_64 if you want a diffrent config for a x86_64 Kernel. Then run updpkgsums and makepkg with the appropriate options, for example makepkg -sri
The makepkg will download, extract, patch and then build the Kernel, with the -i option also install. There is no reason for you to manually download and extract the Kernel.

3 Likes

Xabbu, that is where I am now. Thank you for the clarification. Things seem to go well but when I attempt to boot it says “loading initram” and nothing. Just stops there. I’ve had this before but I could always find the problem using make xconfig. Here, nothing seems to work. I copied and pasted into the CONFIG file my working .config. I will have to try again tomorrow.

I don’t think you can use a straight debian “working” config in a Manjaro kernel. Unless your system didn’t boot with the Manjaro liveUSB, try just building a standard Manjaro kernel first. You need validate your build environment. There are a few details that need to be right and hardly anybody remembers all of them once their system has been building kernels for awhile!

Once you can build a working standard kernel, then you can start experimenting.

I think that’s what I was using. The .config is what I created using make xconfig. Otherwise, it was all Manjaro. :frowning:

Humor me. Start with the stock Manjaro config (no modifications). Build a standard Manjaro kernel and see if it boots. I seem to recall that you have a fast AMD with a ton of cores. It should take under 10-15 minutes. Once that works, then you’ll only have to worry about your config edits (or your patches) if your modified kernel doesn’t boot.

1 Like

Yes exactly. Small steps in the beginning, don’t change too much at once.

Here’s a simple (and simplified) procedure if you want to start rolling your own kernels, including git for version control:

  1. git clone an existing kernel, in this example let’s use Manjaro 4.17:
    git clone https://gitlab.manjaro.org/packages/core/linux417.git

  2. before you start to do anything, create a local git branch for your development:
    cd linux417
    git checkout -b development (replace development with any name you like)

  3. [optional] give your kernel a different name so it can be easily installed alongside existing ones.
    For that, you have to replace every instance of -MANJARO with a name of your choice, this in every file, not only in PKGBUILD!
    You could use a simple ‘find and replace’ in your text editor, or use the sed command, e.g. sed -i -e "s|-MANJARO|-CUSTOM|" PKGBUILD.
    You also have to edit various other names, like

pkgbase=linux417
pkgname=('linux417' 'linux417-headers')

should become

pkgbase=linux417-custom
pkgname=('linux417-custom' 'linux417-headers-custom')

You also have to adapt the package() functions accordingly. Check again if you really got everything, it’s quite important.

  1. Now you can edit PKGBUILD, insert patches, remove the comment before one of the make *config lines to launch the configuration.

  2. run updpkgsums

  3. Then you can try launching makepkg. In kernel config, don’t forget to save your config.
    Copy over your config from the build directory (e.g. /tmp/makepkg) to your git folder and name it something like config.custom. We will add that config later to the PKGBUILD

  4. When the build process finishes, you will have a kernel and a header package, ideally with your custom name. Install with pacman -U, reboot and if it works, continue to next step

  5. Edit your PKGBUILD again, this time replace the default config with the one you saved previously. Don’t forget to run updpkgsums again.

  6. Now you can add the modified/added files to your git branch. First check status with git status, then add modified files with git add [Note: you can also do this before the build].
    Once done, commit your changes with git commit.

  7. For any extramodules, the procedure is more or less the same. Again, don’t forget to change the names in the files if you use a custom one, for example extramodules-4.17-MANJARO becomes extramodules-4.17-CUSTOM etc.

  8. Since we used git, we can always switch back to original Manjaro with git checkout master, and you can update that branch easily with git pull. You can even go further and merge a new updated Manjaro branch into your own with git merge, but that’s out of scope and doesn’t always work without intervention.

8 Likes

I did what you said last night. Same results. I regressed a bit and it won’t load the init ram step. Let me redo this process using Torvic’s easy step-by-step process and I’ll see if that works!

I’m trying the kernel re-name instructions. They got me started. There were a couple more minor details, but I’m building as I type. I know the standard mainline 4.16 runs on my target system, but I hadn’t built it in Manjaro before. I didn’t want to disturb my working kernel projects (4.14, 4.17), so a different kernel seemed best to test.

Update: Everything looked good until I tried to actually boot 4.16.18-T100MJ. I got “Kernel panic - not syncing: VFS: unable to mount fs on unknown-block(0,0)”. Re-checking things now… Freshly installed Manjaro 4.9.111 works as expected except for backlight control. Customized (not renamed) 4.14 and 4.17 also work properly.

My case is a known good build environment, a clean copy of linux416 (32 bit kernel) with only a kernel name change attempted. I must have missed something.

Edit 2: I was able to build & boot a plain 4.16.18 without changing the kernel name. So I know the project files, the config and the build environment are OK…

When the build process finishes, you will have a kernel and a header package, ideally with your custom name. Install with pacman -U, reboot and if it works, continue to next step

This part did not work. I had been using makepkg -sri. Two things I don’t know how to do:

  1. clean the build- like, just from the parts that compiled to binary. Clean build directory but don’t erase config.
  2. Installing from the .xz packages.

I’m sorry to report, it did not work. :frowning: It crashes hard at loading initial ramdisk. I am using the ramdisk settings that I always use though. I have a known working config too. It is very unhappy about something. :wink: Maybe I ought to go back to 4.16.x and see if that works?

If you look in the filesystem under /tmp you should see /makepkg/ Under there you should find your project working directory
/tmp/makepkg/linux417[-custom]/src/linux-4.17/
open a terminal down there (linux-4.17) and you can use some of the standard kernel .org build commands like
make clean
you can go back to the linux417 directory and use terminal to rebuild with
makepkg -ef
To install the .xz packages use
sudo pacman -U linux417*.xz

Finally, I got the name changed kernel to boot. I had to change all the things in the instructions, plus add [-custom] name to the files linux416.preset and linux416.install. I also had to edit PKGBUILD where it invokes mkinitcpio to add [-custom] to linux416. Since linux416 works pretty well, I’ll look at adding my patches and changing .config tomorrow.

My final “stock” linux416 PKGBUILD with name change “T100MJ” and pseudo custom .config follows

# Based on the file created for Arch Linux by:
# Tobias Powalowski <tpowa@archlinux.org>
# Thomas Baechler <thomas@archlinux.org>

# Maintainer: Philip Müller <philm@manjaro.org>
# Maintainer: Guinux <guillaume@manjaro.org>
# Maintainer: Rob McCathie <rob@manjaro.org>

pkgbase=linux416-T100MJ
pkgname=('linux416-T100MJ' 'linux416-headers-T100MJ')
_kernelname=-T100MJ
_basekernel=4.16
_basever=416
_aufs=20180409
_bfq=v8r12
_bfqdate=20180412
_sub=18
pkgver=${_basekernel}.${_sub}
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'elfutils' 'git')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_basekernel}.tar.xz"
        #"https://git.kernel.org/torvalds/t/linux-${_basekernel}-${_rc}.tar.gz"
        #https://github.com/torvalds/linux/archive/v${_basekernel}.tar.gz
        #linux-${_basekernel}${_rc}${_shortgit}-${pkgrel}.tar.gz::https://github.com/torvalds/linux/archive/${_git}.tar.gz
        "http://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz"
        # the main kernel config files
        'config.x86_64' 'config-T100MJ' 'config.aufs'
        "${pkgbase}.preset" # standard config files for mkinitcpio ramdisk
        '60-linux.hook'     # pacman hook for depmod
        '90-linux.hook'     # pacman hook for initramfs regeneration
        "aufs4.16-${_aufs}.patch.bz2"
        'aufs4-base.patch'
        'aufs4-kbuild.patch'
        'aufs4-loopback.patch'
        'aufs4-mmap.patch'
        'aufs4-standalone.patch'
        'tmpfs-idr.patch'
        'vfs-ino.patch'
        #"0001-BFQ-${_bfq}-${_bfqdate}.patch::https://github.com/Algodev-github/bfq-mq/compare/0adb328...ae5d540.patch"
        0001-BFQ-${_bfq}-${_bfqdate}.patch
        # ARCH Patches
        0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
        0002-Partially-revert-swiotlb-remove-various-exports.patch
        # MANJARO Patches
        '0001-drm-i915-edp-Only-use-the-alternate-fixed-mode-if-it.patch'
        '0002-Bluetooth-btusb-Apply-QCQ_ROME-setup-for-BTUSB_ATH30.patch'
        '0001-iwlwifi-killer-ac-1550.patch'
        # Bootsplash
        '0001-bootsplash.patch'
        '0002-bootsplash.patch'
        '0003-bootsplash.patch'
        '0004-bootsplash.patch'
        '0005-bootsplash.patch'
        '0006-bootsplash.patch'
        '0007-bootsplash.patch'
        '0008-bootsplash.patch'
        '0009-bootsplash.patch'
        '0010-bootsplash.patch'
        '0011-bootsplash.patch'
        '0012-bootsplash.patch'
        '0013-bootsplash.patch')
sha256sums=('63f6dc8e3c9f3a0273d5d6f4dca38a2413ca3a5f689329d05b750e4c87bb21b9'
            '848fdff6385eddb5b3eac6e394d5d5427c8735dc93a123ee62da611d04eb1637'
            'b7a5e6b000d49fad7f5cf2652aab8a582537300f0953383290023778894dfef6'
            '4050bab395918e7904146b6793b91930e019aa078011a56a19b39028f85db95d'
            'b44d81446d8b53d5637287c30ae3eb64cae0078c3fbc45fcf1081dd6699818b5'
            '43942683a7ff01b180dff7f3de2db4885d43ab3d4e7bd0e1918c3aaf2ee061f4'
            'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
            '90831589b7ab43d6fab11bfa3ad788db14ba77ea4dc03d10ee29ad07194691e1'
            '5b3554db8584a73fd6c2d98b1b5e10df56c966a41f81aad61baa82d293fea969'
            '9ba42faac50267e04075053ae234001ca26ee93ffbe4c3df1a1051d73c939897'
            'b190d37190209cac6b0567c9388d8ce06eeb90d2a849eace2f04ed1d4ec0d8d5'
            'd82f8ecbba759a10f57470dc3947d81a6d8679becf5f901cdfd9638cefe2773a'
            '13f4639da03913fa13dd6daf7b70a6a14ba0da2a3b8624e8fe11b29b74cad6fa'
            '6dc1c8317aaddea3dfee48a6807f884d350b429c75b8c5863e0234631f8bbc09'
            'f8b90d37ffb82bef5ebc2912053ba86610663410b380b83307854bc4690ab0d5'
            '00f0e0862dd31e7248df557672ebc540d5b38d34eca57d14d796540b274bf52b'
            'add5d66f3ab452514dbd2591922f440f94fbc003f6e33e588c17f627c2dc80e4'
            '37b86ca3de148a34258e3176dbf41488d9dbd19e93adbd22a062b3c41332ce85'
            'd365ce80dab359d5277bd2f8568cad50a30ab269f222ed1bb12b8d74571e24a6'
            'c08d12c699398ef88b764be1837b9ee11f2efd3188bd1bf4e8f85dfbeee58148'
            '61abfab9093bdfec4edda3586fd05afe2f488a92ca99cff51c36b359acdcc815'
            '863a02c53b5096a005cdde60d558f3e5d48d33d8360e513b915fa06e0df38c62'
            'a504f6cf84094e08eaa3cc5b28440261797bf4f06f04993ee46a20628ff2b53c'
            'e096b127a5208f56d368d2cb938933454d7200d70c86b763aa22c38e0ddb8717'
            '8c1c880f2caa9c7ae43281a35410203887ea8eae750fe8d360d0c8bf80fcc6e0'
            '1144d51e5eb980fceeec16004f3645ed04a60fac9e0c7cf88a15c5c1e7a4b89e'
            'dd4b69def2efacf4a6c442202ad5cb93d492c03886d7c61de87696e5a83e2846'
            'c9ae3f67042a6a008ba0e19c911fae45fbc7003ce704c4a5028c965b2e0881ff'
            'c8b0cb231659d33c3cfaed4b1f8d7c8305ab170bdd4c77fce85270d7b6a68000'
            '8dbb5ab3cb99e48d97d4e2f2e3df5d0de66f3721b4f7fd94a708089f53245c77'
            'a7aefeacf22c600fafd9e040a985a913643095db7272c296b77a0a651c6a140a'
            'e9f22cbb542591087d2d66dc6dc912b1434330ba3cd13d2df741d869a2c31e89'
            '27471eee564ca3149dd271b0817719b5565a9594dc4d884fe3dc51a5f03832bc'
            '60e295601e4fb33d9bf65f198c54c7eb07c0d1e91e2ad1e0dd6cd6e142cb266d'
            '035ea4b2a7621054f4560471f45336b981538a40172d8f17285910d4e0e0b3ef')
prepare() {
  #mv "${srcdir}/linux-${_git}" "${srcdir}/linux-${_basekernel}"
  #mv "${srcdir}/linux-${_basekernel}-${_rc}" "${srcdir}/linux-${_basekernel}"
  cd "${srcdir}/linux-${_basekernel}"

  # add upstream patch
  patch -p1 -i "${srcdir}/patch-${pkgver}"

  # add latest fixes from stable queue, if needed
  # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
  # enable only if you have "gen-stable-queue-patch.sh" executed before
  #patch -Np1 -i "${srcdir}/prepatch-${_basekernel}`date +%Y%m%d`"

  # disable USER_NS for non-root users by default
  patch -Np1 -i ../0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch

  # Nvidia driver
  patch -Np1 -i ../0002-Partially-revert-swiotlb-remove-various-exports.patch

  # https://bugs.freedesktop.org/show_bug.cgi?id=103497
  patch -Np1 -i ../0001-drm-i915-edp-Only-use-the-alternate-fixed-mode-if-it.patch

  # https://bugzilla.kernel.org/show_bug.cgi?id=199271
  patch -Np1 -i ../0002-Bluetooth-btusb-Apply-QCQ_ROME-setup-for-BTUSB_ATH30.patch

  # iwlwifi: add killer cards for 9000 series
  # https://forum.manjaro.org/t/46167
  patch -Np1 -i "${srcdir}/0001-iwlwifi-killer-ac-1550.patch"

  # Add bootsplash - http://lkml.iu.edu/hypermail/linux/kernel/1710.3/01542.html
  patch -Np1 -i "${srcdir}/0001-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0002-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0003-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0004-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0005-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0006-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0007-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0008-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0009-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0010-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0011-bootsplash.patch"
  patch -Np1 -i "${srcdir}/0012-bootsplash.patch"
  # use git-apply to add binary files
  git apply -p1 < "${srcdir}/0013-bootsplash.patch"

  # add aufs4 support
  patch -Np1 -i "${srcdir}/aufs4.16-${_aufs}.patch"
  patch -Np1 -i "${srcdir}/aufs4-base.patch"
  patch -Np1 -i "${srcdir}/aufs4-kbuild.patch"
  patch -Np1 -i "${srcdir}/aufs4-loopback.patch"
  patch -Np1 -i "${srcdir}/aufs4-mmap.patch"
  patch -Np1 -i "${srcdir}/aufs4-standalone.patch"
  patch -Np1 -i "${srcdir}/tmpfs-idr.patch"
  patch -Np1 -i "${srcdir}/vfs-ino.patch"

  # add BFQ scheduler
  msg "Fix naming schema in BFQ-MQ patch"
  sed -i -e "s|SUBLEVEL = 0|SUBLEVEL = ${_sub}|g" \
      "${srcdir}/0001-BFQ-${_bfq}-${_bfqdate}.patch"
  patch -Np1 -i "${srcdir}/0001-BFQ-${_bfq}-${_bfqdate}.patch"

  if [ "${CARCH}" = "x86_64" ]; then
    cat "${srcdir}/config.x86_64" > ./.config
  else
    cat "${srcdir}/config-T100MJ" > ./.config
  fi

  # cat "${srcdir}/config.aufs" >> ./.config

  if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
  fi

  # set extraversion to pkgrel
  sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile

  # don't run depmod on 'make install'. We'll do this ourselves in packaging
  sed -i '2iexit 0' scripts/depmod.sh

  # get kernel version
  make prepare

  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  #make menuconfig # CLI menu for configuration
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  # ... or manually edit .config

  # rewrite configuration
  yes "" | make config >/dev/null
}

build() {
  cd "${srcdir}/linux-${_basekernel}"

  # build!
  make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}

package_linux416-T100MJ() {
  pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
  depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
  optdepends=('crda: to set the correct wireless channels of your country')
  provides=("linux=${pkgver}")
  backup=("etc/mkinitcpio.d/${pkgbase}.preset")
  install=${pkgname}.install

  cd "${srcdir}/linux-${_basekernel}"

  KARCH=x86

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"

  mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
  cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${_basekernel}-${CARCH}"

  # add kernel version
  if [ "${CARCH}" = "x86_64" ]; then
     echo "${pkgver}-${pkgrel}-T100MJ x64" > "${pkgdir}/boot/${pkgbase}-${CARCH}.kver"
  else
     echo "${pkgver}-${pkgrel}-T100MJ x32" > "${pkgdir}/boot/${pkgbase}-${CARCH}.kver"
  fi

  # make room for external modules
  local _extramodules="extramodules-${_basekernel}${_kernelname:--T100MJ}"
  ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"

  # add real version for building modules and running depmod from hook
  echo "${_kernver}" |
    install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"

  # remove build and source links
  rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}

  # now we call depmod...
  depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"

  # add vmlinux
  install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux

  # sed expression for following substitutions
  local _subst="
    s|%PKGBASE%|${pkgbase}|g
    s|%BASEKERNEL%|${_basekernel}|g
    s|%ARCH%|${CARCH}|g
    s|%KERNVER%|${_kernver}|g
    s|%EXTRAMODULES%|${_extramodules}|g
  "

  # hack to allow specifying an initially nonexisting install file
  sed "${_subst}" "${startdir}/${install}" > "${startdir}/${install}.pkg"
  true && install=${install}.pkg

  # install mkinitcpio preset file
  sed "${_subst}" ${srcdir}/linux416-T100MJ.preset |
    install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"

  # install pacman hooks
  sed "${_subst}" ${srcdir}/60-linux.hook |
    install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/60-${pkgbase}.hook"
  sed "${_subst}" ${srcdir}/90-linux.hook |
    install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
}

package_linux416-headers-T100MJ() {
  pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
  provides=("linux-headers=$pkgver")

  cd "${srcdir}/linux-${_basekernel}"
  local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"

  install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
  install -Dt "${_builddir}/kernel" -m644 kernel/Makefile

  mkdir "${_builddir}/.tmp_versions"

  cp -t "${_builddir}" -a include scripts

  install -Dt "${_builddir}/arch/${KARCH}" -m644 "arch/${KARCH}/Makefile"
  install -Dt "${_builddir}/arch/${KARCH}/kernel" -m644 "arch/${KARCH}/kernel/asm-offsets.s"

  if [ "${CARCH}" = "i686" ]; then
    install -Dt "${_builddir}/arch/${KARCH}" -m644 "arch/${KARCH}/Makefile_32.cpu"
  fi

  cp -t "${_builddir}/arch/${KARCH}" -a "arch/${KARCH}/include"

  install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
  install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h

  # http://bugs.archlinux.org/task/13146
  install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h

  # http://bugs.archlinux.org/task/20402
  install -Dt "${_builddir}/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h
  install -Dt "${_builddir}/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h
  install -Dt "${_builddir}/drivers/media/tuners" -m644 drivers/media/tuners/*.h

  # add xfs and shmem for aufs building
  mkdir -p "${_builddir}"/{fs/xfs,mm}

  # copy in Kconfig files
  find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;

  if [ "${CARCH}" = "x86_64" ]; then
    # add objtool for external module building and enabled VALIDATION_STACK option
    install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
  fi

  # remove unneeded architectures
  local _arch
  for _arch in "${_builddir}"/arch/*/; do
    [[ ${_arch} == */x86/ ]] && continue
    rm -r "${_arch}"
  done

  # remove files already in linux-docs package
  rm -r "${_builddir}/Documentation"

  # Fix permissions
  chmod -R u=rwX,go=rX "${_builddir}"

  # strip scripts directory
  local _binary _strip
  while read -rd '' _binary; do
    case "$(file -bi "${_binary}")" in
      *application/x-sharedlib*)  _strip="${STRIP_SHARED}"   ;; # Libraries (.so)
      *application/x-archive*)    _strip="${STRIP_STATIC}"   ;; # Libraries (.a)
      *application/x-executable*) _strip="${STRIP_BINARIES}" ;; # Binaries
      *) continue ;;
    esac
    /usr/bin/strip ${_strip} "${_binary}"
  done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null)
}

So the above instructions were incomplete? Do we have a -complete- guide that works and is verifiable?

Only a couple of details were missing for changing the kernel name and there were warnings posted in the instructions. Like I said before, no one remembers all the details of setting up the build environment. If you search my PKGBUILD for T100MJ, you can see all the places I had to make edits. torvic got most of them. Anyway, this is one of the more complete guides I’ve seen. All I would add is a list of build tools. The problem with many Linux guides is that they are obsolete within a few weeks…

If you can’t boot an unmodified kernel that you’ve built, then we need to debug the build environment. I’m guessing that you’ve got the needed build tools or you would not be able to finish the makepkg. So it might be worth looking at your /etc/makepkg.conf. I’m not an expert, but I have built unmodified bootable kernels. If you post your makepkg.conf, I can compare yours against mine.

This could take a while, we seem to be in different timezones and it’s getting late here.

1 Like

It’s taking a while because I have to work and I’m remodeling the house. I’m fine with our timeframe here, thank you. I’m trying to debug the whole thing now. There was an update from Manjaro for the 4.17 Kernel but guess what? It too didn’t boot! I think the stupid Nvidia drivers are fouling it up. I’m going to try to switch to AMD as soon as I can because their GPU driver is open source. I think that could save me a lot of headaches.

1 Like

Yeah, if the standard kernel won’t boot, I wouldn’t expect a home built kernel to boot either - unless you added a patch to fix the standard kernel. :smirk:

The Manjaro 4.17 gets pretty far. It almost boots to the desktop but just stops. I’m almost sure that’s stupid Nvidia.

That seems like a reasonable conclusion. Maybe at the grub menu, remove splash and add 3 to the end of the kernel arguments. That should take you to a tty login instead of the GUI desktop. You could also adjust the _sub in the PKGBUILD to the last known 4.17.x that did boot. But the problem could be a graphic driver update, not the kernel…

1 Like

Update: From the command line I could add the Nvidia driver, get online, remove the driver, etc. I think from here I could begin again to test out the mainline Kernel. I’ll report later when I get something working but that may be a day or two.

Yes, the 4.17.x Kernel from Manjaro didn’t have network support on my system. I couldn’t believe it either. It’s fine, the 4.16.x Kernel is now working, network working, and Nvidia driver working. I can refocus again on compiling the Kernel.

Forum kindly sponsored by Bytemark