Coder Social home page Coder Social logo

rauc / rauc Goto Github PK

View Code? Open in Web Editor NEW
750.0 40.0 188.0 5.75 MB

Safe and secure software updates for embedded Linux

Home Page: https://rauc.io

License: GNU Lesser General Public License v2.1

Shell 9.80% C 85.46% Makefile 0.09% M4 2.78% Dockerfile 0.14% Roff 0.61% Python 0.24% Meson 0.87%
embedded linux update client iot rauc ota fota software-update firmware-update

rauc's People

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

Watchers

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

rauc's Issues

Auto-detect nfs boot

when booting your target from nfs, currently it is not possible to use rauc, as it cannot detect to be booted from any configured slot.
The only solution is to add an nfs dummy entry to the system.conf.

As detecting an nfs is relatively easy and a common use case for testing, rauc should provide out-of-the box support for handling nfs as fallback if no other active slot could be detected.

Segmentation fault when running rauc on the target system

Was trying to do a quick sanity check.

When I run rauc on my target system, I get a segmentation fault. What could cause this? The exact same command, w/ exact same input files runs fine on the host.

I built rauc v0.3 via buildroot. (I manually changed the buildroot package settings so that rauc v0.3 gets used instead of 0.2)

My arm-linux-gnueabihf target does not have systemd or D-Bus. Could that be an issue?

Attached are the files used for running the command
files.zip

# rauc --keyring=./demo.cert.pem info update-2015.04-1.raucb
Invalid byte sequence in conversion input
(rauc:8680): GLib-CRITICAL **: g_error_new_literal: assertion 'message != NULL' failed
(rauc:8680): GLib-CRITICAL **: g_propagate_error: assertion 'src != NULL' failed
Segmentation fault

shorthelp

should not contain optional parameters.
Otherwise --key is not optional if generating raucb images

Question: is fixed bundle filename suffix really required?

Note that RAUC bundles must always have a .raucb file name suffix in order
to ensure that RAUC treats them as bundles.

When looking at the code, it seems that this is only used to switch between
local filesystem access or network download mode, but there is no other
technical requirement?

So my question is, whether it would be possible to remove this requirement as
I would prefer to distribute the update image files with .image extension.
This way, we could "hide" the internally used update implementation without
renaming the distributed files forth and back. (This is what I would do if you
tell me that this is a fixed design decision)

Handler/Hook after all slots are successfully updated

Hi,

I'm using your updater since a while now and are very pleased with it. Please continue the great work.

I just came across an issue which is either not implemented or I just overlooked it.

The idea is to either have a handler or hook after all slots have been successfully updated.
You offer a post-install handler within the system.conf file. Which is indeed executed after an update has been successfully installed. But it is still executed from the old system. So my old system need to know about things I would like to do in the future.
The slot hooks won't work either as I need to be sure all slots have been updated. Which is not the case if e.g. I use a hook in appfs slot but don't know if rootfs has already been updated.

The plan is to copy some files from the new appfs into the new rootfs. Unfortunately I have to do it this way as I cannot modify the rootfs during build time.

Many Thanks.

largefile support is broken

While AC_SYS_LARGEFILE is used in configure.ac, the resulting config.h is not included in all source files. In particular src/update_handler.c is affected. As a result open() is not mapped to open64(). I expect this will fail for example for partitions > 2GB.

Is D-Bus support on the target required?

Based on the output below, it looks like the answer is "by default, yes", but can the D-Bus dependency be eliminated?

# ./rauc -d --conf=rauc.config --keyring=./demo.cert.pem install  update-2015.04-1.raucb
Domains: 'rauc'
(rauc:11940): rauc-DEBUG: install started
(rauc:11940): rauc-DEBUG: input bundle: /home/root/rauc/update-2015.04-1.raucb
Error creating proxy: Could not connect: No such file or directory
D-Bus error while installing `/home/root/rauc/update-2015.04-1.raucb`

Do not skip a slot even if its hash matches (with hooks)

This is with RAUC 0.1.1.

I've got an A/B rootfs and A/B persistent storage mounted at /cfg (I want to guard against the persistent storage failing to mount). When doing an update, I want to handle the rootfs as usual, and I want my new /cfg to contain the same files as the current one.

Right now I have an ugly hack as a custom hook for this. That hook copies data around, and it mostly works -- except when the hash of the old tarball for /cfg happens to match the current one. In that case, my hook doesn't run, and on next reboot, my /cfg data are not taking an effect.

I understand the motivation, perhaps I should not provide a tarball for my /cfg in the first place. Pointers in that direction are welcome. Here's what I would like to have:

  • no change for rootfs
  • re-mkfs the new /cfg, always, unconditionally
  • run a hook/script/whatever, always, unconditionally

Can I do that with RAUC?

Here's my system.conf:

[system]
compatible=czechlight-clearfog
bootloader=uboot

[keyring]
path=/etc/rauc/keyring.pem

[slot.rootfs.0]
device=/dev/mmcblk0p1
type=ext4
bootname=A

[slot.cfg.0]
device=/dev/mmcblk0p2
type=ext4
parent=rootfs.0

[slot.rootfs.1]
device=/dev/mmcblk0p3
type=ext4
bootname=B

[slot.cfg.1]
device=/dev/mmcblk0p4
type=ext4
parent=rootfs.1

My manifest.raucm looks like this:

[update]
compatible=czechlight-clearfog
version=dev

[hooks]
filename=hook.sh

[image.rootfs]
sha256=d12933aa8695030615483aa1ce03ea8ef83232355109244bbb6fc653c050a896
size=15241044
filename=rootfs.tar.xz

[image.cfg]
sha256=5ca1b6c461fc194055d52b181f57c63dc1d34c19d041f6395e6f6abc039692bb
size=108
filename=cfg.tar.xz
hooks=post-install;

And here's the hook.sh:

#!/bin/sh

case "$1" in
  slot-post-install)
    case "$RAUC_SLOT_CLASS" in
      cfg)
        if [[ -d /cfg/etc ]]; then
          cp -a /cfg/etc ${RAUC_SLOT_MOUNT_POINT}/
        fi
        ;;
      *)
        echo "Internal error: hook mismatched"
        exit 11
    esac
    ;;
  *)
    echo "Internal error: unrecognized hook"
    exit 11
    ;;
esac

exit 0

Slot hook does not execute pre-install

Hi, I use RAUC to update uboot into emmc flash.Before start, it needs to some necessary operates.So, I add 'pre-install' hook to handle that.Below is the content of manifest.raucm.

    [hooks]
    filename=hook.sh

    [image.bootloader]
    filename=u-boot-emmc.imx.img
    hooks=pre-install;install;

    [image.core]
    filename=boot.vfat.img
    hooks=post-install;

And below is the content of hook.sh.

    echo "**** is $1"
    case "$1" in
    slot-pre-install)
        echo "pre device is $RAUC_SLOT_DEVICE"
        ;;

    slot-install)
        echo "install device is $RAUC_SLOT_DEVICE"
        ;;
    slot-post-install)
        echo "pre device is $RAUC_SLOT_DEVICE"
        ;;
    *)
        echo "Hook arg is $1"
        exit 1
        ;;
    esac

When the update running, I just saw slot-install and slot-post-install be executed.The result shows me the RAUC not pass 'slot-pre-install' to hook.sh file.
Does the RAUC can not support it?

Userinterface is not intuitive

When creating a bundle, you have to point to an folder where the
manifest.raucm is available. The filename seems to be fixed. It can
not be changed. You have to suffix the generated bundle with raucb,
otherwise the installer routine will not recognize it as a bundle.

Solving a use-case where the embded system is just a bunch of squashfs files on a normaly readonly ext4 partition

So, currently I have a embedded ARM system that has its 4GB of MMC flash storage split into 3 partitions, one persistent storage and two 1GB ext4 read-only system partitons that each contain a uboot boot script, kernel, bunch of different squashfs files and a initramfs that mounts the current system partition and uses overlayfs to mount squashfs file on top of each other to form a working rootfs.

My initial idea was to specify all the files the ext4 system partition in the manifest.raucm like so

[update]
compatible=Product Awesome
version=2017-05-08

[file.rootfs/uImage]
filename=uImage

[file.rootfs/dtbs/imx6q-parvus-duracor-310.dtb]
filename=dtbs/imx6q-parvus-duracor-310.dtb

[file.rootfs/uInitrd]
filename=uInitrd

[file.rootfs/00-base.squashfs]
filename=00-base.squashfs

[file.rootfs/10-kernel-modules.squashfs]
filename=10-kernel-modules.squashfs

[file.rootfs/30-static-config.squashfs]
filename=30-static-config.squashfs

[file.rootfs/50-app.squashfs]
filename=00-base.squashfs

That of course didn't work as currently (if I understood correctly from reading the source code) rauc can only use [image.<slot>] targets for updating the system. One option would be to put all the squashfs files to a system.tar.gz file and then let the tar_to_ext4_handler do its work. But in that case it would always override all the file even when only a single one has changed. (also for some reason I didn't manage to get this option to work when I was playing around)

