Merge commit '10e1b544716747d178e6efa9e798f4141a179f9d' into dora

This commit is contained in:
Holger Hans Peter Freyther 2015-08-12 07:54:15 +02:00
commit de1460dab6
30 changed files with 273 additions and 405 deletions

View File

@ -0,0 +1,37 @@
# Default to systemd
DISTRO_FEATURES_append = " systemd "
VIRTUAL-RUNTIME_init_manager = "systemd"
# Maybe only for the sysmoBTS kind of hardware?
MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
# Do not put the sourcecode into the debug packages
PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
# Enable the prserver host
PRSERV_HOST = "localhost:0"
# Delete stuff
#INHERIT += "rm_work"
# Create patched source tarballs
SOURCE_ARCHIVE_PACKAGE_TYPE = "tar"
INHERIT += " sysmocom-archive-patched-source"
# We use opkg and not rpm/smart
PACKAGE_CLASSES ?= "package_ipk"
# When using uclibc/musl.. avoid pulling in gettext. We do
# not need i18n in our tools right now.
USE_NLS = "no"
# We don't need x11, nfc, selinux, pam in our builds
DISTRO_FEATURES_remove = "x11 nfc selinux pam"
# Get rid off XZ for systemd
PACKAGECONFIG_pn-systemd = "ldconfig"
# From fido on.. build curl with libssl to avoid gnutls
PACKAGECONFIG_pn-curl="ipv6 ssl zlib"

View File

@ -16,7 +16,11 @@ MACHINE_FEATURES += "kernel26 x86 usbhost pci acpi"
KERNEL_IMAGETYPE = "bzImage"
IMAGE_FSTYPES = "tar.gz ext4"
IMAGE_FSTYPES = "ext4"
# After dora core2 got renamed to core2-32
# After dora core2 got renamed to core2-32
DEFAULTTUNE := "${@['core2', 'core2-32']['core2-32' in d.getVar('AVAILTUNES', True)]}"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_CONSOLE = "console=ttyS0,115200n8"

View File

@ -4,7 +4,8 @@
require conf/machine/include/ti33x.inc
IMAGE_FSTYPES += "ubi tar.gz"
IMAGE_FSTYPES += "ubifs"
DEFAULTTUNE = "cortexa8hf-neon"
SERIAL_CONSOLE = "115200 ttyO0"

View File

@ -0,0 +1,2 @@
require sysmocom-nitb-image.bb
require sysmocom-rauc-slot.inc

View File

@ -0,0 +1,5 @@
IMAGE_INSTALL_append = " packagegroup-rauc-slot "
# force it to a squashfs
IMAGE_FSTYPES = "squashfs"

View File

@ -1,20 +0,0 @@
etc/hostname
etc/ifplugd.sh
etc/network/interfaces
etc/openvpn
etc/opkg/sysmocom-config.conf
etc/osmocom/osmo-bsc-mgcp.cfg
etc/osmocom/osmo-bsc.cfg
etc/osmocom/osmo-bts.cfg
etc/osmocom/osmo-nitb.cfg
etc/osmocom/osmo-pcu.cfg
etc/osmocom/osmo-sgsn.cfg
etc/systemd/system/multi-user.target.wants/osmo-nitb.service
etc/systemd/system/multi-user.target.wants/osmo-bsc.service
etc/systemd/system/multi-user.target.wants/osmo-sgsn.service
etc/ggsn.conf
etc/default
var/lib/osmocom/hlr.sqlite3
etc/lcr
etc/udhcpd.conf
etc/sysmocom/backup.d

View File

