porting mender to orangepi issue

254 views
Skip to first unread message

Belisko Marek

unread,
Jan 4, 2018, 5:31:09 PM1/4/18
to Mender List mender.io
Hi,

I'm porting mender to orange pi (pc plus) board. I'm using https://github.com/Halolo/orange-pi-distro.git which using mainline 2017.03 u-boot + 4.14 kernel which works. I've read mender documentation and add meta-mender to mentioned repo and update local.conf (according documentation) and start build. Need to poke little bit with u-boot env build problems and then build continue (autopatching works fine). But it's failing when creating sdimg using wic. It fails with error which I was trying to fix but I have no clue what is going on. Below is full log from do_image_sdimg. Thanks for any help and hints. I tried to run clean build to avoid some sstate problems but it doesn't help. I can share small changes I have done to have mender compiled for orangepi.

error log:
DEBUG: Executing python function set_image_size
DEBUG: Python function set_image_size finished
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-extended/parted/parted_3.2.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/rsync/rsync_3.1.2.bb:do_populate_sysroot', '/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/prelink/prelink_git.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.3.bb:do_populate_sysroot', '/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb:do_populate_sysroot', '/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-core/meta/wic-tools.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb:do_populate_sysroot', '/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.5.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/opkg/opkg_0.3.5.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb:do_populate_sysroot', '/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb:do_populate_sysroot', 'virtual:native:/home/marek/projects/orangepi_plus/orange-pi-distro/poky/meta/recipes-extended/pigz/pigz_2.3.4.bb:do_populate_sysroot']
NOTE: Installed into sysroot: ['dosfstools-native', 'parted-native', 'rsync-native', 'gptfdisk-native', 'wic-tools', 'mtools-native', 'acl-native']
NOTE: Skipping as already exists in sysroot: ['depmodwrapper-cross', 'prelink-native', 'mklibs-native', 'pseudo-native', 'update-rc.d-native', 'qemuwrapper-cross', 'opkg-utils-native', 'opkg-native', 'makedevs-native', 'ldconfig-native', 'pigz-native', 'gnu-config-native', 'pkgconfig-native', 'quilt-native', 'autoconf-native', 'xz-native', 'automake-native', 'libtool-native', 'systemd-systemctl-native', 'readline-native', 'util-linux-native', 'texinfo-dummy-native', 'gettext-minimal-native', 'ncurses-native', 'shadow-native', 'popt-native', 'attr-native', 'nss-native', 'elfutils-native', 'binutils-native', 'zlib-native', 'openssl-native', 'debianutils-native', 'qemu-native', 'kmod-native', 'libarchive-native', 'libsolv-native', 'm4-native', 'lzo-native', 'sqlite3-native', 'nspr-native', 'flex-native', 'bison-native', 'cryptodev-linux-native', 'makedepend-native', 'pixman-native', 'libsdl-native', 'glib-2.0-native', 'alsa-lib-native', 'dtc-native', 'gtk-doc-native', 'bzip2-native', 'e2fsprogs-native', 'cmake-native', 'expat-native', 'rpm-native', 'util-macros-native', 'xproto-native', 'libpng-native', 'libx11-native', 'libxext-native', 'libxrandr-native', 'libxrender-native', 'libffi-native', 'gettext-native', 'libpcre-native', 'python3-native', 'curl-native', 'db-native', 'dbus-native', 'file-native', 'xtrans-native', 'inputproto-native', 'xextproto-native', 'kbproto-native', 'libxcb-native', 'randrproto-native', 'renderproto-native', 'libxdmcp-native', 'xcb-proto-native', 'libpthread-stubs-native', 'libxau-native']
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing shell function do_image_sdimg
+ mkdir -p /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0
+ mkdir -p /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/rootfs
+ rm -rf /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data
+ mkdir -p /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data
+ '[' -n '' ']'
+ '[' -f /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/deploy/images/orange-pi-pc-plus/data.tar ']'
+ cd /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0
+ tar xf /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/deploy/images/orange-pi-pc-plus/data.tar
+ mkdir -p /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data/mender
+ echo device_type=orange-pi-pc-plus
+ chmod 0444 /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data/mender/device_type
+ dd if=/dev/zero of=/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data.ext4 count=0 bs=1M seek=128
0+0 records in
0+0 records out
0 bytes copied, 8.1218e-05 s, 0.0 kB/s
+ mkfs.ext4 -F /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data.ext4 -d /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data -L data
mke2fs 1.43.5 (04-Aug-2017)
Discarding device blocks: done                            
Creating filesystem with 131072 1k blocks and 32768 inodes
Filesystem UUID: a622b529-a817-44f1-9754-f119e6939f64
Superblock backups stored on blocks: 
8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Copying files into the device: done
Writing superblocks and filesystem accounting information: done 