So currently i'm using manifest.raucm [handler] option to add a custom shell script that configures the bootloader, mounts the unused system partition given to us by rauc as read-write and copies all the [file.<slot>] files to the partition.

If there is a better way to do it then I would happily hear about it.

(ps, I found out about RAUC at FOSDEM, awesome presentation :)

busybox 1.28's tar is broken

I'm using Buildroot. There has been a recent update of Busybox from 1.27.2 to 1.28.1, and since that time, rauc won't produce a working rootfs. That's because busybox' tar now refuses to create "insecure" symlinks. One such "insecure symlink" is /usr/sbin/init which ought to point to systemd. Here's how my rootfs.tar looks like:

$ tar -tvf x/rootfs.tar.xz | grep sbin/init
lrwxrwxrwx 0/0               0 2018-03-14 15:30 ./usr/sbin/init -> ../lib/systemd/systemd

I see that rauc complains in its log, but only about an unrelated file:

Mar 14 16:27:35 czechlight rauc[259]: Mounting ext4 slot /dev/mmcblk0p3
Mar 14 16:27:35 czechlight rauc[259]: Extracting /run/rauc/bundle/rootfs.tar.xz to /run/rauc/rootfs.1
Mar 14 16:27:35 czechlight kernel: EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
Mar 14 16:27:36 czechlight rauc[259]: tar: skipping unsafe symlink to '../usr/share/zoneinfo/Etc/UTC' in archive, set EXTRACT_UNSAFE_SYMLINKS=1 to extract
Mar 14 16:27:38 czechlight rauc[259]: Unmounting ext4 slot /dev/mmcblk0p3

As a result, here's how /usr/sbin looks like in the resulting rootfs partition slot:

# ls -al /mnt/usr/sbin/
total 2128
drwxr-xr-x    2 root     root          4096 Mar 14 16:27 .
drwxr-xr-x    7 root     root          4096 Mar 14 16:27 ..
-rwxr-xr-x    1 root     root         22120 Mar 14 15:10 badblocks
-rwxr-xr-x    1 root     root         22100 Mar 14 15:10 blkdiscard
-rwxr-xr-x    1 root     root         71708 Mar 14 15:10 blkid
-rwxr-xr-x    1 root     root         34532 Mar 14 15:10 blkzone
-rwxr-xr-x    1 root     root         26296 Mar 14 15:10 blockdev
-rwxr-xr-x    1 root     root         68040 Mar 14 15:10 cfdisk
-rwxr-xr-x    1 root     root         17976 Mar 14 15:10 chcpu
-rwxr-xr-x    1 root     root         13828 Mar 14 15:10 ctrlaltdel
-rwxr-xr-x    1 root     root         18108 Mar 14 15:10 dumpe2fs
-rwxr-xr-x    1 root     root          9684 Mar 14 15:10 e2freefrag
-rwxr-xr-x    1 root     root        231524 Mar 14 15:10 e2fsck
lrwxrwxrwx    1 root     root             7 Mar 14 16:27 e2label -> tune2fs
-rwxr-xr-x    1 root     root         13856 Mar 14 15:10 e2undo
-rwxr-xr-x    1 root     root         17984 Mar 14 15:10 e4crypt
-rwxr-xr-x    1 root     root         13808 Mar 14 15:10 eeprog
-rwxr-xr-x    1 root     root         88644 Mar 14 15:10 fdisk
-rwxr-xr-x    1 root     root         13808 Mar 14 15:10 filefrag
-rwxr-xr-x    1 root     root          5540 Mar 14 15:10 findfs
-rwxr-xr-x    1 root     root         34688 Mar 14 15:10 fsck
lrwxrwxrwx    1 root     root             6 Mar 14 16:27 fsck.ext2 -> e2fsck
lrwxrwxrwx    1 root     root             6 Mar 14 16:27 fsck.ext3 -> e2fsck
lrwxrwxrwx    1 root     root             6 Mar 14 16:27 fsck.ext4 -> e2fsck
-rwxr-xr-x    1 root     root          9704 Mar 14 15:10 fsfreeze
-rwxr-xr-x    1 root     root         30484 Mar 14 15:10 fstrim
-rwxr-xr-x    1 root     root         26416 Mar 14 15:10 fw_printenv
lrwxrwxrwx    1 root     root            11 Mar 14 16:27 fw_setenv -> fw_printenv
-rwxr-xr-x    1 root     root          5580 Mar 14 14:35 i2c-stub-from-dump
-rwxr-xr-x    1 root     root         13868 Mar 14 15:10 i2cdetect
-rwxr-xr-x    1 root     root         17988 Mar 14 15:10 i2cdump
-rwxr-xr-x    1 root     root         13872 Mar 14 15:10 i2cget
-rwxr-xr-x    1 root     root         13892 Mar 14 15:10 i2cset
-rwxr-xr-x    1 root     root         13856 Mar 14 15:10 i2ctransfer
-rwxr-xr-x    1 root     root         22140 Mar 14 15:10 ldattach
-rwxr-xr-x    1 root     root          9736 Mar 14 15:10 logsave
-rwxr-xr-x    1 root     root         96640 Mar 14 15:10 mke2fs
-rwxr-xr-x    1 root     root          9700 Mar 14 15:10 mkfs
lrwxrwxrwx    1 root     root             6 Mar 14 16:27 mkfs.ext2 -> mke2fs
lrwxrwxrwx    1 root     root             6 Mar 14 16:27 mkfs.ext3 -> mke2fs
lrwxrwxrwx    1 root     root             6 Mar 14 16:27 mkfs.ext4 -> mke2fs
-rwxr-xr-x    1 root     root          5568 Mar 14 15:10 mklost+found
-rwxr-xr-x    1 root     root         63368 Mar 14 15:10 mkswap
-rwxr-xr-x    1 root     root          5568 Mar 14 15:10 nologin
-rwxr-xr-x    1 root     root         13900 Mar 14 15:10 readprofile
-rwxr-xr-x    1 root     root         30392 Mar 14 15:10 rtcwake
-rwxr-xr-x    1 root     root         84368 Mar 14 15:10 sfdisk
-rwxr-xr-x    1 root     root         18196 Mar 14 15:10 snmpd
-rwxr-xr-x    1 root     root         22376 Mar 14 15:10 snmptrapd
-rwxr-xr-x    1 root     root        649580 Mar 14 15:10 sshd
-rwxr-xr-x    1 root     root          9752 Mar 14 15:10 swaplabel
-rwxr-xr-x    1 root     root         13916 Mar 14 15:10 swapoff
-rwxr-xr-x    1 root     root         34632 Mar 14 15:10 swapon
-rwxr-xr-x    1 root     root         80096 Mar 14 15:10 tune2fs
-rwxr-xr-x    1 root     root         26364 Mar 14 15:10 wipefs

For reference, here's how it should look like, and actually also how it looks when updated from within a system with a tar implementation that does not decide to randomly skip some files:

# ls -al /usr/sbin/
total 2128
drwxr-xr-x    2 root     root          4096 Mar 14 15:55 .
drwxr-xr-x    7 root     root          4096 Mar 14 15:55 ..
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 addgroup -> ../../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 adduser -> ../../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 arp -> ../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 arping -> ../../bin/busybox
-rwxr-xr-x    1 root     root         22120 Mar 14 15:10 badblocks
-rwxr-xr-x    1 root     root         22100 Mar 14 15:10 blkdiscard
-rwxr-xr-x    1 root     root         71708 Mar 14 15:10 blkid
-rwxr-xr-x    1 root     root         34532 Mar 14 15:10 blkzone
-rwxr-xr-x    1 root     root         26296 Mar 14 15:10 blockdev
-rwxr-xr-x    1 root     root         68040 Mar 14 15:10 cfdisk
-rwxr-xr-x    1 root     root         17976 Mar 14 15:10 chcpu
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 chroot -> ../../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 crond -> ../../bin/busybox
-rwxr-xr-x    1 root     root         13828 Mar 14 15:10 ctrlaltdel
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 delgroup -> ../../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 deluser -> ../../bin/busybox
lrwxrwxrwx    1 root     root            11 Mar 14 15:55 depmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 devmem -> ../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 dnsd -> ../../bin/busybox
-rwxr-xr-x    1 root     root         18108 Mar 14 15:10 dumpe2fs
-rwxr-xr-x    1 root     root          9684 Mar 14 15:10 e2freefrag
-rwxr-xr-x    1 root     root        231524 Mar 14 15:10 e2fsck
lrwxrwxrwx    1 root     root             7 Mar 14 15:55 e2label -> tune2fs
-rwxr-xr-x    1 root     root         13856 Mar 14 15:10 e2undo
-rwxr-xr-x    1 root     root         17984 Mar 14 15:10 e4crypt
-rwxr-xr-x    1 root     root         13808 Mar 14 15:10 eeprog
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 ether-wake -> ../../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 fbset -> ../../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 fdformat -> ../../bin/busybox
-rwxr-xr-x    1 root     root         88644 Mar 14 15:10 fdisk
-rwxr-xr-x    1 root     root         13808 Mar 14 15:10 filefrag
-rwxr-xr-x    1 root     root          5540 Mar 14 15:10 findfs
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 freeramdisk -> ../bin/busybox
-rwxr-xr-x    1 root     root         34688 Mar 14 15:10 fsck
lrwxrwxrwx    1 root     root             6 Mar 14 15:55 fsck.ext2 -> e2fsck
lrwxrwxrwx    1 root     root             6 Mar 14 15:55 fsck.ext3 -> e2fsck
lrwxrwxrwx    1 root     root             6 Mar 14 15:55 fsck.ext4 -> e2fsck
-rwxr-xr-x    1 root     root          9704 Mar 14 15:10 fsfreeze
-rwxr-xr-x    1 root     root         30484 Mar 14 15:10 fstrim
-rwxr-xr-x    1 root     root         26416 Mar 14 15:10 fw_printenv
lrwxrwxrwx    1 root     root            11 Mar 14 15:55 fw_setenv -> fw_printenv
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 getty -> ../bin/busybox
lrwxrwxrwx    1 root     root            16 Mar 14 15:55 halt -> ../bin/systemctl
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 hdparm -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 hwclock -> ../bin/busybox
-rwxr-xr-x    1 root     root          5580 Mar 14 14:35 i2c-stub-from-dump
-rwxr-xr-x    1 root     root         13868 Mar 14 15:10 i2cdetect
-rwxr-xr-x    1 root     root         17988 Mar 14 15:10 i2cdump
-rwxr-xr-x    1 root     root         13872 Mar 14 15:10 i2cget
-rwxr-xr-x    1 root     root         13892 Mar 14 15:10 i2cset
-rwxr-xr-x    1 root     root         13856 Mar 14 15:10 i2ctransfer
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 ifconfig -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 ifdown -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 ifup -> ../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 inetd -> ../../bin/busybox
lrwxrwxrwx    1 root     root            22 Mar 14 15:55 init -> ../lib/systemd/systemd
lrwxrwxrwx    1 root     root            11 Mar 14 15:55 insmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 ip -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 ipaddr -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 iplink -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 ipneigh -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 iproute -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 iprule -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 iptunnel -> ../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 killall5 -> ../../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 klogd -> ../bin/busybox
-rwxr-xr-x    1 root     root         22140 Mar 14 15:10 ldattach
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 loadfont -> ../../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 loadkmap -> ../bin/busybox
-rwxr-xr-x    1 root     root          9736 Mar 14 15:10 logsave
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 losetup -> ../bin/busybox
lrwxrwxrwx    1 root     root            11 Mar 14 15:55 lsmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 makedevs -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 mdev -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 mkdosfs -> ../bin/busybox
-rwxr-xr-x    1 root     root         96640 Mar 14 15:10 mke2fs
-rwxr-xr-x    1 root     root          9700 Mar 14 15:10 mkfs
lrwxrwxrwx    1 root     root             6 Mar 14 15:55 mkfs.ext2 -> mke2fs
lrwxrwxrwx    1 root     root             6 Mar 14 15:55 mkfs.ext3 -> mke2fs
lrwxrwxrwx    1 root     root             6 Mar 14 15:55 mkfs.ext4 -> mke2fs
-rwxr-xr-x    1 root     root          5568 Mar 14 15:10 mklost+found
-rwxr-xr-x    1 root     root         63368 Mar 14 15:10 mkswap
lrwxrwxrwx    1 root     root            11 Mar 14 15:55 modinfo -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Mar 14 15:55 modprobe -> ../bin/kmod
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 nameif -> ../bin/busybox
-rwxr-xr-x    1 root     root          5568 Mar 14 15:10 nologin
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 partprobe -> ../../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 pivot_root -> ../bin/busybox
lrwxrwxrwx    1 root     root            16 Mar 14 15:55 poweroff -> ../bin/systemctl
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 rdate -> ../../bin/busybox
-rwxr-xr-x    1 root     root         13900 Mar 14 15:10 readprofile
lrwxrwxrwx    1 root     root            16 Mar 14 15:55 reboot -> ../bin/systemctl
lrwxrwxrwx    1 root     root            11 Mar 14 15:55 rmmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 route -> ../bin/busybox
-rwxr-xr-x    1 root     root         30392 Mar 14 15:10 rtcwake
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 run-init -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 runlevel -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 setconsole -> ../bin/busybox
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 setlogcons -> ../../bin/busybox
-rwxr-xr-x    1 root     root         84368 Mar 14 15:10 sfdisk
-rwxr-xr-x    1 root     root         18196 Mar 14 15:10 snmpd
-rwxr-xr-x    1 root     root         22376 Mar 14 15:10 snmptrapd
-rwxr-xr-x    1 root     root        649580 Mar 14 15:10 sshd
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 start-stop-daemon -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 sulogin -> ../bin/busybox
-rwxr-xr-x    1 root     root          9752 Mar 14 15:10 swaplabel
-rwxr-xr-x    1 root     root         13916 Mar 14 15:10 swapoff
-rwxr-xr-x    1 root     root         34632 Mar 14 15:10 swapon
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 switch_root -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 sysctl -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 syslogd -> ../bin/busybox
-rwxr-xr-x    1 root     root         80096 Mar 14 15:10 tune2fs
lrwxrwxrwx    1 root     root            17 Mar 14 15:55 ubirename -> ../../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 udhcpc -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 uevent -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 vconfig -> ../bin/busybox
lrwxrwxrwx    1 root     root            14 Mar 14 15:55 watchdog -> ../bin/busybox
-rwxr-xr-x    1 root     root         26364 Mar 14 15:10 wipefs

Despite being extracted from the same .raucb bundle, the are some differences which are, well, substantial :).

Something like setenv("EXTRACT_UNSAFE_SYMLINKS", "1"); from within RAUC should probably fix this, but I wonder if the busybox change is sane in the first place...

`rauc install` fails when `rauc service` is started by dbus

If I run rauc service -d & prior to running rauc install my-bundle.raucb everything works as expected:

root@armada-388-db:~# rauc service -d &
root@armada-388-db:~# Domains: 'rauc'
(rauc:2089): rauc-DEBUG: service start
(rauc:2089): rauc-DEBUG: No mount prefix provided, using /mnt/rauc/ as default
(rauc:2089): rauc-DEBUG: name 'de.pengutronix.rauc' acquired

root@armada-388-db:~# rauc install rauc-bundle-armada-388-db.raucb 
trying to contact rauc service
input bundle: /home/root/rauc-bundle-armada-388-db.raucb
Active slot bootname: A
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: installing
(rauc:2089): rauc-DEBUG: thread started for /home/root/rauc-bundle-armada-388-db.raucb

rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: started
(rauc:2089): rauc-DEBUG: Found booted slot: system.0 on /dev/mmcblk0p1
rauc-Message: Mounting bundle '/home/root/rauc-bundle-armada-388-db.raucb' to '/mnt/rauc/bundle'
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: Checking and mounting bundle...
rauc-Message: Reading bundle: /home/root/rauc-bundle-armada-388-db.raucb
rauc-Message: Verifying bundle... 
Adding to target group: system -> system.1
Target Group:
  system -> system.1
Using default handler
rauc-Message: Marking target slot as non-bootable...
rauc-Message: Checking image type for slot type: ext4
rauc-Message: Image detected as type: *.ext4
rauc-Message: mounting slot /dev/mmcblk0p2
rauc-Message: installing /home/root/rauc-bundle[ 2522.394903] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
-armada-388-db.raucb: Updating slots...
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: Checking slot system.1
rauc-Message: Skipping update for correct image /mnt/rauc/bundle/rauc-image-armada-388-db.ext4
(rauc:2089): rauc-DEBUG: unmounting slot /dev/mmcblk0p2
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: Skipping update for correct image /mnt/rauc/bundle/rauc-image-armada-388-db.ext4
rauc-Message: Marking slots as bootable...
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: Updating slot system.1 done
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: All slots updated
(rauc:2089): rauc-DEBUG: thread finished for /home/root/rauc-bundle-armada-388-db.raucb

rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: finished
rauc-Message: installing `/home/root/rauc-bundle-armada-388-db.raucb` succeeded
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: idle
installing `/home/root/rauc-bundle-armada-388-db.raucb` succeeded

If I don't run rauc service prior to rauc install, the install fails:

root@armada-388-db:~# rauc install rauc-bundle-armada-388-db.raucb 
trying to contact rauc service
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: installing
rauc-Message: installing /home/root/rauc-bundle-armada-388-db.raucb: idle
installing `/home/root/rauc-bundle-armada-388-db.raucb` failed

I tried then modified dbus to call a wrapper when starting rauc, so debug output is logged to a file:

root@armada-388-db:~# cat /tmp/rauc.log 
Domains: 'rauc'
(rauc:2115): rauc-DEBUG: service start
(rauc:2115): rauc-DEBUG: No mount prefix provided, using /mnt/rauc/ as default
(rauc:2115): rauc-DEBUG: name 'de.pengutronix.rauc' acquired
input bundle: /home/root/rauc-bundle-armada-388-db.raucb
Active slot bootname: A
(rauc:2115): rauc-DEBUG: thread started for /home/root/rauc-bundle-armada-388-db.raucb

(rauc:2115): rauc-DEBUG: Found booted slot: system.0 on /dev/mmcblk0p1
Adding to target group: system -> system.1
Target Group:
  system -> system.1
Using default handler

It just hangs there. If I then kill rauc service, the log file is flushed with:

(rauc:2115): rauc-DEBUG: thread finished for /home/root/rauc-bundle-armada-388-db.raucb

This is on a pretty standard yocto, and it happens on both morty and pyro.

Any suggestions are appreciated.

`rauc install` hangs

I've updated from 0.1 to 0.3. rauc install appears to be stuck after finalizing everything except for making the slot bootable:

# rauc install --debug /tmp/update.raucb
Domains: 'rauc'
(rauc:391): rauc-DEBUG: install started
(rauc:391): rauc-DEBUG: input bundle: /tmp/update.raucb
(rauc:391): rauc-DEBUG: Trying to contact rauc service
rauc-Message: installing /tmp/update.raucb: installing
rauc-Message: installing /tmp/update.raucb:   0% Installing
rauc-Message: installing /tmp/update.raucb:   0% Determining slot states
rauc-Message: installing /tmp/update.raucb:  20% Determining slot states done.
rauc-Message: installing /tmp/update.raucb:  20% Checking bundle
rauc-Message: installing /tmp/update.raucb:  20% Verifying signature
rauc-Message: installing /tmp/update.raucb:  40% Verifying signature done.
rauc-Message: installing /tmp/update.raucb:  40% Checking bundle done.
rauc-Message: installing /tmp/update.raucb:  40% Loading manifest file
rauc-Message: installing /tmp/update.raucb:  60% Loading manifest file done.
rauc-Message: installing /tmp/update.raucb:  60% Determining target install group
rauc-Message: installing /tmp/update.raucb:  80% Determining target install group done.
rauc-Message: installing /tmp/update.raucb:  80% Updating slots
rauc-Message: installing /tmp/update.raucb:  80% Checking slot rootfs.1
[ 1804.296527] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
rauc-Message: installing /tmp/update.raucb:  85% Checking slot rootfs.1 done.
rauc-Message: installing /tmp/update.raucb:  85% Copying image
[ 1808.361943] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
rauc-Message: installing /tmp/update.raucb:  90% Copying image done.
[ 1814.841975] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 1814.914191] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: (null)

rauc-Message: installing /tmp/update.raucb:  95% Checking slot cfg.1 done.
rauc-Message: installing /tmp/update.raucb:  95% Copying image skipped
rauc-Message: installing /tmp/update.raucb: 100% Copying image skipped done.

Here's the journal output from the rauc service:

Feb 08 13:38:23 czechlight systemd[1]: Starting Rauc Update Service...
Feb 08 13:38:23 czechlight systemd[1]: Started Rauc Update Service.
Feb 08 13:38:23 czechlight rauc[394]: input bundle: /tmp/update.raucb
Feb 08 13:38:23 czechlight rauc[394]: Active slot bootname: A
Feb 08 13:38:23 czechlight rauc[394]: installing /tmp/update.raucb: started
Feb 08 13:38:23 czechlight rauc[394]: installing /tmp/update.raucb: Checking and mounting bundle...
Feb 08 13:38:23 czechlight rauc[394]: Reading bundle: /tmp/update.raucb
Feb 08 13:38:23 czechlight rauc[394]: Verifying bundle... 
Feb 08 13:38:23 czechlight rauc[394]: Mounting bundle '/tmp/update.raucb' to '/run/rauc/bundle'
Feb 08 13:38:23 czechlight rauc[394]: Target Group:
Feb 08 13:38:23 czechlight rauc[394]:   cfg -> cfg.1
Feb 08 13:38:23 czechlight rauc[394]:   rootfs -> rootfs.1
Feb 08 13:38:23 czechlight rauc[394]: Using default handler
Feb 08 13:38:23 czechlight rauc[394]: Marking target slot as non-bootable...
Feb 08 13:38:23 czechlight rauc[394]: installing /tmp/update.raucb: Updating slots...
Feb 08 13:38:23 czechlight rauc[394]: Checking image type for slot type: ext4
Feb 08 13:38:23 czechlight rauc[394]: Image detected as type: *.tar*
Feb 08 13:38:23 czechlight rauc[394]: installing /tmp/update.raucb: Checking slot rootfs.1
Feb 08 13:38:23 czechlight rauc[394]: mounting slot /dev/mmcblk0p3
Feb 08 13:38:23 czechlight rauc[394]: Slot needs to be updated with /run/rauc/bundle/rootfs.tar.xz
Feb 08 13:38:23 czechlight rauc[394]: Updating /dev/mmcblk0p3 with /run/rauc/bundle/rootfs.tar.xz
Feb 08 13:38:23 czechlight rauc[394]: Formatting ext4 slot /dev/mmcblk0p3
Feb 08 13:38:23 czechlight rauc[394]: installing /tmp/update.raucb: Updating slot rootfs.1
Feb 08 13:38:23 czechlight rauc[394]: mke2fs 1.43.8 (1-Jan-2018)
Feb 08 13:38:25 czechlight rauc[394]: [82B blob data]
Feb 08 13:38:25 czechlight rauc[394]: Creating filesystem with 476928 4k blocks and 119280 inodes
Feb 08 13:38:25 czechlight rauc[394]: Filesystem UUID: 451fec34-92a7-4f70-9de8-b8e392f5cab0
Feb 08 13:38:25 czechlight rauc[394]: Superblock backups stored on blocks:
Feb 08 13:38:25 czechlight rauc[394]:         32768, 98304, 163840, 229376, 294912
Feb 08 13:38:25 czechlight rauc[394]: [49B blob data]
Feb 08 13:38:25 czechlight rauc[394]: [46B blob data]
Feb 08 13:38:25 czechlight rauc[394]: Creating journal (8192 blocks): done
Feb 08 13:38:27 czechlight rauc[394]: [83B blob data]
Feb 08 13:38:27 czechlight rauc[394]: Mounting ext4 slot /dev/mmcblk0p3
Feb 08 13:38:27 czechlight rauc[394]: Extracting /run/rauc/bundle/rootfs.tar.xz to /run/rauc/rootfs.1
Feb 08 13:38:30 czechlight rauc[394]: Unmounting ext4 slot /dev/mmcblk0p3
Feb 08 13:38:34 czechlight rauc[394]: installing /tmp/update.raucb: Updating slot rootfs.1 status
Feb 08 13:38:34 czechlight rauc[394]: Updating slot file /run/rauc/rootfs.1/slot.raucs
Feb 08 13:38:34 czechlight rauc[394]: installing /tmp/update.raucb: Updating slot rootfs.1 done
Feb 08 13:38:34 czechlight rauc[394]: Checking image type for slot type: ext4
Feb 08 13:38:34 czechlight rauc[394]: Image detected as type: *.tar*
Feb 08 13:38:34 czechlight rauc[394]: mounting slot /dev/mmcblk0p4
Feb 08 13:38:34 czechlight rauc[394]: installing /tmp/update.raucb: Checking slot cfg.1
Feb 08 13:38:34 czechlight rauc[394]: Skipping update for correct image /run/rauc/bundle/cfg.tar.xz
Feb 08 13:38:34 czechlight rauc[394]: Marking slots as bootable...
Feb 08 13:38:34 czechlight rauc[394]: installing /tmp/update.raucb: Skipping update for correct image /run/rauc/bundle/cfg.tar.xz
Feb 08 13:38:34 czechlight rauc[394]: installing /tmp/update.raucb: Updating slot cfg.1 done
Feb 08 13:38:34 czechlight rauc[394]: Invalid byte sequence in conversion input
Feb 08 13:38:34 czechlight rauc[394]: g_error_new_literal: assertion 'message != NULL' failed
Feb 08 13:38:34 czechlight rauc[394]: g_task_return_error: assertion 'error != NULL' failed

My /etc/rauc/system/system.conf:

[system]
compatible=czechlight-clearfog
bootloader=uboot

[keyring]
path=/etc/rauc/keyring.pem

[slot.rootfs.0]
device=/dev/mmcblk0p1
type=ext4
bootname=A

[slot.cfg.0]
device=/dev/mmcblk0p2
type=ext4
parent=rootfs.0
ignore-chcksum=true

[slot.rootfs.1]
device=/dev/mmcblk0p3
type=ext4
bootname=B

[slot.cfg.1]
device=/dev/mmcblk0p4
type=ext4
parent=rootfs.1
ignore-chcksum=true
# 