@ -7,7 +7,7 @@ FILES="etc/sysmocom/backup.d"
# Pick some extra files
if [ -e /etc/sysmocom/backup.d/ ]; then
for extra in `ls /etc/sysmocom/backup.d/*.backup`;
for extra in `ls /etc/sysmocom/backup.d/*.files`;
do
echo "Add extras from $extra."
FILES="$FILES `cat $extra`"
@ -16,6 +16,31 @@ fi
DATE=`date +%Y%m%d`
# Called for a file. Compare with the content in /ro-root
# if this file has been modified and only take it then. In
# case the file is not present it in /ro-root it will be
# added to the backup set
backup_file() {
cmp -s /$2 /ro-root/$2
if [ $? -ne 0 ]; then
echo "Adding $2"
tar -rf $1 --transform='s,^,content/,' -C / $2
fi
}
# Check if this is a file, otherwise descend
handle_file() {
if [ -f "/$2" -a -e "/$2" ]; then
backup_file $1 $2
fi
if [ -d "/$2" -a -e "/$2" ]; then
for file in /$2/*;
do
# Construct to have no leading /
handle_file $1 $2/`basename $file`
done
fi
}
do_backup_files() {
BACKUP_FILE="/data/sysmocom-backup_$DATE.tar"
@ -32,24 +57,22 @@ do_backup_files() {
# 2. Add all the files... we need
for file in $FILES;
do
if [ -e "/$file" ]; then
tar -rf $BACKUP_FILE --transform='s,^,content/,' -C / $file
fi
handle_file $BACKUP_FILE $file
done
# 3. Generate more information
NAME="/tmp/backup.$RANDOM"
# 4. Generate more information
NAME="/tmp/backup.$$"
mkdir $NAME
opkg list_installed > $NAME/installed_packages
/sbin/ifconfig | grep HWaddr | cut -d ' ' -f 11 > $NAME/mac_addr
# 4. Add the more information
# 5. Add the more information
tar -rf $BACKUP_FILE --transform='s,^,info/,' -C $NAME installed_packages mac_addr
# 5. Create stable link
# 6. Create stable link
ln -sf $BACKUP_FILE /data/sysmocom-backup.tar
# 6.
# 76
echo "The backup was stored to $BACKUP_FILE"
}

View File

@ -19,8 +19,7 @@ do_restore_files() {
fi
echo "Going to extract files from the backup '$BACKUP_FILE'"
do_extract $BACKUP_FILE content/etc
do_extract $BACKUP_FILE content/var/lib/osmocom
do_extract $BACKUP_FILE content/
}
do_restore_files $1

View File

@ -6,7 +6,7 @@ After=data.mount
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/sbin/sysmocom-restore /data/sysmocom-backup.tar
ExecStart=/usr/sbin/sysmocom-restore-data /data/sysmocom-backup.tar
[Install]
WantedBy=multi-user.target

View File

@ -4,11 +4,10 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384
PR = "r12"
SRC_URI = " \
file://sysmocom-backup \
file://sysmocom-restore \
file://sysmocom-backup-data \
file://sysmocom-restore-data \
file://data.mount \
file://sysmocom-restore.service \
file://default.files \
"
RDEPENDS_${PN} = "tar"
RCONFLICTS_${PN} = "symocom-backup"
@ -17,21 +16,14 @@ inherit systemd
do_install() {
install -d ${D}${sbindir}
install -m 0755 ${WORKDIR}/sysmocom-backup ${D}${sbindir}/
install -m 0755 ${WORKDIR}/sysmocom-restore ${D}${sbindir}/
install -d ${D}${sysconfdir}/sysmocom/backup.d
install -m 0644 ${WORKDIR}/default.files ${D}${sysconfdir}/sysmocom/backup.d/
install -m 0755 ${WORKDIR}/sysmocom-backup-data ${D}${sbindir}/
install -m 0755 ${WORKDIR}/sysmocom-restore-data ${D}${sbindir}/
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/data.mount ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/sysmocom-restore.service ${D}${systemd_unitdir}/system/
}
PACKAGES =+ "${PN}-default"
FILES_${PN}-default = "${sysconfdir}/sysmocom/backup.d/"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "data.mount sysmocom-restore.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"

View File

@ -18,3 +18,6 @@ var/lib/osmocom/hlr.sqlite3
etc/lcr
etc/udhcpd.conf
etc/sysmocom/backup.d
etc/machine-id
etc/dropbear/dropbear_rsa_host_key
etc/uucp

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,5 @@ RDEPENDS_${PN} = "\
ca-cacert-rootcert \
sysmocom-backup \
sysmocom-backup-default \
sysmocom-systemd \
"

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

@ -1,136 +0,0 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# eth0 is attached to the IDU-internal managed switch (IES-3080)
# in the future we will use VLANs to use individual switch ports as
# break-out interfaces. For now we simply do DHCP.
# Note: when inmarsat is available, its route should have a stronger metric
# than iridium (the route installed by linkmon). For the "inactive" routes, the
# metrics should be reversed, because iridium is more likely to be available
# than inmarsat (as an emergency/fallback measure).
#
# transport "active" metric "inactive" metric
# WIFI 10 130
# GSM 20 140
# Iridium 30 110
# Inmarsat 40 120
# VLAN 2000: The iridium openport satellite modem attached to
# port 1 of the IES-3080
auto eth0.2000
iface eth0.2000 inet static
address 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
post-up ip r add 10.6.1.0/24 via 192.168.0.1
# VLAN 2001: Reserved for a future C-Band satellite modem
# attached to port 8 of the IES-3080
auto eth0.2001
iface eth0.2001 inet manual
# VLAN 2002: Reserved for a future Inmarsat satellite modem
# attached to port 6 of the IES-3080
auto eth0.2002
iface eth0.2002 inet dhcp
# management VLAN of IES-3080 switch (172.16.2.3)
auto eth0.6
iface eth0.6 inet manual
# video VLAN on IES-3080
auto eth0.9
iface eth0.9 inet manual
#eth1 is our admin interface and will provide dhcp to clients
auto eth1
iface eth1 inet static
address 172.16.6.1
netmask 255.255.255.0
network 172.16.6.0
# eth2 is attached to the IDU-internal SOB-JB02-SW
auto eth2
iface eth2 inet static
bridge_ports eth2
bridge_maxwait 0
address 172.16.4.1
netmask 255.255.254.0
network 172.16.4.0
# management VLAN towards {N,P}JB
auto eth2.6
iface eth2.6 inet manual
# bridge for VLAN 6: management VLAN
auto br-mgmt
iface br-mgmt inet static
bridge_ports eth2.6 eth0.6
bridge_maxwait 0
address 172.16.2.1
netmask 255.255.254.0
network 172.16.2.0
# bridge for VLAN9: video
auto br-video
iface br-video inet static
bridge_ports eth2.9 eth0.9
bridge_maxwait 0
address 172.16.9.1
netmask 255.255.255.0
network 172.16.9.0
# 172.16.1.1 is the service IP address for SOBMGMT
auto br-mgmt:0
iface br-mgmt:0 inet static
address 172.16.1.1
netmask 255.255.255.255
# GSM management VLAN
auto eth2.7
iface eth2.7 inet static
address 172.16.7.1
netmask 255.255.255.0
network 172.16.7.0
# Video VLAN on JB02, part of br-video
auto eth2.9
iface eth2.9 inet manual
# admin WiFi
auto eth2.1001
iface eth2.1001 inet static
address 172.16.8.1
netmask 255.255.255.0
network 172.16.8.0
# onboard WiFi
auto eth2.1002
iface eth2.1002 inet static
address 172.16.128.1
netmask 255.255.252.0
network 172.16.128.0
# remote WiFi
auto eth2.1003
iface eth2.1003 inet static
address 172.16.132.1
netmask 255.255.252.0
network 172.16.132.0
# JB-facing device for Inmarsat Satlite Crew
auto eth2.1004
iface eth2.1004 inet manual
# uplink of Inmarsat Satlite Crew
auto eth0.1004
iface eth0.1004 inet manual
auto br-satlite
iface br-satlite inet manual
bridge_ports eth0.1004 eth2.1004
bridge_maxwait 0

View File

@ -1,136 +0,0 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# eth0 is attached to the IDU-internal managed switch (IES-3080)
# in the future we will use VLANs to use individual switch ports as
# break-out interfaces. For now we simply do DHCP.
# Note: when inmarsat is available, its route should have a stronger metric
# than iridium (the route installed by linkmon). For the "inactive" routes, the
# metrics should be reversed, because iridium is more likely to be available
# than inmarsat (as an emergency/fallback measure).
#
# transport "active" metric "inactive" metric
# WIFI 10 130
# GSM 20 140
# Iridium 30 110
# Inmarsat 40 120
# VLAN 2000: The iridium openport satellite modem attached to
# port 1 of the IES-3080
auto eth0.2000
iface eth0.2000 inet static
address 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
post-up ip r add 10.6.1.0/24 via 192.168.0.1
# VLAN 2001: Reserved for a future C-Band satellite modem
# attached to port 8 of the IES-3080
auto eth0.2001
iface eth0.2001 inet manual
# VLAN 2002: Reserved for a future Inmarsat satellite modem
# attached to port 6 of the IES-3080
auto eth0.2002
iface eth0.2002 inet dhcp
# management VLAN of IES-3080 switch (172.16.2.3)
auto eth0.6
iface eth0.6 inet manual
# video VLAN on IES-3080
auto eth0.9
iface eth0.9 inet manual
#eth1 is our admin interface and will provide dhcp to clients
auto eth1
iface eth1 inet static
address 172.16.6.1
netmask 255.255.255.0
network 172.16.6.0
# eth2 is attached to the IDU-internal SOB-JB02-SW
auto eth2
iface eth2 inet static
bridge_ports eth2
bridge_maxwait 0
address 172.16.4.1
netmask 255.255.254.0
network 172.16.4.0
# management VLAN towards {N,P}JB
auto eth2.6
iface eth2.6 inet manual
# bridge for VLAN 6: management VLAN
auto br-mgmt
iface br-mgmt inet static
bridge_ports eth2.6 eth0.6
bridge_maxwait 0
address 172.16.2.1
netmask 255.255.254.0
network 172.16.2.0
# bridge for VLAN9: video
auto br-video
iface br-video inet static
bridge_ports eth2.9 eth0.9
bridge_maxwait 0
address 172.16.9.1
netmask 255.255.255.0
network 172.16.9.0
# 172.16.1.1 is the service IP address for SOBMGMT
auto br-mgmt:0
iface br-mgmt:0 inet static
address 172.16.1.1
netmask 255.255.255.255
# GSM management VLAN
auto eth2.7
iface eth2.7 inet static
address 172.16.7.1
netmask 255.255.255.0
network 172.16.7.0
# Video VLAN on JB02, part of br-video
auto eth2.9
iface eth2.9 inet manual
# admin WiFi
auto eth2.1001
iface eth2.1001 inet static
address 172.16.8.1
netmask 255.255.255.0
network 172.16.8.0
# onboard WiFi
auto eth2.1002
iface eth2.1002 inet static
address 172.16.128.1
netmask 255.255.252.0
network 172.16.128.0
# remote WiFi
auto eth2.1003
iface eth2.1003 inet static
address 172.16.132.1
netmask 255.255.252.0
network 172.16.132.0
# JB-facing device for Inmarsat Satlite Crew
auto eth2.1004
iface eth2.1004 inet manual
# uplink of Inmarsat Satlite Crew
auto eth0.1004
iface eth0.1004 inet manual
auto br-satlite
iface br-satlite inet manual
bridge_ports eth0.1004 eth2.1004
bridge_maxwait 0

View File

@ -7,12 +7,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
# Set this to 'preempt_rt' in the local.conf if you want a real time kernel
LINUX_KERNEL_TYPE ?= "standard"
module_autoload_mISDN_l1loop = "mISDN_l1loop"
module_autoload_mISDN_dsp = "mISDN_dsp"
module_conf_mISDN_l1loop = "options mISDN_l1loop pri=1 nchannel=20"
KERNEL_MODULE_PROBECONF_append = "mISDN_l1loop mISDN_dsp"
FILES_${PN} = ""
# Remove when using a Poky/OE-Core with that includes e0bf758982843ec1981b74410616b3492c599d06

View File

@ -32,5 +32,14 @@ do_configure() {
# autoload defaults (alphabetically sorted)
module_autoload_leds-gpio = "leds-gpio"
module_autoload_mmc_block = "mmc_block"
KERNEL_MODULE_AUTOLOAD += "leds-gpio mmc_block"
# Legacy for 3.2 and LCR
module_autoload_mISDN_l1loop = "mISDN_l1loop"
module_autoload_mISDN_dsp = "mISDN_dsp"
module_conf_mISDN_l1loop = "options mISDN_l1loop pri=1 nchannel=20"
KERNEL_MODULE_PROBECONF_append = "mISDN_l1loop mISDN_dsp"
KERNEL_MODULE_AUTOLOAD += "mISDN_l1loop mISDN_dsp"
DEFAULT_PREFERENCE = "20"

View File

@ -43,6 +43,7 @@ module_autoload_msgqueue = "msgqueue"
module_autoload_rtfifo = "rtfifo"
KERNEL_MODULE_PROBECONF_append = "davinci_mmc dspdl_dm644x fpgadl_par leds-gpio mmc_block msgqueue rtfifo"
KERNEL_MODULE_AUTOLOAD_append = "davinci_mmc dspdl_dm644x fpgadl_par leds-gpio mmc_block msgqueue rtfifo"
# module configs (alphabetically sorted)
module_conf_dspdl_dm644x = "options dspdl_dm644x fw_name=${BTS_FIRMWARE_NAME}.out debug=0"

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 kbd kbd-consolefonts kbd-keymaps"
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 busybox 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,73 @@
DESCRIPTION = "ubi with rescue slot"
LICENSE = "MIT"
PACKAGES = ""
PACKAGE_ARCH = "${MACHINE_ARCH}"
DEPENDS = "mtd-utils-native"
do_fetch[cleandirs] = "${S}"
do_unpack[noexec] = "1"
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_packagedata[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"
}
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=14MiB >> 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=35MiB >> 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=35MiB >> 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=16MiB >> 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}.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

@ -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,18 @@
DESCRIPTION = "Task for sysmocom rauc slots"
LICENSE = "MIT"
LIC_FILES_CHKSUM = " \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
ALLOW_EMPTY_${PN} = "1"
PR = "r1"
RDEPENDS_${PN} = "\
rauc \
sysmocom-backup-data \
sysmocom-backup-default \
"
# Add minimal debug helpers
RDEPENDS_${PN} += "\
strace tcpdump \
"

View File

@ -1,5 +1,10 @@
require rauc.bb
SRC_URI = "git://github.com/jluebbe/rauc.git;protocol=https \
file://dev-ca.pem \
file://rauc-done.service \
file://rauc-ubi.rules "
DEPENDS = "squashfs-tools-native curl-native openssl-native glib-2.0-native"
inherit native deploy
@ -11,8 +16,8 @@ do_deploy() {
rm -f ${DEPLOY_DIR_TOOLS}/rauc
ln -sf ./rauc-${PV} ${DEPLOY_DIR_TOOLS}/rauc
# allow override from local.conf?
install -m 600 test/openssl-ca/dev/autobuilder-1.cert.pem ${DEPLOY_DIR_TOOLS}/rauc.cert.pem
install -m 600 test/openssl-ca/dev//private/autobuilder-1.pem ${DEPLOY_DIR_TOOLS}/rauc.priv.pem
install -m 600 ${S}/test/openssl-ca/dev/autobuilder-1.cert.pem ${DEPLOY_DIR_TOOLS}/rauc.cert.pem
install -m 600 ${S}/test/openssl-ca/dev//private/autobuilder-1.pem ${DEPLOY_DIR_TOOLS}/rauc.priv.pem
}
addtask deploy before do_package after do_install

View File

@ -2,8 +2,8 @@ DESCRIPTION = "Osmocom PCU for sysmoBTS"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "git://git.osmocom.org/osmo-pcu.git;protocol=git;branch=zecke/wip"
SRCREV = "410d98e5d0c0eae76221a2d62a837b962f082506"
SRC_URI = "git://git.osmocom.org/osmo-pcu.git;protocol=git;branch=jerlbeck/master"
SRCREV = "6eed1911fd619fb594a9d1a7fc734c1f62ff2f08"
PV = "0.4+git${SRCPV}"
PR = "r3.${META_TELEPHONY_OSMO_INC}"
S = "${WORKDIR}/git"