Coder Social home page Coder Social logo

bela-image-builder's People

Contributors

giuliomoro avatar lbdonovan 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

Watchers

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

bela-image-builder's Issues

xeno-test

when running xeno-test it highlights that a few things are not supported in the kernel. Do we need any of those?
Also mutex_trylock is simply "not supported" (so it is not related to the kernel?) it's a shame, we could use that.

net_packet_dgram skipped (no kernel support)
net_packet_raw skipped (no kernel support)
net_udp skipped (no kernel support)
posix_clock OK
posix_cond OK
posix_fork OK
mutex_trylock not supported
posix_mutex OK
posix_select OK
rtdm skipped (no kernel support)
sched_quota skipped (no kernel support)
sched_tp skipped (no kernel support)
setsched OK
sigdebug skipped (no kernel support)
timerfd OK

`/usr/xenomai/lib` is not added to the lib cache

both of these failed (in scripts/chroot.sh)

ldconfig /usr/xenomai/lib

and

echo /usr/xenomai/lib > /etc/ld.so.conf.d/xenomai.conf

I would expect the former to work and I think the latter is probably good practice anyhow, but not enough (requires to do ldconfig once on the board).
I guess we should check how rcn does it ...

Bela core does not compile

Issue by LBDonovan
Sunday Apr 16, 2017 at 17:54 GMT
Originally opened as LBDonovan/image-builder#3


clang fails on math_runfast.c with:

clang: error: unknown argument: '-no-pie'
clang: error: unsupported argument '-mimplicit-it=arm' to option 'Wa,'

gcc fails on Midi.cpp with:

In file Midi.h: alsa/asoundlib.h: No such file or directory column: 28, line: 13

Boot time

Issue by LBDonovan
Sunday Apr 16, 2017 at 17:58 GMT
Originally opened as LBDonovan/image-builder#5


After a little fiddling boot time is not too bad, output of systemd-analyze:

Startup finished in 4.925s (kernel) + 19.229s (userspace) = 24.154s

systemd-analyze blame:

14.532s dev-mmcblk0p1.device
12.489s generic-board-startup.service
10.759s networking.service
3.530s systemd-udev-trigger.service
2.735s udhcpd.service
2.692s capemgr.service
1.827s rsyslog.service
1.754s ofono.service
1.721s connman.service
1.187s dundee.service
1.129s systemd-journald.service
1.025s dnsmasq.service
942ms wpa_supplicant.service
774ms avahi-daemon.service
712ms systemd-timesyncd.service
707ms systemd-fsck-root.service
644ms ssh.service
613ms systemd-udevd.service
566ms dev-mqueue.mount
494ms systemd-journal-flush.service
483ms systemd-update-utmp.service
474ms kmod-static-nodes.service
427ms sys-kernel-config.mount
405ms systemd-modules-load.service
365ms systemd-update-utmp-runlevel.service
364ms systemd-user-sessions.service
353ms systemd-sysctl.service
344ms hostapd.service
333ms systemd-random-seed.service
322ms sys-kernel-debug.mount
308ms systemd-tmpfiles-setup.service
282ms systemd-tmpfiles-setup-dev.service
220ms sys-fs-fuse-connections.mount
195ms systemd-remount-fs.service

LOCALE screwed up?

Issue by giuliomoro
Tuesday Apr 25, 2017 at 00:23 GMT
Originally opened as LBDonovan/image-builder#12


You would occasionally get this warning (e.g.: when apt-get'ing something that uses perl to configure the package).

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

This solution worked:

$ export LANGUAGE=en_US.UTF-8
$ export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
$ locale-gen en_US.UTF-8
$ dpkg-reconfigure locales

note: the current (incomplete, see log above) configuration is en_GB.UTF-8 (so GB instead of US). I reckon the above fixe with en_GB would work similarly well.

where should the dts files live?

@LBDonovan I forked dtb-rebuilder to https://github.com/BelaPlatform/dtb-rebuilder: using this from now on.

BUT, it is pretty annoying to have to copy the files over from BelaPlatform/Bela to here.
We should decide where to keep them in the first place and only always keep them there.

I'd suggest keeping them in the Bela repo and copying them over to the dtb-rebuilder folder when compiling them in chroot. I don't see any concrete advantage in keeping them in dtb-rebuilder or hope for a merge into mainline (or beagleboard.org) anyhow, given that - to make use of those - someone needs to have a Bela cape and a dedicated image anyhow.

libllvm3.9 and libclang1-3.9 get installed

I: Retrieving libclang1-3.9 1:3.9.1-8
I: Validating libclang1-3.9 1:3.9.1-8
I: Retrieving libllvm3.9 1:3.9.1-8
I: Validating libllvm3.9 1:3.9.1-8

why? What does depend on them? Note we are manually installing clang 4.0

Shutdown takes long

USR0 led keeps blinking for over a minute.
Tried
halt
shutdown -h now

Once it dies, the PWR LED stays on.

Tracked xenomai branch

Currently it is stable-3.0.x, but this is not necessarily always what you want, see this discussion. Perhaps we should just git pull --tags and track the release tags(currently v3.0.5)

Can't login with root

Issue by LBDonovan
Sunday Apr 16, 2017 at 17:53 GMT
Originally opened as LBDonovan/image-builder#2


There's no root password but ssh doesn't let you login as root, you have to login as user 'bela' password 'a' then sudo su. Probably an issue with the ssh config

`apt` could potentially replace the kernel with a stock one

Issue by giuliomoro
Tuesday Apr 25, 2017 at 01:16 GMT
Originally opened as LBDonovan/image-builder#15


apt list --upgradable lists the packages that could be upgrated with apt-get upgrade.
This lists some packages we probably installed manually (e.g.: the kernel). What is the best way to prevent users from mistakenly upgrade some critical packages when doing apt-get upgrade?

apt list --upgradable
Listing... Done
bb-cape-overlays/unknown 4.4.20170418-0rcnee2~stretch+20170421 armhf [upgradable from: 4.4.20170405-0rcnee1~bpo90+20170407]
bb-customizations/unknown 1.20170421-0rcnee1~stretch+20170421 all [upgradable from: 1.20170413-0rcnee4~bpo90+20170413]
bsdmainutils/testing 9.0.12+nmu1 armhf [upgradable from: 9.0.12]
cpp-6/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
g++-6/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
gcc-6/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
gcc-6-base/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libasan3/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libatomic1/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libcc1-0/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libgcc-6-dev/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libgcc1/testing 1:6.3.0-14 armhf [upgradable from: 1:6.3.0-12]
libgomp1/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libicu57/testing 57.1-6 armhf [upgradable from: 57.1-5]
libldap-2.4-2/testing 2.4.44+dfsg-4+b1 armhf [upgradable from: 2.4.44+dfsg-3]
libldap-common/testing 2.4.44+dfsg-4 all [upgradable from: 2.4.44+dfsg-3]
libobjc-6-dev/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libobjc4/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libstdc++-6-dev/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libstdc++6/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
libubsan0/testing 6.3.0-14 armhf [upgradable from: 6.3.0-12]
linux-firmware-image-4.4.61-ti-xenomai-r98/unknown 1stretch armhf [upgradable from: 1cross]
linux-headers-4.4.61-ti-xenomai-r98/unknown 1stretch armhf [upgradable from: 1cross]
linux-image-4.4.61-ti-xenomai-r98/unknown 1stretch armhf [upgradable from: 1cross]

When/how should Bela start at boot?

I added a line at the end of /opt/Bela/bela_init.sh:

sleep $SLEEPTIME; /root/Bela/projects/basic/basic

Now, if SLEEPTIME=2 (seconds) or less, then the program actually starts but the PRU hangs during a DAC_WAIT_FOR_FINISH:

  423 :                   : .macro DAC_WAIT_FOR_FINISH
  424 :                   :  LOOP:
  425 :                   :      LBBO r27, reg_spi_addr, SPI_CH0STAT, 4
  426 :                   :      QBBC LOOP, r27, 0
  427 :                   : .endm

so probably something is wrong in booting up the SPI peripheral?

If SLEEPTIME=4 then the program starts fine. I hear sound 19 seconds after I power up the board (after a graceful shutdown).
If SLEEPTIME=3 then it depends. Once it started and worked fine, the other time it started but stopped after half a second (PRU hanged again at that point).

be able to build kernel modules on the board

Once you have the board up and running:

scp -r downloads/ti-linux-kernel-dev/KERNEL/security/selinux/include bbb:/lib/modules/`cat kernel/kernel_version`/build/security/selinux/include
scp -r downloads/ti-linux-kernel-dev/KERNEL/tools/include/* bbb:/lib/modules/`cat kernel/kernel_version`/build/tools/include

and on the board:

cd /lib/modules/$(uname -r)/build
make headers_check && make headers_install && make scripts

at this point all the build tools will be ARM and you can build kernel modules.

partition table

Add a large-ish FAT32 partition for the ~ folder
This will allow:

  1. faster boot time by mounting the rootfs as ro
  2. easy access to the partition through a file browser on the host.
  3. a first step towards potential security improvements (e.g.: if the ~ is of a non-root user), though for now it should be /root otherwise nothing will work :)

with the following drawbacks:

  1. partition need to be mounted before the Bela program is started at boot
  2. users may easily modify the examples folder without realizing they are making a permanent change

kernel does not compile with CONFIG_XENO_DRIVERS_RTIPC

... as pointed out in #16
I think it is a bug of Xenomai introduced in https://git.xenomai.org/xenomai-3.git/commit/kernel/drivers/ipc/rtipc.c?h=next&id=1ba2fc8ef98d927f07a8d7465fe9ea541f501e39
:
sys32_put_iovec should only be used if CONFIG_XENO_ARCH_SYS3264 is defined. In fact all the compat.h headers only declare it #ifdef CONFIG_XENO_ARCH_SYS3264.
In the above commit they changed a compile time check (#ifdef) to a runtime check if (IS_ENABLED(CONFIG_XENO_ARCH_SYS3264).
The patch below seems to make it compile. Whether it destroys something else, I have no idea.
One day I may be able to raise this on the xenomai mailing list.

diff --git a/drivers/xenomai/ipc/rtipc.c b/drivers/xenomai/ipc/rtipc.c
index 46b253a..a541f4e 100644
--- a/drivers/xenomai/ipc/rtipc.c
+++ b/drivers/xenomai/ipc/rtipc.c
@@ -108,10 +108,14 @@ int rtipc_put_iovec(struct rtdm_fd *fd, struct iovec *iov,
        if (!rtdm_fd_is_user(fd)) {
                memcpy(msg->msg_iov, iov, len);
                ret = 0;
-       } else if (IS_ENABLED(CONFIG_XENO_ARCH_SYS3264) &&
+       }
+
+#ifdef CONFIG_XENO_ARCH_SYS3264
+         else if (IS_ENABLED(CONFIG_XENO_ARCH_SYS3264) &&
                   rtdm_fd_is_compat(fd))
                ret = sys32_put_iovec((struct compat_iovec __user *)msg->msg_iov,
                                      iov, msg->msg_iovlen);
+#endif

Latest Xenomai does not compile

http://xenomai.org/pipermail/xenomai/2017-May/037335.html

this was broken in 9a865549170f82561389eaa6d4dbda6f8a46d2e1

The below will make your kernel compile

--- a/arch/arm/xenomai/machine.c
+++ b/arch/arm/xenomai/machine.c
@@ -35,7 +35,7 @@ static void mach_arm_prefault(struct vm_area_struct *vma)
                flags = (vma->vm_flags & VM_MAYWRITE) ? FAULT_FLAG_WRITE : 0;
                for (addr = vma->vm_start;
                     addr != vma->vm_end; addr += PAGE_SIZE)
-                       handle_mm_fault(vma, addr, flags);
+                       handle_mm_fault(vma->vm_mm, vma, addr, flags);
        }
 }

libasound2-dev has some unmet dependencies but it works

Issue by giuliomoro
Tuesday Apr 25, 2017 at 00:18 GMT
Originally opened as LBDonovan/image-builder#11


libasound2-dev

I tried to install it

root@beaglebone:~/Bela# apt-get install libasound2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libasound2-dev : Depends: libasound2 (= 1.1.3-5) but it is not going to be installed
 libc6-dev : Depends: linux-libc-dev (>= 4.9.2-2) but 1cross is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Instead of doing apt --fix-broken install I did:

root@beaglebone:~/Bela# apt-get install linux-libc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  linux-libc-dev

which installed linux-libc-dev armhf 4.9.18-1
at which point I was able to install libasound2-dev

PWR LED stays on after shutdown

I'd love it to go off instead. This way we could disable the flickering USRx LEDs and then the lack of light would mean: board is down.

UAC1/UAC2

tried the usual configfs stuff in /opt/Bela/bela_gadget.sh:

mkdir -p functions/uac2.usb0
....
ln -s functions/uac2.usb0 configs/c.1/

so that the default values are loaded:

root@bela:/sys/kernel/config/usb_gadget/g# for a in functions/uac2.usb0/*; do echo $a:; cat $a; done
functions/uac2.usb0/c_chmask:
3
functions/uac2.usb0/c_srate:
64000
functions/uac2.usb0/c_ssize:
2
functions/uac2.usb0/p_chmask:
3
functions/uac2.usb0/p_srate:
48000
functions/uac2.usb0/p_ssize:
2

see here for some "documentation".

as a result, aplay -L gives:

default:CARD=UAC2Gadget
    UAC2_Gadget, UAC2 PCM
    Default Audio Device
sysdefault:CARD=UAC2Gadget
    UAC2_Gadget, UAC2 PCM
    Default Audio Device
dmix:CARD=UAC2Gadget,DEV=0
    UAC2_Gadget, UAC2 PCM
    Direct sample mixing device
dsnoop:CARD=UAC2Gadget,DEV=0
    UAC2_Gadget, UAC2 PCM
    Direct sample snooping device
hw:CARD=UAC2Gadget,DEV=0
    UAC2_Gadget, UAC2 PCM
    Direct hardware device without any conversions
plughw:CARD=UAC2Gadget,DEV=0
    UAC2_Gadget, UAC2 PCM
    Hardware device with all software conversions

but if I try to play a sound I get:

$ aplay -D hw:CARD=UAC2Gadget,DEV=0 /root/Bela/examples/terminal-only/samples/sample.wav
Playing WAVE '/root/Bela/examples/terminal-only/samples/sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
aplay: set_params:1305: Channels count non available

Also, it does NOT show up on the host (tried Mac and Linux) as an audio device.

missing pasm

Issue by giuliomoro
Monday Apr 24, 2017 at 13:55 GMT
Originally opened as LBDonovan/image-builder#6


though it probably does not come with apt-get and we'd have to install it manually. Or add and maintain a ppa for Bela stuff

prussdrv_open open failed when trying to open the PRU

Maybe something wrong with kernel modules?
this is a diff between lsmod on the previous 4.4.61(working) and the current 4.4.62 (not working)

$ diff mods-working.sorted mods-not-working.sorted
2,4d1
< arc4                    2192  2
< bluetooth             511098  2
< cfg80211              509824  3 mac80211,wl18xx,wlcore
6,16c3,4
< ip_tables              14546  3 iptable_filter,iptable_mangle,iptable_nat
< iptable_filter          1850  0
< iptable_mangle          1849  0
< iptable_nat             2125  0
< libcomposite           53229  14 usb_f_acm,usb_f_ecm,usb_f_rndis
< mac80211              603653  2 wl18xx,wlcore
< nf_conntrack          108839  3 nf_nat,nf_nat_ipv4,nf_conntrack_ipv4
< nf_conntrack_ipv4      17226  1
< nf_defrag_ipv4          1869  1 nf_conntrack_ipv4
< nf_nat                 18076  1 nf_nat_ipv4
< nf_nat_ipv4             6608  1 iptable_nat
---
> ip_tables              14546  0
> libcomposite           53229  8 usb_f_rndis
20d7
< rfkill                 21235  6 cfg80211,bluetooth
33,35c20
< tilcdc                 31016  0
< u_ether                13682  2 usb_f_ecm,usb_f_rndis
< u_serial               13102  3 usb_f_acm
---
> u_ether                13682  1 usb_f_rndis
39,40d23
< usb_f_acm               8036  2
< usb_f_ecm              10981  2
42,45c25
< wl18xx                 99732  0
< wlcore                227162  1 wl18xx
< wlcore_sdio             8686  0
< x_tables               20194  3 ip_tables,iptable_filter,iptable_mangle
---
> x_tables               20194  1 ip_tables

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.