Compare commits

...

4 Commits

Author SHA1 Message Date
Daniel Willmann 955de868ee oc2g-sysdev-remap: Use systemd automount to mount /mnt/rom/* 2019-05-21 18:45:56 +02:00
Harald Welte 4ea11d3577 Use AUTOREV for osmo-bts and osmo-pcu for nightly builds
The nightly builds are supposed to track master of the upstream
git repositories, so let's use AUTOREV for that purpose.
2019-03-21 17:11:45 +01:00
Daniel Willmann b95241275a oc2g: Build OC2g support for osmo-pcu 2019-03-21 17:11:45 +01:00
Daniel Willmann 6822fd070f osmo_bts_git.bb: OC2G systemd/config files are installed by autotools 2019-03-20 17:44:39 +01:00
13 changed files with 91 additions and 115 deletions

View File

@ -1,6 +1,4 @@
THISDIR := "${@os.path.dirname(d.getVar('FILE', True))}"
FILESPATH =. "${@base_set_filespath(["${THISDIR}/files"], d)}:"
PRINC="4"
dirs755_append_oc2g = "/mnt/rom /mnt/rom/factory"
PRINC="5"

View File

@ -1,9 +0,0 @@
/dev/root / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
/dev/mtdblock8 /mnt/rom/factory jffs2 ro,sync,noatime,nofail 0 0
#/dev/mmcblk0p4 /mnt/storage ext4 defaults,noatime,nofail 0 0

View File

@ -0,0 +1,8 @@
[Unit]
Description=Automount ROM partition with factory defaults
[Automount]
Where=/mnt/rom/factory
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=Mount ROM partition with factory defaults
[Mount]
What=/dev/mtdblock8
Where=/mnt/rom/factory
Type=jffs2
Options=ro
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,8 @@
[Unit]
Description=Automount user partition with default settings
[Automount]
Where=/mnt/rom/user
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,10 @@
[Unit]
Description=Mount user partition with default settings
[Mount]
What=/dev/mtdblock9
Where=/mnt/rom/user
Type=jffs2
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,8 @@
[Unit]
Description=Automount storage partition
[Automount]
Where=/mnt/storage
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,10 @@
[Unit]
Description=Mount storage partition
[Mount]
What=/dev/mmcblk0p4
Where=/mnt/storage
Type=ext4
[Install]
WantedBy=multi-user.target

View File

@ -1,52 +0,0 @@
#!/bin/sh
# Start/stop the system devices remapping for OC-2G daemon.
#
### BEGIN INIT INFO
# Provides: oc2g-sysdev-remap
# Required-Start: $syslog $time
# Required-Stop: $syslog $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Remapping all availble system devices of OC-2G platform in system to a easy to reach location
# Description: Accessible to all system devices related to OC-2G platform will be available at /var/oc2g
#
### END INIT INFO
REMAP_DIR='/var/volatile/oc2g'
test -f /usr/bin/oc2g-sysdev-remap|| exit 0
. /etc/init.d/functions
log_daemon_msg () {
echo $@
}
log_end_msg () {
if test "$1" != "0"; then
echo "Error with $DESCRIPTION: $NAME"
fi
return $1
}
case "$1" in
start) log_daemon_msg "Starting system devices remapping script:" "oc2g-sysdev-remap"
mkdir -p ${REMAP_DIR}
/usr/bin/oc2g-sysdev-remap
log_end_msg $?
;;
stop) log_daemon_msg "Stopping system devices remapping script:" "oc2g-sysdev-remap"
test -d ${REMAP_DIR} && rm -rf ${REMAP_DIR}
;;
restart) log_daemon_msg "Restarting system devices remapping script:" "oc2oc2gg-sysdev-remap"
test -d ${REMAP_DIR} && rm -rf ${REMAP_DIR}
mkdir -p ${REMAP_DIR}
/usr/bin/oc2g-sysdev-remap
log_end_msg $?
;;
*) log_action_msg "Usage: /etc/init.d/oc2g-sysdev-remap {start|stop|restart}"
exit 2
;;
esac
exit 0

View File

@ -1,21 +1,18 @@
[Unit]
SourcePath=/etc/init.d/oc2g-sysdev-remap
Description=Remapping all available system devices of platform to a easy to reach location
Before=multi-user.target
Before=shutdown.target
Before=watchdog.service
After=local-fs.target
Before=osmo-bts-oc2g.service
After=checkflash.service
Wants=checkflash.service
After=time-sync.target
Conflicts=shutdown.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
Type=oneshot
RuntimeDirectory=oc2g
ExecStart=/bin/ln -f -s /run/oc2g /var/oc2g
ExecStart=/usr/bin/oc2g-sysdev-remap
RemainAfterExit=yes
ExecStart=/etc/init.d/oc2g-sysdev-remap start
ExecStop=/etc/init.d/oc2g-sysdev-remap stop
[Install]
WantedBy=multi-user.target oc2gbts-mgr.service

View File

@ -2,15 +2,18 @@ DESCRITOPN = "Remap all available system devices of OC-2G platform as symbolic l
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD;md5=3775480a712fc46a69647678acb234cb"
inherit update-rc.d
SRC_URI = "file://oc2g-sysdev-remap \
file://oc2g-sysdev-remap.init \
file://mnt-rom-factory.automount \
file://mnt-rom-factory.mount \
file://mnt-rom-user.automount \
file://mnt-rom-user.mount \
file://mnt-storage.automount \
file://mnt-storage.mount \
file://oc2g-sysdev-remap.service"
S = "${WORKDIR}"
inherit gitver-repo
inherit gitver-repo systemd
REPODIR = "${THISDIR}"
REPOFILE = "oc2g-sysdev-remap_1.0.bb"
@ -22,31 +25,24 @@ PR := "${PR}.${REPOGITFN}"
RDEPENDS_${PN} += "backup-scripts"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_AUTO_ENABLE_${PN}="enable"
SYSTEMD_SERVICE_${PN} = "oc2g-sysdev-remap.service mnt-rom-factory.automount mnt-rom-factory.mount mnt-rom-user.automount mnt-rom-user.mount mnt-storage.automount mnt-storage.mount"
do_install() {
install -d ${D}${sysconfdir}
install -d ${D}${sysconfdir}/systemd
install -d ${D}${sysconfdir}/systemd/system
install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants
install -d ${D}${sysconfdir}/init.d
install -m 0755 -d ${D}${base_libdir}
install -m 0755 -d ${D}${systemd_unitdir}
install -m 0755 -d ${D}${systemd_unitdir}/system
install -d ${D}${bindir}
install -d ${D}/var/volatile/oc2g
ln -sf volatile/oc2g ${D}/var/oc2g
install -d ${D}/${systemd_system_unitdir}
install -m 0755 ${S}/oc2g-sysdev-remap ${D}${bindir}/oc2g-sysdev-remap
install -m 0755 ${S}/oc2g-sysdev-remap.init ${D}${sysconfdir}/init.d/oc2g-sysdev-remap
install -m 0644 ${S}/oc2g-sysdev-remap.service ${D}${systemd_unitdir}/system/oc2g-sysdev-remap.service
ln -sf ${systemd_unitdir}/system/oc2g-sysdev-remap.service ${D}${sysconfdir}/systemd/system/multi-user.target.wants/oc2g-sysdev-remap.service
install -m 0644 ${S}/oc2g-sysdev-remap.service ${D}${systemd_system_unitdir}/
install -m 0644 ${S}/mnt-rom-factory.automount ${D}${systemd_system_unitdir}/
install -m 0644 ${S}/mnt-rom-factory.mount ${D}${systemd_system_unitdir}/
install -m 0644 ${S}/mnt-rom-user.automount ${D}${systemd_system_unitdir}/
install -m 0644 ${S}/mnt-rom-user.mount ${D}${systemd_system_unitdir}/
install -m 0644 ${S}/mnt-storage.automount ${D}${systemd_system_unitdir}/
install -m 0644 ${S}/mnt-storage.mount ${D}${systemd_system_unitdir}/
}
FILES_${PN} += "${bindir} \
${sysconfdir} \
${systemd_unitdir} \
${sysconfdir}/init.d \
/var/oc2g"
${sysconfdir}"
INSANE_SKIP_${PN} = "arch"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "oc2g-sysdev-remap"
INITSCRIPT_PARAMS_${PN} = "defaults 21 21"

View File

@ -2,8 +2,8 @@ DESCRIPTION = "sysmocom OsmoBTS"
LICENSE = "AGPLv3"
LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788"
SRC_URI = "git://git.osmocom.org/osmo-bts.git;protocol=git;destsuffix=git;nobranch=1"
SRCREV = "d785da59431007a372768403271b4108d8b4201e"
SRC_URI = "git://git.osmocom.org/osmo-bts.git;protocol=git;destsuffix=git;branch=master"
SRCREV = "${AUTOREV}"
PV = "1.0.0+git${SRCPV}"
PR = "r1.${META_TELEPHONY_OSMO_INC}"
S = "${WORKDIR}/git"
@ -32,17 +32,6 @@ PACKAGECONFIG ??= "\
"
PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir"
# Latest osmo-bts-oc2g still uses osmo-bts.cfg as file name and config/systemd
# files are not installed through autotools yet.
do_install_append_oc2g() {
install -m 0660 ${S}/doc/examples/oc2g/osmo-bts.cfg ${D}${sysconfdir}/osmocom
# Install systemd and enable on sysinit
install -m 0644 ${S}/contrib/systemd/oc2gbts-mgr.service ${D}${systemd_system_unitdir}/oc2gbts-mgr.service
install -m 0660 ${S}/doc/examples/oc2g/oc2gbts-mgr.cfg ${D}${sysconfdir}/osmocom/
install -m 0644 ${S}/contrib/systemd/osmo-bts-oc2g.service ${D}${systemd_system_unitdir}/
}
SYSTEMD_PACKAGES = "${PN} osmo-bts-virtual"
SYSTEMD_AUTO_ENABLE_${PN}="enable"
@ -56,7 +45,7 @@ SYSTEMD_SERVICE_${PN}_append_oc2g = " oc2gbts-mgr.service osmo-bts-oc2g.service"
CONFFILES_${PN}_append_sysmobts-v2 = " ${sysconfdir}/osmocom/sysmobts-mgr.cfg ${sysconfdir}/osmocom/osmo-bts-sysmo.cfg"
CONFFILES_${PN}_append_sysmobts2100 = " ${sysconfdir}/osmocom/lc15bts-mgr.cfg ${sysconfdir}/osmocom/osmo-bts-lc15.cfg"
CONFFILES_${PN}_append_oc2g = " ${sysconfdir}/oc2gbts-mgr.cfg ${sysconfdir}/osmocom/osmo-bts.cfg"
CONFFILES_${PN}_append_oc2g = " ${sysconfdir}/oc2gbts-mgr.cfg ${sysconfdir}/osmocom/osmo-bts-oc2g.cfg"
# somehow it seems not posible to use _append constructs on PACKAGES
#PACKAGES_append_sysmobts-v2 = " osmo-bts-remote sysmobts-calib sysmobts-util"

View File

@ -3,7 +3,7 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "git://git.osmocom.org/osmo-pcu.git;protocol=git;branch=master"
SRCREV = "99278b105018af24cc5a28673ffa960e933f3979"
SRCREV = "${AUTOREV}"
PV = "0.6.0+git${SRCPV}"
PR = "r0.${META_TELEPHONY_OSMO_INC}"
S = "${WORKDIR}/git"
@ -12,6 +12,7 @@ DEPENDS = "libosmocore osmo-bts"
DEPENDS_append_sysmobts-v2 = " femtobts-api"
DEPENDS_append_litecell15 = " lc15-firmware"
DEPENDS_append_sysmobts2100 = " lc15-firmware"
DEPENDS_append_oc2g = " oc2g-firmware"
# This implements PCU Interface v8 (GPRS RSSI)
RDEPENDS_${PN} = "osmo-bts (>= 0.8.0)"
@ -19,6 +20,7 @@ RDEPENDS_${PN} = "osmo-bts (>= 0.8.0)"
EXTRA_OECONF_sysmobts-v2 += "--enable-sysmocom-dsp"
EXTRA_OECONF_litecell15 += "--enable-lc15bts-phy"
EXTRA_OECONF_sysmobts2100 += "--enable-lc15bts-phy"
EXTRA_OECONF_oc2g += "--enable-oc2gbts-phy"
inherit autotools pkgconfig systemd