From 2ad885f06aa6d2ac4214c6ae28ac82bd7534e828 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Tue, 23 Jun 2015 14:21:57 +0200 Subject: [PATCH 01/28] 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. --- recipes-apps/tasks/task-sysmocom-tools.bb | 3 ++- .../sysmocom-systemd/files/emergency.service | 9 +++++++++ .../sysmocom-systemd/sysmocom-systemd_1.0.bb | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 recipes-config/sysmocom-systemd/files/emergency.service create mode 100644 recipes-config/sysmocom-systemd/sysmocom-systemd_1.0.bb diff --git a/recipes-apps/tasks/task-sysmocom-tools.bb b/recipes-apps/tasks/task-sysmocom-tools.bb index 8f6c4e7957..96e6307fc4 100644 --- a/recipes-apps/tasks/task-sysmocom-tools.bb +++ b/recipes-apps/tasks/task-sysmocom-tools.bb @@ -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 \ " diff --git a/recipes-config/sysmocom-systemd/files/emergency.service b/recipes-config/sysmocom-systemd/files/emergency.service new file mode 100644 index 0000000000..34afaac0b5 --- /dev/null +++ b/recipes-config/sysmocom-systemd/files/emergency.service @@ -0,0 +1,9 @@ +[Unit] +Description=Emergency Reboot +DefaultDependencies=no +Conflicts=shutdown.target +Before=shutdown.target + +[Service] +ExecStart=/bin/systemctl --force reboot +Type=oneshot diff --git a/recipes-config/sysmocom-systemd/sysmocom-systemd_1.0.bb b/recipes-config/sysmocom-systemd/sysmocom-systemd_1.0.bb new file mode 100644 index 0000000000..c9c2330616 --- /dev/null +++ b/recipes-config/sysmocom-systemd/sysmocom-systemd_1.0.bb @@ -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" From eb571a7c886d9af98c31a447f23842c797eb7e94 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 6 Aug 2015 12:34:19 +0200 Subject: [PATCH 02/28] 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 --- recipes-bsp/barebox/barebox-sysmobts_git.bb | 2 +- recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb | 2 +- recipes-bsp/barebox/barebox-sysmocom-odu_git.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes-bsp/barebox/barebox-sysmobts_git.bb b/recipes-bsp/barebox/barebox-sysmobts_git.bb index d835f02fc1..33a9c9394c 100644 --- a/recipes-bsp/barebox/barebox-sysmobts_git.bb +++ b/recipes-bsp/barebox/barebox-sysmobts_git.bb @@ -1,6 +1,6 @@ require barebox.inc -SRCREV = "8d95a37caebcfae91146ee4794bbb8f4c31e4b32" +SRCREV = "56c50b3f4b098014d16f920b7c001e16942b21ce" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ diff --git a/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb b/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb index 865363fd0e..e5bd119e8a 100644 --- a/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb +++ b/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb @@ -1,6 +1,6 @@ require barebox.inc -SRCREV = "8d95a37caebcfae91146ee4794bbb8f4c31e4b32" +SRCREV = "56c50b3f4b098014d16f920b7c001e16942b21ce" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ diff --git a/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb b/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb index 9b2c135441..ee8fc9906c 100644 --- a/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb +++ b/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb @@ -2,7 +2,7 @@ require barebox.inc RDEPENDS_${PN} += "${PN}-mlo" -SRCREV = "8d95a37caebcfae91146ee4794bbb8f4c31e4b32" +SRCREV = "56c50b3f4b098014d16f920b7c001e16942b21ce" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ From 0c06d8a3d36b9641b482979f85240df53ce12104 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 6 Aug 2015 14:41:25 +0200 Subject: [PATCH 03/28] 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 --- recipes-bsp/barebox/barebox-sysmobts_git.bb | 2 +- recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb | 2 +- recipes-bsp/barebox/barebox-sysmocom-odu_git.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes-bsp/barebox/barebox-sysmobts_git.bb b/recipes-bsp/barebox/barebox-sysmobts_git.bb index 33a9c9394c..5acfb6acc5 100644 --- a/recipes-bsp/barebox/barebox-sysmobts_git.bb +++ b/recipes-bsp/barebox/barebox-sysmobts_git.bb @@ -1,6 +1,6 @@ require barebox.inc -SRCREV = "56c50b3f4b098014d16f920b7c001e16942b21ce" +SRCREV = "95e1a85cb276362e0b76396841e4e6988ab523b0" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ diff --git a/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb b/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb index e5bd119e8a..5cfba3d248 100644 --- a/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb +++ b/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb @@ -1,6 +1,6 @@ require barebox.inc -SRCREV = "56c50b3f4b098014d16f920b7c001e16942b21ce" +SRCREV = "95e1a85cb276362e0b76396841e4e6988ab523b0" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ diff --git a/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb b/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb index ee8fc9906c..f7c3470fba 100644 --- a/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb +++ b/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb @@ -2,7 +2,7 @@ require barebox.inc RDEPENDS_${PN} += "${PN}-mlo" -SRCREV = "56c50b3f4b098014d16f920b7c001e16942b21ce" +SRCREV = "95e1a85cb276362e0b76396841e4e6988ab523b0" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ From 046634e17a7ac16fcfb7912b83adafff442e50e8 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 6 Aug 2015 14:42:40 +0200 Subject: [PATCH 04/28] 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 --- .../images/image-rauc-rescue-initramfs.bb | 41 +++++++++++ recipes-core/images/image-rauc-slot-rescue.bb | 71 ------------------- recipes-core/images/image-rauc-ubi.bb | 71 +++++++++++++++++++ 3 files changed, 112 insertions(+), 71 deletions(-) create mode 100644 recipes-core/images/image-rauc-rescue-initramfs.bb delete mode 100644 recipes-core/images/image-rauc-slot-rescue.bb create mode 100644 recipes-core/images/image-rauc-ubi.bb diff --git a/recipes-core/images/image-rauc-rescue-initramfs.bb b/recipes-core/images/image-rauc-rescue-initramfs.bb new file mode 100644 index 0000000000..2a14739279 --- /dev/null +++ b/recipes-core/images/image-rauc-rescue-initramfs.bb @@ -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; " diff --git a/recipes-core/images/image-rauc-slot-rescue.bb b/recipes-core/images/image-rauc-slot-rescue.bb deleted file mode 100644 index 00537cc2a8..0000000000 --- a/recipes-core/images/image-rauc-slot-rescue.bb +++ /dev/null @@ -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; " diff --git a/recipes-core/images/image-rauc-ubi.bb b/recipes-core/images/image-rauc-ubi.bb new file mode 100644 index 0000000000..56514fce8d --- /dev/null +++ b/recipes-core/images/image-rauc-ubi.bb @@ -0,0 +1,71 @@ +DESCRIPTION = "ubi with rescue slot" + +LICENSE = "MIT" + +PACKAGES = "" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +DEPENDS = "mtd-utils-native" + +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" +} + +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 -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 From fe728f0dccaa6fedd7a58595b76ccb2c5707567c Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 6 Aug 2015 19:15:22 +0200 Subject: [PATCH 05/28] initramfs-rauc-slot: fix overlay fs name Signed-off-by: Jan Luebbe --- recipes-core/initrdscripts/initramfs-rauc-slot/overlay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-core/initrdscripts/initramfs-rauc-slot/overlay b/recipes-core/initrdscripts/initramfs-rauc-slot/overlay index bed1e106b6..1bb05027fc 100644 --- a/recipes-core/initrdscripts/initramfs-rauc-slot/overlay +++ b/recipes-core/initrdscripts/initramfs-rauc-slot/overlay @@ -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..." From d0610b60cf837a57455519574c1ef93bdbe05280 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Aug 2015 13:58:12 +0200 Subject: [PATCH 06/28] linux-sysmocom: Move the mISDN legacy to the 3.2 kernel recipe Only in 3.2 we are using mISDN for lcr. Move the module loading over there so we can let it die when we kill this recipe. --- recipes-bsp/linux/linux-sysmocom.inc | 6 ------ recipes-bsp/linux/linux-sysmocom_3.2.bb | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/recipes-bsp/linux/linux-sysmocom.inc b/recipes-bsp/linux/linux-sysmocom.inc index c65bd46e26..2a8d075ec2 100644 --- a/recipes-bsp/linux/linux-sysmocom.inc +++ b/recipes-bsp/linux/linux-sysmocom.inc @@ -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 diff --git a/recipes-bsp/linux/linux-sysmocom_3.2.bb b/recipes-bsp/linux/linux-sysmocom_3.2.bb index be6b2e4691..f4477219ad 100644 --- a/recipes-bsp/linux/linux-sysmocom_3.2.bb +++ b/recipes-bsp/linux/linux-sysmocom_3.2.bb @@ -33,4 +33,12 @@ do_configure() { module_autoload_leds-gpio = "leds-gpio" module_autoload_mmc_block = "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" From 1016ac1dbc3b23241ab89ef9e9475e6dc54c4283 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Aug 2015 13:59:53 +0200 Subject: [PATCH 07/28] linux-sysmocom: Use the only working module scheme In fido the old autoload feature doesn't work anymore and we need to remove it. Otherwise our sysmobts.service file will create the /dev/dspl.. /dev/fpgadl... firmware upload files and we all think that firmware loading is working. --- recipes-bsp/linux/linux-sysmocom_3.2.bb | 1 + recipes-bsp/linux/linux-sysmocom_git.bb | 1 + 2 files changed, 2 insertions(+) diff --git a/recipes-bsp/linux/linux-sysmocom_3.2.bb b/recipes-bsp/linux/linux-sysmocom_3.2.bb index f4477219ad..7f5d9fabb0 100644 --- a/recipes-bsp/linux/linux-sysmocom_3.2.bb +++ b/recipes-bsp/linux/linux-sysmocom_3.2.bb @@ -32,6 +32,7 @@ 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 diff --git a/recipes-bsp/linux/linux-sysmocom_git.bb b/recipes-bsp/linux/linux-sysmocom_git.bb index 37be276688..1ae499681b 100644 --- a/recipes-bsp/linux/linux-sysmocom_git.bb +++ b/recipes-bsp/linux/linux-sysmocom_git.bb @@ -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" From b4124f692449697d54097b5de0de40234964fb93 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Aug 2015 19:25:06 +0200 Subject: [PATCH 08/28] sysmocom-backup-data: Allow to install in parallel --- .../files/{sysmocom-backup => sysmocom-backup-data} | 0 .../files/{sysmocom-restore => sysmocom-restore-data} | 0 .../sysmocom-backup-data/sysmocom-backup-data_1.0.bb | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) rename recipes-apps/sysmocom-backup-data/files/{sysmocom-backup => sysmocom-backup-data} (100%) rename recipes-apps/sysmocom-backup-data/files/{sysmocom-restore => sysmocom-restore-data} (100%) diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-backup b/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data similarity index 100% rename from recipes-apps/sysmocom-backup-data/files/sysmocom-backup rename to recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-restore b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore-data similarity index 100% rename from recipes-apps/sysmocom-backup-data/files/sysmocom-restore rename to recipes-apps/sysmocom-backup-data/files/sysmocom-restore-data diff --git a/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb b/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb index 07320f570f..f61006b587 100644 --- a/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb +++ b/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb @@ -4,8 +4,8 @@ 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 \ @@ -17,8 +17,8 @@ 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 -m 0755 ${WORKDIR}/sysmocom-backup-data ${D}${sbindir}/ + install -m 0755 ${WORKDIR}/sysmocom-restore-data ${D}${sbindir}/ install -d ${D}${sysconfdir}/sysmocom/backup.d install -m 0644 ${WORKDIR}/default.files ${D}${sysconfdir}/sysmocom/backup.d/ From 4ba1d03895d16cda181344649f4eea3974c89d8b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Aug 2015 19:26:20 +0200 Subject: [PATCH 09/28] sysmocom-backup-data: Fix the glob to load additional files list The defaults.files ends with files and not backup. --- recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data b/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data index 4deb890146..94eeb12c97 100755 --- a/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data @@ -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`" From cc6c1da7a0a5e836fe76f0926e67aefefbc8cd89 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Aug 2015 19:28:52 +0200 Subject: [PATCH 10/28] sysmocom-backup-data: Store the machine-id and ssh host key --- recipes-apps/sysmocom-backup-data/files/default.files | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-apps/sysmocom-backup-data/files/default.files b/recipes-apps/sysmocom-backup-data/files/default.files index fb4d363d10..8f24cb3d4d 100644 --- a/recipes-apps/sysmocom-backup-data/files/default.files +++ b/recipes-apps/sysmocom-backup-data/files/default.files @@ -18,3 +18,5 @@ var/lib/osmocom/hlr.sqlite3 etc/lcr etc/udhcpd.conf etc/sysmocom/backup.d +etc/machine-id +etc/dropbear/dropbear_rsa_host_key From 72f1df181d9f4886f12cbf4d749b5caea9417a26 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Aug 2015 19:46:02 +0200 Subject: [PATCH 11/28] image-rauc-ubi: Make some more space for the data partition By using initramfs for the rescue we occupy 8mb + ~3mb for the kernel and can reduce the size of that slot. With glibc it is difficult to reduce this even further. Let's see if a uclibc build can help us --- recipes-core/images/image-rauc-ubi.bb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes-core/images/image-rauc-ubi.bb b/recipes-core/images/image-rauc-ubi.bb index 56514fce8d..c71c813efe 100644 --- a/recipes-core/images/image-rauc-ubi.bb +++ b/recipes-core/images/image-rauc-ubi.bb @@ -40,25 +40,25 @@ do_deploy() { 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_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=32MiB >> 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=32MiB >> 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=4MiB >> 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 From 3c84414af48eb59b574411e729521f410c184207 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 8 Aug 2015 13:35:11 +0200 Subject: [PATCH 12/28] image-rauc-ubi: Attempt to fix when building from sstate-cache These are set by image.bbclass and they appear to resolve the issue of the exception during SetScene. --- recipes-core/images/image-rauc-ubi.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-core/images/image-rauc-ubi.bb b/recipes-core/images/image-rauc-ubi.bb index c71c813efe..3410fc6bf1 100644 --- a/recipes-core/images/image-rauc-ubi.bb +++ b/recipes-core/images/image-rauc-ubi.bb @@ -8,12 +8,14 @@ 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" From 73d48c807e4a9ec5f831369a0b5a5cdcdfa259c0 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 8 Aug 2015 13:45:54 +0200 Subject: [PATCH 13/28] image-rauc-rescue-initramfs: Do not install kbd packages None of our systems have a graphical console. We do not need to install packages that load keymaps, change console fonts and the console fonts. --- recipes-core/images/image-rauc-rescue-initramfs.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-core/images/image-rauc-rescue-initramfs.bb b/recipes-core/images/image-rauc-rescue-initramfs.bb index 2a14739279..f1ca7b8462 100644 --- a/recipes-core/images/image-rauc-rescue-initramfs.bb +++ b/recipes-core/images/image-rauc-rescue-initramfs.bb @@ -13,7 +13,7 @@ XZ_INTEGRITY_CHECK = "crc32" IMAGE_FSTYPES = "cpio.xz" -BAD_RECOMMENDATIONS_append = " busybox-syslog" +BAD_RECOMMENDATIONS_append = " busybox-syslog kbd kbd-consolefonts kbd-keymaps" BAD_RECOMMENDATIONS_append_sysmobts-v2 = " e2fsprogs-e2fsck" BAD_RECOMMENDATIONS_append_sysmocom-odu = " e2fsprogs-e2fsck" From c0d9e409d9b9a538154414be910194114635ffc3 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 8 Aug 2015 13:46:55 +0200 Subject: [PATCH 14/28] rauc-native: Fix the building of the rauc-native tool Drop system.conf from the SRC_URI and link the right (current test certificates) to be used. --- recipes-extra/rauc/rauc-native.bb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/recipes-extra/rauc/rauc-native.bb b/recipes-extra/rauc/rauc-native.bb index d2fc86d7dd..b93d89ee29 100644 --- a/recipes-extra/rauc/rauc-native.bb +++ b/recipes-extra/rauc/rauc-native.bb @@ -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 From d1a9e0efbced7494428ea55cab4a603b125bc485 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 14:02:50 +0200 Subject: [PATCH 15/28] sysmocom-backup-data: Fix the restore service When the normal backup script is not installed the issue became unnoticable. Use the new/right name for the backup script. --- .../sysmocom-backup-data/files/sysmocom-restore.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service index 0c027a5b03..e4970e439e 100644 --- a/recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service @@ -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 From 09dbe7bd33772796a82c4c7260462ddf8fc26a69 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 14:46:29 +0200 Subject: [PATCH 16/28] sysmocom-backup-data: Restore all files that were saved The backup system allows to define which other files to store so we should just restore everything regardless of where the file is coming from. --- recipes-apps/sysmocom-backup-data/files/sysmocom-restore-data | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-restore-data b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore-data index 08dafe8ae3..e1c4a270fc 100755 --- a/recipes-apps/sysmocom-backup-data/files/sysmocom-restore-data +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore-data @@ -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 From 79545ec6cdf60db2eae1d1cf8ce5708a8ecb18be Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 14:47:35 +0200 Subject: [PATCH 17/28] sysmoocom-backup-data: Optimize taking a backup With the ro image we have a cheap way to figure out which files were changed. We can run cmp between the to be backed up file. This way the stored data will be minimal in the sense of changed files. --- .../files/sysmocom-backup-data | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data b/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data index 94eeb12c97..d78e45814f 100755 --- a/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-backup-data @@ -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" } From a01eff93663a878bdc0552daf0b2532f677d53a5 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 14:51:55 +0200 Subject: [PATCH 18/28] image-rauc-slot-initramfs: Diet and don't install udev We don't need udev in the slot ramfs. We do have the devtmpfs and don't need to apply any kind of rename --- recipes-core/images/image-rauc-slot-initramfs.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-core/images/image-rauc-slot-initramfs.bb b/recipes-core/images/image-rauc-slot-initramfs.bb index a6f3a91377..3c9c98a51a 100644 --- a/recipes-core/images/image-rauc-slot-initramfs.bb +++ b/recipes-core/images/image-rauc-slot-initramfs.bb @@ -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 = "" From e900822de2c24d356a944e9b4b252bc0b3679851 Mon Sep 17 00:00:00 2001 From: Henning Heinold Date: Fri, 7 Aug 2015 17:16:18 +0200 Subject: [PATCH 19/28] init-ifupdown: move sysmocom-idu to meta-sysmocom Fixes: SYS#1936 --- .../sysmocom-idu/interfaces | 136 ------------------ .../init-ifupdown/sysmocom-idu/interfaces | 136 ------------------ 2 files changed, 272 deletions(-) delete mode 100644 recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces delete mode 100644 recipes-bsp/init-ifupdown/init-ifupdown/sysmocom-idu/interfaces diff --git a/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces deleted file mode 100644 index bddcaaa267..0000000000 --- a/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces +++ /dev/null @@ -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 diff --git a/recipes-bsp/init-ifupdown/init-ifupdown/sysmocom-idu/interfaces b/recipes-bsp/init-ifupdown/init-ifupdown/sysmocom-idu/interfaces deleted file mode 100644 index bddcaaa267..0000000000 --- a/recipes-bsp/init-ifupdown/init-ifupdown/sysmocom-idu/interfaces +++ /dev/null @@ -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 From ac63f16b9b552b173151af0369802cc7f974613c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 15:46:47 +0200 Subject: [PATCH 20/28] sysmocom-odu/sysmocom-idu: Use the default tunes we actually use On our build setup we are using these default tune levels, so we should apply them everywhere. --- conf/machine/sysmocom-idu.conf | 3 ++- conf/machine/sysmocom-odu.conf | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/machine/sysmocom-idu.conf b/conf/machine/sysmocom-idu.conf index 83bd105c92..67d4bf5243 100644 --- a/conf/machine/sysmocom-idu.conf +++ b/conf/machine/sysmocom-idu.conf @@ -16,7 +16,8 @@ MACHINE_FEATURES += "kernel26 x86 usbhost pci acpi" KERNEL_IMAGETYPE = "bzImage" -IMAGE_FSTYPES = "tar.gz ext4" +IMAGE_FSTYPES = "ext4" +DEFAULTTUNE="core2" SERIAL_CONSOLE = "115200 ttyS0" MACHINE_CONSOLE = "console=ttyS0,115200n8" diff --git a/conf/machine/sysmocom-odu.conf b/conf/machine/sysmocom-odu.conf index 529b6e3b70..f24cea7c91 100644 --- a/conf/machine/sysmocom-odu.conf +++ b/conf/machine/sysmocom-odu.conf @@ -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" From a11c332fbb2964a0fbf9d1a700640e937ca456cd Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 15:48:04 +0200 Subject: [PATCH 21/28] sysmocom-defaults: Add some defaults that make sense to be used While copying one build to a new directory we inherit most of the config but it is better to collect this in a single place so external contributors build with the same options we use. --- conf/distro/include/sysmocom-defaults.conf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 conf/distro/include/sysmocom-defaults.conf diff --git a/conf/distro/include/sysmocom-defaults.conf b/conf/distro/include/sysmocom-defaults.conf new file mode 100644 index 0000000000..90f50ca9b6 --- /dev/null +++ b/conf/distro/include/sysmocom-defaults.conf @@ -0,0 +1,22 @@ +# 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" From 6159c85e74c2cbc04bf537fa41ea1f58e871883a Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 15:50:13 +0200 Subject: [PATCH 22/28] sysmocom-defaults: Be a bit more aggressive for the size E.g. when using musl and trying to build the smallest possible rootfs. Existing builds should not start to use these flags as they would be likely to force a big rebuild. --- conf/distro/include/sysmocom-defaults.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/conf/distro/include/sysmocom-defaults.conf b/conf/distro/include/sysmocom-defaults.conf index 90f50ca9b6..37140106a2 100644 --- a/conf/distro/include/sysmocom-defaults.conf +++ b/conf/distro/include/sysmocom-defaults.conf @@ -20,3 +20,18 @@ 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" From e6712d10dfda3abf3c26c4bc41bb1e0ba9548da0 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 11 Aug 2015 08:14:34 +0200 Subject: [PATCH 23/28] sysmocom-idu: Pick the right tune level Depending on the upstream version (dora or not) we need to use either core2 or core2-32. Use a python block expression to pick this depending on the distro version. --- conf/machine/sysmocom-idu.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/machine/sysmocom-idu.conf b/conf/machine/sysmocom-idu.conf index 67d4bf5243..bfa22678d3 100644 --- a/conf/machine/sysmocom-idu.conf +++ b/conf/machine/sysmocom-idu.conf @@ -17,7 +17,9 @@ MACHINE_FEATURES += "kernel26 x86 usbhost pci acpi" KERNEL_IMAGETYPE = "bzImage" IMAGE_FSTYPES = "ext4" -DEFAULTTUNE="core2" + +# After dora core2 got renamed to core2-32 +DEFAULTTUNE="${@['core2-32','core2'][d.getVar('DISTRO_VERSION', True)[0:3] == '1.5']}" SERIAL_CONSOLE = "115200 ttyS0" MACHINE_CONSOLE = "console=ttyS0,115200n8" From fdc0560b63701f7ab2b707a353c8d7bdfba617e3 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 16:26:40 +0200 Subject: [PATCH 24/28] rauc: Create default files for a rauc slot to be used by the image Create a sysmocom-nitb-rauc-image and create a rauc packagegroup with the default depdencies and an include file to be used by other images. This assumes that sysmocom-image.inc has been included first. --- .../images/sysmocom-nitb-rauc-image.bb | 2 ++ recipes-apps/images/sysmocom-rauc-slot.inc | 5 +++++ .../packagegroups/packagegroup-rauc-slot.bb | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 recipes-apps/images/sysmocom-nitb-rauc-image.bb create mode 100644 recipes-apps/images/sysmocom-rauc-slot.inc create mode 100644 recipes-core/packagegroups/packagegroup-rauc-slot.bb diff --git a/recipes-apps/images/sysmocom-nitb-rauc-image.bb b/recipes-apps/images/sysmocom-nitb-rauc-image.bb new file mode 100644 index 0000000000..ac99dd96b6 --- /dev/null +++ b/recipes-apps/images/sysmocom-nitb-rauc-image.bb @@ -0,0 +1,2 @@ +require sysmocom-nitb-image.bb +require sysmocom-rauc-slot.inc diff --git a/recipes-apps/images/sysmocom-rauc-slot.inc b/recipes-apps/images/sysmocom-rauc-slot.inc new file mode 100644 index 0000000000..889842aa4e --- /dev/null +++ b/recipes-apps/images/sysmocom-rauc-slot.inc @@ -0,0 +1,5 @@ +IMAGE_INSTALL_append = " packagegroup-rauc-slot " + +# force it to a squashfs +IMAGE_FSTYPES = "squashfs" + diff --git a/recipes-core/packagegroups/packagegroup-rauc-slot.bb b/recipes-core/packagegroups/packagegroup-rauc-slot.bb new file mode 100644 index 0000000000..84d75eb391 --- /dev/null +++ b/recipes-core/packagegroups/packagegroup-rauc-slot.bb @@ -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 \ +" + From fa5e7b12e5a8ae4c1b246f25f84d009b34afc857 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 11 Aug 2015 13:44:03 +0200 Subject: [PATCH 25/28] sysmocom-idu: Fix the core2 vs. core2-32 tune selection The distro is included after the machine so we can not rely on the DISTRO_VERSION here. Use the AVAILTUNES and see if the core2-32 is listed and then pick it. --- conf/machine/sysmocom-idu.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/machine/sysmocom-idu.conf b/conf/machine/sysmocom-idu.conf index bfa22678d3..72628ac525 100644 --- a/conf/machine/sysmocom-idu.conf +++ b/conf/machine/sysmocom-idu.conf @@ -19,7 +19,8 @@ KERNEL_IMAGETYPE = "bzImage" IMAGE_FSTYPES = "ext4" # After dora core2 got renamed to core2-32 -DEFAULTTUNE="${@['core2-32','core2'][d.getVar('DISTRO_VERSION', True)[0:3] == '1.5']}" +# 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" From 2a2a0cf49903abc4a34029da986e23ea36f2e2d0 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 10 Aug 2015 16:25:35 +0200 Subject: [PATCH 26/28] sysmocom-backup: Create a single sysmocom-backup-default We can not have sysmocom-backup-default and sysmocom-backup-data-default installed at the same time. I don't want to play games with RREPLACE and RPROVIDES either. So simply use one of the two files. Copy the two more default values over to the other recipe. --- .../sysmocom-backup-data/files/default.files | 22 ------------------- .../sysmocom-backup-data_1.0.bb | 8 ------- .../sysmocom-backup/files/default.files | 2 ++ 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 recipes-apps/sysmocom-backup-data/files/default.files diff --git a/recipes-apps/sysmocom-backup-data/files/default.files b/recipes-apps/sysmocom-backup-data/files/default.files deleted file mode 100644 index 8f24cb3d4d..0000000000 --- a/recipes-apps/sysmocom-backup-data/files/default.files +++ /dev/null @@ -1,22 +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 -etc/machine-id -etc/dropbear/dropbear_rsa_host_key diff --git a/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb b/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb index f61006b587..425c411cf0 100644 --- a/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb +++ b/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb @@ -8,7 +8,6 @@ SRC_URI = " \ file://sysmocom-restore-data \ file://data.mount \ file://sysmocom-restore.service \ - file://default.files \ " RDEPENDS_${PN} = "tar" RCONFLICTS_${PN} = "symocom-backup" @@ -20,18 +19,11 @@ do_install() { install -m 0755 ${WORKDIR}/sysmocom-backup-data ${D}${sbindir}/ install -m 0755 ${WORKDIR}/sysmocom-restore-data ${D}${sbindir}/ - install -d ${D}${sysconfdir}/sysmocom/backup.d - install -m 0644 ${WORKDIR}/default.files ${D}${sysconfdir}/sysmocom/backup.d/ - 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" diff --git a/recipes-apps/sysmocom-backup/files/default.files b/recipes-apps/sysmocom-backup/files/default.files index fb4d363d10..8f24cb3d4d 100644 --- a/recipes-apps/sysmocom-backup/files/default.files +++ b/recipes-apps/sysmocom-backup/files/default.files @@ -18,3 +18,5 @@ var/lib/osmocom/hlr.sqlite3 etc/lcr etc/udhcpd.conf etc/sysmocom/backup.d +etc/machine-id +etc/dropbear/dropbear_rsa_host_key From d777b0ecd09c05978450c19cd29a3da6e44988e5 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 11 Aug 2015 14:08:59 +0200 Subject: [PATCH 27/28] sysmocom-backup: Store the UUCP data as well Store UUCP configuration in the backup as well. --- recipes-apps/sysmocom-backup/files/default.files | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-apps/sysmocom-backup/files/default.files b/recipes-apps/sysmocom-backup/files/default.files index 8f24cb3d4d..e146b0c026 100644 --- a/recipes-apps/sysmocom-backup/files/default.files +++ b/recipes-apps/sysmocom-backup/files/default.files @@ -20,3 +20,4 @@ etc/udhcpd.conf etc/sysmocom/backup.d etc/machine-id etc/dropbear/dropbear_rsa_host_key +etc/uucp From 10e1b544716747d178e6efa9e798f4141a179f9d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 12 Aug 2015 07:45:19 +0200 Subject: [PATCH 28/28] osmo-pcu: Upgrade to the latest code in jerlbeck/master This is using codel as a form of congestion algorithm to drop packages early before the queue getting too long. --- recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb b/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb index 4420052e26..b3e59ce2e3 100644 --- a/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb +++ b/recipes-sysmobts/osmo-pcu/osmo-pcu_git.bb @@ -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"