Manjaro arm on Amlogic Tv box?

Using https://yadi.sk/d/ZMQW85B-P6QejA provided by @uropb. I can boot from a sd card with a usb stick attached to my x96 air usb3 slot.
But if I use my ssd usb3 stick it won’t boot linux, just goes to android. My usb ssd is one the problematic that needs to be ignored the uas. In my laptop i can mount it by adding a .conf file to /etc/modprobe.d with this commands
echo options usb-storage quirks=152d:0562:u | sudo tee /etc/modprobe.d/blacklist_uas_152d.conf
sudo update-initramfs -u
I read that is possible to use as root partition this kind of ssd by adding usb-storage.quirks=152d:0562:u to /boot/cmdline.txt with the raspberrypi. So i was wondering if is possible to have similar approach with manjaro arm for tv boxes
Here is the same problem with odroid xu4, and how it is solved [Solved] UAS problem with Seagate disk and enclosure - ODROID

I think I manged to make it work.
I had this usb-storage.quirks=152d:0562:u (usb-storage.quirks=idVendor:idProduct:u) in extlinux.conf like this
root=LABEL=ROOT_MNJRO rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 usb-storage.quirks=152d:0562:u bootsplash.bootfile=bootsplash-themes/manjaro/bootsplash

then I did
sudo mkinitcpio -p linux-vim
then reboot
dmesg | grep usb

and now I get
New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 257.539259] usb 2-1: Product: External
[ 257.542930] usb 2-1: Manufacturer: JMicron
[ 257.546983] usb 2-1: SerialNumber: 201210430000402
[ 257.552722] usb 2-1: UAS is ignored for this device, using usb-storage instead
[ 257.558948] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 257.565279] usb-storage 2-1:1.0: Quirks match for vid 152d pid 0562: 800000
[ 257.572040] scsi host0: usb-storage 2-1:1.0
[ 258.290646] usbcore: registered new interface driver uas

Now Iḿ going to try this image using the ssd as root partition
Update
I can now use ssd with manjaro on my x96 air, but booting from a sd card and using the ssd as root still fails (boots in android). Maybe its needed to set a delay because the ssd card is slow and doesn’t get detected?

How can I do the same in manjaro?

1 Like

