belaplatform / bela-image-builder Goto Github PK
View Code? Open in Web Editor NEWScripts to build a Bela image from scratch
License: MIT License
Scripts to build a Bela image from scratch
License: MIT License
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
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 ...
Issue by giuliomoro
Monday Apr 24, 2017 at 23:56 GMT
Originally opened as LBDonovan/image-builder#10
I was getting EINVAL
all over the place (see LBDonovan/image-builder#3 (comment) )
I configured with this on the BBB:
$ /root/xenomai/configure --with-core=cobalt --enable-smp --enable-pshared CFLAGS="-fno-pie -no-pie" LDFLAGS="-no-pie -fno-pie"
then compiled and installed and it worked straight away.
well... ifconfig
is not there. More to come.
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
Issue by giuliomoro
Monday Apr 24, 2017 at 23:49 GMT
Originally opened as LBDonovan/image-builder#9
The images ships with clang-3.8
(from apt-get
I suppose).
We should get 4.0 from here. Perhaps that is also available on some dedicated ppa
Issue by giuliomoro
Tuesday Apr 25, 2017 at 01:56 GMT
Originally opened as LBDonovan/image-builder#16
Please enable
CONFIG_XENO_DRIVERS_RTIPC
Otherwise you cannot create pipes! (RTIPC is real-time-inter-process-communication).
Perhaps other things need to be enabled as well, check the 3.8.13 kernel config for hints on XENO flags to enable:
BelaPlatform/Bela#171 (comment)
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
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.
@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.
Issue by LBDonovan
Sunday Apr 16, 2017 at 17:51 GMT
Originally opened as LBDonovan/image-builder#1
This only started happening after I got rid of Apache and Bone101, it's probably an issue with systemd
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
USR0 led keeps blinking for over a minute.
Tried
halt
shutdown -h now
Once it dies, the PWR LED stays on.
this causes warnings at each sudo
what is that supposed to do?
... so you have to remember the old trick "return, tilde, dot" in order to get back your terminal.
Issue by giuliomoro
Tuesday Apr 25, 2017 at 01:11 GMT
Originally opened as LBDonovan/image-builder#14
/dev/mmcblk0p1
is 1.6G. Let's aim for 3825204736 bytes (3.82GB) (the size of the eMMC on the black)
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
)
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
given that debootstrap
takes some packages from non-free
(e.g.: the firmwares for wireless devices), then this should be added also to sources.list
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]
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).
Issue by giuliomoro
Monday Apr 24, 2017 at 16:09 GMT
Originally opened as LBDonovan/image-builder#7
this gives you the current commit hash and writes it to a file
git rev-parse HEAD > gitcommithash
dtoverlay
is a command line utility that loads and removes overlays while the system is running, as well as listing the available overlays and displaying their help information
Not sure if this is a pi only thingy.
https://www.raspberrypi.org/documentation/configuration/device-tree.md#part3.5
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.
These are customarily introduced when compiling Xenomai natively with gcc 6.3
Add a large-ish FAT32 partition for the ~
folder
This will allow:
ro
~
is of a non-root user), though for now it should be /root
otherwise nothing will work :)with the following drawbacks:
examples
folder without realizing they are making a permanent change Issue by LBDonovan
Sunday Apr 16, 2017 at 17:55 GMT
Originally opened as LBDonovan/image-builder#4
... 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
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);
}
}
... which is pretty annoying.
For instance, it creates all the files in downloads/
with root
as the owner ...
What does it need sudo
for?
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
so that they can boot from the SD card !
It's not in the image I have been using lately... not sure why @roberthjack
Issue by giuliomoro
Tuesday Apr 25, 2017 at 01:10 GMT
Originally opened as LBDonovan/image-builder#13
No less
on the system??? really???
apt-file
less
dnsutils
psmisc
libasound2-dev
alsa-utils
midisport-firmware
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.
Issue by giuliomoro
Monday Apr 24, 2017 at 23:44 GMT
Originally opened as LBDonovan/image-builder#8
one at 192.168.7.2
(usb0
), the other one at 192.168.6.2
(usb1
). Both working, as far as I can tell, but the latter should be removed
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.
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
to copy MMC to SD and SD to MMC and other goodies.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.