Solar2D Linux

Solar2D Linux

  • raspi4 - debian 12(raspi os/bookworm) gcc-12 clang-14
  • jetson - ubuntu 20.04 Focal (skip because of gcc-9)
  • raspi5 - ubuntu 22.04 Jammy gcc-11, kernel is build with gcc-12

ubuntu 22.10 kinetic

https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/releases

ubuntu 22.08 (Kinetic): Based on Debian 12 (Bookworm) GNOME 43

/Users/ymmtny/Documents/work/Solar2DTux/

  • platform/linux/Solar2DBuilder/test

    • hello

      ../linux/bin/Solar2DBuilder build --lua "args_arm.lua"
      local params =
      {
        platform='linux',
        arch    = 'arm', -- armhf, arm64, x86_64, amd64
        appName='hello',
        appVersion='1.0',
        dstPath='.',
        projectPath='./HelloWorld',
        linuxtemplate='../linux/bin/Resources/template_arm.tgz',
      }
      return params

platform/linux/buildx

  • build.sh

    docker run --rm --name builder -it -v $(pwd):/solar2d -v ¥
     $(pwd)/platform/linux/buildx/entrypoint.sh:/entrypoint.sh  ¥
     --entrypoint /entrypoint.sh ¥
     --platform linux/arm64 gcc:12-bookworm
  • entorypoint.sh

    cd /solar2d/platform/linux
    sh ./setup_dev.sh
    sh ./setup_build.sh
    • setup_dev.sh

      apt-get install -y cmake ...
      aput-get install -y temurin-8-jdk temurin-8-jre
      ...
      
      git clone https://git.launchpad.net/ubuntu/+source/readline
      git checkout -b debian/stretch origin/debian/stretch
      ...
      
      wget wxurl=https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4.tar.bz2
      ...
    • setup_build.sh

      • build gtk
      • git clone Solar2D
      • build Solar2D
    • objdump -p /usr/local/bin/Solar2D/Solar2DSimulator | grep NEEDED

      NEEDED               libGL.so.1
      NEEDED               libz.so.1
      NEEDED               libopenal.so.1
      NEEDED               libfreetype.so.6
      NEEDED               libpng16.so.16
      NEEDED               libjpeg.so.62
      NEEDED               libcrypto.so.3
      NEEDED               libcurl.so.4
      NEEDED               libSDL2-2.0.so.0
      NEEDED               libstdc++.so.6
      NEEDED               libm.so.6
      NEEDED               libgcc_s.so.1
      NEEDED               libc.so.6
    • snap

      cp -R platform/linux/snapcraft/snap_arm64 /solar2d/snap

bookworm uses wayland. raspi-config > Advanced to swich X11

sudo raspi-config nonint do_wayland W1

https://qiita.com/ktamido/items/82ed2f5bd324d4721096 バージョン0.7.0以降の WayVNC は RealVNC と互換性のある RSA-AES 認証が追加されたらしく、適切な証明書を生成すると、RealVNCから接続できる

https://docs.cse.lehigh.edu/xforwarding/xforwarding-mac/ https://stackoverflow.com/questions/65468655/vs-code-remote-x11-cant-get-display-while-connecting-to-remote-server

sudo apt update
sudo apt install x11-apps

java 8

AppImage


snap

error

pi@kwiksher-solar2d:~/projects/deploy-solar2d $ snap run --strace solar2d
/snap/strace-static/current/bin/strace: Cannot find user 'pi'
sudo apt update
sudo apt install snapd
sudo reboot

sudo snap install core
snap install hello-world
sudo snap install snapcraft --classic
sudo snap install lxd --channel=latest/stable

sudo snap remove –purge lxd

https://stackoverflow.com/questions/57525289/not-able-to-execute-lxd-lxc-commands-as-sudo

newgrp lxd
sudo usermod -aG pi lxd
lxd init  --minimal
snapcraft --use-lxd

sudo usermod -aG ymmtny lxd

sudo gpasswd lxd

snap install opy_latest_amd64.snap --dangerous
unsquashfs <file>.snap
  sudo apt update

  ln -s ../sysroot sysroot

  snap remove --purge lxd

  lxd init --minimal
  snapcraft --use-lxd

  snapcraft prime --shell-after --use-lxd

  snapcraft clean

  lxc ls
  lxc container
  lxc delete {name}

  snap install solar2d_2100.9999_arm64.snap --dangerous --devmode

  snap connections --all

The shorthand format will also produce the same result:

```
architectures:
  - amd64
```

snapパッケージング入門

sudo ifconfig usb0 down for windows with raspi4 type-c

