Code Monkey home page Code Monkey logo

longanpi-3h-sdk's People

Contributors

0x754c avatar elasticdotventures avatar wu-yue-yu avatar zepan 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

Watchers

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

longanpi-3h-sdk's Issues

Andoid image

Hi, this is not an issue but just wondering whether is there an Android image avialable?

No audio

Has anyone managed to get audio working over HDMI?

Error during the linux build process

I am running the linux build shell script in Ubuntu and I get a configuration error at the point the script tries to make the defconfig:

  • make mrproper
  • make longanpi_3h_defconfig
    HOSTCC scripts/basic/fixdep
    HOSTCC scripts/kconfig/conf.o
    HOSTCC scripts/kconfig/confdata.o
    HOSTCC scripts/kconfig/expr.o
    LEX scripts/kconfig/lexer.lex.c
    YACC scripts/kconfig/parser.tab.[ch]
    HOSTCC scripts/kconfig/lexer.lex.o
    HOSTCC scripts/kconfig/menu.o
    HOSTCC scripts/kconfig/parser.tab.o
    HOSTCC scripts/kconfig/preprocess.o
    HOSTCC scripts/kconfig/symbol.o
    HOSTCC scripts/kconfig/util.o
    HOSTLD scripts/kconfig/conf

*** Can't find default configuration "arch/arm64/configs/longanpi_3h_defconfig"!


Can anyone tell me whether this is a component I am missing, or is this a permissions issue?

thanks

how to compile a .img file

with the sparse instructions provided i'm trying to compile a custom image that can be written to an sd card.
is there a standard mechanism or script for doing this?

I ask because there is both an EMMC and SD card version in the zip at the mega download site, so I assume there are some nuances to generating those files. I don't have EMMC I only need the SD, but having both scripts in this repo makes sense.

Thanks!

Kernel panic when trying to use a self-compiled image to boot from SD Card

Dear developers,

I've been trying to compile my own image since yesterday, but I guess I'm doing something wrong. Once I've transfered it to the SD card (step 3 here), when trying to boot from it I get the following message:

kernel panic - not syncing: no working init found. Try passing init= option to kernel.

I've also tried to create the .img file and then burn it using Balena Etcher to the SD card, but I get no signal from the HDMI and the device quickly becomes unreachable when pinging. I have no problem using your SD Card image (I have an EMMC model), I've also ran the scripts with sudo (and without) and also used the modified mkrootfs.sh script from the closed issued here.

I can provide additional info on request.

Best regards,
cmuki

errors making uboot

I'm still fighting to have a docker compliant image for LonganPI 3H.
When running mkuboot.sh, I get following output and I wonder if this is OK.