Here's how I build my update bundle:

cat > ${RAUC_BUILD_DIR}/manifest.raucm << EOF
[update]
compatible=czechlight-clearfog
version=dev

[hooks]
filename=hook.sh

[image.rootfs]
filename=${ROOTFS_NAME}

[image.cfg]
filename=${EMPTY_TAR_NAME}
hooks=post-install
EOF

rauc \
  --cert ${BR2_EXTERNAL_CZECHLIGHT_PATH}/crypto/rauc-cert.pem \
  --key ${BR2_EXTERNAL_CZECHLIGHT_PATH}/crypto/rauc-key.pem \
  bundle ${RAUC_BUILD_DIR} ${RAUC_IMAGE}

And the hook.sh:

#!/bin/sh

case "$1" in
  slot-post-install)
    case "$RAUC_SLOT_CLASS" in
      cfg)
        if [[ -d /cfg/etc ]]; then
          cp -a /cfg/etc ${RAUC_SLOT_MOUNT_POINT}/
        fi
        ;;
      *)
        echo "Internal error: hook mismatched"
        exit 11
    esac
    ;;
  *)
    echo "Internal error: unrecognized hook"
    exit 11
    ;;
esac

exit 0

However, I don't see any difference in behavior even when removing the whole [hooks] section from my update bundle.

rauc install does not work with barebox and the bootloader spec

I use barebox as bootloader with following functionality:

  • bootchooser
  • state framework
  • bootloader spec
  • nand/mtd/ubi/ubifs

In the bootloader spec i use the option "linux-appendroot true". Thus barebox only knows the boot medium and the boot partition. All other information, such as the position of the kernel and the device tree, will be completely described in the rootfs. Everything works fine with the sd-card (boot mmc0.0) and via nfs (boot nfs).

Now i setup the nand with ubi and after the start of linux (boot nand0.root.ubi.system0) the command-line looks like this:
root=ubi0:system0 ubi.mtd=root rootfstype=ubifs console=ttymxc0,115200n8

It works as described in the documentation of Barebox:

For UBIFS fileystems it will be root=ubi0:volname ubi.mtd=mtdpartname rootfstype=ubifs. NFS filesystems will result in root=/dev/nfs nfsroot=ip:/path/to/nfsroot,v3,tcp. The v3,tcp part is configurable in global.linux.rootnfsopts.

The rauc system.conf:

bootloader=barebox

[slot.rootfs.0]
device=/dev/ubi0_0
type=ubifs
bootname=ubi0:system0

[slot.rootfs.1]
device=/dev/ubi0_1
type=ubifs
bootname=ubi0:system1

So the "bootsname" given in the command line can be matched.

But if I want to install an update with rauc, I get the following error:

rauc[346]: rootfs -> rootfs.0
rauc[346]: Using default handler
rauc-Message: Marking target slot as non-bootable...
rauc[346]: Failed to set variable bootstate.ubi0:system0.priority in state state to 0: No such file or directory

These errors occur because there is no entry "ubi0:system0" in the device tree. Now I could change the entry in the device tree. However, in the label of a devicetree entry is the sign ":" forbidden, or not possible. Am I the only one that has this constellation?

And how could you fix this? I would reluctantly give up the bootloader spec!

meta-rauc: run with --debug

rauc doesn't give a lot of information by default, and basic things like "which files were included" can be hard to work out.

Suggestion: Add --debug to the rauc command in bundle.bbclass. Bitbake logs output to files, so this won't affect regular (successful) use, and will greatly aid someone who is trying to debug an issue.

Improved D-Bus Interface

I would like to start this as a discussion base for future extensions, and possible re-designs of the current. D-Bus API. Thus if you've got any need for functionality, any concern about the existing implementation, or similar, please note it here so we can collect it.

One initial discussion base we already had in #238 were the current limitation of the Info D-Bus method was mentioned. Our current approach to an extensible and generic interface is to have a pure string-variant-dict-based approach. Similar to what we have in the Status method.
A drawback of this might be that this way is "too flexible" and not really an API anymore..

Another limitation we already had issues with in the past is the curent Install method that does not allow to provide further options and thus required us to move the 'delayed activation' feature (35a13bc) to a system.conf-only feature, for example.

Lack of Barebox Example

I apologize if this isn't the correct location, but I didn't see anywhere else to post. If there is a mailing list or discussion forum available, please direct me towards it.

I have been working through using RAUC with Barebox for the last couple days, but it feels like I'm just grasping at straws. Nowhere in the documentation is clear instructions or an example of how to get RAUC working with Barebox. The documentation states "If in doubt about choosing the right bootloader, we recommend to use Barebox as it provides a dedicated boot handling framework, called bootchooser.", yet the only documentation about Barebox is compiling it with a couple flags, and putting "barebox" in the system.conf file. How does it access the "state"? Where is the "state" stored? What variables are needed in the "state" so RAUC can do its thing? Also, the bootchooser documentation seems to show that it has a "state" framework (http://www.barebox.org/doc/latest/user/state.html), but it doesn't show how to create one.

A slightly separate issue is that I can't seem to figure out the correct "type" to specify for a ubi partition with the raw kernel/device tree copied into it. It looks like the table is a "todo" that hasn't been completed yet. If it helps, I use "ubiupdatevol" to copy the kernel/device tree into their respective partitions.

I feel that if I could just have one example configuration for how the "state" is used with Barebox, and how it's accessed by RAUC, it would go a significant way in helping me move along.

-Jeremy

problem integrating rauc hawkbit

I have installed rauc-hawkbit client on my beaglebone.
My configuration file is :
[client]
hawkbit_server = 192.168.0.15:8080
ssl = false
ca_file =
tenant_id = DEFAULT
target_name = test
auth_token = ahVahL1Il1shie2aj2poojeChee6ahShu
mac_address = ff:ff:ff:ff:ff:ff
bundle_download_location = /tmp/bundle.raucb
log_level = debug

my hawkbit server is running on my local machine who's ip and port is mentioned at hawkbit server.
beaglbone and server are in the same LAN .

on running rauc-hawkbit-client on beaglebone:
DEBUG Using selector: EpollSelector
DEBUG GET http://192.168.0.15:8080//DEFAULT/controller/v1/test
WARNING Polling failed due to TimeoutError
INFO Retry will happen in 60 seconds

Strangely, this error is occuring only on my beaglebone.

I tried installing rauc-hawkbit on another pc and pc-pc communication is flawless.
Any idea on where am I going wrong or what other things do I need to check?

P.S. : I wrote a sample code only sending GET request from my beaglebone to hawkbit server. That code is working fine as I am getting 200 OK and config info from the server in the sample code output.

casync & ubifs support

Hi,

I tested casync and wondered, why ubifs images are not supported? Is there a specific unhandled problem, missing implementation or is ubifs just not tested yet?

rauc service fails on NFS boot

When booting from NFS the service fails with:

Starting Rauc Update Service...
** Message: name acquired
booted from: /dev/nfs
** Message: Detected nfs boot, ignoring missing active slot
slot states:
  rootfs.0: class=rootfs, device=/dev/mmcblk1p1, type=ext4, bootname=system0
      state=inactive, description=, parent=(none), mountpoint=(none)
  rootfs.1: class=rootfs, device=/dev/mmcblk1p2, type=ext4, bootname=system1
      state=inactive, description=, parent=(none), mountpoint=(none)
** (rauc:534): WARNING **: Failed to determine booted slot
rauc.service: Control process exited, code=exited status=1
** Message: stopping service
Failed to start Rauc Update Service.
rauc.service: Unit entered failed state.
rauc.service: Failed with result 'exit-code'.

rauc info works as expected:

booted from: /dev/nfs
** Message: Detected nfs boot, ignoring missing active slot
slot states:
  rootfs.0: class=rootfs, device=/dev/mmcblk1p1, type=ext4, bootname=system0
      state=inactive, description=, parent=(none), mountpoint=(none)
  rootfs.1: class=rootfs, device=/dev/mmcblk1p2, type=ext4, bootname=system1
      state=inactive, description=, parent=(none), mountpoint=(none)

Sharness tests hang in case of an error

In case of a failure during sharness tests, these tend to hang and not terminate correctly.

This problem could be discovered both during local tests as well as for automated Travis tests.

The problem seems to be related to the last changes made for D-Bus testing and only seem to occur when tests are invoked by make.

