Compare commits

...

15 Commits

Author SHA1 Message Date
Jan Luebbe 359534502e initramfs-rauc-slot: support restoring the backup archive
This change adds an initramfs module to mount the data partition and
restore the backup to the overlay. It is enabled by adding it to the
image-rauc-slot-initramfs recipe.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-09-06 19:20:33 +02:00
Jan Luebbe 0d7f0b449f sysmocom-backup-data: do not enable the restore service automatically
This is needed for an upcoming change which will restore the backup from
the initramfs.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-09-06 19:20:33 +02:00
Jan Luebbe e13aef6e6d rauc: update to newer git version for file reuse support
The new version searches mounted slots for matching files referenced by
the new manifest. This avoids downloading files we already have on the
system.

Additionally, the new version includes better error handling and more
unit tests.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-09-06 19:20:33 +02:00
Jan Luebbe a608c2c191 initramfs-rauc-install: fix root device entry for slot B
The typo caused an empty root= command line argument, which made it
impossible to boot this slot.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-09-06 19:20:33 +02:00
Jan Luebbe 497f5720d8 image-rauc-ubi: make sure all files belong to root
mkfs.ubifs needs the --squash-uids options, which squashes owners making all
files owned by root.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-09-05 10:59:33 +02:00
Jan Luebbe 756c513305 linux-sysmocom: switch all systems to 4.1.4
Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 19:21:11 +02:00
Jan Luebbe c57febc988 initramfs-rauc-slot: fix overlay fs name
Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 19:15:22 +02:00
Jan Luebbe f8674f6eb4 image-rauc-ubi: change rescue slot layout
Splitt of the actual rescue root filesystem to
image-rauc-rescue-initramfs and build image-rauc-ubi using
kernel+initramfs (like normal rauc slots).

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 14:46:32 +02:00
Jan Luebbe 4f4f0af076 barebox: update to newer git version for changed rescue slot layout
We now use kernel+initramfs for the rescue slot as well.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 14:46:32 +02:00
Jan Luebbe 84695fb247 linux: update for sysmobts
Move to newer stable kernel (3.10.84).

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 14:46:32 +02:00
Jan Luebbe 5c1f5ef1d7 barebox: update to newer git version for MAC address configuration
The new version configures the MAC address from the EEPROM on the
sysmocom-odu.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 14:46:32 +02:00
Jan Luebbe 9246433eb9 ntp: update the configuration to use GPS and PPS
The NTPd/GPSd SHM interface does not seem to work. Instead use the
native GPSd refclock (46) and configure it with the measured offset.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 14:46:32 +02:00
Jan Luebbe 76a6dc238d gpsd: create the /dev/gps0 symlink on the sysmocom-odu
This is needed for the NTPd GPSd refclock. Also start GPSd using systemd.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
2015-08-06 14:46:32 +02:00
Jan Luebbe 278342d64d sysmocom-configure: add simple framework to run configuration scripts
The configuration scripts are named for the systemd units for which they
generate configuration files. The generator causes them to run before
those units are started.

If /slot/system.conf is missing, we just exit the generator.
2015-08-06 14:46:32 +02:00
Jan Luebbe 1eb9eb8032 systemd: ship emergency.service which triggers a reboot
This reboots the system instead of starting a shell on boot problems.
Because the slot will only be marked as sucessfully booted as the last
step in a normal boot, repeated emergency boots will cause a fallback at
the boot chooser level to the other slot.

Testing this is possible by passing 'emergency' via the kernel command
line.
2015-08-06 14:46:32 +02:00
36 changed files with 2712 additions and 1701 deletions

View File

@ -1,7 +1,7 @@
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-sysmocom"
PREFERRED_VERSION_linux-sysmocom = "3.10.80+git%"
PREFERRED_VERSION_linux-sysmocom = "4.1.4+git%"
PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}depmod:module-init-tools-cross"
PREFERRED_VERSION_u-boot = "git"
@ -26,7 +26,6 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\
kernel-module-dspdl-dm644x \
kernel-module-fpgadl \
kernel-module-fpgadl-par \
kernel-module-leds-gpio \
kernel-module-msgqueue \
kernel-module-nls-ascii \
kernel-module-nls-utf8 \