arch/arm/mach-sunxi/dram_sun50i_h616.c: In function ‘mctl_phy_ca_bit_delay_compensation’:
arch/arm/mach-sunxi/dram_sun50i_h616.c:805:9: warning: enumeration value ‘SUNXI_DRAM_TYPE_DDR4’ not handled in switch [-Wswitch]
  805 |         switch (para->type) {
      |         ^~~~~~
arch/arm/mach-sunxi/dram_sun50i_h616.c: In function ‘mctl_phy_init’:
arch/arm/mach-sunxi/dram_sun50i_h616.c:877:9: warning: enumeration value ‘SUNXI_DRAM_TYPE_DDR4’ not handled in switch [-Wswitch]
  877 |         switch (para->type) {
      |         ^~~~~~
arch/arm/mach-sunxi/dram_sun50i_h616.c:924:9: warning: enumeration value ‘SUNXI_DRAM_TYPE_DDR4’ not handled in switch [-Wswitch]
  924 |         switch (para->type) {
      |         ^~~~~~
arch/arm/mach-sunxi/dram_sun50i_h616.c:944:9: warning: enumeration value ‘SUNXI_DRAM_TYPE_DDR4’ not handled in switch [-Wswitch]
  944 |         switch (para->type) {
      |         ^~~~~~
arch/arm/mach-sunxi/dram_sun50i_h616.c:1004:9: warning: enumeration value ‘SUNXI_DRAM_TYPE_DDR4’ not handled in switch [-Wswitch]
 1004 |         switch (para->type) {
      |         ^~~~~~
arch/arm/mach-sunxi/dram_sun50i_h616.c: In function ‘mctl_ctrl_init’:
arch/arm/mach-sunxi/dram_sun50i_h616.c:1155:9: warning: enumeration value ‘SUNXI_DRAM_TYPE_DDR4’ not handled in switch [-Wswitch]
 1155 |         switch (para->type) {
      |         ^~~~~~
arch/arm/mach-sunxi/dram_sun50i_h616.c:1177:9: warning: enumeration value ‘SUNXI_DRAM_TYPE_DDR4’ not handled in switch [-Wswitch]
 1177 |         switch (para->type) {
      |         ^~~~~~

File u-boot-sunxi-with-spl.bin is generated, but I don't know if is usable.

20240226 EMMC image doesn't boot

Hello!

It seems like the latest image hangs on boot due to an error in extlinux.conf - it expects /dev/mmcblk0p2, but it should be /dev/mmcblk1p2.

The log entry was "Waiting for root device /dev/mmcblk0p2".

This happens after writing the image to EMMC and booting from it.

How to compile a custom kernel?

I'm struggling with the steps to compile a custom kernel.

cd build/linux
make menuconfig
# next .. load arch/arm64/configs/longanpi_3h_defconfig
cd ../..
sh mklinux.sh

using the menuconfig step I'm able to change kernel options (specifically in my case I'm trying to add overlay filesystem & br_netfilter options for k8s) .. HOWEVER after this step I encounter an issue when running mklinux.sh where it can't cd dbts directory.

My specific changes are:

[M] Virtualization
[M] File System | Overlay FS
[M] Networking support | Networking Options | 
    ... [M] 802.1d Ethernet Bridging
    ... [M] Network Packet Filter
       ..  [M] Bridged IP/ARP packets filtering

** these modules are required to run k8s with cri-o containers

The error happens in mklinux.sh

+ cd _install/boot
+ cp vmlinuz-6.7.0-rc3+ Image
+ cd dtbs
mklinux.sh: 55: cd: can't cd to dtbs

Hardware video acceleration/decoding isn't working in Chromium

I get 2-3 frames per second when playing 360p YouTube videos, which is unwatchable.

I tried installing mesa-vulkan-drivers, but that didn't help at all.

Has anyone managed to get YouTube to play normally in Chromium?

I can't use mpv or similar -- this is for non-technical people.

Tailscale

Hi, I am attempting to install Tailscale but have an error saying the TUN module is unavailable. Do I need to make a new image and include the TUN module in the kernel, or is it something that I have missed? Thanks

Document (or script) process for building SD/MMC image from generates root filesystem

Hi Sipeed devs,

Thanks for putting together these scripts, they provide a very clean method of rebuilding the root filesystem that works reliably.

I am interested in the process that Sipeed use to generate full SD and EMMC images using the root filesystem generated from this repository (images here):
https://wiki.sipeed.com/hardware/en/longan/h618/lpi3h/3_images.html

Could this process be documented in this repository with a mkimage.sh perhaps? as it would be useful for people to be able to rebuild the Sipeed images end to end.

The mkrootfs.sh script is broken.

The last script fix is broken.
All downloaded system files are placed in the "sid" directory. And they don’t go into rootfs.tar.

Log:

D: 1 1803 suite: unstable
D: 1 1803 target: /home/danilin/LonganPi-3H-SDK/sid
D: 1 1803 variant: important
E: cannot create /home/danilin/LonganPi-3H-SDK: Permission denied; cannot create /home/danilin/LonganPi-3H-SDK/sid: Permission denied; cannot create /home/danilin/LonganPi-3H-SDK/sid//etc: Permission denied; cannot create /home/danilin/LonganPi-3H-SDK/sid//etc/apt: Permission denied; cannot create /home/danilin/LonganPi-3H-SDK/sid//etc/apt/apt.conf.d: Permission denied at /usr/bin/mmdebstrap line 192.
	main::error("cannot create /home/danilin/LonganPi-3H-SDK: Permission denie"...) called at /usr/bin/mmdebstrap line 1968
	main::run_setup(HASH(0x559629ad7458)) called at /usr/bin/mmdebstrap line 1824
	main::setup(HASH(0x559629ad7458)) called at /usr/bin/mmdebstrap line 5873
	main::__ANON__() called at /usr/bin/mmdebstrap line 683
	main::get_unshare_cmd(CODE(0x559629ad7f38), ARRAY(0x5596299ffa48)) called at /usr/bin/mmdebstrap line 5920
	main::main() called at /usr/bin/mmdebstrap line 6253

Using the HW encoder with ffmpeg

Dear developer,

Are you aware of a way to use the encoder for transcoding with ffmpeg? I would like to use it with Jellyfin to transcode videos.
I searched a lot of projects and built a kernel with the Cedrus VPU Driver (and other modules), but couldn't find a way to do it, especially with a modern kernel (there are several github repos, but a lot of them are over 5 years old and not updated).
For reference here - a lot of work was done to Rockchip's hwaccel support in Jellyfin and it will be enabled in the 10.9 release.

Best regards,
cmuki

mkimage contain wrong rootfs.tar name

in original script says
LINE90 sudo tar -xpf $BUILD_DIR/rootfs.tar -C /tmp/rootfs
but also you've been updated rootfs scripts (_debian_gui, _debian_cli, -ubuntu-cli)
so you should count on that if you want to build an image from mkimage.sh script.

make it sudo tar -xpf $BUILD_DIR/rootfs_debian_cli.tar -C /tmp/rootfs works for me know but just FYI.

also mklinux-debian-cli.sh might has permission issue.
I had to chmod before run sudo ./mklinux-debian-cli.sh
(thanks)

Kernel requires CONFIG_THERMAL to be disabled to boot

Hi Sipeed developers, thanks for all your work on this!

I am doing some work to get this board configuration into Armbian as a community supported board, and along the way I have found an issue with the thermal configuration.

If the kernel configuration has CONFIG_THERMAL=y, it appears the temperature sensors on the Sipeed LonganPi 3H report incorrect temperature readings and trigger a thermal shutdown in early boot (when the CPU/GPU is cold).

I also booted the LPI3H_20240110_SD.img available on the Sipeed website and note that it does not have thermal configured in the kernel, and also doesn't report any temperature information through lm-sensors.

root@lpi3h-5396:/# uname -a
Linux lpi3h-5396 6.7.0-rc3+ #1 SMP PREEMPT Wed Dec 20 10:17:59 UTC 2023 aarch64 GNU/Linux
root@lpi3h-5396:/# sensors
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.

Turning thermal configuration on for kernel and booting the image triggers and immediate thermal shutdown when the kernel loads.

Starting kernel ...

done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... Scanning for Btrfs filesystems
done.
[    2.498172] thermal thermal_zone0: gpu-thermal: critical temperature reached, shutting down
[    2.506572] reboot: HARDWARE PROTECTION shutdown (Temperature too high)
[    2.519090] reboot: Power down

done.

Is there a patch available (or being developed) that implements the CPU/GPU temperature sensors for this board? I am a little concerned running it (especially in early development) without visibility of the system temperatures.

Thanks :)

hard time installing kubernetes distributions in defualt image (k3s / k0s)

When I tried to k0s install and start services, this happened

Error: pre-flight checks failed, check out `k0s sysinfo`: lookup localhost on 8.8.8.8:53: no such host

so I tried to edit my /etc/hosts to include

127.0.0.1       localhost lpi3h-c6dd
::1             localhost ip6-localhost ip6-loopback

and service starts

but then when I tried to join my worker nodes, below happened.

root@lpi3h-(devicename)~# sudo k0s worker "mytoken"
Error: pre-flight checks failed, check out `k0s sysinfo`: failed to load/attach eBPF device filter program: load ext_infos: detect support for Program BTF (func/line_info): detect support for BTF: function not implemented
root@lpi3h-(devicename):~# k0s sysinfo

Machine ID: "(machine ID)" (from machine) (pass)
Total memory: 3.9 GiB (pass)
Disk space available for /var/lib/k0s: 24.6 GiB (pass)
Name resolution: localhost: [127.0.0.1 ::1] (pass)
Operating system: Linux (pass)
  Linux kernel release: 6.7.0-rc3+ (pass)
  Max. file descriptors per process: current: 1048576 / max: 1048576 (pass)
  AppArmor: unavailable (pass)
  Executable in PATH: modprobe: /usr/sbin/modprobe (pass)
  Executable in PATH: mount: /usr/bin/mount (pass)
  Executable in PATH: umount: /usr/bin/umount (pass)
  /proc file system: mounted (0x9fa0) (pass)
  Control Groups: version 2 (pass)
    cgroup controller "cpu": available (is a listed root controller) (pass)
    cgroup controller "cpuacct": available (via cpu in version 2) (pass)
    cgroup controller "cpuset": available (is a listed root controller) (pass)
    cgroup controller "memory": available (is a listed root controller) (pass)
    cgroup controller "devices": error: failed to load/attach eBPF device filter program: load ext_infos: detect support for Program BTF (func/line_info): detect support for BTF: function not implemented
    cgroup controller "freezer": available (cgroup.freeze exists) (pass)
    cgroup controller "pids": available (is a listed root controller) (pass)
    cgroup controller "hugetlb": unavailable (warning)
    cgroup controller "blkio": available (via io in version 2) (pass)
  CONFIG_CGROUPS: Control Group support: no kernel config found (warning)
  CONFIG_NAMESPACES: Namespaces support: no kernel config found (warning)
  CONFIG_NET: Networking support: no kernel config found (warning)
  CONFIG_EXT4_FS: The Extended 4 (ext4) filesystem: no kernel config found (warning)
  CONFIG_PROC_FS: /proc file system support: no kernel config found (warning)
Error: sysinfo failed

so I tried other distribution (k3s)

and this happened

root@lpi3h-(devicename):~# curl -sfL https://get.k3s.io | sh -
[INFO]  Finding release for channel stable
[INFO]  Using v1.28.6+k3s2 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.28.6+k3s2/sha256sum-arm64.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.28.6+k3s2/k3s-arm64
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
sh: 581: [: Illegal number:
[INFO]  Skipping installation of SELinux RPM
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
iptables-restore/1.8.10 (nf_tables) Failed to initialize nft: Protocol not supported

so I tried

update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
update-alternatives --set arptables /usr/sbin/arptables-legacy
update-alternatives --set ebtables /usr/sbin/ebtables-legacy
=========================================
update-alternatives: using /usr/sbin/iptables-legacy to provide /usr/sbin/iptables (iptables) in manual mode
update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in manual mode
update-alternatives: error: alternative /usr/sbin/arptables-legacy for arptables not registered; not setting
update-alternatives: error: alternative /usr/sbin/ebtables-legacy for ebtables not registered; not setting

it seems can start a service at first, but when I checked status

root@lpi3h-(devicename):~# systemctl status k3s
● k3s.service - Lightweight Kubernetes
     Loaded: loaded (/etc/systemd/system/k3s.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-02-28 22:36:11 CST; 20s ago
       Docs: https://k3s.io
    Process: 776 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service 2>/dev/null (code=exited, status=0/SUCCESS)
    Process: 779 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=1/FAILURE)
    Process: 782 ExecStartPre=/sbin/modprobe overlay (code=exited, status=1/FAILURE)
   Main PID: 784 (k3s-server)
      Tasks: 26
     Memory: 549.0M (peak: 554.3M)
        CPU: 1min 31.407s
     CGroup: /system.slice/k3s.service
             └─784 "/usr/local/bin/k3s server"

Feb 28 22:36:31 lpi3h--(devicename)k3s[784]: time="2024-02-28T22:36:31+08:00" level=info msg="Waiting for control-plane node lpi3h-(devicename)startup: nodes \"lpi3h-(devicename)\" not found"
Feb 28 22:36:31 lpi3h-(devicename)k3s[784]: I0228 22:36:31.928469     784 shared_informer.go:318] Caches are synced for garbage collector
Feb 28 22:36:31 lpi3h-(devicename)k3s[784]: I0228 22:36:31.936853     784 shared_informer.go:318] Caches are synced for garbage collector
Feb 28 22:36:31 lpi3h-(devicename)k3s[784]: I0228 22:36:31.936943     784 garbagecollector.go:166] "All resource monitors have synced. Proceeding to collect garbage"
Feb 28 22:36:32 lpi3h-(devicename)k3s[784]: I0228 22:36:32.142245     784 event.go:307] "Event occurred" object="kube-system/local-path-provisioner-84db5d44d9" fieldPath="" kind="ReplicaSet" apiVersion="apps/v1" type="Normal" reason="SuccessfulCreate" message="Created pod: local-path-p>
Feb 28 22:36:32 lpi3h-(devicename)k3s[784]: I0228 22:36:32.172260     784 event.go:307] "Event occurred" object="kube-system/coredns-6799fbcd5" fieldPath="" kind="ReplicaSet" apiVersion="apps/v1" type="Normal" reason="SuccessfulCreate" message="Created pod: coredns-6799fbcd5-v7hrv"
Feb 28 22:36:32 lpi3h-(devicename)k3s[784]: W0228 22:36:32.188201     784 handler_proxy.go:93] no RequestInfo found in the context
Feb 28 22:36:32 lpi3h-(devicename)k3s[784]: E0228 22:36:32.188476     784 controller.go:146] Error updating APIService "v1beta1.metrics.k8s.io" with err: failed to download v1beta1.metrics.k8s.io: failed to retrieve openAPI spec, http error: ResponseCode: 503, Body: service unavailable
Feb 28 22:36:32 lpi3h-(devicename)k3s[784]: , Header: map[Content-Type:[text/plain; charset=utf-8] X-Content-Type-Options:[nosniff]]
Feb 28 22:36:32 lpi3h-(devicename)k3s[784]: E0228 22:36:32.188747     784 handler_proxy.go:137] error resolving kube-system/metrics-server: no endpoints available for service "metrics-server"
Feb 28 22:36:32 lpi3h-(devicename)k3s[784]: I0228 22:36:32.199985     784 replica_set.go:676] "Finished syncing" kind="ReplicaSet" key="kube-system/local-path-provisioner-84db5d44d9" duration="689.235263ms"

