Tdesktop: Telegram-desktop Snap package won't run

Created on 4 Mar 2020  Â·  109Comments  Â·  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Install latest stable/edge package from snap
  2. run telegram using command telegram-desktop

Expected behaviour

Telegram must run

Actual behaviour

it outputs the next line and exits:
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

Configuration

Operating system: Raspbian Buster on raspberry pi 3b ( 32bit os fork of debian ARMHF)

Version of Telegram Desktop: 1.9.9 and 1.9.19 snap packages

Logs:

[2020.03.04 00:13:36] Launched version: 1009009, install beta: [FALSE], alpha: 0, debug mode: [FALSE], test dc: [FALSE]
[2020.03.04 00:13:36] Executable dir: /snap/telegram-desktop/1041/bin/, name: telegram-desktop
[2020.03.04 00:13:36] Initial working dir: /home/pi/
[2020.03.04 00:13:36] Working dir: /home/pi/snap/telegram-desktop/1041/.local/share/TelegramDesktop/
[2020.03.04 00:13:36] Command line: telegram-desktop
[2020.03.04 00:13:36] Executable path before check: /snap/telegram-desktop/1041/bin/telegram-desktop
[2020.03.04 00:13:36] Logs started
[2020.03.04 00:13:38] Connecting local socket to /run/user/1000/snap.telegram-desktop/af7321eb1e0d0276c1a531cd3bb10672...
[2020.03.04 00:13:38] This is the only instance of Telegram, starting server and app...
[2020.03.04 00:13:38] Failed to start listening to /run/user/1000/snap.telegram-desktop/af7321eb1e0d0276c1a531cd3bb10672 server, error -1

edit1 : added log file(this is for stable.same thing happens with edge)

All 109 comments

I cannot find log files :)

~/snap/telegram-desktop/current/.local/share/TelegramDesktop/log.txt

~/snap/telegram-desktop/current/.local/share/TelegramDesktop/log.txt

i've added the logs.thanks.

[2020.03.04 00:13:38] Failed to start listening to /run/user/1000/snap.telegram-desktop/af7321eb1e0d0276c1a531cd3bb10672 server, error -1

Which file system are you using?

ext4
(also fat32 for boot)

32-bit or 64-bit OS?

I'm using Raspbian which is a fork of Debian
it has 32bit os(armhf)

Please, recheck error on the edge, it should change

@ilya-fedin Installed 1.9.19-beta-17-gfdd431dce and problem remains.telegram still does not opens

Yes, it is not fixed, just logging changed. Please, attach new log.

@ilya-fedin I think nothing really changes.
the error is the exact same and here is the log_start0.txt:

[2020.03.07 00:18:38] Launched version: 1009019, install beta: [TRUE], alpha: 0, debug mode: [FALSE], test dc: [FALSE]
[2020.03.07 00:18:38] Executable dir: /snap/telegram-desktop/1269/bin/, name: telegram-desktop
[2020.03.07 00:18:38] Initial working dir: /home/pi/
[2020.03.07 00:18:38] Working dir: /home/pi/snap/telegram-desktop/1269/.local/share/TelegramDesktop/
[2020.03.07 00:18:38] Command line: telegram-desktop
[2020.03.07 00:18:38] Executable path before check: /snap/telegram-desktop/1269/bin/telegram-desktop
[2020.03.07 00:18:38] Logs started
[2020.03.07 00:18:38] Launcher filename: telegram-desktop_telegram-desktop.desktop
[2020.03.07 00:18:41] Connecting local socket to /run/user/1000/snap.telegram-desktop/375d90da0104bc0eabfb2527e38498a1...
[2020.03.07 00:18:41] This is the only instance of Telegram, starting server and app...
[2020.03.07 00:18:41] Failed to start listening to /run/user/1000/snap.telegram-desktop/375d90da0104bc0eabfb2527e38498a1 server: QLocalServer::listen: Unknown error 1

the error is the exact same

no :)

no :)

Yep my bad.
Checked the commit and saw what's going on.
Anyway, I will be glad to help in order to solve this issue.mention me if you need anything else.
thanks for support

According to http://man7.org/linux/man-pages/man3/errno.3.html
EPERM 1 Operation not permitted
:thinking:

which is snap vesion, is apparmor enabled?