View File

@ -32,6 +32,7 @@ UBINIZE_ARGS = "-m 2048 -p 128KiB -s 512 -O 2048"
# Go back to prefer our kernel
PREFERRED_PROVIDER_virtual/kernel = "linux-sysmocom"
KERNEL_IMAGETYPE = "uImage"
KERNEL_DEVICETREE = "am335x-sysmocom-odu.dtb"
PREFERRED_PROVIDER_virtual/bootloader = "barebox-sysmocom-odu"
EXTRA_IMAGEDEPENDS += "barebox-sysmocom-odu"

View File

@ -1,7 +1,7 @@
DESCRIPTION = "sysmocom config backup and restore scripts"
LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
PR = "r12"
PR = "r13"
SRC_URI = " \
file://sysmocom-backup \
@ -34,4 +34,4 @@ FILES_${PN}-default = "${sysconfdir}/sysmocom/backup.d/"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "data.mount sysmocom-restore.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
SYSTEMD_AUTO_ENABLE_${PN} = "disable"

View File

@ -3,7 +3,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = " \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
ALLOW_EMPTY_${PN} = "1"
PR = "r9"
PR = "r10"
RDEPENDS_${PN} = "\
lmsensors-scripts \
@ -16,4 +16,6 @@ RDEPENDS_${PN} = "\
ca-cacert-rootcert \
sysmocom-backup \
sysmocom-backup-default \
sysmocom-systemd \
sysmocom-configure \
"

View File

@ -1,6 +1,6 @@
require barebox.inc
SRCREV = "8d95a37caebcfae91146ee4794bbb8f4c31e4b32"
SRCREV = "95e1a85cb276362e0b76396841e4e6988ab523b0"
SRC_URI = " \
git://git.sysmocom.de/barebox.git;branch=v2015.06 \
file://defconfig \

View File

@ -1,6 +1,6 @@
require barebox.inc
SRCREV = "8d95a37caebcfae91146ee4794bbb8f4c31e4b32"
SRCREV = "95e1a85cb276362e0b76396841e4e6988ab523b0"
SRC_URI = " \
git://git.sysmocom.de/barebox.git;branch=v2015.06 \
file://defconfig \

View File

@ -2,7 +2,7 @@ require barebox.inc
RDEPENDS_${PN} += "${PN}-mlo"
SRCREV = "8d95a37caebcfae91146ee4794bbb8f4c31e4b32"
SRCREV = "95e1a85cb276362e0b76396841e4e6988ab523b0"
SRC_URI = " \
git://git.sysmocom.de/barebox.git;branch=v2015.06 \
file://defconfig \

View File

@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
inherit sysmocom-module
PR = "r2"
PR = "r3"
SRC_URI = "http://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.18.1/backports-3.18.1-1.tar.xz \
file://dont-export-clk_enable-twice.patch \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -33,4 +33,4 @@ do_configure() {
module_autoload_leds-gpio = "leds-gpio"
module_autoload_mmc_block = "mmc_block"
DEFAULT_PREFERENCE = "20"
DEFAULT_PREFERENCE = "-1"

View File