also when I checked br_netfilter / overlay myself

root@lpi3h-(devicename):~# sudo modprobe br_netfilter sudo modprobe overlay
modprobe: FATAL: Module br_netfilter not found in directory /lib/modules/6.7.0-rc3+
modprobe: FATAL: Module overlay not found in directory /lib/modules/6.7.0-rc3+

this came out.
br_netfilter and overlay / eBPF, BTF is not supported I guess?

Original Android, not Android TV

Hi, since it have problems i encountered when i use Android TV image from the guideline:

  • Can't perform adb connect.
  • Can't offer admin app activation.
    And since the second one is critical for my use case, i'm using Headwind MDM which require admin access to operating system. Can you make or change your Android TV image to pure Android ?

GPIO example doesn't work!

I like this board, but unfortunately the example of using GPIO does not work in build 20240228. Perhaps it worked in previous builds. I can’t control the LED from the echo and the C code doesn’t work either. Please fix this in the build or example.

num=194
echo ${num} > /sys/class/gpio/export  
-bash: echo: write error: Device or resource busy

How to install the driver ch340?

Sipeed Longan Pi 3H (4Gb)
LPI3H_20240228_SD.img

I'm not an experienced user, but my SONOFF Zigbee 3.0 USB Dongle Plus V2 device has previously worked on other systems without additional steps.
Now I can't even just install the driver.
Can I get a step by step installation guide?
image