PASS: test/rauc.t 1 - rauc noargs
PASS: test/rauc.t 2 - rauc invalid arg
PASS: test/rauc.t 3 - rauc invalid cmd
PASS: test/rauc.t 4 - rauc missing arg
PASS: test/rauc.t 5 - rauc version
PASS: test/rauc.t 6 - rauc help
PASS: test/rauc.t 7 - rauc checksum without argument
PASS: test/rauc.t 8 - rauc checksum with signing
PASS: test/rauc.t 9 - rauc checksum with extra args
FAIL: test/rauc.t 10 - rauc info
PASS: test/rauc.t 11 - rauc info shell
FAIL: test/rauc.t 12 - rauc info json
FAIL: test/rauc.t 13 - rauc info json-pretty
PASS: test/rauc.t 14 - rauc info invalid
PASS: test/rauc.t 15 - rauc bundle
PASS: test/rauc.t 16 - rauc status
PASS: test/rauc.t 17 - rauc --override-boot-slot=system0 status
PASS: test/rauc.t 18 - rauc status readable
PASS: test/rauc.t 19 - rauc status shell
PASS: test/rauc.t 20 - rauc status json
PASS: test/rauc.t 21 - rauc status json-pretty
PASS: test/rauc.t 22 - rauc status invalid
SKIP: test/rauc.t 23 # SKIP rauc status mark-good: internally (missing !SERVICE)
SKIP: test/rauc.t 24 # SKIP rauc status mark-bad: internally (missing !SERVICE)
SKIP: test/rauc.t 25 # SKIP rauc status mark-active: internally (missing !SERVICE)
PASS: test/rauc.t 26 - rauc status mark-good: via D-Bus
PASS: test/rauc.t 27 - rauc status mark-bad: via D-Bus
PASS: test/rauc.t 28 - rauc status mark-active: via D-Bus
PASS: test/rauc.t 29 - rauc install invalid local paths
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

Signature verification fails for larger files

For larger files, we get a malloc error and verification failes. Tested here with a ~200MB bundle.

** Message: Verifying bundle...
3061376208:error:07069041:memory buffer routines:BUF_MEM_grow_clean:malloc failure:buffer.c:159:

** (rauc:406): WARNING **: signature invalid (squashfs size: 201342976)

Filesystem support

What requirements on the filesystem type does RAUC depend on? Will this work with F2FS?

system config slot key `readonly` ignored

Both the documentation and the parser handle a readonly key that can be set in a slot configuration in a system.conf as follows:

[slot.rootfs.0]
...
readonly=true

But, there is no code that further processes or respects this setting. Thus, currently it is simply unhandled.

The readonly key must either be used or should be removed from documentation and from parser.

Cross-Compile in host platform

Hello,

I compiled Rauc for my host machine without any problems.

On my target machine (AM3354, Kernel 3.14, Custom Rootfs), a rootfs that I compiled with busybox is running and and no any compiler tools included. Can I compile Rauc for target machine with cross compiler on my host machine? I did not see a help file on this topic.

Thank you.

Check for unparsed keys and groups in system.conf

What we already have since 9c16261 for the manifest.raucm but what is still missing in the system.conf is a more strict parsing to prevent the user from ineffective or malicious configuration.

Thus, for example a

[slot.rootfs.0]
ignore-chcksum=true

will be accepted, but it actually does not do what the user expects. He wanted to write

-ignore-chcksum=true
+ignore-checksum=true

Tracking and warning the user about unparsed configuration options will prevent from creating systems not behaving as expected.

signature error for bundle

with the latest version of rauc available on github..

root@arm:~# rauc info /media/usb/testUpdate.raucb
rauc-Message: Reading bundle: /media/usb/testUpdate.raucb
rauc-Message: Verifying bundle...
**
rauc:ERROR:src/signature.c:320:cms_get_cert_chain: assertion failed: (sk_X509_value(signers, 0) == sk_X509_value(*verified_chain, 0))
Aborted

I have created certificate and key using :
openssl req -x509 -newkey rsa:4096 -nodes -keyout demo.key.pem -out demo.cert.pem -subj "/O=rauc Inc./CN=rauc-demo"

I have given the demo.cert.pem as keyring to the system.conf file on target.

P.S. : I have downloaded the older version where I am not facing this problem.

Missing information in the documentation

Missing information in the documentation

I'm experimenting with RAUC and Barebox right now. At the beginning I packed my RFS as tar.gz into a RAUC bundle. Now, a NAND is used as memory. Now a UBI file system is needed. My RAUC bundle now contains UBIFS image instead of a tar.gz.

The documentation contains only this chapter:
2.7. Installation and Storage Handling

However, it does not show that a RAUC bundle with a UBIFS image uses UBIVOL (type = ubivol) in the system.conf.

Here you should add even more documentation, that other people do not waste time.

Fails to compile on a raspberry pi

./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable debugging... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for a sed that does not truncate output... /bin/sed
checking whether C compiler accepts -Werror=unknown-warning-option... no
checking whether C compiler accepts -fno-strict-aliasing... yes
checking whether C compiler accepts -Wall... yes
checking whether C compiler accepts -Wextra... yes
checking whether C compiler accepts -Wundef... yes
checking whether C compiler accepts -Wnested-externs... yes
checking whether C compiler accepts -Wwrite-strings... yes
checking whether C compiler accepts -Wpointer-arith... yes
checking whether C compiler accepts -Wmissing-declarations... yes
checking whether C compiler accepts -Wmissing-prototypes... yes
checking whether C compiler accepts -Wstrict-prototypes... yes
checking whether C compiler accepts -Wredundant-decls... yes
checking whether C compiler accepts -Wno-unused-parameter... yes
checking whether C compiler accepts -Wno-missing-field-initializers... yes
checking whether C compiler accepts -Wdeclaration-after-statement... yes
checking whether C compiler accepts -Wformat=2... yes
checking whether C compiler accepts -Wold-style-definition... yes
checking whether C compiler accepts -Wcast-align... yes
checking whether C compiler accepts -Wformat-nonliteral... yes
checking whether C compiler accepts -Wformat-security... yes
checking whether C compiler accepts -Wsign-compare... yes
checking whether C compiler accepts -Wstrict-aliasing... yes
checking whether C compiler accepts -Wshadow... yes
checking whether C compiler accepts -Winline... yes
checking whether C compiler accepts -Wpacked... yes
checking whether C compiler accepts -Wmissing-format-attribute... yes
checking whether C compiler accepts -Wmissing-noreturn... yes
checking whether C compiler accepts -Winit-self... yes
checking whether C compiler accepts -Wredundant-decls... (cached) yes
checking whether C compiler accepts -Wmissing-include-dirs... yes
checking whether C compiler accepts -Wunused-but-set-variable... yes
checking whether C compiler accepts -Warray-bounds... yes
checking whether C compiler accepts -Wimplicit-function-declaration... yes
checking whether C compiler accepts -Wreturn-type... yes
checking whether C compiler accepts -Wswitch-enum... yes
checking whether C compiler accepts -Wswitch-default... yes
checking whether C compiler accepts -Wno-suggest-attribute=format... yes
checking whether C compiler accepts -Wno-error=unused-parameter... yes
checking whether C compiler accepts -Wno-error=missing-field-initializers... yes
checking whether C compiler accepts -Werror=unknown-warning-option... (cached) no
checking whether the linker accepts -Wl,--no-as-needed... yes
checking whether the linker accepts -Wl,--fatal-warnings... yes
checking for gawk... (cached) mawk
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking for catchsegv... catchsegv
checking build system type... armv6l-unknown-linux-gnueabihf
checking host system type... armv6l-unknown-linux-gnueabihf
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert armv6l-unknown-linux-gnueabihf file names to armv6l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv6l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether to build with code coverage support... no
checking whether to enable Valgrind on the unit tests... checking for valgrind... no
yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for CURL... yes
checking for JSON_GLIB... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating test/services/de.pengutronix.rauc.service
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

make
make --no-print-directory all-am
CC src/librauc_la-bundle.lo
src/bundle.c: In function 'check_bundle':
src/bundle.c:301:5: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'guint64' [-Werror=format=]
"signature size sanity check failed: %"G_GSIZE_FORMAT" exceeds bundle size", sigsize);
^
src/bundle.c:308:5: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'guint64' [-Werror=format=]
"signature size sanity check failed: %"G_GSIZE_FORMAT" exceeds 64KiB", sigsize);
^
cc1: all warnings being treated as errors
Makefile:1136: recipe for target 'src/librauc_la-bundle.lo' failed
make[1]: *** [src/librauc_la-bundle.lo] Error 1
Makefile:813: recipe for target 'all' failed
make: *** [all] Error 2

Initial Operation state is unset

The initial state retrieved by busctl get-property de.pengutronix.rauc / de.pengutronix.rauc.Installer Operation is s "" not s "idle".

Rauc needs Kernel support. Mention this in chapter prerequisite?

Hi,

I failed to get rauc to work because some leak of kernel support. After switching on loopback support and squasfs, rauc works fine.

-# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set

-# CONFIG_SQUASHFS is not set
+CONFIG_SQUASHFS=y
+CONFIG_SQUASHFS_FILE_CACHE=y
+# CONFIG_SQUASHFS_FILE_DIRECT is not set
+CONFIG_SQUASHFS_DECOMP_SINGLE=y
+# CONFIG_SQUASHFS_DECOMP_MULTI is not set
+# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set
+# CONFIG_SQUASHFS_XATTR is not set
+CONFIG_SQUASHFS_ZLIB=y
+CONFIG_SQUASHFS_LZ4=y
+CONFIG_SQUASHFS_LZO=y
+CONFIG_SQUASHFS_XZ=y
+# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3