+ wks=/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/mender-sdimg.wks
+ rm -f /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/mender-sdimg.wks
+ '[' -n '' ']'
+ true
+ '[' -n 8388608 ']'
++ expr 8388608 / 1024
+ boot_env_align_kb=8192
+ cat
+ cat
+ echo '### Contents of wks file ###'
### Contents of wks file ###
+ cat /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/mender-sdimg.wks
part --source rawcopy --sourceparams="file=/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/deploy/images/orange-pi-pc-plus/uboot.env" --ondisk mmcblk0 --align 8192 --no-table
part --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --align 8192 --active --fixed-size 16
part --source rootfs --ondisk mmcblk0 --fstype=ext4 --label primary --align 8192 --fixed-size 425984k
part --source rootfs --ondisk mmcblk0 --fstype=ext4 --label secondary --align 8192 --fixed-size 425984k
part --source rawcopy --sourceparams=file="/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/data.ext4" --ondisk mmcblk0 --fstype=ext4 --label data --align 8192 --fixed-size 128
bootloader --ptable msdos
+ echo '### End of contents of wks file ###'
### End of contents of wks file ###
+ outimgname=/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/deploy-opipcplus-minimal-image-complete/opipcplus-minimal-orange-pi-pc-plus-20180104184416.sdimg
+ wicout=/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/deploy-opipcplus-minimal-image-complete/opipcplus-minimal-orange-pi-pc-plus-20180104184416-sdimg
+ BUILDDIR=/home/marek/projects/orangepi_plus/orange-pi-distro/build
+ wic create /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/mender-sdimg.wks --vars /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/sysroots/orange-pi-pc-plus/imgdata/ -e opipcplus-minimal -o /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/deploy-opipcplus-minimal-image-complete/opipcplus-minimal-orange-pi-pc-plus-20180104184416-sdimg/
INFO: Creating image(s)...

WARNING: overhead-factor was specified, but size was not, so bitbake variables will be used for the size. In this case both IMAGE_OVERHEAD_FACTOR and --overhead-factor will be applied
ERROR: _exec_cmd: export PATH=/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/recipe-sysroot-native/sbin:/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/recipe-sysroot-native/usr/sbin:/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/recipe-sysroot-native/usr/bin:$PATH;mcopy -i /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/deploy-opipcplus-minimal-image-complete/opipcplus-minimal-orange-pi-pc-plus-20180104184416-sdimg/tmp.wic.kkfh96cr/rootfs_boot.2.vfat -s /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/deploy-opipcplus-minimal-image-complete/opipcplus-minimal-orange-pi-pc-plus-20180104184416-sdimg/tmp.wic.kkfh96cr/boot.2/* ::/ returned '1' instead of 0
output: /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/deploy-opipcplus-minimal-image-complete/opipcplus-minimal-orange-pi-pc-plus-20180104184416-sdimg/tmp.wic.kkfh96cr/boot.2/*: No such file or directory

+ bb_exit_handler
+ ret=1
+ case $ret in
+ case $BASH_VERSION in
+ echo 'WARNING: /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/temp/run.do_image_sdimg.31516:1 exit 1 from '\''BUILDDIR="/home/marek/projects/orangepi_plus/orange-pi-distro/build" wic create "$wks" --vars "/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/sysroots/orange-pi-pc-plus/imgdata/" -e "opipcplus-minimal" -o "$wicout/"'\'''
WARNING: /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/temp/run.do_image_sdimg.31516:1 exit 1 from 'BUILDDIR="/home/marek/projects/orangepi_plus/orange-pi-distro/build" wic create "$wks" --vars "/home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/sysroots/orange-pi-pc-plus/imgdata/" -e "opipcplus-minimal" -o "$wicout/"'
+ exit 1
ERROR: Function failed: do_image_sdimg (log file is located at /home/marek/projects/orangepi_plus/orange-pi-distro/build/tmp-glibc/work/orange_pi_pc_plus-oe-linux-gnueabi/opipcplus-minimal/1.0-r0/temp/log.do_image_sdimg.31516)

BR,

marek

Kristian Amlie

unread,
Jan 5, 2018, 3:39:41 AM1/5/18
to men...@lists.mender.io, Belisko Marek
I've tried to reproduce this, but I haven't been able. I know have I
seen this myself at least once in the past, but I don't know what
triggered it.

Can you post:

* your local.conf
* your bblayers.conf
* the output of:
bitbake -e opipcplus-minimal | grep '^IMAGE_BOOT_FILES='

Thanks!

--
Kristian

Belisko Marek

unread,
Jan 5, 2018, 6:08:49 AM1/5/18
to Mender List mender.io, marek....@gmail.com
Hi, attached all requested files/info.

bitbake -e opipcplus-minimal | grep '^IMAGE_BOOT_FILES=' 
IMAGE_BOOT_FILES=" "

looks odd why IMAGE_BOOT_FILES is empty

Thanks.

BR,

marek

Dňa piatok, 5. januára 2018 9:39:41 UTC+1 Kristian Amlie napísal(-a):
bblayers.conf
local.conf

Kristian Amlie

unread,
Jan 5, 2018, 6:17:06 AM1/5/18
to men...@lists.mender.io, Belisko Marek
On 05/01/18 12:08, Belisko Marek wrote:
> Hi, attached all requested files/info.
>
> bitbake -e opipcplus-minimal | grep '^IMAGE_BOOT_FILES=' 
> IMAGE_BOOT_FILES=" "
>
> looks odd why IMAGE_BOOT_FILES is empty

Yes, I suspected it might be empty. This is not necessarily an error
though, it's just that we don't test it as much. However, I tried
setting it to empty to reproduce, and I still couldn't. I'll take a look
at your other files and see if I can spot anything.

--
Kristian
> --
> You received this message because you are subscribed to the Google
> Groups "Mender List mender.io" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mender+un...@lists.mender.io
> <mailto:mender+un...@lists.mender.io>.
> To post to this group, send email to men...@lists.mender.io
> <mailto:men...@lists.mender.io>.
> Visit this group at
> https://groups.google.com/a/lists.mender.io/group/mender/.

Belisko Marek

unread,
Jan 8, 2018, 2:46:02 PM1/8/18
to Mender List mender.io, marek....@gmail.com
Hi Kristian,

did my other files give you a clue what can be wrong with image generation? Should I ask yocto for support? I'm using yocto a lot but wic is completely new thing to me.

Thanks and BR,

marek

Dňa piatok, 5. januára 2018 12:17:06 UTC+1 Kristian Amlie napísal(-a):

Kristian Amlie

unread,
Jan 9, 2018, 2:53:21 AM1/9/18
to men...@lists.mender.io, Belisko Marek
On 08/01/18 20:46, Belisko Marek wrote:
> Hi Kristian,
>
> did my other files give you a clue what can be wrong with image
> generation? Should I ask yocto for support? I'm using yocto a lot but
> wic is completely new thing to me.

I took a look at your files now and I cannot see anything out of the
ordinary. What you could try is to populate IMAGE_BOOT_FILES with some
dummy file (which should exist in the deployment directory), and see if
that works (that would put it on the boot partition, but it can be zero
length).

Asking on the Yocto list is also a good idea, since the error message is
rubbish, even if the error turns out to be on the Mender side.

--
Kristian

Belisko Marek

unread,
Jan 11, 2018, 3:49:54 PM1/11/18
to Mender List mender.io, marek....@gmail.com
Hi Kristian,

I did look again to issue and seems I fixed it by adding IMAGE_BOOT_FILES to machine.conf. When inspecting wic env IMAGE_BOOT_FILES was empty and it seems was causing issue.
Image is now build but in deploy/images/machine I can see only /opipcplus-minimal-orange-pi-pc-plus-20180111203332-sdimg directory which contains only rootfs_boot.2.vfat which is IMO not final sdimg so probably something is still missing.

Thanks.

BR,

marek

Dňa utorok, 9. januára 2018 8:53:21 UTC+1 Kristian Amlie napísal(-a):

Belisko Marek

unread,
Jan 11, 2018, 3:59:51 PM1/11/18
to Mender List mender.io, marek....@gmail.com
Oh I'm blind, image is there in root: opipcplus-minimal-orange-pi-pc-plus-20180111204325.sdimg

Hope this helps someone else ;)

BR,

marek

Dňa štvrtok, 11. januára 2018 21:49:54 UTC+1 Belisko Marek napísal(-a):

greg.di...@gmail.com

unread,
Jan 11, 2018, 4:05:40 PM1/11/18
to mender, marek....@gmail.com
Nice!

Does it work well? As an Orange Pi owner, I'd love to give this a try.
Also, feel free to contribute the board support!

Thanks,
Greg

--
You received this message because you are subscribed to the Google Groups "Mender List mender.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mender+unsubscribe@lists.mender.io.
To post to this group, send email to men...@lists.mender.io.

Belisko Marek

unread,
Jan 11, 2018, 4:08:22 PM1/11/18
to Mender List mender.io, marek....@gmail.com
Hi Georgio,

I didn't try image yet will do later though and post results + necessary patches.
I have orangepi-pc-plus so I'll test on this device (but should work also on other orangepi's).
I'm using https://github.com/Halolo/orange-pi-distro.git as base (using mainline u-boot + kernel)

BR,

marek

Dňa štvrtok, 11. januára 2018 22:05:40 UTC+1 Gregorio Di Stefano napísal(-a):
To unsubscribe from this group and stop receiving emails from it, send an email to mender+un...@lists.mender.io.

Belisko Marek

unread,
Jan 15, 2018, 3:44:01 PM1/15/18
to Mender List mender.io, marek....@gmail.com
Hi,

I find some time today to test mender image for orangepi and result is it wont boot. I overlooked one step and it it that orangepi needs special SD boot partition setup (http://www.orangepi.org/Docs/Settingup.html).
I'm bit puzzled how to integrate this with current mender classes. For RPI and BB seems it's not the case because there is simple FAT partition with boot files. Any ideas how to add this special custom boot partitioning during mender image build?

Thanks and BR,

marek

Dňa štvrtok, 11. januára 2018 22:08:22 UTC+1 Belisko Marek napísal(-a):

Kristian Amlie

unread,
Jan 16, 2018, 4:12:35 AM1/16/18
to men...@lists.mender.io, Belisko Marek
On 15/01/18 21:44, Belisko Marek wrote:
> Hi,
>
> I find some time today to test mender image for orangepi and result is
> it wont boot. I overlooked one step and it it that orangepi needs
> special SD boot partition setup
> (http://www.orangepi.org/Docs/Settingup.html).
> I'm bit puzzled how to integrate this with current mender classes. For
> RPI and BB seems it's not the case because there is simple FAT partition
> with boot files. Any ideas how to add this special custom boot
> partitioning during mender image build?

From what I can see, this is exactly the partition configuration that
Mender uses. However, it looks like they are putting the bootloader
directly near the boot sector, while usually it is put as a file in the
FAT boot partition. Try adding this to local.conf and see if it helps:

IMAGE_BOOTLOADER_FILE = "u-boot-sunxi-with-spl.bin"

The name might be simply "u-boot.bin" under Yocto, you'll have to check.
This writes the raw bootloader to the sectors directly following the
partition table, which is also what the dd command on orangepi.org does.

--
Kristian

Belisko Marek

unread,
Jan 16, 2018, 2:44:53 PM1/16/18
to Mender List mender.io, marek....@gmail.com
Hi Kristian,

thanks for reply. I got it working but meed to define also one other variable:

IMAGE_BOOTLOADER_FILE="u-boot-sunxi-with-spl.bin"

IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET="16"

to have correct offset for spl.

Thanks and BR,

marek

Dňa utorok, 16. januára 2018 10:12:35 UTC+1 Kristian Amlie napísal(-a):

Kristian Amlie

unread,
Jan 18, 2018, 2:37:31 AM1/18/18
to men...@lists.mender.io, Belisko Marek
On 16/01/18 20:44, Belisko Marek wrote:
> Hi Kristian,
>
> thanks for reply. I got it working but meed to define also one other
> variable:
>
> IMAGE_BOOTLOADER_FILE="u-boot-sunxi-with-spl.bin"
>
> IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET="16"
>
> to have correct offset for spl.

Yes, you're right, I misread the 'dd' offsets. Glad you got it working!

--
Kristian

Belisko Marek

unread,
Jan 22, 2018, 4:08:25 PM1/22/18
to Mender List mender.io, marek....@gmail.com
Hi,

now when have orangepi supported in mender I tried to use hosted mender beta server to check if I'll see the device. Date is set correctly using ntp and device is connected on the internet.
I can see it (with strange MAC but ok) and i can see heartbeat fits my local time.

But in device mender log I have only this (enabled debug level):

Jan 22 20:59:39 orange-pi-pc-plus systemd[1]: Started Mender OTA update service.
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="Reading Mender configuration from file /etc/mender/mender.conf" module=config
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="block type: RSA PRIVATE KEY" module=keystore
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=info msg="State transition: init [none] -> init [none]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=info msg="State transition: init [none] -> idle [Idle]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=info msg="State transition: init [none] -> init [none]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="no state data stored" module=state
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=info msg="State transition: init [none] -> idle [Idle]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="statescript: timeout for executing scripts is not defined; using default of 60 seconds" module=executor
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=info msg="State transition: idle [Idle] -> authorize [Sync]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="statescript: timeout for executing scripts is not defined; using default of 60 seconds" module=executor
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="handle authorize state" module=state
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=info msg="State transition: idle [Idle] -> authorize [Sync]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=error msg="authorize failed: transient error: authorization request failed: failed to build authorization request: failed to obtain authorization message data: failed to obtain identity 
data: wait for helper failed: exit status 1" module=state
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=error msg="authorize failed: transient error: authorization request failed: failed to build authorization request: failed to obtain authorization message data
: failed to obtain identity data: wait for helper failed: exit status 1" module=state
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="statescript: timeout for executing scripts is not defined; using default of 60 seconds" module=executor
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="handle authorize wait state" module=state
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: time="2018-01-22T20:59:39Z" level=debug msg="wait 5m0s before next authorization attempt" module=state

Am I still missing something? Or device shown in mender server is dummy only? Thanks.

BR,

marek

Dňa štvrtok, 18. januára 2018 8:37:31 UTC+1 Kristian Amlie napísal(-a):

greg.di...@gmail.com

unread,
Jan 22, 2018, 4:14:10 PM1/22/18
to mender, Belisko Marek
Here is the interest part of the log:

Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=error msg="authorize failed: transient error: authorization request failed: failed to build authorization request: failed to obtain authorization message data: failed to obtain identity 
data: wait for helper failed: exit status 1" module=state
Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender



It looks like it's failing to run.

Thanks, Greg

--
You received this message because you are subscribed to the Google Groups "Mender List mender.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mender+unsubscribe@lists.mender.io.

Eystein Måløy Stenberg

unread,
Jan 22, 2018, 4:17:09 PM1/22/18
to men...@lists.mender.io, Belisko Marek
Hi Marek,

I think the device you see in Hosted Mender is the virtual onboarding
one (check its device type & MAC).

So most likely your orangepi device is not able to talk to Hosted Mender
at all, due to this error:

Jan 22 20:59:39 orange-pi-pc-plus mender[417]:
time="2018-01-22T20:59:39Z" level=error msg="authorize failed: transient
error: authorization request failed: failed to build authorization
request: failed to obtain authorization message data

I don't know exactly what this message means but someone else might. :)
> --
> You received this message because you are subscribed to the Google
> Groups "Mender List mender.io" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mender+un...@lists.mender.io
> <mailto:mender+un...@lists.mender.io>.
> To post to this group, send email to men...@lists.mender.io
> <mailto:men...@lists.mender.io>.
--

Eystein

Belisko Marek

unread,
Jan 23, 2018, 7:29:27 AM1/23/18
to greg.di...@gmail.com, mender
hi Greg,


On Mon, Jan 22, 2018 at 10:14 PM, greg.di...@gmail.com
<greg.di...@gmail.com> wrote:
> Here is the interest part of the log:
>
> Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=error msg="authorize
> failed: transient error: authorization request failed: failed to build
> authorization request: failed to obtain authorization message data: failed
> to obtain identity
> data: wait for helper failed: exit status 1" module=state
> Jan 22 20:59:39 orange-pi-pc-plus mender[417]: level=info msg="State
> transition: authorize [Sync] -> authorize-wait [Idle]" module=mender
>
>
> Does this file exist on your system:
> https://github.com/mendersoftware/mender/blob/master/support/mender-device-identity
> ?
Nope it doesn't exists but looking to
meta-mender-core/recipes-mender/mender/mender.inc (line ~134) it
should. There exists mender-inventory-hostinfo/network.
Strange. Ideas? Thanks.
>
> It looks like it's failing to run.
>
> Thanks, Greg
>
BR,

marek
> email to mender+un...@lists.mender.io.
> To post to this group, send email to men...@lists.mender.io.
> Visit this group at
> https://groups.google.com/a/lists.mender.io/group/mender/.
>
>



--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com

Belisko Marek

unread,
Jan 23, 2018, 3:48:27 PM1/23/18
to Mender List mender.io, greg.di...@gmail.com
Hi,

it looks like I was wrong. 
File does exist on device but seems that running it manually will fail:

/usr/share/mender/identity/mender-device-identity 
cat: can't open '/sys/class/net/bonding_masters/type': Not a directory

After some digging to mender-device-identity I find out that it fails because about error message.

After small fix (add check if file exists):
for dev in $SCN/*; do
        if [ ! -f "$dev/type" ]; then
          continue
        fi
    iftype=$(cat $dev/type)

seems I move forward:

systemctl restart mender
root@orange-pi-pc-plus:~# Jan 23 20:44:51 orange-pi-pc-plus systemd[1]: Stopping Mender OTA update service...
Jan 23 20:44:51 orange-pi-pc-plus systemd[1]: Stopped Mender OTA update service.
Jan 23 20:44:51 orange-pi-pc-plus systemd[1]: Started Mender OTA update service.
Jan 23 20:44:51 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:51Z" level=debug msg="Reading Mender configuration from file /etc/mender/mender.conf" module=config
Jan 23 20:44:51 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:51Z" level=debug msg="block type: RSA PRIVATE KEY" module=keystore
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: level=info msg="State transition: init [none] -> init [none]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: level=info msg="State transition: init [none] -> idle [Idle]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=info msg="State transition: init [none] -> init [none]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="no state data stored" module=state
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=info msg="State transition: init [none] -> idle [Idle]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="statescript: timeout for executing scripts is not defined; using default of 60 seconds" module=executor
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=info msg="State transition: idle [Idle] -> authorize [Sync]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="statescript: timeout for executing scripts is not defined; using default of 60 seconds" module=executor
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="handle authorize state" module=state
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: level=info msg="State transition: idle [Idle] -> authorize [Sync]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="tenant token: dummy" module=auth
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="authorization data: {{\"mac\":\"46:4c:02:b1:80:14\"} dummy -----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAoS/YdwuyP5ctAzgJ
c+VP\nJF7WXm650n6mlqLloFarLjm7kElRoXeaENMdVYuPonv9s+h12KqXoe2tYmoVr06J\nB+E67MmAQ6xwtBupmohZ4RKeN3jDcbJdnd53zjw4jmgGJ7XpagGOBxy+Y/rfPXi9\n3AsFRMCurWot6ry+w7Wr2SGu5P6slVrt2hsxCXSNHWcpC4REgrGga5Lg1jNg9/Tn\njiSd1e/nPpQPnBfOTJXo1AOSljZmsWUo9rP
x9fHj72z8xkmF/VbQ94ubLxrmevc0\nBGireBHT6wATPTE2dPaYqrIW6RKdlUKS57TEN8AXTs8QZwRd8XQVjEVIZVdaABQF\nCXXcGoTnuIyYdMKtRJX7D8JWtaBPhdXrA/xj3/c5cxVOJHnuUs/5gpPmL1oGv4Mf\nNKW/2C9LClyiyGVXmFiTJB6oVdQeg2nGSLBLxGNzdbfWRQzp3QALE9Rl+7ldrK1K\nYWmpaO7t/c
joPB7SLaXLI5oz0f0u8r2mXunjSChSiMSNAgMBAAE=\n-----END PUBLIC KEY-----\n}" module=auth
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="making authorization request to server https://docker.mender.io with req: &{POST https://docker.mender.io/api/devices/v1/authentication/auth_reques
ts HTTP/1.1 %!s(int=1) %!s(int=1) map[Content-Type:[application/json] Authorization:[Bearer dummy] X-Men-Signature:[mdIVkUxfb5S3rt9MZ6iS7WXCe41XTjftqrpOiGpmAdCeCS92d/OB9Wli/FgniK/uLCymMMxuqlkQo/1DSLuHsaTEXtleUGxxyPebiTpy9rCubF7LxMAICLrRr6h
7cS9cmbD0u4qYAbYxbZHrDS1lHNztS5GegKI3bghiNi3dTXrzPlh+rhAL0AbLe3lMB9bj8tYw59yr2fcgnRPDTzklizJZS7dCYWlUTZoPyRNUMPUbKheVynWL8A4QX83Wu/97PQ71FgFYwrJVhNz2ILmJR+FmslSTVhLK8AnTIxZu8uLle78OlAALy5xOrrHmA6VMvv5TPbtpOvFyzgOdEzW0ObhXkVXipfZ0zt56NKXr1K
nsS7nZXtd+9Lcb3vqyuwSb+jzE/CCLCir+0QsQ6b44UtzvTK49XmjYW5Mh13OONWFL693BXaZ2YCDxqXy1nhOgMJuMvKsk/H2kAiRJkuXco6OpLcpLJEPnUI5UFi1S8SIMLlxqLqAJ4HtxhyDJY2BY]] {{\"id_data\":\"{\\\"mac\\\":\\\"46:4c:02:b1:80:14\\\"}\",\"tenant_token\":\"dummy\",\
"pubkey\":\"-----BEGIN PUBLIC KEY-----\\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAoS/YdwuyP5ctAzgJc+VP\\nJF7WXm650n6mlqLloFarLjm7kElRoXeaENMdVYuPonv9s+h12KqXoe2tYmoVr06J\\nB+E67MmAQ6xwtBupmohZ4RKeN3jDcbJdnd53zjw4jmgGJ7XpagGOBxy+Y/rfPXi9
\\n3AsFRMCurWot6ry+w7Wr2SGu5P6slVrt2hsxCXSNHWcpC4REgrGga5Lg1jNg9/Tn\\njiSd1e/nPpQPnBfOTJXo1AOSljZmsWUo9rPx9fHj72z8xkmF/VbQ94ubLxrmevc0\\nBGireBHT6wATPTE2dPaYqrIW6RKdlUKS57TEN8AXTs8QZwRd8XQVjEVIZVdaABQF\\nCXXcGoTnuIyYdMKtRJX7D8JWtaBPhdXrA/x
j3/c5cxVOJHnuUs/5gpPmL1oGv4Mf\\nNKW/2C9LClyiyGVXmFiTJB6oVdQeg2nGSLBLxGNzdbfWRQzp3QALE9Rl+7ldrK1K\\nYWmpaO7t/cjoPB7SLaXLI5oz0f0u8r2mXunjSChSiMSNAgMBAAE=\\n-----END PUBLIC KEY-----\\n\"}\n} %!s(func() (io.ReadCloser, error)=0x1d757c) %!s(int
64=717) [] %!s(bool=false) docker.mender.io map[] map[] %!s(*multipart.Form=<nil>) map[]   %!s(*tls.ConnectionState=<nil>) %!s(<-chan struct {}=<nil>) %!s(*http.Response=<nil>) <nil>}" module="client_auth"
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: level=error msg="authorize failed: transient error: authorization request failed: failed to execute authorization request: Post https://docker.mender.io/api/devices/v1/authentication/auth_requ
ests: dial tcp: lookup docker.mender.io on 192.168.100.1:53: no such host" module=state
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=error msg="authorize failed: transient error: authorization request failed: failed to execute authorization request: Post https://docker.mender.io/api/devices
/v1/authentication/auth_requests: dial tcp: lookup docker.mender.io on 192.168.100.1:53: no such host" module=state
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="statescript: timeout for executing scripts is not defined; using default of 60 seconds" module=executor
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="handle authorize wait state" module=state
Jan 23 20:44:52 orange-pi-pc-plus mender[430]: time="2018-01-23T20:44:52Z" level=debug msg="wait 5m0s before next authorization attempt" module=state

and to me it looks like it cannot resolve docker.mender.io but I can ping gmail.com so internet should be working:
PING gmail.com (172.217.23.197): 56 data bytes
64 bytes from 172.217.23.197: seq=0 ttl=54 time=12.695 ms
64 bytes from 172.217.23.197: seq=1 ttl=54 time=29.099 ms
^C
--- gmail.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 12.695/20.897/29.099 ms
root@orange-pi-pc-plus:~# nslookup docker.mender.io
Server:    192.168.100.1
Address 1: 192.168.100.1

nslookup: can't resolve 'docker.mender.io'

Any ideas how to proceed? Thanks.

BR,

marek


Dňa utorok, 23. januára 2018 13:29:27 UTC+1 Belisko Marek napísal(-a):

greg.di...@gmail.com

unread,
Jan 23, 2018, 3:53:43 PM1/23/18
to Belisko Marek, Mender List mender.io
Hi,

Looks like you've integrated Mender with our default testing configuration. 
What are you planning to achieve here? Do you want to bootstrap with hosted.mender.io?

If so, you have to modify the mender.conf file, and point the client to "hosted.mender.io" and set the tenant key in the config file as well.

Let me know how that works.

Thanks,
Greg

Hi,

Belisko Marek

unread,
Jan 23, 2018, 4:10:02 PM1/23/18
to Mender List mender.io, marek....@gmail.com
Hi,

ok thanks for info. Can you please elaborate a bit on tenanttoken (documentation is a bit weak ;)) I found some token on hosted.mender.io (under My Organisation), but when update to that token + update serveUrl I still cannot authenticate with server:

Jan 23 21:06:42 orange-pi-pc-plus mender[583]: kEBfcgHBMl6mmZOHUBZLs9RFOyZ0ITCvYO37kexm6ZTYdVszt3DwhEzoGonXy9bEAPoYK5kBEWBkR5n6UghMsuIwn086ny1s319eNRKGeCzC508VebbOYC81BkET6f6MYogydvh2b2RaxlZMb180wFZwfEIZ9OD8swAFOkw5clLnF5kNSnx4xw-LMz4RxN2C
H\",\"pubkey\":\"-----BEGIN PUBLIC KEY-----\\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAoS/YdwuyP5ctAzgJc+VP\\nJF7WXm650n6mlqLloFarLjm7kElRoXeaENMdVYuPonv9s+h12KqXoe2tYmoVr06J\\nB+E67MmAQ6xwtBupmohZ4RKeN3jDcbJdnd53zjw4jmgGJ7XpagGOBxy+Y/r
fPXi9\\n3AsFRMCurWot6ry+w7Wr2SGu5P6slVrt2hsxCXSNHWcpC4REgrGga5Lg1jNg9/Tn\\njiSd1e/nPpQPnBfOTJXo1AOSljZmsWUo9rPx9fHj72z8xkmF/VbQ94ubLxrmevc0\\nBGireBHT6wATPTE2dPaYqrIW6RKdlUKS57TEN8AXTs8QZwRd8XQVjEVIZVdaABQF\\nCXXcGoTnuIyYdMKtRJX7D8JWtaBPhd
XrA/xj3/c5cxVOJHnuUs/5gpPmL1oGv4Mf\\nNKW/2C9LClyiyGVXmFiTJB6oVdQeg2nGSLBLxGNzdbfWRQzp3QALE9Rl+7ldrK1K\\nYWmpaO7t/cjoPB7SLaXLI5oz0f0u8r2mXunjSChSiMSNAgMBAAE=\\n-----END PUBLIC KEY-----\\n\"}\n} %!s(func() (io.ReadCloser, error)=0x1d757c) %!
s(int64=1385) [] %!s(bool=false) hosted.mender.io map[] map[] %!s(*multipart.Form=<nil>) map[]   %!s(*tls.ConnectionState=<nil>) %!s(<-chan struct {}=<nil>) %!s(*http.Response=<nil>) <nil>}" module="client_auth"
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: time="2018-01-23T21:06:43Z" level=debug msg="got response: &{401 Unauthorized 401 HTTP/2.0 2 0 map[Server:[openresty/1.13.6.1] Date:[Tue, 23 Jan 2018 21:06:43 GMT] Content-Type:[application/js
on; charset=utf-8] Vary:[Accept-Encoding] X-Authentication-Version:[master_d0a4e28d7daadba03e9a7c51465b6c7ea0cf2e87] X-Men-Requestid:[92ac27b1-5104-4214-8a19-3881c03dcbab] Access-Control-Allow-Origin:[*]] 0x10929950 -1 [] false false map[]
 0x10798580 0x10b886c0}" module="client_auth"
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: time="2018-01-23T21:06:43Z" level=error msg="authorize failed: transient error: authorization request failed: authentication request rejected" module=state
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: time="2018-01-23T21:06:43Z" level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: time="2018-01-23T21:06:43Z" level=debug msg="statescript: timeout for executing scripts is not defined; using default of 60 seconds" module=executor
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: level=error msg="authorize failed: transient error: authorization request failed: authentication request rejected" module=state
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: time="2018-01-23T21:06:43Z" level=debug msg="handle authorize wait state" module=state
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: time="2018-01-23T21:06:43Z" level=debug msg="wait 5m0s before next authorization attempt" module=state
Jan 23 21:06:43 orange-pi-pc-plus mender[583]: level=info msg="State transition: authorize [Sync] -> authorize-wait [Idle]" module=mender

Thanks.

BR,

marek
Dňa utorok, 23. januára 2018 21:53:43 UTC+1 Gregorio Di Stefano napísal(-a):

Belisko Marek

unread,
Jan 23, 2018, 4:11:45 PM1/23/18
to Mender List mender.io, marek....@gmail.com
Stupid me, I need to activate device on hosted mender server. Not it seems it's working. Sorry for the noise.

BR,

marek

Dňa utorok, 23. januára 2018 22:10:02 UTC+1 Belisko Marek napísal(-a):
Reply all
Reply to author
Forward
0 new messages