Jump to content

Trying to recompile the Kernel for MINI M8S...


whoman

Recommended Posts

Hello All!

Just got my MINI M8S today and thanks to Armbian, I now have Debian up and running.

 

I used "Armbian_5.24_Amlogic-s905x_Debian_jessie_3.14.29_20170118.img"

 

The only issue I have is that some of the ALSA kernel modules that are needed for MIDI support are disabled in this kernel.  Specifically, SND_SEQ_OSS, and possibly one or two others.

 

So I went ahead and installed the "linux-source" package, which matched up nicely with the existing headers.

After uncompressing, I copied "cp ../linux-headers-3.14.29/Module.symvers .", then I ran 'make menuconfig', which pulled in the config from '/boot' and I proceeded to enable the pertinent module options within menuconfig, however 'OSS Sequencer API' isn't module capable (you can only put an asterisk in the box, not an M).  So I proceeded to compile a new kernel with "make-kpkg clean" followed by "fakeroot make-kpkg --initrd --revision=custom.1.0 kernel_image".

 

Oddly enough I got a message suggesting the "revision" parameter had an illegal character (which it does not).

 

 

 

 

# fakeroot make-kpkg --initrd --revision=custom.1.0 kernel_image
 Error: The revision string may only contain
 alphanumerics and  the  characters ~ +  .
 If epochs are used, the colon : is also allowed
 The current value is: custom.1.0
 Aborting.
 

 

 

So I removed the 'revision' parameter completely, and ran "make-kpkg clean" followed by "fakeroot make-kpkg --initrd kernel_image"

 

 

 

 

fakeroot make-kpkg --initrd kernel_image
exec make kpkg_version=13.014+nmu1 -f /usr/share/kernel-package/ruleset/minimal.mk debian INITRD=YES
====== making target debian/stamp/conf/minimal_debian [new prereqs: ]======
This is kernel package version 13.014+nmu1.
test -d debian             || mkdir debian
test ! -e stamp-building || rm -f stamp-building
install -p -m 755 /usr/share/kernel-package/rules debian/rules
for file in ChangeLog  Control  Control.bin86 config templates.in rules; do                                      \
            cp -f  /usr/share/kernel-package/$file ./debian/;                               \
        done
cp: cannot stat ‘/usr/share/kernel-package/ChangeLog’: No such file or directory
for dir  in Config docs examples ruleset scripts pkg po;  do                                      \
          cp -af /usr/share/kernel-package/$dir  ./debian/;                                 \
        done
test -f debian/control || sed         -e 's/=V/3.16.39/g'  \
                -e 's/=D/3.16.39-10.00.Custom/g'         -e 's/=A/arm64/g'  \
    -e 's/=SA//g'  \
    -e 's/=I//g'                    \
    -e 's/=CV/3.16/g'                \
    -e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/g'                \
    -e 's/=ST/linux/g'      -e 's/=B/arm64/g'    \
                -e 's/=R//g'    /usr/share/kernel-package/Control > debian/control
test -f debian/changelog ||  sed -e 's/=V/3.16.39/g'       \
            -e 's/=D/3.16.39-10.00.Custom/g'        -e 's/=A/arm64/g'       \
            -e 's/=ST/linux/g'     -e 's/=B/arm64/g'         \
            -e 's/=M/Unknown Kernel Package Maintainer <unknown@unconfigured.in.etc.kernel-pkg.conf>/g'                            \
             /usr/share/kernel-package/changelog > debian/changelog
chmod 0644 debian/control debian/changelog
test -d ./debian/stamp || mkdir debian/stamp
make -f debian/rules debian/stamp/conf/kernel-conf
make[1]: Entering directory '/usr/src/linux-source-3.16'
debian/ruleset/misc/checks.mk:36: *** Error. I do not know where the kernel image goes to [kimagedest undefined] The usual case for this is that I could not determine which arch or subarch this machine belongs to. Please specify a subarch, and try again..  Stop.
make[1]: Leaving directory '/usr/src/linux-source-3.16'
/usr/share/kernel-package/ruleset/minimal.mk:93: recipe for target 'debian/stamp/conf/minimal_debian' failed
make: *** [debian/stamp/conf/minimal_debian] Error 2
Failed to create a ./debian directory: No such file or directory at /usr/bin/make-kpkg line 966.
 

 

 