@ -1,5 +1,6 @@
inherit kernel
require linux-sysmocom.inc
require recipes-kernel/linux/linux-dtb.inc
DEPENDS += "bc-native"
@ -7,24 +8,25 @@ DEPENDS += "bc-native"
# reverse dependency tracking for the kernel doesn't appear to work. So
# please bump the PR on version changes!
# at versions changes do not forget to update conf/machine/include/sysmobts.inc too
LINUX_VERSION ?= "3.10.80"
LINUX_VERSION ?= "4.1.4"
LINUX_VERSION_EXTENSION ?= "-sysmocom-${LINUX_KERNEL_TYPE}"
# Overrides for the sysmocom bts v2
BTS_FIRMWARE_NAME_sysmobts-v2 = "sysmobts-v2"
SRCREV = "3122273386e140378bfc7f8ec5d76e4e04c32ad1"
SRCREV = "bc2a891db1d166bbb97acb68664adf6383900cb5"
PR = "r43"
PV = "${LINUX_VERSION}+git${SRCPV}"
SRC_URI = "git://git.sysmocom.de/sysmo-bts/linux.git;protocol=git;branch=linux-3.10.80 \
SRC_URI = "git://git.sysmocom.de/sysmo-bts/linux.git;protocol=git;branch=linux-4.1.4 \
file://defconfig"
S = "${WORKDIR}/git"
COMPATIBLE_MACHINE = "(sysmobts-v2|sysmocom-bsc)"
COMPATIBLE_MACHINE = "(sysmobts-v2|sysmocom-bsc|sysmocom-bsc|sysmocom-odu)"
EXTRA_OEMAKE += "KALLSYMS_EXTRA_PASS=1"
EXTRA_OEMAKE_append_sysmocom-odu = " LOADADDR=0x81000000"
require linux-tools.inc

View File

@ -3,6 +3,10 @@
# machine - it records the machine specific clock error
driftfile /etc/ntp.drift
# allow a larger distance between serial and PPS
# mindist is in seconds
tos mindist 0.250
# This obtains a random server which will be close
# (in IP terms) to the machine. Add other servers
# as required, or change this.
@ -14,11 +18,11 @@ server 127.127.1.0
fudge 127.127.1.0 stratum 14
# GPSD interface for NMEA based time
server 127.127.28.0
fudge 127.127.28.0 refid GPS
server 127.127.46.0 minpoll 4 prefer
fudge 127.127.46.0 refid GPS stratum 1 time2 0.720
# PPS interface to kernel
server 127.127.22.0
server 127.127.22.0 minpoll 4
fudge 127.127.22.0 refid PPS
# Defining a default security setting, allowing queries but declining

View File

@ -0,0 +1,12 @@
#!/bin/sh
set -eu
TEST_VALUE="default"
. /slot/system.conf
cat >/etc/symocom/test.cfg <<EOF
[main]
bla=$TEST_VALUE
EOF

View File

@ -0,0 +1,12 @@
#!/bin/sh
set -eu
OSMOBSC_VALUE="bar"
. /slot/system.conf
cat >/etc/osmocom/osmo-bsc.cfg <<EOF
#dummy: OSMOBSC_VALUE=$OSMOBSC_VALUE
EOF

View File

@ -0,0 +1,11 @@
#!/bin/sh
TEST_VALUE="default"
. /slot/system.conf
cat >/etc/sysmocom/test.cfg <<EOF
[main]
bla=$TEST_VALUE
model=sysmocom-bsc
EOF

View File

@ -0,0 +1,32 @@
#!/bin/sh
if [ ! -e /slot/system.conf ]; then
exit 0
fi
. /slot/system.conf
for HANDLER in $(ls /etc/sysmocom/configure.d/*.sh); do
UNIT=$(basename "$HANDLER" .sh)
cat >$1/${UNIT//./-}-configure.service <<EOF
[Unit]
Description=Generate $UNIT Configuration
After=sysmocom-restore.service
Before=$UNIT
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=$HANDLER
EOF
mkdir -p $1/$UNIT.wants
ln -s /lib/systemd/system/${UNIT//./-}-configure.service $1/$UNIT.wants/
done
if [ -n "$OSMOBSC_ENABLED" ]; then
ln -s /lib/systemd/system/osmo-bsc.service $1/multi-user.target.wants/
fi
if [ -n "$OSMONITB_ENABLED" ]; then
ln -s /lib/systemd/system/osmo-nitb.service $1/multi-user.target.wants/
fi

View File

@ -0,0 +1,19 @@
DESCRIPTION = "sysmocom configuration scripts"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = " \
file://sysmocom-generator \
file://multi-user.target.sh \
file://osmo-bsc.service.sh \
"
do_install() {
install -d ${D}${systemd_unitdir}/system-generators
install -m 0755 ${WORKDIR}/sysmocom-generator ${D}${systemd_unitdir}/system-generators/
install -d ${D}${sysconfdir}/sysmocom/configure.d
install -m 0755 ${WORKDIR}/*.sh ${D}${sysconfdir}/sysmocom/configure.d/
}
FILES_${PN} += "${systemd_unitdir}/system-generators"

View File

@ -0,0 +1,9 @@
[Unit]
Description=Emergency Reboot
DefaultDependencies=no
Conflicts=shutdown.target
Before=shutdown.target
[Service]
ExecStart=/bin/systemctl --force reboot
Type=oneshot

View File

@ -0,0 +1,14 @@
DESCRIPTION = "sysmocom systemd customization"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = " \
file://emergency.service \
"
do_install() {
install -d ${D}${sysconfdir}/systemd/system
install -m 0644 ${WORKDIR}/emergency.service ${D}${sysconfdir}/systemd/system
}
CONFFILES_${PN} += "${sysconfdir}/systemd/system/emergency.service"

View File

@ -0,0 +1,41 @@
DESCRIPTION = "rescue initramfs"
PACKAGE_INSTALL = "task-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${ROOTFS_PKGMANAGE} rauc dropbear"
IMAGE_LINGUAS = ""
LICENSE = "MIT"
# cpio config
XZ_COMPRESSION_LEVEL = "-e -9 --lzma2=dict=512KiB"
XZ_THREADS = "-T 0"
XZ_INTEGRITY_CHECK = "crc32"
IMAGE_FSTYPES = "cpio.xz"
BAD_RECOMMENDATIONS_append = " busybox-syslog"
BAD_RECOMMENDATIONS_append_sysmobts-v2 = " e2fsprogs-e2fsck"
BAD_RECOMMENDATIONS_append_sysmocom-odu = " e2fsprogs-e2fsck"
inherit core-image
require recipes-apps/images/image-manifest.inc
shrink_rescue() {
# The kernel should not be in the initramfs
rm -rf ${IMAGE_ROOTFS}/boot
# In case of the sysmoBTS.. remove files
rm -rf ${IMAGE_ROOTFS}/lib/firmware/sysmobts*
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/staging/sysmobts/msgqueue.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/fpgadl.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/staging/sysmobts/rtfifo.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/dspdl.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/dspdl_dm644x.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/fpgadl_par.ko
# Who cares about udev?
rm -rf ${IMAGE_ROOTFS}/lib/udev/hwdb.d/*
rm -rf ${IMAGE_ROOTFS}/etc/udev/hwdb.bin
}
IMAGE_PREPROCESS_COMMAND += "shrink_rescue; "

View File

@ -1,6 +1,6 @@
DESCRIPTION = "slot initramfs"
PACKAGE_INSTALL = "initramfs-framework-base initramfs-module-debug initramfs-module-rauc-overlay busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
PACKAGE_INSTALL = "initramfs-framework-base initramfs-module-debug initramfs-module-rauc-overlay initramfs-module-rauc-backup busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
# Do not pollute the initrd image with rootfs features
#IMAGE_FEATURES = ""

View File

@ -1,71 +0,0 @@
DESCRIPTION = "rescue initramfs"
PACKAGE_INSTALL = "task-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${ROOTFS_PKGMANAGE} rauc dropbear"
IMAGE_LINGUAS = ""
LICENSE = "MIT"
inherit core-image
require recipes-apps/images/image-manifest.inc
# cpio config
XZ_COMPRESSION_LEVEL = "-e -9 --lzma2=dict=512KiB"
XZ_THREADS = "-T 0"
XZ_INTEGRITY_CHECK = "crc32"
# ubifs config (override IMAGE_CMD_ubi to create custome volumes)
IMAGE_CMD_ubi () {
echo \[rescue\] > ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs >> ubinize.cfg
echo vol_id=0 >> ubinize.cfg
echo vol_size=32MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=rescue >> ubinize.cfg
echo \[system0\] >> ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo vol_id=1 >> ubinize.cfg
echo vol_size=32MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=system0 >> ubinize.cfg
echo \[system1\] >> ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo vol_id=2 >> ubinize.cfg
echo vol_size=32MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=system1 >> ubinize.cfg
echo \[data\] >> ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo vol_id=3 >> ubinize.cfg
echo vol_size=4MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=data >> ubinize.cfg
echo vol_flags=autoresize >> ubinize.cfg
mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS} && ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${UBINIZE_ARGS} ubinize.cfg
}
IMAGE_FSTYPES_sysmocom-idu = "cpio.xz"
IMAGE_FSTYPES_sysmobts-v2 = "ubi"
BAD_RECOMMENDATIONS_append = " busybox-syslog"
BAD_RECOMMENDATIONS_append_sysmobts-v2 = " e2fsprogs-e2fsck"
BAD_RECOMMENDATIONS_append_sysmocom-odu = " e2fsprogs-e2fsck"
shrink_rescue() {
# In case of the sysmoBTS.. remove files
rm -rf ${IMAGE_ROOTFS}/lib/firmware/sysmobts*
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/staging/sysmobts/msgqueue.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/fpgadl.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/staging/sysmobts/rtfifo.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/dspdl.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/dspdl_dm644x.ko
rm -rf ${IMAGE_ROOTFS}/lib/modules/*/kernel/drivers/misc/fpgadl_par.ko
# Who cares about udev?
rm -rf ${IMAGE_ROOTFS}/lib/udev/hwdb.d/*
rm -rf ${IMAGE_ROOTFS}/etc/udev/hwdb.bin
}
IMAGE_PREPROCESS_COMMAND += "shrink_rescue; "

View File

@ -0,0 +1,72 @@
DESCRIPTION = "ubi with rescue slot"
LICENSE = "MIT"
PACKAGES = ""
PACKAGE_ARCH = "${MACHINE_ARCH}"
do_fetch[cleandirs] = "${S}"
do_patch[noexec] = "1"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
do_install[noexec] = "1"
do_populate_sysroot[noexec] = "1"
do_package[noexec] = "1"
do_package_write_ipk[noexec] = "1"
do_package_write_deb[noexec] = "1"
do_package_write_rpm[noexec] = "1"
do_fetch[depends] = "virtual/kernel:do_build image-rauc-rescue-initramfs:do_build"
S = "${WORKDIR}"
do_fetch() {
mkdir -p "${S}/fs"
cp "${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin" "${S}/fs/kernel"
cp "${DEPLOY_DIR_IMAGE}/image-rauc-rescue-initramfs-${MACHINE}.cpio.xz" "${S}/fs/initramfs"
}
do_fetch_append_sysmocom-odu() {
cp "${DEPLOY_DIR_IMAGE}/uImage-am335x-sysmocom-odu.dtb" "${S}/fs/devicetree"
}
IMAGE_ROOTFS = "${S}/fs"
IMAGE_NAME = "${PN}-${MACHINE}-${DATETIME}"
# Don't include the DATETIME variable in the sstate package sigantures
IMAGE_NAME[vardepsexclude] = "DATETIME"
IMAGE_LINK_NAME = "${PN}-${MACHINE}"
do_deploy() {
echo \[rescue\] > ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rescue.ubifs >> ubinize.cfg
echo vol_id=0 >> ubinize.cfg
echo vol_size=32MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=rescue >> ubinize.cfg
echo \[system0\] >> ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo vol_id=1 >> ubinize.cfg
echo vol_size=32MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=system0 >> ubinize.cfg
echo \[system1\] >> ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo vol_id=2 >> ubinize.cfg
echo vol_size=32MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=system1 >> ubinize.cfg
echo \[data\] >> ubinize.cfg
echo mode=ubi >> ubinize.cfg
echo vol_id=3 >> ubinize.cfg
echo vol_size=4MiB >> ubinize.cfg
echo vol_type=dynamic >> ubinize.cfg
echo vol_name=data >> ubinize.cfg
echo vol_flags=autoresize >> ubinize.cfg
mkfs.ubifs --squash-uids -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rescue.ubifs ${MKUBIFS_ARGS}
ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.ubi ${UBINIZE_ARGS} ubinize.cfg
ln -sf ${IMAGE_NAME}.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.ubi
}
addtask deploy after do_fetch before do_build

View File

@ -152,7 +152,7 @@ menuentry "Slot A (OK=\$A_OK TRY=\$A_TRY)" ${ENTRY_ARGS}{
}
menuentry "Slot B (OK=\$B_OK TRY=\$B_TRY)" ${ENTRY_ARGS}{
linux (hd0,3)/kernel root=${INSTALL_TGT3} \$CMDLINE rauc.slot=B
linux (hd0,3)/kernel root=${INSTALL_TGT}3 \$CMDLINE rauc.slot=B
initrd (hd0,3)/initramfs
}
EOF

View File

@ -2,12 +2,14 @@ SUMMARY = "Modular initramfs system components for RAUC"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
PR = "r1"
PR = "r2"
inherit allarch
SRC_URI = "file://overlay \
file://rescue"
file://rescue \
file://mount_data \
file://restore_backup"
do_install() {
install -d ${D}/init.d
@ -17,10 +19,15 @@ do_install() {
# rescue
install -m 0755 ${WORKDIR}/rescue ${D}/init.d/10-rescue
# backup
install -m 0755 ${WORKDIR}/mount_data ${D}/init.d/25-mount_data
install -m 0755 ${WORKDIR}/restore_backup ${D}/init.d/26-restore_backup
}
PACKAGES = "initramfs-module-rauc-overlay \
initramfs-module-rauc-rescue"
initramfs-module-rauc-rescue \
initramfs-module-rauc-backup"
SUMMARY_initramfs-module-rauc-overlay = "initramfs support for overlayfs (ubifs&squashfs)"
RDEPENDS_initramfs-module-rauc-overlay = "initramfs-framework-base"
@ -29,3 +36,7 @@ FILES_initramfs-module-rauc-overlay = "/init.d/20-overlay"
SUMMARY_initramfs-module-rauc-rescue = "initramfs rescue mode support"
RDEPENDS_initramfs-module-rauc-rescue = "initramfs-framework-base"
FILES_initramfs-module-rauc-rescue = "/init.d/10-rescue"
SUMMARY_initramfs-module-rauc-backup = "initramfs backup restore support"
RDEPENDS_initramfs-module-rauc-backup = "initramfs-module-rauc-overlay"
FILES_initramfs-module-rauc-backup = "/init.d/25-mount_data /init.d/26-restore_backup"

View File

@ -27,7 +27,7 @@ overlay_run() {
info "Mounting overlayfs..."
mkdir /rw-root/root
mkdir /rw-root/work
mount -t overlayfs -o lowerdir=/ro-root,upperdir=/rw-root/root,workdir=/rw-root/work overlayfs /rootfs || fatal "Failed!"
mount -t overlay -o lowerdir=/ro-root,upperdir=/rw-root/root,workdir=/rw-root/work overlayfs /rootfs || fatal "Failed!"
fi
if [ -e /slot/overlay.tar.bz2 ]; then
info "Extracting overlay..."

View File

@ -0,0 +1,31 @@
#!/bin/sh
BACKUP_FILE=/rootfs/data/sysmocom-backup.tar
restore_backup_enabled() {
if [ ! -e "$BACKUP_FILE" ] ; then
info "The backup file '$BACKUP_FILE' does not exist, skipping restore..."
return 1
fi
return 0
}
restore_backup_extract() {
# List the files and check if grep hits something
SEARCH=`tar -tvf $1 | grep $2`
RES=$?
if [ $RES = 0 ]; then
tar -C /rootfs/tmp/ -xvf $1 $2
cp -a /rootfs/tmp/content/* /rootfs/
rm -rf /rootfs/tmp/content
else
echo "Directory '$2' is not in backup '$1'."
fi
}
restore_backup_run() {
info "Extracting files from the backup '$BACKUP_FILE'"
restore_backup_extract $BACKUP_FILE content/etc || fatal "Failed!"
restore_backup_extract $BACKUP_FILE content/var/lib/osmocom || fatal "Failed!"
}

View File

@ -0,0 +1,11 @@
#!/bin/sh
mount_data_enabled() {
return 0
}
mount_data_run() {
info "Mounting data..."
mkdir -p /rootfs/data
mount -t ubifs ubi0:data /rootfs/data
}

View File

@ -0,0 +1,11 @@
#!/bin/sh
mount_data_enabled() {
return 0
}
mount_data_run() {
info "Mounting data..."
mkdir -p /rootfs/data
mount -t ext4 /dev/sda4 /rootfs/data
}

View File

@ -0,0 +1,11 @@
#!/bin/sh
mount_data_enabled() {
return 0
}
mount_data_run() {
info "Mounting data..."
mkdir -p /rootfs/data
mount -t ubifs ubi0:data /rootfs/data
}

View File

@ -0,0 +1 @@
SUBSYSTEM=="tty", KERNEL=="ttyO2", SYMLINK="gps0"

View File

@ -0,0 +1,5 @@
# If you must specify a non-NMEA driver, uncomment and modify the next line
GPSD_SOCKET="/var/run/gpsd.sock"
GPSD_OPTIONS=""
GPS_DEVICES="/dev/gps0"

View File

@ -18,9 +18,9 @@ SRC_URI = "http://download.savannah.gnu.org/releases/${PN}/${P}.tar.gz \
file://gpsd-default \
file://gpsd \
file://60-gpsd.rules \
file://gpsd.service \
"
SRC_URI_append_sysmocom-idu = " file://gpsd.service "
SRC_URI[md5sum] = "fc5b03aae38b9b5b6880b31924d0ace3"
SRC_URI[sha256sum] = "706fc2c1cf3dfbf87c941f543381bccc9c4dc9f8240eec407dcbf2f70b854320"
@ -106,9 +106,8 @@ do_install_append() {
#support for python
#install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
#install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
}
do_install_append_sysmocom-idu() {
#support for systemd
install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
install -m 0644 ${WORKDIR}/gpsd.service ${D}${systemd_unitdir}/system/
@ -143,8 +142,7 @@ DESCRIPTION_libgps = "C service library used for communicating with gpsd"
FILES_libgps = "${libdir}/libgps.so.*"
DESCRIPTION_gpsd-conf = "gpsd configuration files and init scripts"
FILES_gpsd-conf = "${sysconfdir}"
FILES_gpsd-conf_append_sysmocom-idu = " ${systemd_unitdir}/system/ "
FILES_gpsd-conf = "${sysconfdir} ${systemd_unitdir}/system/"
CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default"
DESCRIPTION_gpsd-gpsctl = "Tool for tweaking GPS modes"

View File

@ -1,7 +1,7 @@
DESCRIPTION = "rauc update controller"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
PR = "r4"
PR = "r0"
SRC_URI = "git://github.com/jluebbe/rauc.git;protocol=https \
file://dev-ca.pem \
@ -13,7 +13,7 @@ PV = "0+git${SRCPV}"
S = "${WORKDIR}/git"
SRCREV = "d44adb00797d42efdd5f55064b0f3943906b081f"
SRCREV = "011953fa6c824ca518cf0ea074ddeede3726bdcd"
DEPENDS = "curl openssl glib-2.0"