DIY mainline kernel (4.12)+ ubuntu base 17.04 (zesty) for vim pro and EMMC install

Issues for now are…

raxy@ivnVimPro:~$ sudo apt-get install keyboard-configuration
Reading package lists... Done
Building dependency tree       
Reading state information... Done
keyboard-configuration is already the newest version (1.108ubuntu15.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
raxy@ivnVimPro:~$ sudo dpkg-reconfigure keyboard-configuration
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
insserv: warning: script 'K01khadas-bt-init' missing LSB tags and overrides
insserv: warning: script 'khadas-bt-init' missing LSB tags and overrides
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
insserv: warning: script 'K01khadas-bt-init' missing LSB tags and overrides
insserv: warning: script 'khadas-bt-init' missing LSB tags and overrides
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.122ubuntu8.8) ...

Visibly, sudo dpkg-reconfigure keyboard-configuration encounters some mess related to insserv and or update-rc.d,
WTF !!! :pouting_cat:

for now, this is my best bet
localectl set-keymap fr
but it does not do the job

And I definitely need to fix the mess with my startup scripts and init.d which visibly prevents me from running my beloved kbd configuration command (sudo dpkg-reconfigure keyboard-configuration)

Time to publish a few updates of the toolset,
mainly the new /etc/init.d/khadas-bt-init (see new link below)

to install it, as root,