I tried adding "--arch=arm64", no change, same error.

 

 

 

Am I not doing this correctly as far as kernel compilation goes for the Armbian?

Any insight would be greatly appreciated.

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

To build your kernel you can use a different algorithm of actions. Clone the source code. Copy the working configuration. To make a change. To compile the kernel. To collect the initrd. To handle initrd mkimage utility (need it for work u-boot). Without treatment, the initrd will not be perceived by the boot loader.

Link to comment
Share on other sites

Hi Balbes150,

Thank you for your response. 

I will try how you suggest.

 

I think perhaps for the step "Clone the source code" might be my mistake... I used "apt-get install linux-source".

 

This time I will try cloning the source directly from "kernel.org".

I will check to make sure I download the correct version.

 

I will try this tonight.

Thanks again.

Link to comment
Share on other sites

I'm not sure which location to download the source for my kernel image.

I originally downloaded the image "Armbian_5.24_Amlogic-s905x_Debian_jessie_3.14.29_20170118.img" from the link: https://yadi.sk/d/pHxaRAs-tZiei

 

I can't seem to determine where the source code is located.

 

I did go to https://github.com/igorpecovnik/lib on my Ubuntu Desktop system and I did run the compile.sh script.

I see that there is a kernel source folder named "sources/linux-odroidc2/odroidc2-3.14.y"

 

Would this be the source used to compile my kernel from "Armbian_5.24_Amlogic-s905x_Debian_jessie_3.14.29_20170118.img"?

If that is incorrect, can you let me know where I could find the source for "Armbian_5.24_Amlogic-s905x_Debian_jessie_3.14.29_20170118.img"?

 

Thanks for your time.

Link to comment
Share on other sites

The kernel sources for S905\S905X\S912 are in this GIT. The compliance branch in GIT the names of images and kernel versions.

 

1. images, the title of which stated "3.14.29" use - collected from branches S905X (universal - for the entire line of chips S9xxx).

2. Images - "3.14.79" - the branch odroid (this thread is only for chips S905)

3. Branch "armbian" - universal plan - for entire line S9xxx in an attempt to collect all positive elements   branches (Amlogic + Hardkernel + LE).

 

Pay attention to Assembly and installation\kernel for TV boxes is specific and different from the usual. I hope Marc (user Nofan Tasi) to share its successful experience build the kernel from source for TV boxes (including their details).

Link to comment
Share on other sites

The kernel sources for S905\S905X\S912 are in this GIT. The compliance branch in GIT the names of images and kernel versions.

 

1. images, the title of which stated "3.14.29" use - collected from branches S905X (universal - for the entire line of chips S9xxx).

2. Images - "3.14.79" - the branch odroid (this thread is only for chips S905)

3. Branch "armbian" - universal plan - for entire line S9xxx in an attempt to collect all positive elements   branches (Amlogic + Hardkernel + LE).

 

Pay attention to Assembly and installation\kernel for TV boxes is specific and different from the usual. I hope Marc (user Nofan Tasi) to share its successful experience build the kernel from source for TV boxes (including their details).

 

Hi all

 

Here is recipe I use to natively build S905/ordroid kernel. Note this is on gentoo so initramfs details differ from ubuntu practice.

**** BACKUP /boot /lib/modules /lib/firmware ****


**** choose 4.9 gcc ****
gcc-config aarch64-unknown-linux-gnu-4.9.4
. /etc/profile


export ARCH=arm64
git clone https://github.com/150balbes/Amlogic_s905-kernel.git


cd Amlogic_s905-kernel
git checkout S905X
 or
git checkout odroid


make clean
make mrproper


# S905X
wget https://raw.githubusercontent.com/150balbes/lib/master/config/kernel/linux-amlogics905x-default.config
cp -p linux-amlogics905x-default.config .config


# odroid
cp -p ../config-3.14.79-vegas95 .config


make oldconfig


make -j3 Image
make -j3 modules
make -j3 dtbs