What do you think about a chapter prerequisite in docs?

Regards
Gavin

cms_verify() fails with OpenSSL 1.1.x

With OpenSSL 1.1.x either running the tests (make check) or performing a bundle installation causes a verification error in RAUCs cms_verify() method that calls libcrypto CMS_verify():

140573172512064:error:2E09D06D:CMS routines:CMS_verify:content verify error:../crypto/cms/cms_smime.c:393:

rauc install fails with busybox tar: invalid tar magic

Hi,

I had problems getting rauc work with busybox tar. Using nativ tar rauc just works fine!
Maybe not a bug but worth to mention it in documentation?

with default busybox tar settings
Dec 02 09:36:57 CI4000 rauc[1094]: tar: invalid tar magic

with all tar busybox options enabled
Dec 02 09:50:16 CI4000 rauc[1094]: tar: unknown typeflag: 0x56

Regards
Gavin

Forward progress log to the RAUC CLI

Currently, the RAUC CLI only prints the result of an installation when calling

./rauc install /path/to/bundle.raucb

but there is no possibility to let it show the progress information that is exposed over D-Bus. Currently log data can only be obtained by inspecting the service logs, e.g. by doing a journalctl -f -u rauc.service when using systemd.

unintuitive option `ignore-checksum`

IMHO the slot option ignore-checksum is misnamed. For a piece of software that should write an image somewhere I would expect that adding ignore-checksum results in the installation of the image even if the checksum that is part of the image doesn't match. According to its documentation its about skipping installation if the image to install is already installed.

IMHO a better name for this function would be force-install-same.

Failed marking slot rootfs non-bootable

root@arm:~# rauc install /media/usb/up2.raucb 
Trying to contact rauc service
rauc-Message: installing /media/usb/up2.raucb: installing
rauc-Message: installing /media/usb/up2.raucb:   0% Installing
rauc-Message: installing /media/usb/up2.raucb:   0% Determining slot states
rauc-Message: installing /media/usb/up2.raucb:  20% Determining slot states done.
rauc-Message: installing /media/usb/up2.raucb:  20% Checking bundle
rauc-Message: installing /media/usb/up2.raucb:  20% Verifying signature
rauc-Message: installing /media/usb/up2.raucb:  40% Verifying signature done.
rauc-Message: installing /media/usb/up2.raucb:  40% Checking bundle done.
rauc-Message: installing /media/usb/up2.raucb:  40% Verifying manifest
rauc-Message: installing /media/usb/up2.raucb:  40% Loading manifest file
rauc-Message: installing /media/usb/up2.raucb:  50% Loading manifest file done.
rauc-Message: installing /media/usb/up2.raucb:  50% Verifying manifest checksums
rauc-Message: installing /media/usb/up2.raucb:  60% Verifying manifest checksums done.
rauc-Message: installing /media/usb/up2.raucb:  60% Verifying manifest done.
rauc-Message: installing /media/usb/up2.raucb:  60% Determining target install group
rauc-Message: installing /media/usb/up2.raucb:  80% Determining target install group done.
rauc-Message: installing /media/usb/up2.raucb: 100% Installing failed.
rauc-Message: installing /media/usb/up2.raucb: LastError: Handler error: Failed marking slot rootfs.1 non-bootable
Installing `/media/usb/up2.raucb` failed
root@arm:~# tail -f --lines=20 /var/log/syslog 
...
Sep 15 12:16:14 arm rauc[5607]: Using default handler
Sep 15 12:16:15 arm rauc[5607]: rauc-Message: Marking target slot as non-bootable...
Sep 15 12:16:15 arm rauc[5607]: Cannot parse config file: No such file or directory
Sep 15 12:16:15 arm rauc[5607]: Error: environment not initialized
Sep 15 12:16:15 arm rauc[5607]: (rauc:5607): rauc-WARNING **: fw_setenv failed: Child process exited with code 1
Sep 15 12:16:15 arm rauc[5607]: (rauc:5607): rauc-WARNING **: failed marking as bad
Sep 15 12:16:16 arm rauc[5607]: (rauc:5607): rauc-WARNING **: Handler error: Failed marking slot rootfs.1 non-bootable
Sep 15 12:16:16 arm rauc[5607]: rauc-Message: installing /media/usb/up2.raucb: Handler error: Failed marking slot rootfs.1 non-bootable
Sep 15 12:16:16 arm rauc[5607]: rauc-Message: installing /media/usb/up2.raucb: finished
Sep 15 12:16:16 arm rauc[5607]: rauc-Message: installing `/media/usb/up2.raucb` failed: 1

Any idea on which configuration needs to done. The error message is not giving sufficient information.

UBIFS type and determinate slot

Hi,
we use UBIFS on our device. For kernel boot args we set
ubi.mtd=8 root=ubi0:rootfs0 rootfstype=ubifs to mount rootfs0 and
ubi.mtd=8 root=ubi0:rootfs1 rootfstype=ubifs to mount rootfs1.

in /etc/rauc/system.conf we create two sections:

[...]

[slot.rootfs.0]
device=ubi0:rootfs0
type=ubifs
bootname=system0

[slot.rootfs.1]
device=ubi0.rootfs1
type=ubifs
bootname=system1

[...]

RAUC recognize booted slot, because of mount (ubi0:rootfs0 -> /), but if we try to install a bundle it fails.
rauc try to open file like: /etc/rauc/ubi0:rootfs0. This file is not exists of course.

Have I made a mistake somewhere ?
if not, is it possible to add a support for ubifs type ubiX:VOLNAME syntax?

Regards,
Andreas

Updates over http and version control

Hi,

I am integrating with Yocto and I am trying to wrap my head around how updates and versioning works with RAUC. I am assuming for each new version, RAUC_BUNDLE_VERSION needs to be updated and the *.raucb needs to be uploaded to a web server. I don't see any examples though for how RAUC checks if there is a new version available and downloads/installs it. Is this not built into RAUC? Do I need to use casync along with hawkBit to add this functionality?

casync convert documentation, missing args

Hi,

the documentation states we can simply call

rauc convert conventional-bundle.raucb casync-bundle.raucb

to create a casync bundle, but it seems the --cert, --key and --keyring parameters are required for this to work since

$ rauc convert conventional-bundle.raucb casync-bundle.raucb
Cert and key files must be provided

and

$ rauc --cert=mycert.cert.pem --key=mycert.pem convert conventional-bundle.raucb casync-bundle.raucb
No keyring file provided

rauc status mark-good/bad fails with permission denied on /dev/mmcblk0boot0

rauc status mark-good/bad command fails with "Operation not permitted" error. Installing update bundle fails too. I can however set u-boot environment variable manually using fw_setenv command. I am using meta-rauc with yocto.

Sep 07 14:03:26 colibri-imx6 rauc[1045]: rauc-Message: installing `/media/sda1/update-bundle-colibri-imx6-20170907135421.raucb` failed: 1
Sep 07 14:03:26 colibri-imx6 rauc[1045]: rauc-Message: installing /media/sda1/update-bundle-colibri-imx6-20170907135421.raucb: finished
Sep 07 14:03:26 colibri-imx6 rauc[1045]: rauc-Message: installing /media/sda1/update-bundle-colibri-imx6-20170907135421.raucb: Handler error: Failed marking slot rootfs.1 non-bootable
Sep 07 14:03:26 colibri-imx6 rauc[1045]: (rauc:1045): rauc-WARNING **: Handler error: Failed marking slot rootfs.1 non-bootable
Sep 07 14:03:26 colibri-imx6 rauc[1045]: (rauc:1045): rauc-WARNING **: failed marking as bad
Sep 07 14:03:26 colibri-imx6 rauc[1045]: (rauc:1045): rauc-WARNING **: fw_setenv failed: Child process exited with code 1
Sep 07 14:03:26 colibri-imx6 rauc[1045]: Error: can't write fw_env to flash
Sep 07 14:03:26 colibri-imx6 rauc[1045]: Write error on /dev/mmcblk0boot0: Operation not permitted
Sep 07 14:03:26 colibri-imx6 rauc[1045]: rauc-Message: Marking target slot as non-bootable...
Sep 07 14:03:25 colibri-imx6 rauc[1045]: Using default handler
Sep 07 14:03:25 colibri-imx6 rauc[1045]:   rootfs -> rootfs.1
Sep 07 14:03:25 colibri-imx6 rauc[1045]: Target Group:
Sep 07 14:03:25 colibri-imx6 rauc[1045]: Adding to target group: rootfs -> rootfs.1
Sep 07 14:03:03 colibri-imx6 rauc[1045]: rauc-Message: Verifying bundle...
Sep 07 14:03:03 colibri-imx6 rauc[1045]: rauc-Message: Reading bundle: /media/sda1/update-bundle-colibri-imx6-20170907135421.raucb
Sep 07 14:03:03 colibri-imx6 rauc[1045]: rauc-Message: installing /media/sda1/update-bundle-colibri-imx6-20170907135421.raucb: Checking and mounting bundle...
Sep 07 14:03:03 colibri-imx6 rauc[1045]: rauc-Message: Mounting bundle '/media/sda1/update-bundle-colibri-imx6-20170907135421.raucb' to '/run/rauc/bundle'
Sep 07 14:03:03 colibri-imx6 rauc[1045]: rauc-Message: installing /media/sda1/update-bundle-colibri-imx6-20170907135421.raucb: started
Sep 07 14:03:03 colibri-imx6 rauc[1045]: Active slot bootname: A
Sep 07 14:03:03 colibri-imx6 rauc[1045]: input bundle: /media/sda1/update-bundle-colibri-imx6-20170907135421.raucb