https://blog.tstylestudio.com/2022/02/10/raspberrypi%E3%81%ABlxd%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F/

  • Solar2D/platform/linux/gh_action.sh

    sudo snap install snapcraft --classic
    sudo snap install lxd --channel=latest/stable
    
    >sudo snap remove --purge lxd
    
    sudo lxd init --minimal
    ...
    ...
    sudo snapcraft --use-lxd
  • Dockerfile, how install snap, snapd: unrecognized service

  • https://snapcraft.io/docs/build-on-docker

  • https://snapcraft.io/docs/installing-snap-on-raspbian

    adb

    /Solar2D/platform/linux/snapcraft/snap/snapcraft.yaml

    base: core20
    architectures:
      - amd64
    
    layout:
      /usr/bin/keytool:
        symlink: $SNAP/usr/lib/jvm/java-8-openjdk-amd64/bin/keytool
      /usr/bin/jarsigner:
        symlink: $SNAP/usr/lib/jvm/java-8-openjdk-amd64/bin/jarsigner
      /usr/bin/java:
        symlink: $SNAP/usr/lib/jvm/java-8-openjdk-amd64/bin/java
    
    
    parts:
      readline:
        source: http://mirrors.kernel.org/ubuntu/pool/main/r/readline/libreadline7_7.0-3_amd64.deb
        plugin: dump
        source-type: deb
    • https://forum.snapcraft.io/t/how-to-execute-a-binary-file-inside-a-snap/34342/13

      everything (binary and libraries) is inside release/,

      apps:
        examplebin:
          command: mybinary
          environment:
            LD_LIBRARY_PATH: $SNAP/release:$SNAP/lib/x86_64-linux-gnu
      
      parts:
        examplebin:
          plugin: dump
          source: release
    • snapパッケージにおけるセキュリティモデル

    • 自作コマンド(opy)をbrewとsnapに対応した

      sudo snap install opy_latest_amd64.snap --dangerous
    • Can I use snapcraft with LXD on macOS? - answered by bard

      No, directly using Snapcraft with LXD on macOS isn't possible. Here's the breakdown:
      
      LXD limitations: macOS itself doesn't have built-in LXD support. LXD relies on functionalities offered by the Linux kernel, which macOS lacks.
      
      Snapcraft on macOS: While Snapcraft itself can run on macOS, it's limited to store-related operations. It cannot build snaps directly due to the missing Linux environment.
      
      There are alternative approaches to consider:
      
      Remote LXD instance: You can point Snapcraft to a remote LXD instance running on a Linux machine. This allows leveraging LXD for building while using your macOS machine for development. Tools like "cleanbuild" can facilitate this setup.
      
      Multipass: Snapcraft defaults to using Multipass (a lightweight Ubuntu virtualization solution) on macOS for building snaps. This provides a Linux environment for the build process within macOS.
      
      If you're comfortable with virtualization, using Multipass might be a simpler solution for building snaps on your macOS machine.
      Here are some alternative approaches:
      
      Build with LXD: If you're on Raspberry Pi itself, consider using LXD for building snaps. This ensures the snap targets the Raspberry Pi's architecture from the get-go.
      
      Multipass workaround (advanced): There are complex workarounds involving creating a custom cloud image for Multipass that matches Raspberry Pi's architecture. This approach is not recommended for beginners due to its involved nature. You can search for "Multipass Raspberry Pi cloud image" for more information if you're interested.
      
      For most scenarios, building with LXD directly on your Raspberry Pi is the recommended approach for ensuring compatibility with the target platform.

flatpak

flatpak run --command=sh --devel <application-id>

deb

clang

  • https://stackoverflow.com/questions/76838543/cross-compiling-from-macos-to-raspberry-pi-4-with-clang-and-cmake

    aj@raspberrypi:~ $ clang++-13 --version
    Debian clang version 13.0.1-6~deb11u1
    Target: aarch64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /usr/bin
    
    aj@raspberrypi:~ $ lld-link-13 --version
    Debian LLD 13.0.1
    aj@raspberrypi:~ $ ldd --version
    ldd (Debian GLIBC 2.31-13+rpt2+rpi1+deb11u5) 2.31
    aj@andys-mbp ~/Code/cross-clang-rpi4 $ clang++ --version
    Apple clang version 14.0.3 (clang-1403.0.22.14.1)
    Target: arm64-apple-darwin22.5.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    
    aj@andys-mbp ~/Code/cross-clang-rpi4 $ ld --version
    Homebrew LLD 14.0.6 (compatible with GNU linkers)
    aj@andys-mbp ~/Code/cross-clang-rpi4 $ cmake --version
    cmake version 3.26.3

docker buildx

debian ubuntu

jetson nano


gcc

The Bullseye default compiler is gcc 10, with Bookworm it’s gcc 12. clang-13 the latest clang release on Bullseye, clang-15 the latest on Bookworm.


kwiksher-solar2d.loca

  • /Users/ymmtny/Documents/GitHub/making-iot/Koi/doc/setup_memo_raspi_yolo.md

    /Users/ymmtny/Documents/GitHub/AI-RC/backup

    • cmdline.txt
    • config.txt
    • firstrun.sh
  otg_mode=1
  dtoverlay=dwc2
  #dtoverlay=disable-wifi
modules-load=dwc2,g_ether

first_run.sh, Before the rm … command, add this:

```
cat << EOF > /etc/network/interfaces.d/usb0
auto usb0
allow-hotplug usb0
iface usb0 inet static
    address 192.168.2.2
    netmask 255.255.255.0
    gateway 192.168.2.1
EOF
```