cp -p arch/arm64/boot/dts/*.dtb /boot/dtb/


make modules_install
make install
make firmware_install


# S905X
dracut --kernel-cmdline "root=LABEL=ROOTFS boot=LABEL=BOOT" initramfs-dracut-arm64-3.14.29 3.14.29
cp -p initramfs-dracut-arm64-3.14.29 initrd.img
mkimage -A arm64 -O linux -T ramdisk -C none -a 0 -e 0 -n uinitrd -d initrd.img uInitrd


# odroid
dracut --kernel-cmdline "root=LABEL=ROOTFS boot=LABEL=BOOT" initramfs-dracut-arm64-3.14.79+ 3.14.79+
cp -p initramfs-dracut-arm64-3.14.79+ initrd.img
mkimage -A arm64 -O linux -T ramdisk -C none -a 0 -e 0 -n uinitrd -d initrd.img uInitrd


# install them in /boot


unset ARCH=arm64
**** restore previous gcc ****
gcc-config aarch64-unknown-linux-gnu-6.3.0
. /etc/profile

 

depends on S905x or odroid your boot could look like

 

 S905x

aml_autoscript      amlogics905x_init.sh  config-3.14.29  dtb.img             s905_autoscript      s905.start          uInitrd
aml_autoscript.zip  boot.bmp              dtb             initrd.img-3.14.29  s905_autoscript.cmd  System.map-3.14.29  zImage
 odroid
aml_autoscript        boot.bmp         dtb.img              s905_autoscript.cmd  uInitrd           zImage
aml_autoscript.zip    config-3.14.79+  initrd.img-3.14.79+  s905.start           uInitrd-3.14.79+
amlogics905x_init.sh  dtb              s905_autoscript      System.map-3.14.79+  vmlinuz-3.14.79+

The script files come from Balbes distributions.

 

Link to comment
Share on other sites

Thank you so much,

I followed Nofan Tasi's Recipe and it worked perfectly. :thumbup:

 

I was able to successfully compile the new kernel with the modules I wanted to enable...

 

I then modified my boot configuration to boot the new kernel, and confirmed now the modules are loading and MIDI is working correctly.

 

Thanks again Nofan Tasi and Balbes150. 

 

Now I have some gstreamer questions I will open a new thread for.

Link to comment
Share on other sites

Hi ,

 

My device is a "MINI M8S II" and I am using "Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_desktop_20170118.img".

 

I have no audio output on HDMI.

 

I am open to use "Armbian_5.24_Amlogic-s905x_Debian_jessie_3.14.29_20170118.img" if the issue can be solved 

By any chance, can you share your new kernel for download with the modules enabled for this device ?

 

Thank you.

Link to comment
Share on other sites

Hi dxs1,

Unfortunately my kernel will do nothing different for audio output.

 

the modules I have compiled are only for "midi sequencer" communication.  They have nothing to do with audio output.

 

Also, I could be mistaken but I'm pretty sure the amlogic drivers for sound output are already in the original kernel configuration, so that is likely not the cause of your issue.

 

I'm personally using this strictly for video/image output, so I have no experience with audio output on the S905X.

 

I would suggest creating a new thread, so that more people will see your thread title and can help with your problem.

Link to comment
Share on other sites

On 28/1/2560 at 1:38 PM, whoman said:

Thank you so much,

I followed Nofan Tasi's Recipe and it worked perfectly. :thumbup:

 

I was able to successfully compile the new kernel with the modules I wanted to enable...

 

I then modified my boot configuration to boot the new kernel, and confirmed now the modules are loading and MIDI is working correctly.

 

Thanks again Nofan Tasi and Balbes150. 

 

Now I have some gstreamer questions I will open a new thread for.

Hello whoman

I used "Armbian_5.24_Amlogic-s905x_Debian_jessie_3.14.29

I think the problem is the same as you. The problem is that the kernel does not support midi. (/dev/snd/seq not found)

I am an end user, so it's hard to get a kernel file. I tried to follow the example of Nofan Tasi and it was not successful. As I said, I'm not expert and do not understand the config values of kernel.

Can you describe your kernel compilation successfully? Hope to receive your kindness from you.

Thank you

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines