Giter Club home page Giter Club logo

amlogic-s9xxx-archlinuxarm's Introduction

Welcome to Guoxin "7Ji" Pu's profile

A free and open source software enjoyer, creator, maintainer and contributor; hardware tinkerer; full-time OS and kernel engineer.

My GitHub Stats

My current public blog site is at https://7ji.github.io/ . The posts there only focus on non-development stuffs, like servers, booting, reverse-engineering, etc, note there's none of content about my FOSS projects, as I prefer to document the projects in tree and get everything recorded in issues or any other public places. There's nothing about daily life so be prepared for the information density.

My email is publicly available, but, please don't send private email asking about the public projects, I've ensured the publicly avaiable documentation and existing issues be enough to get you around. Keep public subjects public, i.e. open an issue instead of sending an email. If you do send, be warned that your email will either be ignored or get an impatient, unfriendly reply.

My GitHub Language Stats

I created the following projects and maintain them actively:

  • ampart, a partition tool for Amlogic's proprietary eMMC partition format mainly found on their Android firmware, in C, based on my reverse-engineering, a patchset for mainline kernel is also available to natively support such partitions.
  • ampack, a tool to unpack, convert and (re)pack Amlogic burning images, in Rust, also based on my reverse-engineering, aiming to replace AML's proprietary aml_image_v2_packer binray.
  • git-mirrorer / gmr, a tool to mirror git repos, and archive and checkout them with submodules included implicitly, in C, using libgit2 and libyaml.
  • YAopenvfD, a helper daemon to improve the functionality of the linux_openvfd kernel module, for fragment LCD displays found on set-top boxes, in C.
  • eemount, a system utility to efficiently and elegantly set up the external ROMs mounting for EmuELEC (see below), in C, using libsystemd.
  • pkgbuild-rs, a naive PKGBUILD parsing library, that runs on any distro or platform (even non Arch), in Rust.
  • alnopm, an Arch Linux Pacman repository database parsing library, that runs on any distro or platform (even non Arch), in Rust.
  • arb, a builder to build an Arch Linux repo in a disk-space-and-network-efficient way, in Rust.
  • sd-networkd-wg-ddns, a systemd-networkd wireguard netdev endpoints DynDNS updater, in C.
  • wireguard-deployer, a single-config WireGuard keys and systemd-networkd + OpenWrt configs generator (also as tar with correct permissions), in Rust.
  • archrepo, an Arch Linux / Arch Linux ARM repo, focusing on media center use cases, hosting pre-built kernel and video de/encoding packages, notably for Rockchip RK3588 (Orange Pi 5/5B/5Plus, Orange Pi 3B, Radxa Rock 5B) and Amlogic platforms, updated hourly.
  • amlogic-s9xxx-archlinuxarm, orangepi5-archlinuxarm and orangepi5-rkloader providing pre-built ALARM / bootloader images with my ported/maintained kernels pre-installed.
  • nvrust, a daemon to turn any Linux box into a Network Video Recorder, in Rust, using libffmpeg.
  • videoArchiver.py, a video archiving tool, in Python, using ffmpeg.
  • usb2host in C, router_reporter in Go, mirai-ip-notifier in Go, arch_pkgbuilds_dumper in Python, CargoStranding in C++, CargoStrandingWeb in Javascript, and other nice tools.

I created the following organisations and actively lead & maintain them:

  • 7Ji-PKGBUILDs, collections of PKGBUILDs (recipes to build Arch Linux package from) submitted/maintained/co-maintained by myself, focusing on kernel, video de/encoding, and more. Consider it my own AUR.
  • HybridELEC, a downstream semi-distro to achieve side-by-side dual boot of CoreELEC (see below) and EmuELEC (see below), some special images are also released for chosen devices to achieve triple boot, with Android as the main OS. In various languages (including an Android App to switch OS) and based on kernel/booting reverse-engineering.

I maintaind the following projects previously and enjoyed the experience:

  • EmuELEC (during 2022-2023), a distro focusing on smooth out-of-box retro gaming experience on entry-level ARM devices, for Amlogic and Rockchip devices. As the kernel expert in team to introduce support to new devices.

I contributed to various projects and here's not enough space to document them.

Some of my upstreamable / non-upstreamable patches to mainline kernel and u-boot are hosted in the following repos/branches:

  • 7Ji/linux, the default amlogic tree contains my patchsets to enable Amlogic partitions support, port several device trees, and add/improve the JL21xx network PHY driver and openvfd driver.
  • 7Ji/u-boot, the default random-boxes tree contains my patchsets to port/add several device trees, and add support for environment-based partitions.
  • 7Ji/linux-orangepi, the default orange-pi-5.10-rk3588-gcc-12 branch contains my fixes to drivers, filesystem, memory management and more to make the BSP kernel buildable on post-gcc-12 toolchains.

amlogic-s9xxx-archlinuxarm's People

Contributors

7ji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

amlogic-s9xxx-archlinuxarm's Issues

Wifi problem

Hi , recently i installed your amlogic-archlinuxarm on my TVBOX
i have problem to connecting to wifi .
any command not exist to help me to connect to wifi such as iwctl , wpa_supplicant , wifi-menu , nmtui ,etc

系统通过reboot重启后 RTL8761BTV 蓝牙不能使用

测试盒子为UNT403A,CPU: S905L3A / S905L3A-b

现在的做法和发现:

  1. 修改dts源码,在uart_A部分增加bluetooth内容并编译为dtb:
    &uart_A {
    status = "okay";
    pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
    pinctrl-names = "default";
    uart-has-rtscts;

     bluetooth {
             compatible = "realtek,rtl8723bs-bt";
             enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
             max-speed = <2000000>;
             clocks = <&wifi32k>;
             clock-names = "lpo";
     };
    

};
临时优化方法:上述代码中bluetooth部分其实只有
compatible = "realtek,rtl8723bs-bt";
这一行有用!

  1. 将2m波特率的config文件复制到/lib/firmware/rtl_bt/rtl8761b_config.bin。
  2. poweroff、断电、重开,蓝牙正常!
  3. reboot后蓝牙无法识别无法使用、gpioset命令也无法使用(因为gpio 82已经被系统/rfkill占用)。
    参见https://bbs.hassbian.com/thread-18366-1-1.html
    该帖子作者试过reset-gpios,不好使,猜测得修改驱动程序源码重新编译内核了。

我在archlinuxarm和Armbian下,遇到的问题是一样,故过来看看有没有啥解决办法。
相关文件已经放在https://gitee.com/xiayang0521/set_bluetooth

关于linux-headers

类似的问题也出现在amlogic-s9xxx-armbian,比如我想安装zfs-linux,结果需要linux-headers,

yay -S zfs-linux
-> Could not find all required packages:
linux=6.1.12.arch1-1 (Wanted by: zfs-linux)
linux-headers=6.1.12.arch1-1 (Wanted by: zfs-linux)

能不能在编译内核时给一个对应的程序包?没有这东西似乎编译一个wifi驱动都困难。

不好意思,在release里看到了,我去试试。

chroot环境域名解析失败

主机系统使用的是ArchLinuxARM-aarch64-Amlogic-20221112.2.img.xz,使用arch-chroot 进入chroot环境,无法ping通域名,好像是主机resolv.conf文件的问题,改成/run/systemd/resolve/resolv.conf的软链接就正常了

WIFI not detected

Hi , my wifi cheap is rtl88x2cs and my wifi cheap not listed at ip add command

dmesg频繁出现audit: type=...

机型unt403A cpu S905L3A 使用meson-g12a-s905l3a-cm311.dtb,在Armbian中使用https://gitee.com/xiayang0521/backup_linux_system里的脚本写入了EMMC,安装上ArchLinuxARM-aarch64-Amlogic-20230216_011012-root.tar.xz之后,成功启动,没发现啥使用问题,但dmesg出现如下信息,不知道有没有影响:

...
[ 14.133623] kauditd_printk_skb: 18 callbacks suppressed
[ 14.133637] audit: type=1334 audit(1675140692.232:36): prog-id=26 op=LOAD
[ 14.140124] audit: type=1334 audit(1675140692.236:37): prog-id=27 op=LOAD
[ 14.146833] audit: type=1334 audit(1675140692.244:38): prog-id=28 op=LOAD
[ 14.332413] audit: type=1130 audit(1675140692.428:39): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 16.606818] platform sdio-pwrseq: deferred probe pending
[ 16.606956] platform wifi32k: deferred probe pending
[ 18.284162] audit: type=1100 audit(1675140696.380:40): pid=390 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='op=PAM:authentication grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 18.304732] audit: type=1101 audit(1675140696.396:41): pid=390 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 18.329760] audit: type=1103 audit(1675140696.404:42): pid=390 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 18.354489] audit: type=1006 audit(1675140696.404:43): pid=390 uid=0 subj=kernel old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=1 res=1
[ 18.367733] audit: type=1300 audit(1675140696.404:43): arch=c00000b7 syscall=64 success=yes exit=1 a0=3 a1=7fc66cbad0 a2=1 a3=7f9a03e9c0 items=0 ppid=381 pid=390 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="sshd" exe="/usr/bin/sshd" subj=kernel key=(null)
[ 18.393686] audit: type=1327 audit(1675140696.404:43): proctitle=737368643A20726F6F74205B707269765D
[ 19.156101] kauditd_printk_skb: 69 callbacks suppressed
[ 19.156114] audit: type=1100 audit(1675140697.252:81): pid=393 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='op=PAM:authentication grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 19.182016] audit: type=1101 audit(1675140697.256:82): pid=393 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 19.206250] audit: type=1110 audit(1675140697.260:83): pid=404 uid=0 auid=0 ses=1 subj=kernel msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 19.229783] audit: type=1103 audit(1675140697.264:84): pid=393 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 19.254846] audit: type=1006 audit(1675140697.264:85): pid=393 uid=0 subj=kernel old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=3 res=1
[ 19.268121] audit: type=1300 audit(1675140697.264:85): arch=c00000b7 syscall=64 success=yes exit=1 a0=3 a1=7fecfd9220 a2=1 a3=7f9c7b49c0 items=0 ppid=381 pid=393 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=3 comm="sshd" exe="/usr/bin/sshd" subj=kernel key=(null)
[ 19.294091] audit: type=1327 audit(1675140697.264:85): proctitle=737368643A20726F6F74205B707269765D
[ 19.303055] audit: type=1110 audit(1675140697.276:86): pid=403 uid=0 auid=0 ses=1 subj=kernel msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 19.353702] audit: type=1105 audit(1675140697.452:87): pid=393 uid=0 auid=0 ses=3 subj=kernel msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'
[ 19.585025] audit: type=1110 audit(1675140697.680:88): pid=410 uid=0 auid=0 ses=3 subj=kernel msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sshd" hostname=192.168.1.18 addr=192.168.1.18 terminal=ssh res=success'

how to enable openvfd

Hi , thanks for your amazing project , but how i can enable openvfd ? need to install extra package? or YAopenvfd installed by default?

写入设备emmc的boot分区内容可以直接复制U盘boot么

我按照https://7ji.github.io/embedded/2022/11/08/alarm-install.html#extra-partitioning-of-emmc--%E7%BB%99emmc%E5%88%86%E5%8C%BA 安装好之后,唯独看https://7ji.github.io/embedded/2022/11/11/amlogic-booting.html#setups--%E5%AE%89%E8%A3%85%E6%96%B9%E6%B3%95 决定不了/boot分区里的内容