According to http://man7.org/linux/man-pages/man3/errno.3.html
EPERM 1 Operation not permitted
🤔

so whats going on with this?

which is snap vesion, is apparmor enabled?

snap and snapd version 2.37.4-1+rpi1
and about apparmor:
1.AFAIK apparmor must be enabled in kernel and i'm positive raspbian doesn't support it in kernel
2.apparmor isn't installed in my os

nope wrong.
apparmor is installed(checked it with dpkg and i missplled it last comment and it's totally new to raspbian thats why i didn't notice)
i guess it is enabled.
how should i config it so it works with snapd?

hmm, check this:

systemctl status apparmor
systemctl status snapd.apparmor

+ check terminal output of telegram-desktop, maybe apparmor outputs some warnings/errors

apparmor.service:service is enabled and loaded but it is inactive.condition:condition failed 24h ago
condition check resulted in load apparmor profiles being skipped

and snapd.apparmor : unit snapd.apparmor.service could not be found

telegram-desktop only outputs that one line related to locale.nothing else

hmm, try snap run --strace telegram-desktop

There are also a snappy-debug utility.

snap install snappy-debug
sudo snappy-debug.security scanlog telegram-desktop

And run tdesktop, it should output what permission is missing

damn, that's 20711 lines of output... I can see lot's of file/directory not found errors and i'll begin to check for anything related.ill upload the file in few minutes.pastebin server crashed with 400 bad request error while handling a large amount of text being uploaded.
I can't make a gist as well.lol

damn, that's 20711 lines of output...

snap run --strace telegram-desktop > strace 2>&1
You will get strace file in current directory

yep already did.here is the file : strace-output-tdesktop.txt

I'm installing snappy-debug right now.please wait

here is the file

btw, you can attach files with github
image

It wasn't uploading.
i'll upload it again for future(that link expires in 30 days):
strace-output-tdesktop.txt

(i waiting for snappy-debug)

sudo snap run snappy-debug.security scanlog telegram-desktop

i used this command(cant use sudo with any snap packages...wierd)
and it stuck in this:

INFO: Following '/var/log/syslog'. If have dropped messages, use:
INFO: $ sudo journalctl --output=short --follow --all | sudo snappy-debug
kernel.printk_ratelimit = 0

and it stuck in this

you should run tdesktop in parallel, it is a real-time debugger :)

you should run tdesktop in parallel, it is a real-time debugger :)

oops! didn;t know this one :)
i ran telegram-desktop in parallel but still its the same

i ran telegram-desktop in parallel but still its the same

