From a2bb468480672fd360998e3315b34327d2233987 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 29 Jun 2015 07:57:13 +0200 Subject: [PATCH 01/12] osmo-bts: Fix the branch name in the hope to fix the build --- recipes-sysmobts/osmo-bts/osmo-bts_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb index c25a9c95b6..6c38c6dfdd 100644 --- a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb +++ b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb @@ -2,7 +2,7 @@ DESCRIPTION = "sysmocom OsmoBTS" LICENSE = "AGPLv3" LIC_FILES_CHKSUM="file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" -SRC_URI = "git://git.osmocom.org/osmo-bts.git;protocol=git;branch=zecke/sysmobts-calibration;name=osmobts;destsuffix=git \ +SRC_URI = "git://git.osmocom.org/osmo-bts.git;protocol=git;branch=master;name=osmobts;destsuffix=git \ git://git.osmocom.org/openbsc;protocol=git;branch=master;name=openbsc;destsuffix=openbsc" SRCREV_osmobts = "f869a95f3b81d281405e3fc3026e1d0d53174082" SRCREV_openbsc = "57ee78078905c7499bd4e6857f8981d22badfcac" From 89e0c53ba8abdec7b4f303040041455f6834204f Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 30 Jun 2015 22:04:23 +0200 Subject: [PATCH 02/12] osmo-bts: Bump the PR to force a re-fetch of the source --- recipes-sysmobts/osmo-bts/osmo-bts_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb index 6c38c6dfdd..e5a6659639 100644 --- a/recipes-sysmobts/osmo-bts/osmo-bts_git.bb +++ b/recipes-sysmobts/osmo-bts/osmo-bts_git.bb @@ -7,7 +7,7 @@ SRC_URI = "git://git.osmocom.org/osmo-bts.git;protocol=git;branch=master;name=os SRCREV_osmobts = "f869a95f3b81d281405e3fc3026e1d0d53174082" SRCREV_openbsc = "57ee78078905c7499bd4e6857f8981d22badfcac" PV = "0.4.3+git${SRCPV}" -PR = "r17.${META_TELEPHONY_OSMO_INC}" +PR = "r18.${META_TELEPHONY_OSMO_INC}" S = "${WORKDIR}/git" SRCREV_FORMAT = "openbsc-rosmobts" From 6826004831334f1a37c036c14354047ce5fdcdae Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 2 Jul 2015 22:02:19 +0200 Subject: [PATCH 03/12] osmo-pcu: Upgrade PCU and fix the branch name --- 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 6fd7a69fa7..8205a8d365 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=master" -SRCREV = "67728acc7a90dbf076eb179d6e3e119a4197896a" +SRC_URI = "git://git.osmocom.org/osmo-pcu.git;protocol=git;branch=jerlbeck/wip/pdch-alloc" +SRCREV = "410d98e5d0c0eae76221a2d62a837b962f082506" PV = "0.4+git${SRCPV}" PR = "r2.${META_TELEPHONY_OSMO_INC}" S = "${WORKDIR}/git" From 20d03de6b2bc89f7a977c3b4b5abdbd21a2dcdc3 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 26 Jun 2015 10:44:11 +0200 Subject: [PATCH 04/12] rauc: build without background service The allows us to drop the RDEPENDS on dbus. --- recipes-extra/rauc/files/rauc.service | 12 ------------ recipes-extra/rauc/rauc.bb | 11 ++++------- 2 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 recipes-extra/rauc/files/rauc.service diff --git a/recipes-extra/rauc/files/rauc.service b/recipes-extra/rauc/files/rauc.service deleted file mode 100644 index 7e873ee4fb..0000000000 --- a/recipes-extra/rauc/files/rauc.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Rauc Update Service - -[Service] -Type=dbus -BusName=de.pengutronix.rauc -#User=root -ExecStart=@BINDIR@/rauc service - -[Install] -WantedBy=multi-user.target - diff --git a/recipes-extra/rauc/rauc.bb b/recipes-extra/rauc/rauc.bb index fbd2ea346b..8b5886589c 100644 --- a/recipes-extra/rauc/rauc.bb +++ b/recipes-extra/rauc/rauc.bb @@ -6,7 +6,6 @@ PR = "r4" SRC_URI = "git://github.com/jluebbe/rauc.git;protocol=https \ file://dev-ca.pem \ file://system.conf \ - file://rauc.service \ file://rauc-done.service \ file://rauc-ubi.rules \ file://system.conf " @@ -14,23 +13,22 @@ PV = "0+git${SRCPV}" S = "${WORKDIR}/git" -SRCREV = "7904e2e9d17fe0319bc46912e3531cf1b5ed4533" +SRCREV = "cb56cb46412cd25088635394043c9ff8a29c8df5" DEPENDS = "curl openssl glib-2.0" -RDEPENDS_${PN} += "dbus" # rauc is invoking these depending the machine RDEPENDS_${PN}_append_sysmobts-v2 = " barebox-state" RDEPENDS_${PN}_append_sysmocom-odu = " barebox-state" RDEPENDS_${PN}_append_sysmocom-bsc = " grub" -EXTRA_OECONF += " ac_cv_prog_MKSQUASHFS=mksquashfs" - FILES_${PN} += "/mnt/rauc" FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules" inherit autotools pkgconfig gettext systemd +EXTRA_OECONF = "--disable-service" + do_install_append () { # Create rauc config dir mkdir -p ${D}${sysconfdir}/rauc @@ -54,7 +52,6 @@ do_install_append () { # Systemd service install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/rauc.service ${D}${systemd_unitdir}/system/ install -m 0644 ${WORKDIR}/rauc-done.service ${D}${systemd_unitdir}/system/ sed -i -e 's!@BINDIR@!${bindir}!g' ${D}${systemd_unitdir}/system/*.service @@ -64,6 +61,6 @@ do_install_append () { } SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE_${PN} = "rauc.service rauc-done.service" +SYSTEMD_SERVICE_${PN} = "rauc-done.service" SYSTEMD_AUTO_ENABLE_${PN} = "enable" From 5b5741f31476b7d2457a79efeb35dbf602a37d30 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 26 Jun 2015 10:58:12 +0200 Subject: [PATCH 05/12] sysmocom-backup-data: add alternative package for overlay based systems When using squashfs + overlayfs a root, we need to store the backup somewhere else and restore it on every boot. Do avoid breaking existing users, this is implemented in a separate recipe (as suggested by Holger). --- .../sysmocom-backup-data/files/default.files | 20 +++++++ .../files/sysmobts-v2/data.mount | 7 +++ .../files/sysmocom-backup | 56 +++++++++++++++++++ .../files/sysmocom-bsc/data.mount | 7 +++ .../files/sysmocom-odu/data.mount | 7 +++ .../files/sysmocom-restore | 26 +++++++++ .../files/sysmocom-restore.service | 12 ++++ .../sysmocom-backup-data_1.0.bb | 37 ++++++++++++ 8 files changed, 172 insertions(+) create mode 100644 recipes-apps/sysmocom-backup-data/files/default.files create mode 100644 recipes-apps/sysmocom-backup-data/files/sysmobts-v2/data.mount create mode 100755 recipes-apps/sysmocom-backup-data/files/sysmocom-backup create mode 100644 recipes-apps/sysmocom-backup-data/files/sysmocom-bsc/data.mount create mode 100644 recipes-apps/sysmocom-backup-data/files/sysmocom-odu/data.mount create mode 100755 recipes-apps/sysmocom-backup-data/files/sysmocom-restore create mode 100644 recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service create mode 100644 recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb diff --git a/recipes-apps/sysmocom-backup-data/files/default.files b/recipes-apps/sysmocom-backup-data/files/default.files new file mode 100644 index 0000000000..fb4d363d10 --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/files/default.files @@ -0,0 +1,20 @@ +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 diff --git a/recipes-apps/sysmocom-backup-data/files/sysmobts-v2/data.mount b/recipes-apps/sysmocom-backup-data/files/sysmobts-v2/data.mount new file mode 100644 index 0000000000..f07f6b0ce2 --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/files/sysmobts-v2/data.mount @@ -0,0 +1,7 @@ +[Unit] +Description=/data + +[Mount] +What=ubi0:data +Where=/data +Type=ubifs diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-backup b/recipes-apps/sysmocom-backup-data/files/sysmocom-backup new file mode 100755 index 0000000000..4deb890146 --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-backup @@ -0,0 +1,56 @@ +#!/bin/sh + + +# Make sure to look at sysmocom-restore to check if the file would +# be restored right. Currently only some dirs get restored. +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`; + do + echo "Add extras from $extra." + FILES="$FILES `cat $extra`" + done +fi + +DATE=`date +%Y%m%d` + + +do_backup_files() { + BACKUP_FILE="/data/sysmocom-backup_$DATE.tar" + + # 0. Sanity checking + if [ -e $BACKUP_FILE ]; then + echo "The backup file '$BACKUP_FILE' already exists. Exiting!" + exit 1 + fi + + # 1. Create an empty archive.. + tar -cf $BACKUP_FILE --files-from=/dev/null + + # 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 + done + + # 3. Generate more information + NAME="/tmp/backup.$RANDOM" + mkdir $NAME + opkg list_installed > $NAME/installed_packages + /sbin/ifconfig | grep HWaddr | cut -d ' ' -f 11 > $NAME/mac_addr + + # 4. Add the more information + tar -rf $BACKUP_FILE --transform='s,^,info/,' -C $NAME installed_packages mac_addr + + # 5. Create stable link + ln -sf $BACKUP_FILE /data/sysmocom-backup.tar + + # 6. + echo "The backup was stored to $BACKUP_FILE" +} + +do_backup_files diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-bsc/data.mount b/recipes-apps/sysmocom-backup-data/files/sysmocom-bsc/data.mount new file mode 100644 index 0000000000..2a37a5797b --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-bsc/data.mount @@ -0,0 +1,7 @@ +[Unit] +Description=/data + +[Mount] +What=/dev/sda4 +Where=/data +Type=ext4 diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-odu/data.mount b/recipes-apps/sysmocom-backup-data/files/sysmocom-odu/data.mount new file mode 100644 index 0000000000..f07f6b0ce2 --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-odu/data.mount @@ -0,0 +1,7 @@ +[Unit] +Description=/data + +[Mount] +What=ubi0:data +Where=/data +Type=ubifs diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-restore b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore new file mode 100755 index 0000000000..08dafe8ae3 --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore @@ -0,0 +1,26 @@ +#!/bin/sh + +do_extract() { + # List the files and check if grep hits something + SEARCH=`tar -tvf $1 | grep $2` + RES=$? + if [ $RES = 0 ]; then + tar --transform='s,^content/,,' -C / -xvf $1 $2 + else + echo "Directory '$2' is not in backup '$1'." + fi +} + +do_restore_files() { + BACKUP_FILE=$1 + if [ ! -e "$BACKUP_FILE" ] ; then + echo "The backup file '$BACKUP_FILE' does not exist. Exiting!" + exit 1 + 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_restore_files $1 diff --git a/recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service new file mode 100644 index 0000000000..0c027a5b03 --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/files/sysmocom-restore.service @@ -0,0 +1,12 @@ +[Unit] +Description=Restore Configuration Backup +Requires=data.mount +After=data.mount + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=/usr/sbin/sysmocom-restore /data/sysmocom-backup.tar + +[Install] +WantedBy=multi-user.target 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 new file mode 100644 index 0000000000..07320f570f --- /dev/null +++ b/recipes-apps/sysmocom-backup-data/sysmocom-backup-data_1.0.bb @@ -0,0 +1,37 @@ +DESCRIPTION = "sysmocom config backup and restore scripts" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +PR = "r12" + +SRC_URI = " \ + file://sysmocom-backup \ + file://sysmocom-restore \ + file://data.mount \ + file://sysmocom-restore.service \ + file://default.files \ +" +RDEPENDS_${PN} = "tar" +RCONFLICTS_${PN} = "symocom-backup" + +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 -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" From 2b3373ce53e1eeef46e2107c3b4c2e011d7afb92 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 26 Jun 2015 18:38:35 +0200 Subject: [PATCH 06/12] rauc: update to newer version The new version fixes compatibility checking. --- recipes-extra/rauc/rauc.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-extra/rauc/rauc.bb b/recipes-extra/rauc/rauc.bb index 8b5886589c..29e54f6372 100644 --- a/recipes-extra/rauc/rauc.bb +++ b/recipes-extra/rauc/rauc.bb @@ -13,7 +13,7 @@ PV = "0+git${SRCPV}" S = "${WORKDIR}/git" -SRCREV = "cb56cb46412cd25088635394043c9ff8a29c8df5" +SRCREV = "1a4fd3c9f3806e64039c9cf60c182cddf116ae1f" DEPENDS = "curl openssl glib-2.0" From 3c38bd3c2f9b74ba97a4c0b9b85e16d9396bd13b Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Tue, 30 Jun 2015 18:59:26 +0200 Subject: [PATCH 07/12] barebox: enable password support for sysmobts and sysmocom-odu This uses a new git revision to use a required fix. --- .../barebox/barebox-sysmobts/defconfig | 25 +++++++++++++------ recipes-bsp/barebox/barebox-sysmobts_git.bb | 10 +++++++- .../barebox/barebox-sysmocom-odu-mlo_git.bb | 2 +- .../barebox/barebox-sysmocom-odu/defconfig | 17 ++++++------- .../barebox/barebox-sysmocom-odu_git.bb | 10 +++++++- recipes-bsp/barebox/barebox.inc | 7 ++++++ 6 files changed, 50 insertions(+), 21 deletions(-) diff --git a/recipes-bsp/barebox/barebox-sysmobts/defconfig b/recipes-bsp/barebox/barebox-sysmobts/defconfig index 4e27290924..f38af9a8eb 100644 --- a/recipes-bsp/barebox/barebox-sysmobts/defconfig +++ b/recipes-bsp/barebox/barebox-sysmobts/defconfig @@ -126,7 +126,13 @@ CONFIG_HUSH_FANCY_PROMPT=y CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y # CONFIG_MENU is not set -# CONFIG_PASSWORD is not set +CONFIG_PASSWORD=y +CONFIG_PASSWORD_DEFAULT="" +# CONFIG_PASSWD_SUM_MD5 is not set +CONFIG_PASSWD_SUM_SHA1=y +# CONFIG_PASSWD_SUM_SHA256 is not set +# CONFIG_PASSWD_SUM_SHA512 is not set +# CONFIG_PASSWD_CRYPTO_PBKDF2 is not set CONFIG_DYNAMIC_CRC_TABLE=y CONFIG_ERRNO_MESSAGES=y CONFIG_TIMESTAMP=y @@ -251,7 +257,7 @@ CONFIG_CMD_RM=y CONFIG_CMD_RMDIR=y # CONFIG_CMD_SHA1SUM is not set # CONFIG_CMD_SHA224SUM is not set -CONFIG_CMD_SHA256SUM=y +# CONFIG_CMD_SHA256SUM is not set # CONFIG_CMD_SHA384SUM is not set # CONFIG_CMD_SHA512SUM is not set # CONFIG_CMD_UNCOMPRESS is not set @@ -285,7 +291,11 @@ CONFIG_CMD_CLEAR=y CONFIG_CMD_ECHO=y CONFIG_CMD_ECHO_E=y CONFIG_CMD_EDIT=y -# CONFIG_CMD_LOGIN is not set +CONFIG_CMD_LOGIN=y +CONFIG_CMD_PASSWD=y +# CONFIG_PASSWD_MODE_HIDE is not set +CONFIG_PASSWD_MODE_STAR=y +# CONFIG_PASSWD_MODE_CLEAR is not set # CONFIG_CMD_SPLASH is not set CONFIG_CMD_READLINE=y CONFIG_CMD_TIMEOUT=y @@ -551,14 +561,13 @@ CONFIG_LIBMTD=y # CONFIG_CRC32=y CONFIG_DIGEST=y -CONFIG_SHA224=y -CONFIG_SHA256=y +CONFIG_SHA1=y # CONFIG_DIGEST_MD5_GENERIC is not set -# CONFIG_DIGEST_SHA1_GENERIC is not set +CONFIG_DIGEST_SHA1_GENERIC=y # CONFIG_DIGEST_SHA224_GENERIC is not set -CONFIG_DIGEST_SHA256_GENERIC=y +# CONFIG_DIGEST_SHA256_GENERIC is not set # CONFIG_DIGEST_SHA384_GENERIC is not set # CONFIG_DIGEST_SHA512_GENERIC is not set # CONFIG_DIGEST_HMAC_GENERIC is not set # CONFIG_DIGEST_SHA1_ARM is not set -CONFIG_DIGEST_SHA256_ARM=y +# CONFIG_DIGEST_SHA256_ARM is not set diff --git a/recipes-bsp/barebox/barebox-sysmobts_git.bb b/recipes-bsp/barebox/barebox-sysmobts_git.bb index 3a44d54172..e5c599a180 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 = "05d4d07f387fbcbfd5c719792ccfeb3e4aef5a2a" +SRCREV = "9f78d1b7a7c31a8c67423ab8ac9839f4ba2f5df7" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ @@ -14,6 +14,14 @@ BAREBOX_ELF_SYMLINK ?= "barebox-${MACHINE}.elf" BAREBOX_BIN_IMAGE ?= "barebox-${MACHINE}-${PKGV}-${PKGR}.bin" BAREBOX_BIN_SYMLINK ?= "barebox-${MACHINE}.bin" +# generated using echo -n 'bts-stop' | sha1sum +BAREBOX_PASSWORD = "5a7ef8875df28cb95a0f833906f94df8573bcc5d" + +do_configure_append () { + mkdir -p ${WORKDIR}/env/nv + echo 5 > ${WORKDIR}/env/nv/login.timeout +} + do_deploy_append () { install -d ${DEPLOYDIR} install ${S}/arch/arm/pbl/zbarebox ${DEPLOYDIR}/${BAREBOX_ELF_IMAGE} diff --git a/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb b/recipes-bsp/barebox/barebox-sysmocom-odu-mlo_git.bb index bf457cc4dc..280110f5ec 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 = "05d4d07f387fbcbfd5c719792ccfeb3e4aef5a2a" +SRCREV = "9f78d1b7a7c31a8c67423ab8ac9839f4ba2f5df7" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ diff --git a/recipes-bsp/barebox/barebox-sysmocom-odu/defconfig b/recipes-bsp/barebox/barebox-sysmocom-odu/defconfig index 3f5f8f99fb..f93f0ed230 100644 --- a/recipes-bsp/barebox/barebox-sysmocom-odu/defconfig +++ b/recipes-bsp/barebox/barebox-sysmocom-odu/defconfig @@ -144,10 +144,10 @@ CONFIG_MENU=y CONFIG_PASSWORD=y CONFIG_PASSWORD_DEFAULT="" # CONFIG_PASSWD_SUM_MD5 is not set -# CONFIG_PASSWD_SUM_SHA1 is not set +CONFIG_PASSWD_SUM_SHA1=y # CONFIG_PASSWD_SUM_SHA256 is not set # CONFIG_PASSWD_SUM_SHA512 is not set -CONFIG_PASSWD_CRYPTO_PBKDF2=y +# CONFIG_PASSWD_CRYPTO_PBKDF2 is not set CONFIG_DYNAMIC_CRC_TABLE=y CONFIG_ERRNO_MESSAGES=y # CONFIG_TIMESTAMP is not set @@ -318,8 +318,8 @@ CONFIG_CMD_MENU=y # CONFIG_CMD_MENU_MANAGEMENT is not set CONFIG_CMD_MENUTREE=y CONFIG_CMD_PASSWD=y -CONFIG_PASSWD_MODE_HIDE=y -# CONFIG_PASSWD_MODE_STAR is not set +# CONFIG_PASSWD_MODE_HIDE is not set +CONFIG_PASSWD_MODE_STAR=y # CONFIG_PASSWD_MODE_CLEAR is not set # CONFIG_CMD_SPLASH is not set CONFIG_CMD_READLINE=y @@ -614,15 +614,12 @@ CONFIG_CRC16=y CONFIG_DIGEST=y CONFIG_MD5=y CONFIG_SHA1=y -CONFIG_SHA224=y -CONFIG_SHA256=y -CONFIG_DIGEST_MD5_GENERIC=y -# CONFIG_DIGEST_SHA1_GENERIC is not set +# CONFIG_DIGEST_MD5_GENERIC is not set +CONFIG_DIGEST_SHA1_GENERIC=y # CONFIG_DIGEST_SHA224_GENERIC is not set # CONFIG_DIGEST_SHA256_GENERIC is not set # CONFIG_DIGEST_SHA384_GENERIC is not set # CONFIG_DIGEST_SHA512_GENERIC is not set # CONFIG_DIGEST_HMAC_GENERIC is not set # CONFIG_DIGEST_SHA1_ARM is not set -CONFIG_DIGEST_SHA256_ARM=y -CONFIG_CRYPTO_PBKDF2=y +# CONFIG_DIGEST_SHA256_ARM is not set diff --git a/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb b/recipes-bsp/barebox/barebox-sysmocom-odu_git.bb index 07f24af16b..d23141528d 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 = "05d4d07f387fbcbfd5c719792ccfeb3e4aef5a2a" +SRCREV = "9f78d1b7a7c31a8c67423ab8ac9839f4ba2f5df7" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ @@ -14,6 +14,14 @@ S = "${WORKDIR}/git" BAREBOX_IMAGE ?= "barebox-${MACHINE}-${PKGV}-${PKGR}.img" BAREBOX_SYMLINK ?= "barebox-${MACHINE}.img" +# generated using echo -n 'odu-stop' | sha1sum +BAREBOX_PASSWORD = "45cd62a2c4b834d6f8077db04f024aec070801db" + +do_configure_append () { + mkdir -p ${WORKDIR}/env/nv + echo 5 > ${WORKDIR}/env/nv/login.timeout +} + do_deploy_append () { install -d ${DEPLOYDIR} install ${S}/images/barebox-am33xx-sysmocom-odu.img ${DEPLOYDIR}/${BAREBOX_IMAGE} diff --git a/recipes-bsp/barebox/barebox.inc b/recipes-bsp/barebox/barebox.inc index 4000e3036a..79b42852ed 100644 --- a/recipes-bsp/barebox/barebox.inc +++ b/recipes-bsp/barebox/barebox.inc @@ -20,6 +20,13 @@ do_configure_prepend() { echo CONFIG_BAREBOXCRC32_TARGET=n >> ${S}/.config echo CONFIG_KERNEL_INSTALL_TARGET=n >> ${S}/.config echo CONFIG_IMD_TARGET=n >> ${S}/.config + # password + if [ -n "${BAREBOX_PASSWORD}" ]; then + echo -n "${BAREBOX_PASSWORD}" > ${S}/.password + echo CONFIG_PASSWORD_DEFAULT=\".password\" >> ${S}/.config + fi + # extra environment files + sed -i -e 's,^\(CONFIG_DEFAULT_ENVIRONMENT_PATH=.*\)\"$,\1 ../env\",' ${S}/.config oe_runmake oldconfig } From e8097c044e8c2c51437c7a45d64f4a8ef5825f68 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Tue, 30 Jun 2015 19:12:09 +0200 Subject: [PATCH 08/12] rauc: update to newer version The new version fixes a possible free of an uninitialized pointer. --- recipes-extra/rauc/rauc.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-extra/rauc/rauc.bb b/recipes-extra/rauc/rauc.bb index 29e54f6372..c51a5eadb7 100644 --- a/recipes-extra/rauc/rauc.bb +++ b/recipes-extra/rauc/rauc.bb @@ -13,7 +13,7 @@ PV = "0+git${SRCPV}" S = "${WORKDIR}/git" -SRCREV = "1a4fd3c9f3806e64039c9cf60c182cddf116ae1f" +SRCREV = "d44adb00797d42efdd5f55064b0f3943906b081f" DEPENDS = "curl openssl glib-2.0" From 2cd82376d96ab1af60d88ac4bca248ff2acaaf2b Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 2 Jul 2015 11:42:30 +0200 Subject: [PATCH 09/12] initramfs-framework: make sure console messages are visible on reboot The serial console may take some time to send the messages, so sleep a moment before rebooting. --- recipes-core/initrdscripts/initramfs-framework/init | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-core/initrdscripts/initramfs-framework/init b/recipes-core/initrdscripts/initramfs-framework/init index fc129911b6..07530e3cb9 100755 --- a/recipes-core/initrdscripts/initramfs-framework/init +++ b/recipes-core/initrdscripts/initramfs-framework/init @@ -58,6 +58,7 @@ fatal() { echo >/dev/console msg "fatal error: rebooting" + sleep 3 reboot -f } From 385453cf22a90c1c945f316986b14a63e9149536 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 2 Jul 2015 11:43:47 +0200 Subject: [PATCH 10/12] initramfs-rauc-install: add installer for the sysmocom-idu The partition layout needed for rauc is different from the one created by the existing installer (based on the live image). An initramfs-framework module for installation to the sysmocom-idu is added. It is included in a corresponding initramfs image for use on an USB memory stick. --- .../images/image-rauc-install-initramfs.bb | 21 ++ .../initrdscripts/initramfs-rauc-install.bb | 29 +++ .../initramfs-rauc-install/install | 184 ++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 recipes-core/images/image-rauc-install-initramfs.bb create mode 100644 recipes-core/initrdscripts/initramfs-rauc-install.bb create mode 100644 recipes-core/initrdscripts/initramfs-rauc-install/install diff --git a/recipes-core/images/image-rauc-install-initramfs.bb b/recipes-core/images/image-rauc-install-initramfs.bb new file mode 100644 index 0000000000..aa1549d542 --- /dev/null +++ b/recipes-core/images/image-rauc-install-initramfs.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "install initramfs" + +PACKAGE_INSTALL = "initramfs-framework-base initramfs-module-debug initramfs-module-udev initramfs-module-rauc-install busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +#IMAGE_FEATURES = "" + +#export IMAGE_BASENAME = "core-image-minimal-initramfs" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "cpio.xz" +# COMPRESS_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.xz" +XZ_COMPRESSION_LEVEL = "-e -9 --lzma2=dict=512KiB" +XZ_THREADS = "-T 0" +XZ_INTEGRITY_CHECK = "crc32" + +inherit core-image + +BAD_RECOMMENDATIONS += "busybox-syslog" diff --git a/recipes-core/initrdscripts/initramfs-rauc-install.bb b/recipes-core/initrdscripts/initramfs-rauc-install.bb new file mode 100644 index 0000000000..e18eb978b1 --- /dev/null +++ b/recipes-core/initrdscripts/initramfs-rauc-install.bb @@ -0,0 +1,29 @@ +SUMMARY = "Modular initramfs system components for RAUC" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +PR = "r0" + +SRC_URI = "file://install" + +BOOTUSER = "${@d.getVar('BOOT_USER', True) or ""}" +BOOTPASSWD = "${@d.getVar('BOOT_PASSWD', True) or ""}" + +do_install() { + install -d ${D}/init.d + + if [ -n "${BOOTPASSWD}" ] && [ -n "${BOOTUSER}" ]; then + sed -i ${WORKDIR}/install \ + -e "s/^\(.*BOOTPASSWD=\).*$/\1${BOOTPASSWD}/g" \ + -e "s/^\(.*BOOTUSER=\).*$/\1${BOOTUSER}/g" + fi + + # install + install -m 0755 ${WORKDIR}/install ${D}/init.d/10-install +} + +PACKAGES = "initramfs-module-rauc-install" + +SUMMARY_initramfs-module-rauc-install = "initramfs installer support" +RDEPENDS_initramfs-module-rauc-install = "initramfs-framework-base grub parted e2fsprogs-mke2fs" +FILES_initramfs-module-rauc-install = "/init.d/10-install" diff --git a/recipes-core/initrdscripts/initramfs-rauc-install/install b/recipes-core/initrdscripts/initramfs-rauc-install/install new file mode 100644 index 0000000000..035f6a5d32 --- /dev/null +++ b/recipes-core/initrdscripts/initramfs-rauc-install/install @@ -0,0 +1,184 @@ +INSTALL_TGT=/dev/sda +INSTALL_SRC=/dev/disk/by-label/installer + +install_enabled() { + if [ -z "$bootparam_install" ]; then + return 1 + fi + return 0 +} + +install_probe_target() { + until [ -e $INSTALL_TGT ]; do + info "Waiting for target block device '$INSTALL_TGT' to appear ..." + sleep 5 + done + info "Found target block device 'sda'" + return 0 +} + +install_probe_source() { + until [ -e $INSTALL_SRC ]; do + info "Waiting for filesystem with label "installer" to appear ..." + sleep 5 + done + info "Found update filesystem: $INSTALL_SRC" + + mkdir -p /mnt/install || exit 1 + if ! mount -o ro $INSTALL_SRC /mnt/install; then + fatal "Unable to mount $INSTALL_SRC" + fi + return 0 +} + +install_confirm() { + info "Current partitions on $INSTALL_TGT:" + parted $INSTALL_TGT print || true + sleep 1 + until read -p "Enter 'INSTALL' to begin installation to /dev/sda: " RESULT && [ "$RESULT" = "INSTALL" ]; do + sleep 1 + done + return 0 +} + +install_partitions() { + info "Clearing beginning of $INSTALL_TGT" + dd if=/dev/zero bs=512 count=64 of=$INSTALL_TGT || exit 1 + info "Creating partitions on $INSTALL_TGT" + parted $INSTALL_TGT mklabel msdos || exit 1 + parted $INSTALL_TGT -- \ + mkpart primary 4MiB 512MiB \ + mkpart primary 512MiB 1536MiB \ + mkpart primary 1536MiB 2560MiB \ + mkpart primary 2560MiB 100% \ + print|| exit 1 + return 0 +} + +install_format() { + info "Creating filesystems on $INSTALL_TGT" + mkfs.ext4 ${INSTALL_TGT}1 || exit 1 + mkfs.ext4 ${INSTALL_TGT}2 || exit 1 + mkfs.ext4 ${INSTALL_TGT}3 || exit 1 + mkfs.ext4 ${INSTALL_TGT}4 || exit 1 + return 0 +} + +install_boot() { + mkdir -p /mnt/boot || exit 1 + if ! mount -o rw -t ext4 ${INSTALL_TGT}1 /mnt/boot; then + fatal "Unable to mount ${INSTALL_TGT}1" + fi + + info "Installing grub configuration to ${INSTALL_TGT}1" + mkdir /mnt/boot/grub || exit 1 + GRUBCFG=/mnt/boot/grub/grub.cfg + + cat > $GRUBCFG << EOF || exit 1 +default=0 +timeout=3 + +serial --unit=0 --speed=115200 + +terminal_input serial +terminal_output serial +EOF + + BOOTPASSWD= + BOOTUSER= + if [ -n "${BOOTPASSWD}" ] && [ -n "${BOOTUSER}" ]; then + cat >> $GRUBCFG << EOF || exit 1 +set superusers="$BOOTUSER" +password $BOOTUSER $BOOTPASSWD +EOF + fi + + if [ -n "${BOOTPASSWD}" ] && [ -n "${BOOTUSER}" ]; then + ENTRY_ARGS="--unrestricted " + fi + + CMDLINE="console=$bootparam_console net.ifnames=0 panic=60 ro quiet" + + cat >> $GRUBCFG << EOF +set ORDER="A B" +set A_OK=0 +set B_OK=0 +set A_TRY=0 +set B_TRY=0 +load_env + +# select bootable slot +for SLOT in \$ORDER; do + if [ "\$SLOT" == "A" ]; then + INDEX=1 + OK=\$A_OK + TRY=\$A_TRY + A_TRY=1 + fi + if [ "\$SLOT" == "B" ]; then + INDEX=2 + OK=\$B_OK + TRY=\$B_TRY + B_TRY=1 + fi + if [ "\$OK" -eq 1 -a "\$TRY" -eq 0 ]; then + default=\$INDEX + break + fi +done + +# reset booted flags +if [ "\$default" -eq 0 ]; then + if [ "\$A_OK" -eq 1 -a "\$A_TRY" -eq 1 ]; then + A_TRY=0 + fi + if [ "\$B_OK" -eq 1 -a "\$B_TRY" -eq 1 ]; then + B_TRY=0 + fi +fi + +save_env A_TRY B_TRY + +CMDLINE="$CMDLINE" + +menuentry "Rescue" $ENTRY_ARGS{ + linux (hd0,1)/kernel root=${INSTALL_TGT}1 \$CMDLINE rauc.slot=R + initrd (hd0,1)/initramfs +} + +menuentry "Slot A (OK=\$A_OK TRY=\$A_TRY)" ${ENTRY_ARGS}{ + linux (hd0,2)/kernel root=${INSTALL_TGT}2 \$CMDLINE rauc.slot=A + initrd (hd0,2)/initramfs +} + +menuentry "Slot B (OK=\$B_OK TRY=\$B_TRY)" ${ENTRY_ARGS}{ + linux (hd0,3)/kernel root=${INSTALL_TGT3} \$CMDLINE rauc.slot=B + initrd (hd0,3)/initramfs +} +EOF + chmod 0444 $GRUBCFG || exit 1 + + info "Installing grub bootloader to ${INSTALL_TGT}1" + grub-install --boot-directory=/mnt/boot ${INSTALL_TGT} || exit 1 + echo "(hd0) ${INSTALL_TGT}" > /mnt/boot/grub/device.map || exit 1 + + info "Installing 'kernel' to ${INSTALL_TGT}1" + cp /mnt/install/kernel /mnt/boot/kernel || exit 1 + + info "Installing 'initramfs' to ${INSTALL_TGT}1" + cp /mnt/install/rescue-initramfs /mnt/boot/initramfs || exit 1 + umount /mnt/boot || exit 1 +} + +install_run() { + install_probe_target || fatal "Failed to find installer target disk" + install_probe_source || fatal "Failed to find installer source filesystem" + install_confirm || fatal "Failed to get confirmation from user" + install_partitions || fatal "Failed to partition disk" + install_format || fatal "Failed to format disk" + install_boot || fatal "Failed to create boot filesystem" + info "Installation complete, rebooting" + sync + sleep 5 + reboot -f +} From bcbd47e2afd5445929a1413e04f1ec8406795717 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 3 Jul 2015 15:53:30 +0200 Subject: [PATCH 11/12] barebox: update to newer git version for eeprom write-protect For the sysmocom-odu, this add support for the EEPROM write-protect GPIO. --- 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 e5c599a180..24c9d0daeb 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 = "9f78d1b7a7c31a8c67423ab8ac9839f4ba2f5df7" +SRCREV = "cb9695a3ead9d62ad1d339409c7b15255d3b10ed" 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 280110f5ec..8d7e34ca92 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 = "9f78d1b7a7c31a8c67423ab8ac9839f4ba2f5df7" +SRCREV = "cb9695a3ead9d62ad1d339409c7b15255d3b10ed" 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 d23141528d..2151de16f4 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 = "9f78d1b7a7c31a8c67423ab8ac9839f4ba2f5df7" +SRCREV = "cb9695a3ead9d62ad1d339409c7b15255d3b10ed" SRC_URI = " \ git://git.sysmocom.de/barebox.git;branch=v2015.06 \ file://defconfig \ From 5c86ed95c907f9e518a8fa3b3f6d58a8fe0a4f56 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 6 Jul 2015 14:02:02 +0200 Subject: [PATCH 12/12] linux-backports: bump PR as dependency to kernel somehow not working See SYS#1353 for details. --- recipes-bsp/linux-backports/linux-backports_3.18.1.1.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bsp/linux-backports/linux-backports_3.18.1.1.bb b/recipes-bsp/linux-backports/linux-backports_3.18.1.1.bb index 11254dbd8b..e50557ac1e 100644 --- a/recipes-bsp/linux-backports/linux-backports_3.18.1.1.bb +++ b/recipes-bsp/linux-backports/linux-backports_3.18.1.1.bb @@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" inherit sysmocom-module -PR = "r0" +PR = "r1" 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 \