mkrootfs.sh报错

mkdir: cannot create directory ‘build’: File exists

  • genrootfs
  • echo '
    deb https://mirrors.bfsu.edu.cn/debian/ testing main contrib non-free non-free-firmware
    deb https://mirrors.bfsu.edu.cn/debian/ testing-updates main contrib non-free non-free-firmware
    deb https://mirrors.bfsu.edu.cn/debian/ testing-backports main contrib non-free non-free-firmware
    deb https://mirrors.bfsu.edu.cn/debian-security/ testing-security main contrib non-free non-free-firmware
    '
  • mmdebstrap --architectures=arm64 -v -d '--include=ca-certificates locales dosfstools binutils file tree sudo bash-completion memtester openssh-server wireless-regdb wpasupplicant systemd-timesyncd usbutils parted systemd-sysv iperf3 stress-ng avahi-daemon tmux screen i2c-tools net-tools ethtool ckermit lrzsz minicom picocom btop neofetch iotop htop bmon e2fsprogs nvi tcpdump alsa-utils squashfs-tools evtest bluez bluez-hcidump bluez-tools btscanner bluez-alsa-utils device-tree-compiler debian-archive-keyring connman-gtk chromium linux-cpupower task-xfce-desktop xfce4-terminal xfce4-screenshooter pulseaudio-module-bluetooth blueman fonts-noto-core fonts-noto-cjk fonts-noto-mono fonts-noto-ui-core tango-icon-theme'
    I: automatically chosen mode: unshare
    I: arm64 cannot be executed, falling back to qemu-user
    I: No SUITE specified, expecting sources.list on standard input
    I: Reading sources.list from standard input...
    I: using /tmp/mmdebstrap.LfsHc0Bl2n as tempdir
    D: aptopts: []
    D: architectures: arm64
    D: components: main
    D: customize_hook: []
    D: dpkgopts: []
    D: essential_hook: []
    D: foreignarchs: []
    D: havemknod: 0
    D: include: ca-certificates locales dosfstools binutils file tree sudo bash-completion memtester openssh-server wireless-regdb wpasupplicant systemd-timesyncd usbutils parted systemd-sysv iperf3 stress-ng avahi-daemon tmux screen i2c-tools net-tools ethtool ckermit lrzsz minicom picocom btop neofetch iotop htop bmon e2fsprogs nvi tcpdump alsa-utils squashfs-tools evtest bluez bluez-hcidump bluez-tools btscanner bluez-alsa-utils device-tree-compiler debian-archive-keyring connman-gtk chromium linux-cpupower task-xfce-desktop xfce4-terminal xfce4-screenshooter pulseaudio-module-bluetooth blueman fonts-noto-core fonts-noto-cjk fonts-noto-mono fonts-noto-ui-core tango-icon-theme
    D: maketar: 1
    D: mode: unshare
    D: nativearch: arm64
    D: noop: []
    D: qemu: aarch64
    D: root: /tmp/mmdebstrap.LfsHc0Bl2n
    D: setup_hook: []
    D: sourceslist:
    deb https://mirrors.bfsu.edu.cn/debian/ testing main contrib non-free non-free-firmware
    deb https://mirrors.bfsu.edu.cn/debian/ testing-updates main contrib non-free non-free-firmware
    deb https://mirrors.bfsu.edu.cn/debian/ testing-backports main contrib non-free non-free-firmware
    deb https://mirrors.bfsu.edu.cn/debian-security/ testing-security main contrib non-free non-free-firmware

D: target: -
D: variant: important
I: running apt-get update...
Get:1 https://mirrors.bfsu.edu.cn/debian testing InRelease [156 kB]
Err:1 https://mirrors.bfsu.edu.cn/debian testing InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Get:2 https://mirrors.bfsu.edu.cn/debian testing-updates InRelease [45.1 kB]
Err:2 https://mirrors.bfsu.edu.cn/debian testing-updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Get:3 https://mirrors.bfsu.edu.cn/debian testing-backports InRelease [45.2 kB]
Err:3 https://mirrors.bfsu.edu.cn/debian testing-backports InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Get:4 https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease [43.5 kB]
Err:4 https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
Reading package lists...
W: GPG error: https://mirrors.bfsu.edu.cn/debian testing InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'https://mirrors.bfsu.edu.cn/debian testing InRelease' is not signed.
W: GPG error: https://mirrors.bfsu.edu.cn/debian testing-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'https://mirrors.bfsu.edu.cn/debian testing-updates InRelease' is not signed.
W: GPG error: https://mirrors.bfsu.edu.cn/debian testing-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'https://mirrors.bfsu.edu.cn/debian testing-backports InRelease' is not signed.
W: GPG error: https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
E: The repository 'https://mirrors.bfsu.edu.cn/debian-security testing-security InRelease' is not signed.
E: apt-get update -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed at /usr/bin/mmdebstrap line 126.
main::error("apt-get update -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false f"...) called at /usr/bin/mmdebstrap line 649
main::run_progress(CODE(0x5614a2072158), CODE(0x5614a1e61e40), CODE(0x5614a1e61cd8), "/tmp/mmdebstrap.LfsHc0Bl2n") called at /usr/bin/mmdebstrap line 701
main::run_apt_progress(HASH(0x5614a1fc8b38)) called at /usr/bin/mmdebstrap line 1144
main::setup(HASH(0x5614a1fc7e20)) called at /usr/bin/mmdebstrap line 2200
main::ANON() called at /usr/bin/mmdebstrap line 471
main::get_unshare_cmd(CODE(0x5614a1f9bcf8), ARRAY(0x5614a1f5d4b0)) called at /usr/bin/mmdebstrap line 2221
main::main() called at /usr/bin/mmdebstrap line 2400
I: removing tempdir /tmp/mmdebstrap.LfsHc0Bl2n...

firstboot.service not working

firstboot.service is not working. There is no user in the system.

Possible solution: when creating rootfs you need to delete /etc/machine-id

making build to work in EMMC

It seems I have hard time make proper image due to lack of my skill hehe,

What I did

based on

OS: Ubuntu 22.04.4 LTS x86_64 
Kernel: 6.5.0-25-generic 
Packages: 2056 (dpkg), 11 (snap) 
Shell: bash 5.1.16 
DE: GNOME 42.9 
Terminal: gnome-terminal 
CPU: AMD Ryzen 5 5600X (12) @ 3.700G 
GPU: Intel Device 56a0 
Memory: 2281MiB / 31989MiB 
sudo apt install qemu-user-static gcc-aarch64-linux-gnu mmdebstrap git binfmt-support make build-essential  bison flex make gcc libncurses-dev debian-archive-keyring swig libssl-dev bc python3-setuptools

does steps according to link with some modification :
git clone https://github.com/sipeed/LonganPi-3H-SDK.git

then
modify mkrootfs.sh collate to this

run scripts as order of

./mkatf.sh
./mklinux.sh
./mkuboot.sh
sudo ./mkrootfs.sh

build an image from same article from
3. Make a boot TF card
4. Make a boot TF card image

either boot from baked TF(microSD) card
or
SCP built image to /opt and