Post it here with “```” and I will try to pkg it.

@spikerguy Here comes the source for rtl8822cs wifi driver dkms package (as written before this is just the rtl8723cs package adapted to rtl8822cs).

Info: I have built the package this morning and for testing I have transfered it to a second Manjaro image on sd card which still had kernel 5.10.5. I was able to install the package and successfully activate internal wifi. Everything working well after a reboot.
Then I upgraded to 5.10.8 kernel and driver was automatically rebuilt. Again, everything working well after a reboot.

dkms.conf:

PACKAGE_NAME="rtl8822cs"
PACKAGE_VERSION="@PKGVER@"

AUTOINSTALL="yes"

CLEAN[0]="make clean"

MAKE[0]="'make' -j4 ARCH=arm64 KVER=$kernelver KSRC=/lib/modules/$kernelver/build/"

BUILT_MODULE_NAME[0]="88x2cs"

BUILT_MODULE_LOCATION[0]=""

DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"

dkms-rtl8822cs.install

post_install() {
   dkms install "rtl8822cs/2020.11.20"
}

post_upgrade() {
   post_install
}

pre_remove() {
   dkms remove "rtl8822cs/2020.11.20" --all
}

PKGBUILD

_gitname=rtl8822cs
pkgname=dkms-rtl8822cs
pkgver=2020.11.20
pkgrel=1
pkgdesc="Realtek RTL8822CS wifi driver (DKMS)"
arch=('any')
url="https://github.com/chewitt/$_gitname"
license=('GPL')
install=dkms-rtl8822cs.install
depends=('linux>4.14' 'dkms' 'linux-headers>4.14')
makedepends=('git')
options=(!strip)
source=("git+${url}.git" "dkms.conf")

md5sums=('SKIP' 'SKIP')
#         '7bd926532bc021b116f82bf1b049c8bf')

pkgver() {
   cd "$srcdir/$_gitname"
   git log -1 --format="%cd" --date=short | sed 's|-|.|g'
}

package() {
   cp dkms.conf "$srcdir/$_gitname/"
   cd "$srcdir/$_gitname"
   mkdir -p "$pkgdir/usr/src/rtl8822cs-$pkgver"
   cp -r . "$pkgdir/usr/src/rtl8822cs-$pkgver"
}

So no arm.patch needed for this?

Looks straight forward :slight_smile:

Ill pkg this but I’d like you to use git and host it on git for other distros to reuse it. That way you will get the hang of using git. :stuck_out_tongue:
“Come for the OS, Stay for the community” :wink:

Ill do the same on manjaros git :wink:

Compiling :slight_smile:
Looks good. I cannot test if it works but all looks good.

Gitlab Repo
@TheMojoMan dm me what you want me to add to creator name and email :wink:

Will push it to unstable in some time.

Maybe in future will have to replace

to use the sames pkgver :smiley:

Updated to unstable, Those who have rtl8822 chip please test and let me know if anything needs to be changed.

1 Like

Sorry I need help, how can I do a similar thing in manjaro arm?

Create a directory /etc/initramfs-tools/scripts/local-block
Create an executable script in that directory with these contents:
delay=20
echo Sleeping for ${delay} seconds to allow disk to be found...
sleep ${delay}
"update-initramfs -u" to incorporate the new script into the ramdisk.

Yes this seem to work fine with a usb stick connected.
@uropb Can you share the source for this ? I am testing it with emmc and it doesn’t seem to work with emmc as it cannot find emmc at all.

What exactly are you trying to do ?

I’m trying to have a delay so my /dev/sda1 can have time to appear and then can be used as the root partition

Should be visible on boot, Can you see it on uboot start screen ? I tried a usb stick and I could see that uboot was able to read it .

but it seems that some ssd disks are slow to show (mine is one of them) and then it doesn’t boot, in my case boots in android.

Manage to make it work, with root=/dev/sda
Now I have to do some testing

What were you trying to do before ? I think you followed the method I explained by using the Label or number or PARTUUID any method will do the job.

Good to know you found a solution.

Using label but something wasn’t working (maybe because i was copying only the boot partition to the sd card with disk restore image, now i used a full image with etcher)

I will try and report back, but the main reason for using a ssd is that I’m fed up of slowly killing sd and usb cards (1 sd card and a usb stick in the last 2 days)

Oh Ok, IDK which one you have been using but I have only faced this issue after using the sd cards for months after writing multiple images on it during every release.

Anyways finally you have found a solution for it. I have been testing emmc installer script and I have the updated version of it but the u-boot.ext doesn’t support emmc boot, so need a new u-boot.ext

1 Like

I already have my home assistant installed in manjaro minimal version … the operating system running on SD Card and waiting for @spikerguy to tell me when it has a version that I can try to transfer the operating system from the SD Card to the EMMC memory.

@spikerguy I await your notice.

1 Like

just lost my sound output
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SM1X96MAXPLUS [SM1-X96-MAX-PLUS], device 0: fe.dai-link-0 () []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: SM1X96MAXPLUS [SM1-X96-MAX-PLUS], device 1: fe.dai-link-1 (
) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: SM1X96MAXPLUS [SM1-X96-MAX-PLUS], device 2: fe.dai-link-2 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
I tried to edit /usr/bin/g12a_sound.sh But I don’t have such file
So now sound points to dummy output
Can someone pass me the g12a_sound.sh so I can see if works?

Here comes g12a_sound.sh with card1 already set to the name of your sound card:

#!/bin/sh


mixer() {
  parm=${4:-on}
  amixer -c "$1" sset "$2" "$3" $parm >/dev/null 2>&1
  amixer -c "$1" sset "$2" $parm >/dev/null 2>&1
}


if [ -f $HOME/.config/sound.conf ]; then

  alsactl restore -f $HOME/.config/sound.conf

else

# get card num
#card=`echo $1 | sed 's/[^0-9]*//g'`
card1=`aplay -l | grep "Karte 0" | awk '{print $3}'`
echo $card1
card1="SM1X96MAXPLUS"
for card in $card1 
do

echo $card

# set common mixer params
  mixer $card Master 0db
  mixer $card Front 100%
  mixer $card PCM 0db
  mixer $card Synth 100%

# mute CD, since using digital audio instead
  mixer $card CD 0% mute

# Only unmute Line and Aux if they are possibly used.
#  mixer $card Line 100%
#  mixer $card Aux 100%

# mute mic
  mixer $card Mic 0% mute

# ESS 1969 chipset has 2 PCM channels
  mixer $card PCM,1 100%

# Trident/YMFPCI/emu10k1
  mixer $card Wave 100%
  mixer $card Music 100%
  mixer $card AC97 100%
  mixer $card Surround 90%
  mixer $card 'Surround Digital' 90%
  mixer $card 'Wave Surround' 90%
  mixer $card 'Duplicate Front' 90%
  mixer $card 'Sigmatel 4-Speaker Stereo' 90%

# CS4237B chipset:
  mixer $card 'Master Digital' 100%

# DRC
  mixer $card 'Dynamic Range Compression' 90%

# Envy24 chips with analog outs
  mixer $card DAC 100%
  mixer $card DAC,0 100%
  mixer $card DAC,1 100%

# some notebooks use headphone instead of master
  mixer $card Headphone 100%
  mixer $card Speaker 100%
  mixer $card 'Internal Speaker' 0% mute
  mixer $card Playback 100%
  mixer $card Headphone 100%
  mixer $card Speaker 100%
  mixer $card Center 100%
  mixer $card LFE 100%
  mixer $card Center/LFE 100%

# Intel P4P800-MX  (Ubuntu bug #5813)
  mixer $card 'Master Playback Switch' on

# set digital output mixer params
  mixer $card 'IEC958' 100% on
  mixer $card 'IEC958 Output' 100%
  mixer $card 'IEC958 Coaxial' 100%
  mixer $card 'IEC958 LiveDrive' 100%
  mixer $card 'IEC958 Optical Raw' 100%
  mixer $card 'SPDIF Out' 100%
  mixer $card 'SPDIF Front' 100%
  mixer $card 'SPDIF Rear' 100%
  mixer $card 'SPDIF Center/LFE' 100%
  mixer $card 'Master Digital' 100%

  mixer $card 'Analog Front' 100%
  mixer $card 'Analog Rear' 100%
  mixer $card 'Analog Center/LFE' 100%

# ASRock ION 330 (and perhaps others) has 2 IEC958 channels
  mixer $card IEC958,0 on
  mixer $card IEC958,1 on

# some ION2 has much more IEC958 channels ...
  mixer $card IEC958,2 on
  mixer $card IEC958,3 on

# ASRock ION 330 has Master Front set to 0
  mixer $card 'Master Front' 100%

# Shuttle XS35GT needs this too
  mixer $card 'Master',0 100% on

# and this for various Fusion devices like Zotac ZBOX
  mixer $card 'Front',0 100% on

# NVidia CK804 sound devices
  mixer $card 'IEC958 Playback AC97-SPSA' 100%

# Allwinner H3 Analog
  mixer $card 'Line Out' 0db on

# Allwinner A20 Analog
        mixer $card 'HPO MIX HPVOL' on
      mixer $card 'OUT MIXL DAC L1' on
      m I tried to edit `/usr/bin/g12a_sound.sh` But I don’t have such fileixer $card 'OUT MIXR DAC R1' on
        mixer $card 'Stereo DAC MIXL DAC L1' on
        mixer $card 'Stereo DAC MIXR DAC R1' on

    done

    fi

    exit 0mixer $card 'Power Amplifier' 0db
  mixer $card 'Power Amplifier DAC' on
  mixer $card 'Power Amplifier Mute' on

# Allwinner A64 Analog
  mixer $card Headphone 0db on
  mixer $card 'AIF1 Slot 0 Digital DAC' on

# Amlogic G12 HDMI to PCM0 - OLD CONF
#  mixer $card 'FRDDR_A SINK 1 SEL' 'OUT 1'
#  mixer $card 'FRDDR_A SRC 1 EN' on
#  mixer $card 'TDMOUT_B SRC SEL' 'IN 0'
#  mixer $card 'TOHDMITX I2S SRC' 'I2S B'
#  mixer $card 'TOHDMITX' on

# Amlogic G12 HDMI to PCM0 - NEW CONF
   mixer $card 'FRDDR_A SINK 1 SEL' 'OUT 0'
   mixer $card 'FRDDR_A SRC 1 EN' on
   mixer $card 'TDMOUT_A SRC SEL' 'IN 0'
   mixer $card 'TOHDMITX' on
   mixer $card 'TOHDMITX I2S SRC' 'I2S A'

# Amlogic G12 S/PDIF to PCM1
  mixer $card 'FRDDR_B SINK 1 SEL' 'OUT 3'
  mixer $card 'FRDDR_B SRC 1 EN' on
  mixer $card 'SPDIFOUT SRC SEL' 'IN 1'
  mixer $card 'SPDIFOUT Playback' on

# Amlogic GX HDMI and S/PDIF
  mixer $card 'AIU HDMI CTRL SRC' 'I2S'
  mixer $card 'AIU SPDIF SRC SEL' 'SPDIF'

# RockPI 4B Analog
  mixer $card 'Right Headphone Mixer Right DAC' on
  mixer $card 'Left Headphone Mixer Left DAC' on

# NanoPC T4 Analog
  mixer $card 'HPO L' on
  mixer $card 'HPO R' on
  mixer $card 'HPOVOL L' on
  mixer $card 'HPOVOL R' on
  mixer $card 'HPO MIX HPVOL' on
  mixer $card 'OUT MIXL DAC L1' on
  mixer $card 'OUT MIXR DAC R1' on
  mixer $card 'Stereo DAC MIXL DAC L1' on
  mixer $card 'Stereo DAC MIXR DAC R1' on

done

fi

exit 0
1 Like

thanks @TheMojoMan , going to try it

No luck.
Reinstalled another image and upgraded, no issue with sound

I take it from balbes150 libreelec img. How it work Official LE11 Test Images for Amlogic (Kodi-20) - Seite 5 - Amlogic - LibreELEC Forum
Source code l don’t know. But libreelec can install to emmc and have right u-boot.

@spikerguy, I have been using this for_linux-vim-5101.tar u-boot.ext and for me it does not boot up if a USB stick or USB HDD is connected to another USB port on Beelink GT King Pro.

With a new install of manjaro, and trying to use unstable repo to install rtl8822cs package. I’m getting this error.
DKMS make.log for rtl8822cs-2020.11.20 for kernel 5.10.8-1-MANJARO-ARM (aarch64)
ter 02 fev 2021 10:35:29 WET
/bin/sh: linha 1: bc: comando não encontrado
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/5.10.8-1-MANJARO-ARM/build/ M=/var/lib/dkms/rtl8822cs/2020.11.20/build modules
make[1]: a entrar na pasta “/usr/lib/modules/5.10.8-1-MANJARO-ARM/build”
/bin/sh: linha 1: bc: comando não encontrado
CC [M] /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_cmd.o
CC [M] /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_security.o
CC [M] /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_io.o
CC [M] /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_debug.o
/var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_debug.c: In function ‘dump_drv_version’:
/var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_debug.c:49:62: error: macro “DATE” might prevent reproducible builds [-Werror=date-time]
49 | RTW_PRINT_SEL(sel, “build time: %s %s\n”, DATE, TIME);
| ^
In file included from /var/lib/dkms/rtl8822cs/2020.11.20/build/include/drv_types.h:60,
from /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_debug.c:17:
/var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_debug.c:49:44: error: macro “TIME” might prevent reproducible builds [-Werror=date-time]
49 | RTW_PRINT_SEL(sel, “build time: %s %s\n”, DATE, TIME);
| ^~~~~~~~
/var/lib/dkms/rtl8822cs/2020.11.20/build/include/rtw_debug.h:224:25: note: in definition of macro ‘RTW_PRINT_SEL’
224 | _seqdump(sel, fmt, ##arg) /rtw_warn_on(1)/;
| ^~~
CC [M] /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_ioctl_query.o
CC [M] /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_ioctl_set.o
CC [M] /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_ieee80211.o
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/rtl8822cs/2020.11.20/build/core/rtw_debug.o] Erro 1
make[2]: *** A aguardar por trabalhos não terminados…
make[1]: *** [Makefile:1805: /var/lib/dkms/rtl8822cs/2020.11.20/build] Erro 2
make[1]: a sair da pasta “/usr/lib/modules/5.10.8-1-MANJARO-ARM/build”
make: *** [Makefile:2296: modules] Erro 2

Is it complaining about the date?