cd /etc/init.d
vi khadas-bt-init (copy paste from https://pastebin.com/E2qg0LYX)
chmod +x khadas-bt-init
update-rc.d khadas-bt-init defaults
update-rc.d khadas-bt-init enable

then reboot
If you have previously paired a BT keyboard, then it will get automatically re-connected for typing login and password

1 Like

finally, DONE ! :star_struck::man_mechanic::sweat_smile::keyboard:

these allowed me to have the keybord layout i was expecting (fr) to log on the tty1 session on the hdmi display :

sudo apt-get install console-setup
sudo dpkg-reconfigure console-setup
(and just confirm whatever default it proposes)

about wifi ,
it also works;
I can connect to my phone’s hotspot,
shutdown eth0, and still manage to do an apt-get update successfully;

you remember I could not connect on a channel 13 wifi network yet,
but at least I can say that this current distro (4.12.7/16.04.3) is doing wifi (and maybe will not stall as ethernet did with older versions of the mainline kernel)

to be tested under load (like downloading a big video file maybe)

1 Like

Nice work! :slight_smile:

I’m thinking to build Ubuntu for my second Khadas Vim Pro and stumbled upon this detailed thread. Will definitely try out :wink:

Why aren’t you putting your scripts on GitHub? Would be easier to get always the latest version and see modifications.

1 Like

Is it somehow possible to publish your kernel as a *.deb file? I would like to install it over my 4.9 ubuntu server installation.

Is everything working (USB / Ethernet)?

hi,
usb does not work,
sorry i do not know how to build a .deb out of my kernel;
how would you install a .deb as the kernel of your existing distro?

make ARCH=arm64 deb-pkg :wink:

2 Likes

Salut Neil,

I kinda failed at my very 1st attempt to build a .deb kernel package,
please check logs below and help me understand what went wrong…tks

raxy@bodhi-giada:~/project/khadas-build-script/Khadas-Components/linux-kernel$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
raxy@bodhi-giada:~/project/khadas-build-script/Khadas-Components/linux-kernel$ make ARCH=arm64 deb-pkg arch/arm64/Makefile:23: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:44: Detected assembler with broken .inst; disassembly will be unreliable
  CHK     include/config/kernel.release
    make clean
      CLEAN   .
      CLEAN   arch/arm64/kernel/vdso
      CLEAN   arch/arm64/kernel
      CLEAN   drivers/firmware/efi/libstub
      CLEAN   drivers/tty/vt
      CLEAN   drivers/video/logo
      CLEAN   kernel
      CLEAN   lib/raid6
      CLEAN   lib
      CLEAN   usr
      CLEAN   arch/arm64/boot
      CLEAN   arch/arm64/boot/dts/amlogic
      CLEAN   .tmp_versions
      TAR     linux-4.12.10.tar.gz
    make KBUILD_SRC=
    arch/arm64/Makefile:23: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
    arch/arm64/Makefile:44: Detected assembler with broken .inst; disassembly will be unreliable
      CHK     include/config/kernel.release
      UPD     include/config/kernel.release
      CHK     include/generated/uapi/linux/version.h
      CHK     include/generated/utsrelease.h
      UPD     include/generated/utsrelease.h
      HOSTCC  scripts/basic/fixdep
      HOSTCC  scripts/basic/bin2c
      CC      kernel/bounds.s
    gcc: error: unrecognized command line option ‘-mlittle-endian’
    gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
    make[3]: *** [kernel/bounds.s] Error 1
    make[2]: *** [prepare0] Error 2
    make[1]: *** [deb-pkg] Error 2
    make: *** [deb-pkg] Error 2

After googling the errors,
I ended up trying this new command line:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- deb-pkg

first errors are now gone,I wait for build result
I still have no idea of what to do next to take into account the dtb and the modules, and how to install all this on a running 4.9 or 4.12.7 system…:plate_with_cutlery: :haircut_man:

Edit:
build ended without error,
now, I see no evident sign of a .deb file anywhere, so, where is it ?

Ok, while I try to get documented on how to build a debian kernel package,
I decided to build the full xenial distro including the up-to-date 4.12.10 stable kernel;

and the good news is,
the build method I described before just works as well on the latest (4.12.10) mainline stable kernel sources;

so now, I managed to build, deploy and boot a working ubuntu base16.04.3+kernel 4.12.10 :checkered_flag::star_struck::tongue::palm_tree:

the bad news is,USB keyboard does not get recognized yet: no message in console nor in dmesg when I plug my usb keyboard,
and lsusb command cannot be found! this is too baaad !

As @balbes150 says his armbian built with the same kernel has working usb ports and I cannot get usb to work yet, I need to figure out what could be wrong in my distro;

any hint @numbqq or @narmstrong please ?
thanks

please find boot trace (dmesg) at this pastebin

See Neil patches for the kernel. For example in the project “meta-meson”.
Or use to build the kernel GIT Armbian.

Sorry i cannot find such patched source code,
Please kindly provide git url and branch or tag name to be used, tks !

An indication of the kernel Sources.
https://github.com/superna9999/meta-meson/blob/master/recipes-kernel/linux/linux-yocto-meson64_4.13.bb#L8

Indication used the kernel configuration and patches.
https://github.com/superna9999/meta-meson/blob/master/recipes-kernel/linux/linux-yocto-meson64_4.13.bb#L10

The files kernel configuration and patches.
https://github.com/superna9999/meta-meson/tree/master/recipes-kernel/linux/linux-yocto-meson64-4.13

I recommend using this step-by-step manual to start the Assembly. By the way, you can start the build only one kernel and get the output files of the kernel and dtb, and you can specify in customizing, that would have been collected ready deb\rpm packages which can install the usual commands in the existing system.

1 Like

octo poky env set for now, but build failed due to disk full, i will retry after i freed some more space

when I do…

cd amlogic-bsp/
source poky/oe-init-build-env
export MACHINE=khadas-vim
bitbake amlogic-image-headless-initrd

after a while, I get these errors…

| ERROR: Function failed: do_prep_locale_tree (log file is located at /home/raxy/Documents/amlogic-bsp/build/tmp-glibc/work/aarch64-oe-linux/glibc-locale/2.25-r0/temp/log.do_package.5485)
ERROR: Task (/home/raxy/Documents/amlogic-bsp/poky/meta/recipes-core/glibc/glibc-locale_2.25.bb:do_package) failed with exit code '1'
ERROR: qemu-native-2.8.0-r0 do_compile: oe_runmake failed
ERROR: qemu-native-2.8.0-r0 do_compile: Function failed: do_compile (log file is located at /home/raxy/Documents/amlogic-bsp/build/tmp-glibc/work/x86_64-linux/qemu-native/2.8.0-r0/temp/log.do_compile.5092)
ERROR: Logfile of failure stored in: /home/raxy/Documents/amlogic-bsp/build/tmp-glibc/work/x86_64-linux/qemu-native/2.8.0-r0/temp/log.do_compile.5092

II can’t figure out what is wrong, after looking in the error log and make file for glibc, I tried to set
export ENABLE_BINARY_LOCALE_GENERATION=1
but the same errors pop up again and again.

Anyone might have any clue on what I could change ?

1 Like

I 'm so sorry I finally need to give up on octo poky, I cannot figure out how to build a kernel the OpenEmbedded way.
So back to mainline legacy and trying to validate my existing protocol on 4.12.14
stay tuned.

EDIT:
4.12.14 + xenial successfully built (even if need to recheck some error messages)

boots ok,
serial console ok
ethernet works,
distro updates and upgrades ok
login prompt displayed on hdmi
BT installs ok

2 Likes

about building my kernel as a .deb package:
i’ve seen this

https://forum.odroid.com/viewtopic.php?f=112&t=11241

has anyone managed to build one vim kernel from an ubuntu 14 or 16 ,and with make-dpkg ?

1 Like