dd if=/opt/your_image_file of=/dev/mmcblk1
sync

to copy stuff to eMMC.

===========
also tried :
modify LonganPi-3H-SDK/overlay/boot/extlinux to have below

label g1
	menu label Linux (boot from EMMC)
	linux /Image
	fdtdir /dtbs

	append root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

modify LonganPi-3H-SDK/overlay/opt/firstboot.sh to have below

# resize root filesystem

if (lsblk | grep -q "mmcblk1p2"); then
        parted -s /dev/mmcblk1 "resizepart 2 -0"
	resize2fs /dev/mmcblk1p2
fi

parted -s /dev/mmcblk0 "resizepart 2 -0"
resize2fs /dev/mmcblk0p2

logs are attached below.

mkatf_output.log
mklinux.log
mkuboot.log
mkrootfs.log

kernel about docker

After I have built the Rootfs of Ubuntu using mkrootfs-ubuntu-cli.sh and packaged the image, I can install Docker normally.
But I got an error when I tried to run Docker.
Use journalctl-u docker.service to check the error report as follows:
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to register "bridge" driver: failed to create NAT chain DOCKER: iptables failed: iptables-t nat-N DOCKER: iptables/1.8.7 Failed to initialize nft: Protocol not supported.
How can I modify the kernel options so that docker works properly?

GPIO PWM example

Product seems promising, but without python libraries for pwm and gpio, it would be hard to use it.

sipeed@lpi3h-4cfe:~$ sudo apt install python3-gpiozero
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-gpiozero is already the newest version (1.6.2-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 67 not upgraded.

And then simple python3 program

from gpiozero import LED
from time import sleep

red = LED(17)

while True:
    red.on()    #turn led on
    sleep(1)    #delay for 1 second
    red.off()   #turn led off
    sleep(1)

gives this error:

sipeed@lpi3h-4cfe:~/Desktop$ python3 motor.py
/usr/lib/python3/dist-packages/gpiozero/devices.py:288: PinFactoryFallback: Falling back from rpigpio: This module can only be run on a Raspberry Pi!
  warnings.warn(
/usr/lib/python3/dist-packages/gpiozero/devices.py:288: PinFactoryFallback: Falling back from lgpio: No module named 'lgpio'
  warnings.warn(
/usr/lib/python3/dist-packages/gpiozero/devices.py:288: PinFactoryFallback: Falling back from rpio: No module named 'RPIO'
  warnings.warn(
/usr/lib/python3/dist-packages/gpiozero/devices.py:288: PinFactoryFallback: Falling back from pigpio: No module named 'pigpio'
  warnings.warn(
/usr/lib/python3/dist-packages/gpiozero/devices.py:288: PinFactoryFallback: Falling back from native: unable to locate Pi revision in /proc/device-tree or /proc/cpuinfo
  warnings.warn(
Traceback (most recent call last):
  File "/home/sipeed/Desktop/motor.py", line 4, in <module>
    red = LED(17)
          ^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 108, in __call__
    self = super(GPIOMeta, cls).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 200, in __init__
    super(DigitalOutputDevice, self).__init__(
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 83, in __init__
    super(OutputDevice, self).__init__(pin, pin_factory=pin_factory)
  File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 85, in __init__
    super(SourceMixin, self).__init__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 540, in __init__
    super(GPIODevice, self).__init__(**kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 250, in __init__
    Device.pin_factory = Device._default_pin_factory()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 291, in _default_pin_factory
    raise BadPinFactory('Unable to load any default pin factory!')
gpiozero.exc.BadPinFactory: Unable to load any default pin factory!

Can you share example how how to use PINS on product Longan Pi 3H.

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.