Fails to compile on a Raspberry Pi

Hello all,

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable debugging... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for a sed that does not truncate output... /bin/sed
checking whether C compiler accepts -Werror=unknown-warning-option... no
checking whether C compiler accepts -fno-strict-aliasing... yes
checking whether C compiler accepts -Wall... yes
checking whether C compiler accepts -Wextra... yes
checking whether C compiler accepts -Wundef... yes
checking whether C compiler accepts -Wnested-externs... yes
checking whether C compiler accepts -Wwrite-strings... yes
checking whether C compiler accepts -Wpointer-arith... yes
checking whether C compiler accepts -Wmissing-declarations... yes
checking whether C compiler accepts -Wmissing-prototypes... yes
checking whether C compiler accepts -Wstrict-prototypes... yes
checking whether C compiler accepts -Wredundant-decls... yes
checking whether C compiler accepts -Wno-unused-parameter... yes
checking whether C compiler accepts -Wno-missing-field-initializers... yes
checking whether C compiler accepts -Wdeclaration-after-statement... yes
checking whether C compiler accepts -Wformat=2... yes
checking whether C compiler accepts -Wold-style-definition... yes
checking whether C compiler accepts -Wcast-align... yes
checking whether C compiler accepts -Wformat-nonliteral... yes
checking whether C compiler accepts -Wformat-security... yes
checking whether C compiler accepts -Wsign-compare... yes
checking whether C compiler accepts -Wstrict-aliasing... yes
checking whether C compiler accepts -Wshadow... yes
checking whether C compiler accepts -Winline... yes
checking whether C compiler accepts -Wpacked... yes
checking whether C compiler accepts -Wmissing-format-attribute... yes
checking whether C compiler accepts -Wmissing-noreturn... yes
checking whether C compiler accepts -Winit-self... yes
checking whether C compiler accepts -Wredundant-decls... (cached) yes
checking whether C compiler accepts -Wmissing-include-dirs... yes
checking whether C compiler accepts -Wunused-but-set-variable... yes
checking whether C compiler accepts -Warray-bounds... yes
checking whether C compiler accepts -Wimplicit-function-declaration... yes
checking whether C compiler accepts -Wreturn-type... yes
checking whether C compiler accepts -Wswitch-enum... yes
checking whether C compiler accepts -Wswitch-default... yes
checking whether C compiler accepts -Wno-suggest-attribute=format... yes
checking whether C compiler accepts -Wno-error=unused-parameter... yes
checking whether C compiler accepts -Wno-error=missing-field-initializers... yes
checking whether C compiler accepts -Werror=unknown-warning-option... (cached) no
checking whether the linker accepts -Wl,--no-as-needed... yes
checking whether the linker accepts -Wl,--fatal-warnings... yes
checking for gawk... (cached) mawk
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking for catchsegv... catchsegv
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether to build with code coverage support... no
checking whether to enable Valgrind on the unit tests... checking for valgrind... no
yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for CURL... yes
checking for JSON_GLIB... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

$ make
echo 0.1.1.141-8a48 > .version-t && mv .version-t .version
GEN rauc-installer-generated.c
make --no-print-directory all-am
CC src/librauc_la-bootchooser.lo
CC src/librauc_la-bundle.lo
CC src/librauc_la-checksum.lo
CC src/librauc_la-config_file.lo
CC src/librauc_la-context.lo
CC src/librauc_la-install.lo
CC src/librauc_la-manifest.lo
CC src/librauc_la-mark.lo
CC src/librauc_la-mount.lo
CC src/librauc_la-service.lo
CC src/librauc_la-signature.lo
In file included from /usr/lib/arm-linux-gnueabihf/glib-2.0/include/glibconfig.h:9:0,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from ./include/context.h:3,
from src/signature.c:10:
src/signature.c: In function 'get_pubkey_hash':
src/signature.c:182:29: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
g_assert(tmp_buf- der_buf == len);
^
/usr/include/glib-2.0/glib/gmacros.h:318:25: note: in definition of macro 'G_LIKELY'
#define G_LIKELY(expr) (expr)
^
src/signature.c:182:3: note: in expansion of macro 'g_assert'
g_assert(tmp_buf- der_buf == len);
^
cc1: all warnings being treated as errors
Makefile:1249: recipe for target 'src/librauc_la-signature.lo' failed
make[1]: *** [src/librauc_la-signature.lo] Error 1
Makefile:824: recipe for target 'all' failed
make: *** [all] Error 2

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10)

$ uname -a
Linux caglarpi 4.9.28-v7+ #998 SMP Mon May 15 16:55:39 BST 2017 armv7l GNU/Linux

Fails to build on beaglebone black

./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable debugging... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for a sed that does not truncate output... /bin/sed
checking whether C compiler accepts -Werror=unknown-warning-option... no
checking whether C compiler accepts -fno-strict-aliasing... yes
checking whether C compiler accepts -Wall... yes
checking whether C compiler accepts -Wextra... yes
checking whether C compiler accepts -Wundef... yes
checking whether C compiler accepts -Wnested-externs... yes
checking whether C compiler accepts -Wwrite-strings... yes
checking whether C compiler accepts -Wpointer-arith... yes
checking whether C compiler accepts -Wmissing-declarations... yes
checking whether C compiler accepts -Wmissing-prototypes... yes
checking whether C compiler accepts -Wstrict-prototypes... yes
checking whether C compiler accepts -Wredundant-decls... yes
checking whether C compiler accepts -Wno-unused-parameter... yes
checking whether C compiler accepts -Wno-missing-field-initializers... yes
checking whether C compiler accepts -Wdeclaration-after-statement... yes
checking whether C compiler accepts -Wformat=2... yes
checking whether C compiler accepts -Wold-style-definition... yes
checking whether C compiler accepts -Wcast-align... yes
checking whether C compiler accepts -Wformat-nonliteral... yes
checking whether C compiler accepts -Wformat-security... yes
checking whether C compiler accepts -Wsign-compare... yes
checking whether C compiler accepts -Wstrict-aliasing... yes
checking whether C compiler accepts -Wshadow... yes
checking whether C compiler accepts -Winline... yes
checking whether C compiler accepts -Wpacked... yes
checking whether C compiler accepts -Wmissing-format-attribute... yes
checking whether C compiler accepts -Wmissing-noreturn... yes
checking whether C compiler accepts -Winit-self... yes
checking whether C compiler accepts -Wredundant-decls... (cached) yes
checking whether C compiler accepts -Wmissing-include-dirs... yes
checking whether C compiler accepts -Wunused-but-set-variable... yes
checking whether C compiler accepts -Warray-bounds... yes
checking whether C compiler accepts -Wimplicit-function-declaration... yes
checking whether C compiler accepts -Wreturn-type... yes
checking whether C compiler accepts -Wswitch-enum... yes
checking whether C compiler accepts -Wswitch-default... yes
checking whether C compiler accepts -Wno-suggest-attribute=format... yes
checking whether C compiler accepts -Wno-error=unused-parameter... yes
checking whether C compiler accepts -Wno-error=missing-field-initializers... yes
checking whether C compiler accepts -Werror=unknown-warning-option... (cached) no
checking whether the linker accepts -Wl,--no-as-needed... yes
checking whether the linker accepts -Wl,--fatal-warnings... yes
checking for gawk... (cached) gawk
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking for catchsegv... catchsegv
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether to build with code coverage support... no
checking whether to enable Valgrind on the unit tests... checking for valgrind... no
yes
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for CURL... yes
checking for JSON_GLIB... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking whether compiling and linking against OpenSSL works... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
debian@beaglebone:~/rauc$ make
make --no-print-directory all-am
CC src/librauc_la-install.lo
src/install.c: In function ‘reuse_existing_file_checksum’:
src/install.c:853:9: error: declaration of ‘basename’ shadows a global declaration [-Werror=shadow]
src/install.c: At top level:
cc1: error: unrecognized command line option "-Wno-suggest-attribute=format" [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [src/librauc_la-install.lo] Error 1
make: *** [all] Error 2

parameterless call

rauc should print out the help if called without any parameters
It also should have an return value != 0 in that case

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.