This is bad :(

yep,its stuck.
anyway there is a script to launch telegram-desktop snap package.if something happens there,will snappy-debug be able to catch that as well?or the updator for telegram before telegram itself?

if something happens there,will snappy-debug be able to catch that as well?or the updator for telegram before telegram itself?

I don’t understand what you wanted to say :(

there is script file in /snap/telegram-desktop/1269/bin/desktop-launch
and i guess there is a package that checks if telegram is latest version or not before launching it.
if the error we are looking for is in either one of these files,can snappy-debug check these files or the only thing that snappy-debug looks inside is telegram-desktop binary file itself?

or the only thing that snappy-debug looks inside is telegram-desktop binary file itself

It greps syslog for apparmor errors xD

is there any other way to check apparmor?
like from journalctl or ...?

[pid  7128] lstat64("/run/user/1000/snap.telegram-desktop/375d90da0104bc0eabfb2527e38498a1", 0x7ecfce70) = -1 ENOENT (No such file or directory)
[pid  7128] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 9
[pid  7128] bind(9, {sa_family=AF_UNIX, sun_path="/run/user/1000/snap.telegram-desktop/375d90da0104bc0eabfb2527e38498a1"}, 110) = 0
[pid  7128] listen(9, 50)               = -1 EPERM (Operation not permitted)
[pid  7128] close(9)                    = 0

This is from your strace log.
Maybe raspbian has some other security mechanism :thinking:
Try to add this to your kernel parameters (/boot/cmdline.txt): selinux=0 apparmor=0 audit=0 security=""

that didn't work

Hmm, can you show cat /proc/cmdline?

coherent_pool=1M 8250.nr_uarts=0 bcm2708_fb.fbwidth=1280 bcm2708_fb.fbheight=1024 bcm2708_fb.fbswap=1 smsc95xx.macaddr=_removed_ vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=_Removed_  rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles selinux=0 apparmor=0 audit=0 security=""

What if you reinstall snap in devmode?
e.g

snap remove telegram-desktop
snap install --edge --devmode telegram-desktop

that took a minute.stuck on the same locale error and then telegram ran successfully
here is the log for 'telegram-desktop'

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
ALSA lib conf.c:3916:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL hw:0
AL lib: (EE) probe_devices: control open (hw:0): No such file or directory
ALSA lib conf.c:3916:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCcaptureAlsa_open: Could not open capture device 'default': No such file or directory

should i try snappy-debug now?

No, snaps just doesn't support alsa, install pulseaudio.
btw, I found that the network-bind permission was lost. I think this is the case.

should i try snappy-debug now?

tried and it shows nothing
also the lines related to alsa are from #7103

No, snaps just doesn't support alsa, install pulseaudio.

that sucks...raspberry pi audio is kinda different from normal pc/laptop and pulseaudio sucks with it.it usually has no sound and if you fix that it just plays in mono with terrible quality.

btw, I found that the network-bind permission was lost. I think this is the case.

that's good. can you fix it? I can try it anytime

can you fix it?

I can't check if it is actually will be fixed since I can't reproduce :(

I can try it anytime

i can't build armhf snap, I building snap with github actions which is only amd64 :(
But if you want, you can build it yourself, my repo is there: https://github.com/ilya-fedin/tdesktop/tree/snap-permissions (the fix is not commited yet)

btw this was not the problem before.i tested version 1.9.x and telegram was fine.

(_I use a raspberry pi for studying because we have online courses now that schools are closed because of the COVID-19.some of them and some announcements are posted on a telegram channel. every time i have to turn on PC,download files and send them over to the pi and then use them_)

btw this was not the problem before

It is encouraging that adding (returning) the network-bind permission will help

I can't check if it is actually will be fixed since I can't reproduce :(

can you check with dev team if anyone has a raspberry pi(35$ though)?maybe another dev can help if network-bind permission doesn't work

i can't build armhf snap, I building snap with github actions which is only amd64 :(

maybe @john-preston can build snap packages?
anyway give me the instructions on building telegram-desktop and I'll try if you can't build armhf package.it will definitely take lots of hours(more than 5-6 I guess?!) because the cpu is weak and i have 512bm of ram(nearly 450 usable if you minus the vram)

can you check with dev team if anyone has a raspberry pi(35$ though)?

I have rpi2 and rpi4 xD, but I don't want to compile on it (and I have arch linux on them) :(

.it will definitely take lots of hours(more than 5-6 I guess?!) because the cpu is weak

By that reason.

maybe @john-preston can build snap packages?

If I understand correctly, snaps are compiled automatically on the launchpad, which automatically publishes in the snap store, i.e. It is unsuitable for testing.

anyway give me the instructions on building telegram-desktop

Just install and run snapcraft in the repo directory, it will do all the other job.

By that reason.

I feel you xD

If I understand correctly, snaps are compiled automatically on the launchpad, which automatically publishes in the snap store, i.e. It is unsuitable for testing.

I didn't knew this before.
it doesn't really matter to me though.it's 3am here.if you commit i can just let it compile and go to sleep(im going to sleep btw so ill continue tomarrow)

im going to sleep btw so ill continue tomarrow

I really hope that preston merge the PR that I will create tomorrow, so you'll get the working build on the edge channel

OK, sure.Thanks for your support bro...really.
I appreciate it

Reproduced this on Debian Buster amd64.
It seems to be a different behaivor of old versions of snapd.

network-bind didn't help :(

Oh, I even tried to use old socket path, doesn't work.
Maybe the man who created snapcraft recipe @3v1n0 knows what is the case...

Reproduced this on Debian Buster amd64.
It seems to be a different behaivor of old versions of snapd.

I'm not even surprised.that's what u get for updating pacakges every 10 years....debian stable...
Well i didn't know we have snapd version 3.9.5 :| my snapd is way old, so I think I'm going to build it myself(can't find anything about dependencies and ...)

btw, alsa support should be in edge channel, you can activate it with snap connect telegram-desktop:alsa (autoconnect of alsa interface is prohibited by snapd devs, I have no idea how vlc works without that)

we have snapd version 3.9.5

but debian site says it is 2.37.4

but debian site says it is 2.37.4

Debian(stable branch specially) is known for having really old packages.almost every package in debian is old(same goes for other linux OSes based on debian which raspbian is one of them).
They do this so users can live on without updating/having problems.

The latest version I can find in github is 3.10(pre-release) and 3.9.5(latest release)
Ubuntu packages website is having problem for me(500 internal server error)

Which version do you use normally?

The latest version I can find in github is 3.10(pre-release) and 3.9.5(latest release)

lol this is snapcraft, not snapd
https://github.com/snapcore/snapd/releases

lol
yep my bad
well,im going to update it anyway and give you update on the situation

Ubuntu packages website is having problem for me(500 internal server error)

This is fun, but it returns 500 error regularly, I just refreshing it until it loads (2-5 times)

This is fun, but it returns 500 error regularly, I just refreshing it until it loads (2-5 times)

it worked like after 11 times for me.
ubuntu focal fossa(20.4 LTS) is already using 2.44 pre release...
ubuntu Eoan Ermine(19.10.01) is using 2.41
between 2.37.4 and 2.43.3 which is latest release is a gap of 16 major releases and bug fixes so you can get a image on how old it is

Yep.

installed snapd version 2.42.1 and every single dependency by hand...damn...thats so boring to do!
the same thing happens like here
it works

is that locale thing a warning or error?

the same thing happens like here

snap package version? :thinking:

snap package version? 🤔

telegram-desktop from edge
do you want me to try stable as well?

telegram-desktop from edge

No, exact version
Like 1.9.19-beta-17-gfdd431dce

telegram-desktop version 1.9.19-beta-17-gfdd431dce
and updated snapd to 2.43.3

So, the latset commit is not builded yet on launchpad
New version should appear as soon as it builded

btw, alsa support should be in edge channel, you can activate it with snap connect telegram-desktop:alsa (autoconnect of alsa interface is prohibited by snapd devs, I have no idea how vlc works without that)

i missed that oops
it says error: snap "telegram-desktop" has no plug named "alsa"
which as you said latest commit is not yet builded
i'll update when it's available and tell you what happens with that.

@ilya-fedin tested version 1.9.19-beta-18-g1dc6d942c and i get this:
```
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
AL lib: (EE) ALCcaptureAlsa_open: Could not open capture device 'default': No such file or directory
error: : cannot open
error: : cannot open
error: : cannot open
OpenType support missing for "DAOpenSansSemibold", script 11
````
other lines related to alsa config files are gone now but i still can't play videos/audio files&messages
AFAIK in omxplayer i can use these devices : 1.analog 2.HDMI 3.alsa (if you have other devices like usb headsets)(it must choose alsa default device i guess)
normal VLC(not snap) uses alsa output with default device and it works(if you change devices it continues to play on old device though)

Did you run snap connect telegram-desktop:alsa?

yes, I did.
before i ran snap connect telegram-desktop:alsa command i tested it.obviously didn't work.
i ran telegram-desktop again after this command.both outputs were the same and didn't work as well

Is alsa plug connected to slot in snap connections telegram-desktop?

Yes it is

Works for me :thinking:
image

okay found out what happened.
no matter what happens it outputs that line
but....
analog works fine(AUX port)
USB headsets don't work
i can't check HDMI audio but i assume it works as well because of the behaviour of audio

more details:
if using usb device as default it still outputs to analog(or HDMI) if they were previously selected

even more details:
video is still not playing...i know it was another issue.you have to use specific video renderer for raspberry pi.
chrome and vlc and omxplayer are only apps that can play video in raspberry pi
for VLC there is specific renderer called MMAL x11 spliter for raspberry pi
details about MMAL in a C# wrapper lib

i know it was another issue.you have to use specific video renderer for raspberry pi.

omxplayer is a hardware decoding technology. tdesktop doesn't support hardware decoding completely. I.e. it should normally decode on cpu (but, maybe, your raspberry pi's cpu is too weak)
+ there are a very suboptimal renderer, tdesktop plays with lags video that even chrome/firefox play without any issues (no browser has hardware decoding on linux officially).

if using usb device as default it still outputs to analog(or HDMI) if they were previously selected

How do you choose the default device on alsa?

there is a indicator in top panel of LXDE
i checked in alsamixer when you change a audio device from top panel it shows as default in alsamixer as well

omxplayer is a hardware decoding technology. tdesktop doesn't support hardware decoding completely. I.e. it should normally decode on cpu (but, maybe, your raspberry pi's cpu is too weak)

  • there are a very suboptimal renderer, tdesktop plays with lags video that even chrome/firefox play without any issues (no browser has hardware decoding on linux officially).

cpu rendering is really slow in raspberry pie(don't know about pi 4 because its different)
chrome vlc and omxplayer have special decoder so they can do this without problem.
you can do cpu rendering but there is too much lag if you want to play properly 480p or upward.
but telegram doesn't even start at all i guess something else is stopping it completely

there is a indicator in top panel of LXDE

Maybe it creates a .asoundrc file in your home directory, but this won't work since each snap has it own's home directory

chrome vlc and omxplayer have special decoder so they can do this without problem.

arm is not officially supported, so, I think, preston won't do anything specially for arm users :(

Maybe it creates a .asoundrc file in your home directory, but this won't work since each snap has it own's home directory

yes it does.card 0 is analog and card 1 is the usb device.
isn't there a way to use .asoundrc from user home directory instead of snap?

arm is not officially supported, so, I think, preston won't do anything specially for arm users :(

well, you're right actually.I don't really know why preston hates arm so much. they can make smaller devices with much less power.they don't generate too much heat so there are no fans and they are much quieter.
anyway when you attemp to start a video on telegram this happens:

[2020.03.08 11:52:22] Streaming Error: Unable to sws_scale to good size 640, got 0.
[2020.03.08 11:52:23] Audio Info: Closing audio playback device.
[2020.03.08 11:52:23] Audio Info: recreating audio device and reattaching the tracks
[2020.03.08 11:52:23] Streaming Error: Unable to sws_scale to good size 640, got 0.
[2020.03.08 11:52:23] Audio Error: playing changed while loading
[2020.03.08 11:52:24] Audio Info: Closing audio playback device.

well, you're right actually.I don't really know why preston hates arm so much. they can make smaller devices with much less power.they don't generate too much heat so there are no fans and they are much quieter.
anyway when you attemp to start a video on telegram this happens:

I don't think it's hate, instead have to workaround or patch things for one extremely low userbase.

@AliDjango I don’t hate. The problem is testing. I have no idea how to build+test things there, I have only x86/x64 hardware.

isn't there a way to use .asoundrc from user home directory instead of snap?

There are a more convenient way to change the default card: https://github.com/telegramdesktop/tdesktop/issues/7251#issuecomment-591723777

AliDjango I don’t hate. The problem is testing. I have no idea how to build+test things there, I have only x86/x64 hardware.

I know but arm users are human as well xD.well at least we have tdesktop packages for this platform and audio and video won't be a problem.we can save them as a file and open in vlc or something that already works.

Don't get me wrong though @john-preston. I used telegram since 2014 and I never tried to look for any other messenger. I remember how telegram used to like vs what looks like now and that's all thanks to you and dev team and just thought since you added packages for arm maybe I'll help to fix bugs or test new features that require testing because I do have access to arm platform.

I don't think it's hate, instead have to workaround or patch things for one extremely low userbase.

I agree with user base but if telegram-desktop was released on arm a few years ago when people were hyped to do lots of things with telegram/telegram-bots on raspberry pi and similar SBC arm boards the user base would have grown a lot
maybe i should have used another word instead of hate. I didn't want to be offensive toward anyone

we can save them as a file and open in vlc or something that already works.

btw: https://github.com/telegramdesktop/tdesktop/wiki/Hidden-modes
image

There are a more convenient way to change the default card: #7251 (comment)

i don't understand whats going on.but that configuration doesnt work.how should i change it?
this is my config

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "output"
    }
    capture.pcm {
        type plug
        slave.pcm "input"
    }
}

pcm.output {
    type hw
    card 1
}

ctl.!default {
    type hw
    card 1
}

pcm.input {
    type hw
    card 1
}

btw: https://github.com/telegramdesktop/tdesktop/wiki/Hidden-modes
image

I use workmode so I knew about it.tried it but snap ask every single time if i let the telegram opens the file.it's no big deal but kinda gets on my nerves though xD
thanks for suggestion

how should i change it?

You shoulld set ALSA_CARD=1 variable

Where is that variable?

where is that variabe?

This is an environment variable. You can run telegram like ALSA_CARD=1 snap run telegram-desktop or add it to ~/.pam_environment, or to /etc/environment

audio works now.i was confused I thought its a setting in somewhere
I think we can close the issue now. I'll update #7102 and #7103 for future references
@ilya-fedin thanks for helping me

@AliDjango I don’t hate. The problem is testing. I have no idea how to build+test things there, I have only x86/x64 hardware.

QEMU ?

@industrium Yes, I've heard about qemu, but I have no time to dig into that deep myself, I had now three attempts to run arm in qemu on my x64 with still no results.

So if someone provides a complete step-by-step guide (like, what exact commands do I run, I'm not exactly a Linux Jedi) from:

— a desktop x64 (Windows, macOS or Ubuntu 18.04 for example)

to:

— running tdesktop in arm VM and see it crashing on animated stickers

I would be able at least to try to fix that in code or find out how it could be worked around (apart from disabling the cache).

@john-preston
I don't know if these help because I didn't try them and I don't know much about QEMU(they are from 2017 so they may be a little outdated) but check them if you have time:
https://azeria-labs.com/emulate-raspberry-pi-with-qemu/
https://blog.agchapman.com/using-qemu-to-emulate-a-raspberry-pi/

if you don't mind paying a little maybe buy a raspberry pi(35$)

I'm not sure how do you usually debug but:
After you emulated raspbian then install telegram-desktop from snap and you can test it.
you can build .snap package from your x64 desktop and move files to QEMU and test your code maybe.

Also, if you need help with raspbian maybe I can help a little. I've used raspbian for few years.

EDIT: see what @Aokromes commented.it is more updated and its for Windows 10.mine are for linux.although mine are more detailed because it shows you raspi-config and how to enable ssh and ...

it's slow like hell https://i.imgur.com/JUE4zPA.png

If it feels like 1.2ghz low power arm processor That's ok xD
you are emulating a raspberry pi with 1.2ghz processor
also, AFAIK QEMU emulates almost everything so it's going to be slow anyway.
Maybe try to increase your ram to 1gb or 4gb so it feels like RPI4 and increase the emulated frequency

what tutorial did you follow maybe i can try as well?

the one i linked. and yes, when it ends i will increase ram to 4gb.
kernel-qemu-4.4.34-jessie + 2020-02-13-raspbian-buster.img

i guess i know why it is running slow as hell.
the number of raspberry pi logos on top when booting shows the number of cores.you see one.then its a 1 core machine running as 1.2 and that is so slow of course.
versatilepb is one core only and arm1176 is a serveral decades old arm processor used on raspberry pi 1.
i'm trying to emulate a better arm device with raspbian so please bear with that until i come up with another way

https://www.osboxes.org/raspbian/#raspbian-2019-09-30-vmware i go to test those xd

i guess they are desktop version of raspbian that are amd64 if you want to install raspbian on your laptop/desktop
vmware does not support armhf
i guess these are disk images of raspbian from this link:
https://www.raspberrypi.org/downloads/raspberry-pi-desktop/

yeah, they are x86 :/ back to the rheumatic turtle.

https://github.com/bztsrc/raspi3-tutorial

this guy added raspberry pi 3 machine to qemu which needs version 2.12 upward(latest on ubuntu 18.04 is 2.11)

try this:

git clone git://git.qemu.org/qemu.git
cd qemu
git checkout v2.12.0
./configure --target-list=aarch64-softmmu
make -j`nproc`
export PATH="$(pwd)/aarch64-softmmu:${PATH}"
cd ..

# Get source.
git clone https://github.com/bztsrc/raspi3-tutorial
cd raspi3-tutorial
git checkout efdae4e4b23c5b0eb96292f2384dfc8b5bc87538

# Setup to use the host precompiled cross compiler.
# https://github.com/bztsrc/raspi3-tutorial/issues/30
sudo apt-get install gcc-aarch64-linux-gnu
find . -name Makefile | xargs sed -i 's/aarch64-elf-/aarch64-linux-gnu-/'

# Compile and run stuff.
cd 05_uart0
make
../../qemu/aarch64-softmmu/qemu-system-aarch64 -M raspi3 -kernel kernel8.img -serial stdio

source

Was this page helpful?
0 / 5 - 0 ratings