可以图省事,把U盘的boot分区内容直接复制到emmc的boot分区么
emmc上也是一个fat32的boot和ext4的root

我想u盘能启动,那么u盘的boot分区内容是对的,那把boot分区复制到emmc那只要改一下root=UUID=
是不是就可以了

内核包无法编译

image

[tony@alarm linux-aarch64-flippy-bin]$ makepkg -s
==> Making package: linux-aarch64-flippy-bin 6.1.18-1 (Sun 02 Apr 2023 10:43:22 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading boot-6.1.18-flippy-82+.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
==> ERROR: Failure while downloading https://github.com/ophub/kernel/raw/main/pub/stable/6.1.18/boot-6.1.18-flippy-82+.tar.gz
Aborting...
[tony@alarm linux-aarch64-flippy-bin]$
固件包可以编译 但是内核包似乎地址失效了 无法编译成功

能否启动项root=LABEL=ROOTFS_EMMC

新版系统ArchLinuxARM-aarch64-Amlogic-20230225_150037-root.tar.xz已在B860-AV3.2M (CPU: S905L3A) 测试,测试启动以及pacman安装软件没问题。
有个问题,Kernel command line 能否把改用LABEL, 比如,root=LABEL=ROOTFS_EMMC,同时在fstab里也都改用LABEL。

[PROGRESS] Switch to mainline-ish kernel (linux-aarch64-7ji)

We're not using official ArchLinux ARM linux-aarch64 kernel because it is lagged behind in versioning (currently 6.2.10) and is broken on Amlogic platform

The linux-aarch64-flippy kernel we're currently using however, is also lagged behind at 6.1.38, and derived a lot from the mainline kernel. The more it derived the harder it is in the future for users to switch back to the untouched mainline kernel.

A new kernel linux-aarch64-7ji is added, using upstream https://github.com/7ji/linux branch amlogic, now at version 6.4.3, with only bare-minimum changes for Amlogic platforms. Most noticable differences are my patches already in flippy kernel, and a few dts ported from flippy kernel.

The two kernels (linux-aarch64-flippy and linux-aarch64-7ji) are both pre-installed in new images now, with -flippy being the default one. I'm not planning to remove flippy kernel soon since there's preciously a lot of nice stuffs for Amlogic platforms.

If, however, any one want to use -7ji kernel, do note there's a few traps:

  • The kernel lacks a l lot of dts from -flippy, you can still use the dts from flippy kernel if you don't uninstall it. The two kernels can co-exist, unlike ArchlinuxARM's official kernels
  • Since the dts are mostly untouched, the mmc device ordering is different, instead of mmc1 being sd card and mmc2 being emmc, it's mmc0 being sd card and mmc1 being emmc. SDIO card uses slot 2 instead of 1. This will bite you if you're using mmcblkXpY as the bootup configuration or mounting configuration.
  • The kernel does not have dtbs for Allwinner or Rockchip platforms pre-built, this is only for Amlogic platforms

将启动文件放入EMMC单独分区的办法启动alarm未成功

我看了https://7ji.github.io/embedded/2023/02/20/gxbb-emmc.html这篇教程,眼前一亮,感觉应该也适用于其他s9xxx的cpu吧,
unt403a未刷主线bootloader,将20230401的alarm烧录U盘启动,分区按

ampart /dev/mmcblk2  -m dclone dtb::1M:1 initramfs::32M:1 kernel::64M:1 data::-1:4
===================================================================================
ID| name            |          offset|(   human)|            size|(   human)| masks
-----------------------------------------------------------------------------------
 0: bootloader                      0 (   0.00B)           400000 (   4.00M)      0
    (GAP)                                                 2000000 (  32.00M)
 1: reserved                  2400000 (  36.00M)          4000000 (  64.00M)      0
    (GAP)                                                  800000 (   8.00M)
 2: cache                     6c00000 ( 108.00M)                0 (   0.00B)      0
    (GAP)                                                  800000 (   8.00M)
 3: env                       7400000 ( 116.00M)           800000 (   8.00M)      0
    (GAP)                                                  800000 (   8.00M)
 4: dtb                       8400000 ( 132.00M)           100000 (1024.00K)      1
    (GAP)                                                  800000 (   8.00M)
 5: initramfs                 8d00000 ( 141.00M)          2000000 (  32.00M)      1
    (GAP)                                                  800000 (   8.00M)
 6: kernel                    b500000 ( 181.00M)          4000000 (  64.00M)      1
    (GAP)                                                  800000 (   8.00M)
 7: data                      fd00000 ( 253.00M)        1c4300000 (   7.07G)      4
===================================================================================

然后将dtb, initramfs , kernel , rootfs写入对应分区,设置了env的config文件,然后执行

fw_setenv bootcmd 'run emmc_bootcmd' (教程里是bootcmd_mmc1=run emmc_bootcmd,测试也没成功)
fw_setenv emmc_bootargs 'apt_blkdevs=mmcblk2 zswap.enabled=0 root=/dev/mmcblk2p8 rw'
fw_setenv emmc_dtb_offset '0x42000'
fw_setenv emmc_dtb_count '0x800'
fw_setenv emmc_initramfs_offset '0x46800'
fw_setenv emmc_initramfs_count '0x10000'
fw_setenv emmc_kernel_offset '0x5a800'
fw_setenv emmc_kernel_count '0x20000'
fw_setenv emmc_bootcmd 'mmc dev 1; mmc read ${fdt_addr_r} ${emmc_dtb_offset} ${emmc_dtb_count}; mmc read ${ramdisk_addr_r} ${emmc_initramfs_offset} ${emmc_initramfs_count}; mmc read ${kernel_addr_r} ${emmc_kernel_offset} ${emmc_kernel_count}; setenv bootargs "${emmc_bootargs}"; booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}'

fw_printenv显示变量都已设置成功,关机拔优盘,再次启动后没有成功,不知道哪里出了问题。

MDZ-16-AA启动后网络连接的问题

MDZ-16-AA只有一个USB接口,没有有线网络接口
尝试过用HUB同时接U盘和键盘,启动进入系统后再配置无线网络,但使用HUB无法从U盘boot,所以HUB方式也尝试失败
再次尝试ophub/amlogic-s9xxx-armbian,因为这个可以配置first_run_script来启用Wi-Fi,但这个发行版貌似无法驱动MDZ-16-AA的Wi-Fi,通过HDMI视频看booting时候的输出可以看到网络报错

请问有什么解决办法吗?

在emmc上安装系统后无限循环开机图片

设备: 斐讯n1
原系统: ophub发布的Armbian_24.5.0_amlogic_s905d_noble_6.1.87_server_2024.04.20

安装方式:

  1. u盘烧录最新img并创建了data分区存储rootfs.tar.gz
  2. mkfs.ext4 -m 0 /dev/mmcblk2p2 作为root分区 挂载到/mnt
  3. mkfs.vfat -F 32 /dev/mmcblk2p1 作为boot分区 挂载到/mnt/boot
  4. fdisk /dev/mmcblk2p1 修改分区type为EFI
  5. 解压rootfs到/mnt下
  6. 拷贝uboot+修改uEnv.txt+修改exlinux/exlinux.conf
  7. arch-chroot切换根目录后更新系统

解除挂载后重启,拔掉u盘,无限卡在开机图片上,不知道是那一步的问题

unable to up wlan0 interface on RTL8189ftv

Hi , i after installed your aur package it successfully installed and wlan0 shown at ip add command.
but when i run sudo ip link set wlan0 up respond RTNETLINK Operation not permitted?

能写入emmc吗

能写入emmc吗 armbian可以通过armbian-install直接写入emmc 我是直接用的烧录的镜像直接烧录到u盘 现在想把系统写进emmc 但是教程好像没有写入emmc的操作 是我遗漏了吗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.