Add 'meta-sysmocom-bsp/' from commit 'ab0b6f424807bb42a2c2d3aab5c0e59478ef7d5a'

git-subtree-dir: meta-sysmocom-bsp
git-subtree-mainline: 91638a2adc
git-subtree-split: ab0b6f4248
This commit is contained in:
Holger Hans Peter Freyther 2014-07-30 17:25:36 +02:00
commit 268f92b383
234 changed files with 20780 additions and 0 deletions

1
meta-sysmocom-bsp/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.sw?

View File

@ -0,0 +1,4 @@
# This will set BTS_HW_VERSION depending on the machine
PACKAGE_ARCH = "${MACHINE_ARCH}"
BTS_HW_VERSION_sysmobts-v1 = "-DHW_SYSMOBTS_V1"
BTS_HW_VERSION_sysmobts-v2 = "-DHW_SYSMOBTS_V2"

View File

@ -0,0 +1,20 @@
# I add another image type for the sysmoBTS family
UBI_VOLNAME ?= "${MACHINE}-rootfs"
IMAGE_CMD_ubi-sysmo () {
echo \[kernel\] >> ubinize_sysmo.cfg
echo mode=ubi >> ubinize_sysmo.cfg
echo image=${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin >> ubinize_sysmo.cfg
echo vol_id=0 >> ubinize_sysmo.cfg
echo vol_type=static >> ubinize_sysmo.cfg
echo vol_name=${MACHINE}-backup-kernel >> ubinize_sysmo.cfg
echo \[ubifs\] >> ubinize_sysmo.cfg
echo mode=ubi >> ubinize_sysmo.cfg
echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs-sysmo >> ubinize_sysmo.cfg
echo vol_id=1 >> ubinize_sysmo.cfg
echo vol_type=dynamic >> ubinize_sysmo.cfg
echo vol_name=${UBI_VOLNAME} >> ubinize_sysmo.cfg
echo vol_flags=autoresize >> ubinize_sysmo.cfg
mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs-sysmo ${MKUBIFS_ARGS} && ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi-sysmo ${UBINIZE_ARGS} ubinize_sysmo.cfg
}

View File

@ -0,0 +1,3 @@
PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python"
EXTRANATIVEPATH += "python-native"
DEPENDS += " python-native "

View File

@ -0,0 +1,14 @@
# This file is for getting archiving packages with configured sources(archive 's' after configure stage),logs(archive 'temp' after package_write_rpm),dump data
# and creating diff file(get all environment variables and functions in building and mapping all content in 's' including patches to xxx.diff.gz.
# All archived packages will be deployed in ${DEPLOY_DIR}/sources
inherit sysmocom-archiver
# Get archiving package with configured sources including patches
do_configure[postfuncs] += "do_archive_configured_sources "
# Get archiving package with temp(logs) and scripts(.bb and inc files)
do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
# Get dump date and create diff file
do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "

View File

@ -0,0 +1,14 @@
# This file is for getting archiving packages with original sources(archive 's' after unpack stage),patches,logs(archive 'temp' after package_write_rpm),dump data and
# creating diff file(get all environment variables and functions in building and mapping all content in 's' including patches to xxx.diff.gz.
# All archived packages will be deployed in ${DEPLOY_DIR}/sources
inherit sysmocom-archiver
# Get original sources archiving package with patches
do_unpack[postfuncs] += "do_archive_original_sources_patches "
# Get archiving package with temp(logs) and scripts(.bb and inc files)
do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
# Get dump date and create diff file
do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "

View File

@ -0,0 +1,14 @@
# This file is for getting archiving packages with patched sources(archive 's' before do_patch stage),logs(archive 'temp' after package_write_rpm),dump data and
# creating diff file(get all environment variables and functions in building and mapping all content in 's' including patches to xxx.diff.gz.
# All archived packages will be deployed in ${DEPLOY_DIR}/sources
inherit sysmocom-archiver
# Get archiving package with patched sources including patches
do_patch[postfuncs] += "do_archive_patched_sources "
# Get archiving package with logs(temp) and scripts(.bb and .inc files)
do_package_write_rpm[prefuncs] += "do_archive_scripts_logs "
# Get dump date and create diff file
do_package_write_rpm[postfuncs] += "do_dumpdata_create_diff_gz "

View File

@ -0,0 +1,452 @@
# This file is used for archiving sources ,patches,and logs to tarball.
# It also output building environment to xxx.dump.data and create xxx.diff.gz to record
# all content in ${S} to a diff file.
ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache"
ARCHIVE_TYPE ?= "TAR SRPM"
DISTRO ?= "poky"
PATCHES_ARCHIVE_WITH_SERIES = 'TRUE'
def get_bb_inc(d):
'''create a directory "script-logs" including .bb and .inc file in ${WORKDIR}'''
import re
import os
import shutil
bbinc = []
pat=re.compile('require\s*([^\s]*\.*)(.*)')
work_dir = d.getVar('WORKDIR', True)
bbfile = d.getVar('FILE', True)
bbdir = os.path.dirname(bbfile)
script_logs = os.path.join(work_dir,'script-logs')
bb_inc = os.path.join(script_logs,'bb_inc')
bb.mkdirhier(script_logs)
bb.mkdirhier(bb_inc)
def find_file(dir,file):
for root, dirs, files in os.walk(dir):
if file in files:
return os.path.join(root,file)
def get_inc (file):
f = open(file,'r')
for line in f.readlines():
if 'require' not in line:
bbinc.append(file)
else:
try:
incfile = pat.match(line).group(1)
incfile = bb.data.expand(os.path.basename(incfile),d)
abs_incfile = find_file(bbdir,incfile)
if abs_incfile:
bbinc.append(abs_incfile)
get_inc(abs_incfile)
except AttributeError:
pass
get_inc(bbfile)
bbinc = list(set(bbinc))
for bbincfile in bbinc:
shutil.copy(bbincfile,bb_inc)
try:
bb.mkdirhier(os.path.join(script_logs,'temp'))
oe.path.copytree(os.path.join(work_dir,'temp'), os.path.join(script_logs,'temp'))
except (IOError,AttributeError):
pass
return script_logs
def get_series(d):
'''copy patches and series file to a pointed directory which will be archived to tarball in ${WORKDIR}'''
import shutil
src_patches=[]
pf = d.getVar('PF', True)
work_dir = d.getVar('WORKDIR', True)
s = d.getVar('S',True)
dest = os.path.join(work_dir, pf + '-series')
shutil.rmtree(dest, ignore_errors=True)
bb.mkdirhier(dest)
src_uri = d.getVar('SRC_URI', True).split()
fetch = bb.fetch2.Fetch(src_uri, d)
locals = (fetch.localpath(url) for url in fetch.urls)
for local in locals:
src_patches.append(local)
if not cmp(work_dir,s):
tmp_list = src_patches
else:
tmp_list = src_patches[1:]
for patch in tmp_list:
try:
shutil.copy(patch,dest)
except IOError:
if os.path.isdir(patch):
bb.mkdirhier(os.path.join(dest,patch))
oe.path.copytree(patch, os.path.join(dest,patch))
return dest
def get_applying_patches(d):
"""only copy applying patches to a pointed directory which will be archived to tarball"""
import os
import shutil
pf = d.getVar('PF', True)
work_dir = d.getVar('WORKDIR', True)
dest = os.path.join(work_dir, pf + '-patches')
shutil.rmtree(dest, ignore_errors=True)
bb.mkdirhier(dest)
patches = src_patches(d)
for patch in patches:
_, _, local, _, _, parm = bb.decodeurl(patch)
if local:
shutil.copy(local,dest)
return dest
def not_tarball(d):
'''packages including key words 'work-shared','native', 'task-' will be passed'''
import os
workdir = d.getVar('WORKDIR',True)
s = d.getVar('S',True)
if 'work-shared' in s or 'task-' in workdir or 'native' in workdir:
pn = bb.data.getVar('PN', d , True)
if pn == 'gcc-cross':
return False
return True
else:
return False
def get_source_from_downloads(d,stage_name):
'''copy tarball of $P to $WORKDIR when this tarball exists in $DL_DIR'''
if stage_name in 'patched' 'configured':
return
pf = d.getVar('PF', True)
dl_dir = d.getVar('DL_DIR',True)
try:
source = os.path.join(dl_dir,os.path.basename(d.getVar('SRC_URI', True).split()[0]))
if os.path.exists(source) and not os.path.isdir(source):
return source
except (IndexError, OSError):
pass
return ''
def do_tarball(workdir,srcdir,tarname):
'''tar "srcdir" under "workdir" to "tarname"'''
import tarfile
sav_dir = os.getcwd()
os.chdir(workdir)
if (len(os.listdir(srcdir))) != 0:
tar = tarfile.open(tarname, "w:gz")
tar.add(srcdir)
tar.close()
else:
tarname = ''
os.chdir(sav_dir)
return tarname
def archive_sources_from_directory(d,stage_name):
'''archive sources codes tree to tarball when tarball of $P doesn't exist in $DL_DIR'''
import shutil
s = d.getVar('S',True)
work_dir=d.getVar('WORKDIR', True)
PF = d.getVar('PF',True)
tarname = PF + '-' + stage_name + ".tar.gz"
if os.path.exists(s) and work_dir in s:
try:
source_dir = os.path.join(work_dir,[ i for i in s.replace(work_dir,'').split('/') if i][0])
except IndexError:
if not cmp(s,work_dir):
return ''
else:
return ''
source = os.path.basename(source_dir)
return do_tarball(work_dir,source,tarname)
def archive_sources(d,stage_name):
'''copy tarball from $DL_DIR to $WORKDIR if have tarball, archive source codes tree in $WORKDIR if $P is directory instead of tarball'''
import shutil
work_dir = d.getVar('WORKDIR',True)
file = get_source_from_downloads(d,stage_name)
if file:
shutil.copy(file,work_dir)
file = os.path.basename(file)
else:
file = archive_sources_from_directory(d,stage_name)
return file
def archive_patches(d,patchdir,series):
'''archive patches to tarball and also include series files if 'series' is True'''
import shutil
s = d.getVar('S',True)
work_dir = d.getVar('WORKDIR', True)
patch_dir = os.path.basename(patchdir)
tarname = patch_dir + ".tar.gz"
if series == 'all' and os.path.exists(os.path.join(s,'patches/series')):
shutil.copy(os.path.join(s,'patches/series'),patchdir)
tarname = do_tarball(work_dir,patch_dir,tarname)
shutil.rmtree(patchdir, ignore_errors=True)
return tarname
def select_archive_patches(d,option):
'''select to archive all patches including non-applying and series or applying patches '''
if option == "all":
patchdir = get_series(d)
elif option == "applying":
patchdir = get_applying_patches(d)
try:
os.rmdir(patchdir)
except OSError:
tarpatch = archive_patches(d,patchdir,option)
return tarpatch
return
def archive_logs(d,logdir,bbinc=False):
'''archive logs in temp to tarball and .bb and .inc files if bbinc is True '''
import shutil
pf = d.getVar('PF',True)
work_dir = d.getVar('WORKDIR',True)
log_dir = os.path.basename(logdir)
tarname = pf + '-' + log_dir + ".tar.gz"
tarname = do_tarball(work_dir,log_dir,tarname)
if bbinc:
shutil.rmtree(logdir, ignore_errors=True)
return tarname
def get_licenses(d):
'''get licenses for running .bb file'''
licenses = d.getVar('LICENSE', 1).replace('&', '|')
licenses = licenses.replace('(', '').replace(')', '')
clean_licenses = ""
for x in licenses.split():
if x.strip() == '' or x == 'CLOSED':
continue
if x != "|":
clean_licenses += x
if '|' in clean_licenses:
clean_licenses = clean_licenses.replace('|','')
return clean_licenses
def move_tarball_deploy(d,tarball_list):
'''move tarball in location to ${DEPLOY_DIR}/sources'''
import shutil
if tarball_list is []:
return
target_sys = d.getVar('TARGET_SYS', True)
pf = d.getVar('PF', True)
licenses = get_licenses(d)
work_dir = d.getVar('WORKDIR',True)
tar_sources = d.getVar('DEPLOY_DIR', True) + '/sources/' + target_sys + '/' + licenses + '/' + pf
if not os.path.exists(tar_sources):
bb.mkdirhier(tar_sources)
for source in tarball_list:
if source:
if os.path.exists(os.path.join(tar_sources, source)):
os.remove(os.path.join(tar_sources,source))
shutil.move(os.path.join(work_dir,source),tar_sources)
def check_archiving_type(d):
'''check the type for archiving package('tar' or 'srpm')'''
try:
if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in d.getVar('ARCHIVE_TYPE', True).split():
raise AttributeError
except AttributeError:
bb.fatal("\"SOURCE_ARCHIVE_PACKAGE_TYPE\" is \'tar\' or \'srpm\', no other types")
def store_package(d,package_name):
'''store tarbablls name to file "tar-package"'''
try:
f = open(os.path.join(d.getVar('WORKDIR',True),'tar-package'),'a')
f.write(package_name + ' ')
f.close()
except IOError:
pass
def get_package(d):
'''get tarballs name from "tar-package"'''
work_dir = (d.getVar('WORKDIR', True))
tarpackage = os.path.join(work_dir,'tar-package')
try:
f = open(tarpackage,'r')
line = list(set(f.readline().replace('\n','').split()))
except IOError:
pass
f.close()
return line
def archive_sources_patches(d,stage_name):
'''archive sources and patches to tarball. stage_name will append strings ${stage_name} to ${PR} as middle name. for example, zlib-1.4.6-prepatch(stage_name).tar.gz '''
import shutil
check_archiving_type(d)
if not_tarball(d):
return
source_tar_name = archive_sources(d,stage_name)
if stage_name == "prepatch":
if d.getVar('PATCHES_ARCHIVE_WITH_SERIES',True).upper() == 'TRUE':
patch_tar_name = select_archive_patches(d,"all")
elif d.getVar('PATCHES_ARCHIVE_WITH_SERIES',True).upper() == 'FALSE':
patch_tar_name = select_archive_patches(d,"applying")
else:
bb.fatal("Please define 'PATCHES_ARCHIVE_WITH_SERIES' is strings 'True' or 'False' ")
else:
patch_tar_name = ''
if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in 'SRPM':
move_tarball_deploy(d,[source_tar_name,patch_tar_name])
else:
tarpackage = os.path.join(d.getVar('WORKDIR', True),'tar-package')
if os.path.exists(tarpackage):
os.remove(tarpackage)
for package in os.path.basename(source_tar_name), patch_tar_name:
if package:
store_package(d,str(package) + ' ')
def archive_scripts_logs(d):
'''archive scripts and logs. scripts include .bb and .inc files and logs include stuff in "temp".'''
work_dir = d.getVar('WORKDIR', True)
temp_dir = os.path.join(work_dir,'temp')
source_archive_log_with_scripts = d.getVar('SOURCE_ARCHIVE_LOG_WITH_SCRIPTS', True)
if source_archive_log_with_scripts == 'logs_with_scripts':
logdir = get_bb_inc(d)
tarlog = archive_logs(d,logdir,True)
elif source_archive_log_with_scripts == 'logs':
if os.path.exists(temp_dir):
tarlog = archive_logs(d,temp_dir,False)
else:
return
if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in 'SRPM':
move_tarball_deploy(d,[tarlog])
else:
store_package(d,tarlog)
def dumpdata(d):
'''dump environment to "${P}-${PR}.showdata.dump" including all kinds of variables and functions when running a task'''
workdir = bb.data.getVar('WORKDIR', d, 1)
distro = bb.data.getVar('DISTRO', d, 1)
s = d.getVar('S', True)
pf = d.getVar('PF', True)
target_sys = d.getVar('TARGET_SYS', True)
licenses = get_licenses(d)
dumpdir = d.getVar('DEPLOY_DIR', True) + '/sources/' + target_sys + '/' + licenses + '/' + pf
if not os.path.exists(dumpdir):
bb.mkdirhier(dumpdir)
dumpfile = os.path.join(dumpdir, bb.data.expand("${P}-${PR}.showdata.dump",d))
bb.note("Dumping metadata into '%s'" % dumpfile)
f = open(dumpfile, "w")
# emit variables and shell functions
bb.data.emit_env(f, d, True)
# emit the metadata which isnt valid shell
for e in d.keys():
if bb.data.getVarFlag(e, 'python', d):
f.write("\npython %s () {\n%s}\n" % (e, bb.data.getVar(e, d, 1)))
f.close()
def create_diff_gz(d):
'''creating .diff.gz in ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.g gz for mapping all content in 's' including patches to xxx.diff.gz'''
import shutil
work_dir = d.getVar('WORKDIR', True)
exclude_from = d.getVar('ARCHIVE_EXCLUDE_FROM', True).split()
pf = d.getVar('PF', True)
licenses = get_licenses(d)
target_sys = d.getVar('TARGET_SYS', True)
diff_dir = d.getVar('DEPLOY_DIR', True) + '/sources/' + target_sys + '/' + licenses + '/' + pf
diff_file = os.path.join(diff_dir, bb.data.expand("${P}-${PR}.diff.gz",d))
f = open(os.path.join(work_dir,'temp/exclude-from-file'), 'a')
for i in exclude_from:
f.write(i)
f.write("\n")
f.close()
s=d.getVar('S', True)
distro = d.getVar('DISTRO',True)
dest = s + '/' + distro + '/files'
if not os.path.exists(dest):
bb.mkdirhier(dest)
for i in os.listdir(os.getcwd()):
if os.path.isfile(i):
try:
shutil.copy(i, dest)
except IOError:
os.system('fakeroot cp -rf ' + i + " " + dest )
bb.note("Creating .diff.gz in ${DEPLOY_DIR_SRC}/${P}-${PR}.diff.gz")
cmd = "LC_ALL=C TZ=UTC0 diff --exclude-from=" + work_dir + "/temp/exclude-from-file -Naur " + s + '.org' + ' ' + s + " | gzip -c > " + diff_file
d.setVar('DIFF', cmd + "\n")
d.setVarFlag('DIFF', 'func', '1')
bb.build.exec_func('DIFF', d)
shutil.rmtree(s + '.org', ignore_errors=True)
# This function will run when user want to get tarball for sources and patches after do_unpack
python do_archive_original_sources_patches(){
archive_sources_patches(d,'prepatch')
}
# This function will run when user want to get tarball for patched sources after do_patch
python do_archive_patched_sources(){
archive_sources_patches(d,'patched')
}
# This function will run when user want to get tarball for configured sources after do_configure
python do_archive_configured_sources(){
archive_sources_patches(d,'configured')
}
# This function will run when user want to get tarball for logs or both logs and scripts(.bb and .inc files)
python do_archive_scripts_logs(){
archive_scripts_logs(d)
}
# This function will run when user want to know what variable and functions in a running task are and also can get a diff file including
# all content a package should include.
python do_dumpdata_create_diff_gz(){
dumpdata(d)
create_diff_gz(d)
}
# This functions prepare for archiving "linux-yocto" because this package create directory 's' before do_patch instead of after do_unpack.
# This is special control for archiving linux-yocto only.
python do_archive_linux_yocto(){
s = d.getVar('S', True)
if 'linux-yocto' in s:
source_tar_name = archive_sources(d,'')
if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in 'SRPM':
move_tarball_deploy(d,[source_tar_name,''])
}
do_kernel_checkout[postfuncs] += "do_archive_linux_yocto "
# remove tarball for sources, patches and logs after creating srpm.
python do_remove_tarball(){
if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM':
work_dir = d.getVar('WORKDIR', True)
try:
for file in os.listdir(os.getcwd()):
if file in get_package(d):
os.remove(file)
os.remove(os.path.join(work_dir,'tar-package'))
except (TypeError,OSError):
pass
}
do_remove_taball[deptask] = "do_archive_scripts_logs"
do_package_write_rpm[postfuncs] += "do_remove_tarball "
export get_licenses
export get_package

View File

@ -0,0 +1,17 @@
# We have a conf and classes directory, add to BBPATH
BBPATH := "${BBPATH}:${LAYERDIR}"
# We have a packages directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILES += "${LAYERDIR}/yocto-shared/*.bbappend"
# Now we will need to include the matching fixes for a yocto version
BBFILES += "${BBFILES_SYSMOCOM_BSP}"
# selects specific distro or master when DISTRO_VERSION contains SNAPSHOT
BBFILES_SYSMOCOM_BSP = "${LAYERDIR}/yocto-${@ [dict([('1.5','dora'), ('1.5.1', 'dora'), ('1.5.2', 'dora'), ('1.5.3', 'dora'), ('1.1.2','edison')])[d.getVar('DISTRO_VERSION', True)], 'master']['SNAPSHOT' in d.getVar('DISTRO_VERSION', True)]}/*.bbappend"
BBFILE_COLLECTIONS += "sysmocom-bsp"
BBFILE_PATTERN_sysmocom-bsp := "^${LAYERDIR}/"
BBFILE_PRIORITY_sysmocom-bsp = "1"

View File

@ -0,0 +1,2 @@
SOC_FAMILY = "dm6446"

View File

@ -0,0 +1,46 @@
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-sysmocom"
PREFERRED_VERSION_linux-sysmocom = "${@ dict([('1.5','3.10.40+git%'), ('1.5.1','3.10.40+git%'), ('1.5.2','3.10.40+git%'), ('1.5.3','3.10.40+git%'), ('1.1.2','')])[d.getVar('DISTRO_VERSION', True)]}"
PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}depmod:module-init-tools-cross"
PREFERRED_VERSION_u-boot = "git"
KERNEL_IMAGETYPE = "uImage"
UBOOT_ENTRYPOINT = "0x80008000"
UBOOT_LOADADDRESS = "0x80008000"
SERIAL_CONSOLE ?= "115200 ttyS0"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"
#ROOT_FLASH_SIZE = "29"
MACHINE_FEATURES = "kernel26 serial"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\
busybox-ifplugd \
${@['watchdog', ''][d.getVar('DISTRO_FEATURES_INITMAN', True) == 'systemd']} \
kernel \
kernel-module-davinci-wdt \
kernel-module-dspdl \
kernel-module-dspdl-dm644x \
kernel-module-fpgadl \
kernel-module-fpgadl-par \
kernel-module-leds-gpio \
kernel-module-msgqueue \
kernel-module-nls-ascii \
kernel-module-nls-utf8 \
kernel-module-rtfifo "
IMAGE_FSTYPES ?= "tar.bz2 cpio.gz ubifs ubi jffs2"
MACHINE_EXTRA_RDEPENDS = "\
task-sysmocom-bts \
sysmobts-firmware \
${@['watchdog', ''][d.getVar('DISTRO_FEATURES_INITMAN', True) == 'systemd']} \
"
#MACHINE_EXTRA_RRECOMMENDS = "dsplink-module"
require conf/machine/include/tune-arm926ejs.inc
require conf/machine/include/dm6446.inc

View File

@ -0,0 +1,35 @@
SOC_FAMILY = "ti33x"
require conf/machine/include/soc-family.inc
require conf/machine/include/tune-cortexa8.inc
PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
# For built-in LCD, add xf86-input-tslib
XSERVER = "xserver-xorg \
xf86-input-evdev \
xf86-input-mouse \
xf86-video-fbdev \
xf86-input-keyboard"
# Default to external video, change to smallscreen for built-in LCD
GUI_MACHINE_CLASS = "bigscreen"
# Increase this everytime you change something in the kernel
MACHINE_KERNEL_PR = "r21"
KERNEL_IMAGETYPE = "zImage"
UBOOT_ARCH = "arm"
UBOOT_MACHINE = "am335x_evm_config"
UBOOT_ENTRYPOINT = "0x80008000"
UBOOT_LOADADDRESS = "0x80008000"
# Use the expected value of the ubifs filesystem's volume name in the kernel
# and u-boot.
UBI_VOLNAME = "rootfs"
# List common SoC features, may need to add touchscreen for specific machines
MACHINE_FEATURES = "kernel26 apm usbgadget usbhost vfat ext2 screen alsa ethernet sgx"

View File

@ -0,0 +1,14 @@
DEFAULTTUNE ?= "geode"
require conf/machine/include/tune-i586.inc
# Extra tune features
TUNEVALID[geode] = "Enable geode specific processor optimizations"
TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'geode', '-march=geode -mtune=geode', '', d)}"
# Extra tune selections
AVAILTUNES += "geode"
TUNE_FEATURES_tune-geode ?= "${TUNE_FEATURES_tune-x86} geode"
BASE_LIB_tune-geode ?= "lib"
TUNE_PKGARCH_tune-geode = "geode"
PACKAGE_EXTRA_ARCHS_tune-geode = "${PACKAGE_EXTRA_ARCHS_tune-x86} i386 i486 i586 geode"

View File

@ -0,0 +1,16 @@
#@TYPE: Machine
#@NAME: sysmoBTS 2050
#@DESCRIPTION: sysmocom GmbH sysmoBTS 2050 family
require sysmobts-v2.conf
MACHINEOVERRIDES = "${MACHINE}:sysmobts-v2"
# we are disabling the serial console for now, as it may interfere with
# the MSP430 service processor communication until proper filtering/splitting
# of the serial stream is implemented in the kernel
SERIAL_CONSOLE = ""
# we don't want a different UBIfs volume name, as this is compiled into u-boot,
# and thus would require a different u-boot image in turn.
UBI_VOLNAME="sysmobts-v2-rootfs"

View File

@ -0,0 +1,14 @@
#@TYPE: Machine
#@NAME: sysmocom - systems for mobile communications GmbH GSM BTS
#@DESCRIPTION: sysmocom - systems for mobile communications GmbH GSM BTS
# Make sure we build these too
EXTRA_IMAGEDEPENDS = "dvnixload-native ubl u-boot sysmobts-firmware"
EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x20000 --pagesize=0x800 --no-cleanmarkers --pad=0x2000000 -n"
# ubifs config
MKUBIFS_ARGS = "-m 2048 -e 129024 -c 400"
UBINIZE_ARGS = "-m 2048 -p 128KiB -s 512"
require conf/machine/include/sysmobts.inc

View File

@ -0,0 +1,14 @@
#@TYPE: Machine
#@NAME: sysmocom - systems for mobile communications GmbH GSM Superfemto
#@DESCRIPTION: sysmocom - systems for mobile communications GmbH GSM Superfemto
# Make sure we build these too
EXTRA_IMAGEDEPENDS = "dvnixload-native ubl u-boot sysmobts-firmware"
EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x20000 --pagesize=0x800 --no-cleanmarkers --pad=0x2000000 -n"
# ubifs config
MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 999"
UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512"
require conf/machine/include/sysmobts.inc

View File

@ -0,0 +1,10 @@
#@TYPE: Machine
#@NAME: common_pc
#@DESCRIPTION: Machine configuration for running a common x86
require sysmocom-bsc.conf
MACHINEOVERRIDES = "${MACHINE}:sysmocom-bsc"
SERIAL_CONSOLE = "19200 ttyS0"
MACHINE_CONSOLE = "console=ttyS0,19200n8"

View File

@ -0,0 +1,37 @@
#@TYPE: Machine
#@NAME: common_pc
#@DESCRIPTION: Machine configuration for running a common x86
TARGET_ARCH = "i586"
PREFERRED_PROVIDER_virtual/libgl = "mesa-dri"
PREFERRED_PROVIDER_virtual/libx11 ?= "libx11-trim"
PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xf86-dri-lite"
PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xf86-dri-lite"
PREFERRED_PROVIDER_virtual/kernel = "${@ dict([('1.5','linux-sysmocom'), ('1.5.1', 'linux-sysmocom'), ('1.5.1', 'linux-sysmocom'), ('1.1.2','linux')])[d.getVar('DISTRO_VERSION', True)]}"
require conf/machine/include/tune-geode.inc
MACHINE_FEATURES += "kernel26 x86 usbhost pci acpi"
KERNEL_IMAGETYPE = "bzImage"
IMAGE_FSTYPES ?= "tar.gz ext4"
SERIAL_CONSOLE = "38400 ttyS0"
MACHINE_CONSOLE = "console=ttyS0,38400n8"
# We bypass swrast but we need it to be present for X to load correctly
XSERVER ?= "xserver-xf86-dri-lite \
mesa-dri-driver-swrast \
xf86-input-vmmouse \
xf86-input-keyboard \
xf86-input-evdev \
xf86-video-vmware"
GLIBC_ADDONS = "nptl"
GLIBC_EXTRA_OECONF = "--with-tls"
#MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\
busybox-ifplugd "

View File

@ -0,0 +1,41 @@
#@TYPE: Machine
#@NAME: sysmocom-odu
#@DESCRIPTION: Machine configuration for the sysmocom ODU
require conf/machine/include/ti33x.inc
IMAGE_FSTYPES += "ubi tar.gz"
SERIAL_CONSOLE = "115200 ttyO0"
# UBI information. Note that this is board and kernel specific. Changes
# in your kernel port may require changes in these variables. For more
# details about this board please see
# http://processors.wiki.ti.com/index.php/UBIFS_Support
# do ubiattach /dev/ubi_ctrl -m 7 -O 2048
# From dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: logical eraseblock size: 126976 bytes
# from ubiattach stdout:
# UBI device number 0, total 1988 LEBs
MKUBIFS_ARGS = "-F -m 2048 -e 126976 -c 3836"
# do ubiattach /dev/ubi_ctrl -m 7 -O 2048
# from dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: physical eraseblock size: 131072 bytes (128 KiB)
# UBI: sub-page size: 512
# UBI: VID header offset: 2048 (aligned 2048)
UBINIZE_ARGS = "-m 2048 -p 128KiB -s 512 -O 2048"
# Go back to prefer our kernel
PREFERRED_PROVIDER_virtual/kernel = "linux-sysmocom"
KERNEL_IMAGETYPE = "uImage"
PREFERRED_PROVIDER_virtual/bootloader = "barebox-sysmocom"
EXTRA_IMAGEDEPENDS += "barebox-sysmocom"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\
kernel \
"

View File

@ -0,0 +1,77 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: sysklogd
# Required-Start: $remote_fs $time
# Required-Stop: $remote_fs $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: System logger
### END INIT INFO
set -e
if [ -f /etc/syslog.conf ]; then
. /etc/syslog.conf
LOG_LOCAL=0
LOG_REMOTE=0
for D in $DESTINATION; do
if [ "$D" = "buffer" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
LOG_LOCAL=1
elif [ "$D" = "file" ]; then
if [ -n "$LOGFILE" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
fi
if [ -n "$ROTATESIZE" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
fi
if [ -n "$ROTATEGENS" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
fi
LOCAL=0
elif [ "$D" = "remote" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
LOG_REMOTE=1
fi
done
if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -L"
fi
if [ "$REDUCE" = "yes" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -S"
fi
if [ "$DROPDUPLICATES" = "yes" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -D"
fi
if [ -n "$LOGLEVEL" ]; then
SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
fi
else
# default: log to 16K shm circular buffer
SYSLOG_ARGS="-C"
fi
case "$1" in
start)
echo -n "Starting syslogd/klogd: "
start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
echo "done"
;;
stop)
echo -n "Stopping syslogd/klogd: "
start-stop-daemon -K -n syslogd
start-stop-daemon -K -n klogd
echo "done"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: syslog { start | stop | restart }" >&2
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,22 @@
DESTINATION="buffer" # log destinations (buffer file remote)
MARKINT=20 # intervall between --mark-- entries
LOGFILE=/var/log/messages # where to log (file)
REMOTE=loghost:514 # where to log (syslog remote)
REDUCE=no # reduce-size logging
#ROTATESIZE=0 # rotate log if grown beyond X [kByte] (incompatible with busybox)
#ROTATEGENS=3 # keep X generations of rotated logs (incompatible with busybox)
BUFFERSIZE=64 # size of circular buffer [kByte]
FOREGROUND=no # run in foreground (don't use!)
LOGLEVEL=6
# magic when a MMC card is mounted
USING_MMC_CARD=`/bin/mount | grep /media/mmcblk0p1 | wc -l`
if [ 1 -eq $USING_MMC_CARD ] ; then
if [ -e /media/mmcblk0p1/log ] ; then
echo "Using mmc card"
LOGFILE=/media/mmcblk0p1/log/messages
DESTINATION="file"
ROTATESIZE=2048
ROTATEGENS=20
fi
fi

View File

@ -0,0 +1,13 @@
DESCRIPTION = "sysmocom BSC/E1 image"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
LICENSE = "MIT"
inherit boot-directdisk
ROOTFS = "${DEPLOY_DIR_IMAGE}/sysmocom-bsc-e1-image-${MACHINE}.ext3"
do_bootdirectdisk[depends] += "sysmocom-bsc-e1-image:do_rootfs"

View File

@ -0,0 +1,10 @@
IMAGE_INSTALL = "task-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${ROOTFS_PKGMANAGE} task-osmocom task-sysmocom \
task-sysmocom-debug task-sysmocom-tools task-sysmocom-e1 task-gprscore \
e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-e2fsck e2fsprogs-fsck \
kernel-module-nls-iso8859-1 kernel-module-nls-cp437"
IMAGE_LINGUAS = " "
LICENSE = "MIT"
inherit core-image
IMAGE_ROOTFS_SIZE = "524288"

View File

@ -0,0 +1,14 @@
require sysmocom-image.inc
IMAGE_LINGUAS = " "
# This variant of the image will run osmo-bts and osmo-bsc
activate_bsc() {
echo "NO_START=0" > ${IMAGE_ROOTFS}/etc/default/osmo-bsc
}
activate_systemd_bsc() {
ln -sf ${systemd_unitdir}/system/osmo-bsc.service ${IMAGE_ROOTFS}/etc/systemd/system/multi-user.target.wants/
}
IMAGE_PREPROCESS_COMMAND += "${@base_contains('DISTRO_FEATURES','systemd','activate_systemd_bsc','activate_bsc',d)}; "

View File

@ -0,0 +1,10 @@
DESCRIPTION = "sysmocom BSC/IP image"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
LICENSE = "MIT"
inherit boot-directdisk
ROOTFS = "${DEPLOY_DIR_IMAGE}/sysmocom-bsc-ip-image-${MACHINE}.ext4"
do_bootdirectdisk[depends] += "sysmocom-bsc-ip-image:do_rootfs"

View File

@ -0,0 +1,7 @@
IMAGE_INSTALL = "task-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${ROOTFS_PKGMANAGE} task-osmocom task-sysmocom task-sysmocom-debug task-sysmocom-tools task-gprscore sysmocom-udhcpd-config busybox-udhcpd"
IMAGE_LINGUAS = " "
LICENSE = "MIT"
inherit core-image
IMAGE_ROOTFS_SIZE = "262144"

View File

@ -0,0 +1,10 @@
IMAGE_INSTALL = "task-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} task-osmocom task-sysmocom"
IMAGE_LINGUAS = " "
LICENSE = "MIT"
inherit core-image
IMAGE_ROOTFS_SIZE = "8192"
# remove not needed ipkg informations
ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; "

View File

@ -0,0 +1 @@
require sysmocom-image.inc

View File

@ -0,0 +1,20 @@
DEPENDS = "${MACHINE_EXTRA_RDEPENDS}"
IMAGE_INSTALL = "task-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${ROOTFS_PKGMANAGE} task-osmocom task-sysmocom task-sysmocom-debug task-sysmocom-tools ${MACHINE_EXTRA_RDEPENDS} "
IMAGE_LINGUAS = " "
IMAGE_FEATURES += " package-management "
LICENSE = "MIT"
inherit core-image
IMAGE_ROOTFS_SIZE = "32768"
link_uimage() {
echo "Linking the current uImage to /boot/uImage"
OLD_PWD=$PWD
cd ${IMAGE_ROOTFS}/boot
ln -s uImage-* uImage || true
cd $OLD_PWD
}
IMAGE_PREPROCESS_COMMAND += "link_uimage; "

View File

@ -0,0 +1,12 @@
require sysmocom-image.inc
# This variant of the image will run osmo-bts and osmo-nitb
activate_nitb() {
echo "NO_START=0" > ${IMAGE_ROOTFS}/etc/default/osmo-nitb
}
activate_systemd_nitb() {
ln -sf ${systemd_unitdir}/system/osmo-nitb.service ${IMAGE_ROOTFS}/etc/systemd/system/multi-user.target.wants/
}
IMAGE_PREPROCESS_COMMAND += "${@base_contains('DISTRO_FEATURES','systemd','activate_systemd_nitb','activate_nitb',d)}; "

View File

@ -0,0 +1,63 @@
#!/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/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 \
"
DATE=`date +%Y%m%d`
do_backup_files() {
BACKUP_FILE="/home/root/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.
echo "The backup was stored to $BACKUP_FILE"
}
do_backup_files

View File

@ -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 -C / -xvf $1 --strip=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

View File

@ -0,0 +1,13 @@
DESCRIPTION = "sysmocom config backup and restore scripts"
LICENSE = "GPLv3+"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
PR = "r10"
SRC_URI = "file://sysmocom-backup file://sysmocom-restore"
RDEPENDS_${PN} = "tar"
do_install() {
install -d ${D}${sbindir}
install -m 0755 ${WORKDIR}/sysmocom-backup ${D}${sbindir}/
install -m 0755 ${WORKDIR}/sysmocom-restore ${D}${sbindir}/
}

View File

@ -0,0 +1,9 @@
start 10.23.24.123
end 10.23.24.254
interface eth1
option subnet 10.23.24.0
option router 10.23.24.1
option broadcast 10.23.24.255
option dns 8.8.8.8

View File

@ -0,0 +1,14 @@
DESCRIPTION = "Task for sysmocom external tools"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = "file://udhcpd.conf"
PR = "r3"
CONFFILES_${PN} = "${sysconfdir}/udhcpd.conf"
do_install() {
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/udhcpd.conf ${D}${sysconfdir}/
}

View File

@ -0,0 +1,3 @@
PRINC = "7"
RDEPENDS_task-core-boot += ""

View File

@ -0,0 +1,14 @@
DESCRIPTION = "Task for GPRS core network"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
DEPENDS = "virtual/kernel"
ALLOW_EMPTY_${PN} = "1"
PR = "r1"
RDEPENDS_${PN} = "\
openggsn \
gprs-routing osmo-sgsn \
sysmocom-ggsn-config \
"

View File

@ -0,0 +1,24 @@
DESCRIPTION = "Task for sysmoBTS"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
DEPENDS = "virtual/kernel"
ALLOW_EMPTY_${PN} = "1"
PR = "r21"
CALIB = ""
CALIB_sysmobts-v2 = "sysmobts-calib sysmobts-util"
UTIL = ""
UTIL_sysmobts-2050 = "sbts2050-util gpsd gps-utils"
# TODO: re-add femtobts-calib after it went through the API migration
RDEPENDS_${PN} = "\
osmo-bts \
osmo-bts-remote \
osmo-pcu \
lmsensors-scripts \
${CALIB} \
${UTIL} \
"
PACKAGE_ARCH = "${MACHINE_ARCH}"

View File

@ -0,0 +1,18 @@
DESCRIPTION = "Task for sysmocom development/debugging"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
DEPENDS = "virtual/kernel"
ALLOW_EMPTY_${PN} = "1"
PR = "r4"
RDEPENDS_${PN} = "\
dropbear \
mtd-utils \
strace \
tcpdump \
gdb \
gdbserver \
net-tools \
"

View File

@ -0,0 +1,12 @@
DESCRIPTION = "Task for E1 based sysmocom"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
ALLOW_EMPTY_${PN} = "1"
PR = "r2"
RDEPENDS_${PN} = "\
dahdi-linux \
dahdi-firmware \
dahdi-tools \
"

View File

@ -0,0 +1,12 @@
DESCRIPTION = "Package to force building everything we want to provide"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
ALLOW_EMPTY_${PN} = "1"
PR = "r7"
RDEPENDS_${PN} = "\
task-sysmocom-tools \
task-sysmocom-debug \
minicom vlan patch procps psmisc \
ppp rsync sed usbutils "

View File

@ -0,0 +1,18 @@
DESCRIPTION = "Task for sysmocom external tools"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
ALLOW_EMPTY_${PN} = "1"
PR = "r7"
RDEPENDS_${PN} = "\
lmsensors-scripts \
dropbear \
mtd-utils \
screen \
ethtool \
ntpdate \
wget \
ca-cacert-rootcert \
sysmocom-backup \
"

View File

@ -0,0 +1,18 @@
DESCRIPTION = "Task for sysmocom"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
DEPENDS = "virtual/kernel"
ALLOW_EMPTY_${PN} = "1"
PR = "r11"
RDEPENDS_${PN} = "\
task-sysmocom-tools \
osmo-bsc \
osmo-bsc-mgcp \
osmo-bsc-nat \
osmo-gbproxy \
osmo-nitb \
ipaccess-utils \
"

View File

@ -0,0 +1,4 @@
THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESPATH =. "${@base_set_filespath(["${THISDIR}/files"], d)}:"
PRINC="3"

View File

@ -0,0 +1,11 @@
Welcome to
____ _______ _____
| _ \\__ __/ ____|
___ _ _ ___ _ __ ___ ___ | |_) | | | | (___
/ __| | | / __| '_ ` _ \\ / _ \\| _ < | | \\___ \\
\\__ \\ |_| \\__ \\ | | | | | (_) | |_) | | | ____) |
|___/\\__, |___/_| |_| |_|\\___/|____/ |_| |_____/
__/ |
|___/ by sysmocom GmbH

View File

@ -0,0 +1,11 @@
Welcome to
____ _______ _____
| _ \\__ __/ ____|
___ _ _ ___ _ __ ___ ___ | |_) | | | | (___
/ __| | | / __| '_ ` _ \\ / _ \\| _ < | | \\___ \\
\\__ \\ |_| \\__ \\ | | | | | (_) | |_) | | | ____) |
|___/\\__, |___/_| |_| |_|\\___/|____/ |_| |_____/
__/ |
|___/ by sysmocom GmbH

View File

@ -0,0 +1,11 @@
Welcome to
____ _______ _____
| _ \\__ __/ ____|
___ _ _ ___ _ __ ___ ___ | |_) | | | | (___
/ __| | | / __| '_ ` _ \\ / _ \\| _ < | | \\___ \\
\\__ \\ |_| \\__ \\ | | | | | (_) | |_) | | | ____) |
|___/\\__, |___/_| |_| |_|\\___/|____/ |_| |_____/
__/ |
|___/ by sysmocom GmbH

View File

@ -0,0 +1,11 @@
Welcome to
____ _______ _____
| _ \\__ __/ ____|
___ _ _ ___ _ __ ___ ___ | |_) | | | | (___
/ __| | | / __| '_ ` _ \\ / _ \\| _ < | | \\___ \\
\\__ \\ |_| \\__ \\ | | | | | (_) | |_) | | | ____) |
|___/\\__, |___/_| |_| |_|\\___/|____/ |_| |_____/
__/ |
|___/ by sysmocom GmbH

View File

@ -0,0 +1,23 @@
DESCRIPTION = "Set an early date on RTC less systems"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
SRC_URI = "\
file://early-date \
file://early-date.service"
FILES_${PN} = "${systemd_unitdir}/system /sbin"
RDPEPENDS_${PN} = "systemd"
do_install() {
install -d ${D}/sbin
install -d ${D}${systemd_unitdir}/system/basic.target.wants
# Copy the service file and link it
install -m 0644 ${WORKDIR}/early-date.service ${D}${systemd_unitdir}/system
ln -sf ../early-date.service ${D}${systemd_unitdir}/system/basic.target.wants/
# Hardcode to /sbin
# TODO: Set the date as of the build time..
install -m 0755 ${WORKDIR}/early-date ${D}/sbin
}

View File

@ -0,0 +1,10 @@
#!/bin/sh
# Check if the year is lower than the lowest configured and then
# set a default date
YEAR=`date +%Y`
if [ $YEAR -lt 2014 ]; then
date -s 2014.07.18-10:00:00
hwclock -w
fi

View File

@ -0,0 +1,14 @@
[Unit]
Description=Early boot time for RTC less systems
DefaultDependencies=no
After=systemd-remount-fs.service
Before=sysinit.target
[Service]
ExecStart=/sbin/early-date
RemainAfterExit=No
Type=oneshot
StandardOutput=syslog
[Install]
WantedBy=basic.target

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,321 @@
CONFIG_EXPERIMENTAL=y
CONFIG_LOCALVERSION="-PD13.1.2"
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_BLK_DEV_INITRD=y
CONFIG_CGROUPS=y
# CONFIG_PERF_EVENTS is not set
CONFIG_SLAB=y
CONFIG_PROFILING=y
CONFIG_OPROFILE=y
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
# CONFIG_BLK_DEV_BSG is not set
CONFIG_ARCH_OMAP=y
CONFIG_OMAP_MUX_DEBUG=y
# CONFIG_OMAP_MCBSP is not set
CONFIG_OMAP_MBOX_FWK=y
# CONFIG_OMAP_32K_TIMER is not set
# CONFIG_ARCH_OMAP2 is not set
# CONFIG_ARCH_OMAP4 is not set
# CONFIG_SOC_OMAP3430 is not set
# CONFIG_SOC_OMAPTI81XX is not set
# CONFIG_MACH_OMAP3_BEAGLE is not set
# CONFIG_MACH_DEVKIT8000 is not set
# CONFIG_MACH_OMAP_LDP is not set
# CONFIG_MACH_OMAP3530_LV_SOM is not set
# CONFIG_MACH_OMAP3_TORPEDO is not set
# CONFIG_MACH_ENCORE is not set
# CONFIG_MACH_OVERO is not set
# CONFIG_MACH_OMAP3EVM is not set
# CONFIG_MACH_OMAP3517EVM is not set
# CONFIG_MACH_OMAP3_PANDORA is not set
# CONFIG_MACH_OMAP3_TOUCHBOOK is not set
# CONFIG_MACH_OMAP_3430SDP is not set
# CONFIG_MACH_NOKIA_RM680 is not set
# CONFIG_MACH_NOKIA_RX51 is not set
# CONFIG_MACH_OMAP_ZOOM2 is not set
# CONFIG_MACH_OMAP_ZOOM3 is not set
# CONFIG_MACH_CM_T35 is not set
# CONFIG_MACH_CM_T3517 is not set
# CONFIG_MACH_IGEP0020 is not set
# CONFIG_MACH_IGEP0030 is not set
# CONFIG_MACH_SBC3530 is not set
# CONFIG_MACH_OMAP_3630SDP is not set
# CONFIG_MACH_AM335XEVM is not set
# CONFIG_MACH_AM335XIAEVM is not set
CONFIG_OMAP3_EDMA=y
CONFIG_ARM_THUMBEE=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_HIGHMEM=y
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO0,115200"
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_IDLE=y
CONFIG_FPE_NWFPE=y
CONFIG_BINFMT_MISC=y
# CONFIG_SUSPEND is not set
CONFIG_PM_DEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
CONFIG_NETFILTER=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_LOG=y
CONFIG_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_CAN=y
CONFIG_CAN_RAW=y
CONFIG_CAN_BCM=y
CONFIG_CAN_D_CAN=y
CONFIG_CAN_D_CAN_PLATFORM=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_RFKILL=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_MTD=y
CONFIG_MTD_TESTS=m
CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_OF_PARTS is not set
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_OMAP2=y
CONFIG_MTD_ONENAND=y
CONFIG_MTD_ONENAND_VERIFY_WRITE=y
CONFIG_MTD_ONENAND_OMAP2=y
CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_MISC_DEVICES=y
CONFIG_SENSORS_TSL2550=y
CONFIG_EEPROM_AT24=y
CONFIG_SENSORS_LIS3_I2C=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_NETDEVICES=y
CONFIG_TUN=y
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_STMICRO is not set
CONFIG_TI_DAVINCI_EMAC=y
CONFIG_TI_CPSW=y
CONFIG_TI_CPSW_DUAL_EMAC=y
CONFIG_SMSC_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_USB_USBNET=y
# CONFIG_USB_NET_AX8817X is not set
# CONFIG_USB_NET_CDC_NCM is not set
# CONFIG_USB_NET_NET1080 is not set
# CONFIG_USB_BELKIN is not set
# CONFIG_USB_ARMLINUX is not set
# CONFIG_USB_NET_ZAURUS is not set
CONFIG_WL12XX_MENU=y
CONFIG_WL12XX=m
CONFIG_WL12XX_SDIO=m
CONFIG_INPUT_EVDEV=y
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_MATRIX=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_EDT_FT5X06=y
CONFIG_TOUCHSCREEN_TI_TSC=y
CONFIG_INPUT_MISC=y
# CONFIG_SERIO_SERPORT is not set
CONFIG_VT_HW_CONSOLE_BINDING=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
# CONFIG_HW_RANDOM is not set
CONFIG_I2C_CHARDEV=y
CONFIG_SPI=y
CONFIG_SPI_OMAP24XX=y
CONFIG_GPIO_SYSFS=y
CONFIG_GENERIC_PWM=y
CONFIG_DAVINCI_EHRPWM=y
CONFIG_ECAP_PWM=y
CONFIG_SENSORS_LM75=y
CONFIG_WATCHDOG=y
CONFIG_OMAP_WATCHDOG=y
CONFIG_MFD_TI_TSCADC=y
CONFIG_MFD_TPS65910=y
CONFIG_REGULATOR_DUMMY=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_TPS65910=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_DEV=y
CONFIG_MEDIA_TUNER_CUSTOMISE=y
# CONFIG_MEDIA_TUNER_SIMPLE is not set
# CONFIG_MEDIA_TUNER_TDA8290 is not set
# CONFIG_MEDIA_TUNER_TDA827X is not set
# CONFIG_MEDIA_TUNER_TDA18271 is not set
# CONFIG_MEDIA_TUNER_TDA9887 is not set
# CONFIG_MEDIA_TUNER_TEA5761 is not set
# CONFIG_MEDIA_TUNER_TEA5767 is not set
# CONFIG_MEDIA_TUNER_MT20XX is not set
# CONFIG_MEDIA_TUNER_MT2060 is not set
# CONFIG_MEDIA_TUNER_MT2266 is not set
# CONFIG_MEDIA_TUNER_MT2131 is not set
# CONFIG_MEDIA_TUNER_QT1010 is not set
# CONFIG_MEDIA_TUNER_XC2028 is not set
# CONFIG_MEDIA_TUNER_XC5000 is not set
# CONFIG_MEDIA_TUNER_XC4000 is not set
# CONFIG_MEDIA_TUNER_MXL5005S is not set
# CONFIG_MEDIA_TUNER_MXL5007T is not set
# CONFIG_MEDIA_TUNER_MC44S803 is not set
# CONFIG_MEDIA_TUNER_MAX2165 is not set
# CONFIG_MEDIA_TUNER_TDA18218 is not set
# CONFIG_MEDIA_TUNER_TDA18212 is not set
CONFIG_USB_VIDEO_CLASS=y
# CONFIG_RADIO_ADAPTERS is not set
CONFIG_FB=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y
CONFIG_FB_DA8XX=y
CONFIG_FB_DA8XX_CONSISTENT_DMA_SIZE=8
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_BACKLIGHT_PWM=y
CONFIG_BACKLIGHT_TLC59108=y
CONFIG_DISPLAY_SUPPORT=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
CONFIG_LOGO=y
CONFIG_SOUND=y
CONFIG_SND=y
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_ARM is not set
# CONFIG_SND_SPI is not set
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_SOC=y
CONFIG_SND_AM33XX_SOC=y
CONFIG_SND_PCM051_SOC_BOARD=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_DEVICEFS=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_WHITELIST is not set
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_TI81XX_GLUE=y
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_STORAGE=y
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MUSB_HDRC=y
CONFIG_USB_ZERO=m
CONFIG_USB_ETH=m
CONFIG_USB_FILE_STORAGE=m
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_SERIAL=m
CONFIG_MMC=y
CONFIG_MMC_UNSAFE_RESUME=y
CONFIG_SDIO_UART=y
CONFIG_MMC_OMAP_HS=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_M41T80=y
CONFIG_RTC_DRV_TPS65910=y
CONFIG_RTC_DRV_OMAP=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
CONFIG_QUOTA=y
CONFIG_QFMT_V2=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_JFFS2_COMPRESSION_OPTIONS=y
CONFIG_JFFS2_LZO=y
CONFIG_JFFS2_RUBIN=y
CONFIG_UBIFS_FS=y
CONFIG_CRAMFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_FTRACE is not set
CONFIG_DYNAMIC_DEBUG=y
# CONFIG_ARM_UNWIND is not set
CONFIG_DEBUG_LL=y
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_JTAG_ENABLE=y
CONFIG_SECURITY=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_MICHAEL_MIC=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_HW is not set
CONFIG_CRC_CCITT=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=y
CONFIG_CRC7=y
CONFIG_LIBCRC32C=y
CONFIG_USB_ACM=y

View File

@ -0,0 +1,23 @@
DESCRIPTION = "sysmocom Kernel"
SECTION = "kernel"
LICENSE = "GPLv2"
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"
FILES_${PN} = ""
# Remove when using a Poky/OE-Core with that includes e0bf758982843ec1981b74410616b3492c599d06
pkg_postinst_kernel () {
update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
}
pkg_postrm_kernel () {
update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
inherit kernel
require linux-sysmocom.inc
LINUX_VERSION ?= "3.2.48"
LINUX_VERSION_EXTENSION ?= "-sysmocom-${LINUX_KERNEL_TYPE}"
# Overrides for the sysmocom bts v1
BTS_FIRMWARE_NAME_sysmobts-v1 = "sysmobts-v1"
# Overrides for the sysmocom bts v2
BTS_FIRMWARE_NAME_sysmobts-v2 = "sysmobts-v2"
BTS_FIRMWARE_NAME_sysmobts-2050 = "sysmobts-v2"
SRCREV = "bcc4fa827be7f59486ff305d664b42a142025f9b"
# odu handling.
SRCREV_sysmocom-odu = "f11945e1d688bef5d2a81cc0255b19ed416cab42"
LINUX_VERSION_sysmocom-odu = "3.2.0"
PR = "r34"
PV = "${LINUX_VERSION}+git${SRCPV}"
SRC_URI = "git://git.sysmocom.de/sysmo-bts/linux.git;protocol=git;branch=v3.2 \
file://mISDN_loop.patch;patch=1 \
file://defconfig"
S = "${WORKDIR}/git"
COMPATIBLE_MACHINE = "(sysmobts-v1|sysmobts-v2|sysmobts-2050|sysmocom-odu)"
EXTRA_OEMAKE += "KALLSYMS_EXTRA_PASS=1"
# we do not want to have the kernel image inside the kernel
FILES_kernel-image_sysmobts-v1 = ""
require linux-tools.inc
do_configure() {
install -m 0644 ${WORKDIR}/defconfig ${S}/.config
oe_runmake oldconfig
}
# autoload defaults (alphabetically sorted)
module_autoload_davinci_mmc = "davinci_mmc"
module_autoload_davinci_wdt = "davinci_wdt"
module_autoload_dspdl_dm644x = "dspdl_dm644x"
module_autoload_fpgadl_par = "fpgadl_par"
module_autoload_leds-gpio = "leds-gpio"
module_autoload_mmc_block = "mmc_block"
module_autoload_msgqueue = "msgqueue"
module_autoload_rtfifo = "rtfifo"
# module configs (alphabetically sorted)
module_conf_dspdl_dm644x = "options dspdl_dm644x fw_name=${BTS_FIRMWARE_NAME}.out debug=0"
module_conf_fpgadl_par = "options fpgadl_par fw_name=${BTS_FIRMWARE_NAME}.bit"
module_conf_msgqueue = "options msgqueue fw_name=${BTS_FIRMWARE_NAME}.out"
module_conf_rtfifo = "options rtfifo fw_name=${BTS_FIRMWARE_NAME}.out"
RDEPENDS_kernel-module-dspdl-dm644x += "sysmobts-firmware"
RDEPENDS_kernel-module-fpgadl-par += "sysmobts-firmware"
RDEPENDS_kernel-module-msgqueue += "sysmobts-firmware"
RDEPENDS_kernel-module-rtfifo += "sysmobts-firmware"
DEFAULT_PREFERENCE = "20"

View File

@ -0,0 +1,64 @@
inherit kernel
require linux-sysmocom.inc
DEPENDS += "bc-native"
# at versions changes do not forget to update conf/machine/include/sysmobts.inc too
LINUX_VERSION ?= "3.10.50"
LINUX_VERSION_EXTENSION ?= "-sysmocom-${LINUX_KERNEL_TYPE}"
# Overrides for the sysmocom bts v1
BTS_FIRMWARE_NAME_sysmobts-v1 = "sysmobts-v1"
# Overrides for the sysmocom bts v2
BTS_FIRMWARE_NAME_sysmobts-v2 = "sysmobts-v2"
BTS_FIRMWARE_NAME_sysmobts-2050 = "sysmobts-v2"
SRCREV = "9610e792ffde7fb2599d19ca6d2a03230f2043c6"
PR = "r35"
PV = "${LINUX_VERSION}+git${SRCPV}"
SRC_URI = "git://git.sysmocom.de/sysmo-bts/linux.git;protocol=git;branch=v3.10 \
file://defconfig"
# tmp disabled.. patch needs to be rebased for 3.10
# file://mISDN_loop.patch;patch=1
S = "${WORKDIR}/git"
COMPATIBLE_MACHINE = "(sysmobts-v1|sysmobts-v2|sysmobts-2050|sysmocom-bsc)"
EXTRA_OEMAKE += "KALLSYMS_EXTRA_PASS=1"
# we do not want to have the kernel image inside the kernel
FILES_kernel-image_sysmobts-v1 = ""
require linux-tools.inc
do_configure() {
install -m 0644 ${WORKDIR}/defconfig ${S}/.config
oe_runmake oldconfig
}
# autoload defaults (alphabetically sorted)
module_autoload_davinci_mmc = "davinci_mmc"
module_autoload_davinci_wdt = "davinci_wdt"
module_autoload_dspdl_dm644x = "dspdl_dm644x"
module_autoload_fpgadl_par = "fpgadl_par"
module_autoload_leds-gpio = "leds-gpio"
module_autoload_mmc_block = "mmc_block"
module_autoload_msgqueue = "msgqueue"
module_autoload_rtfifo = "rtfifo"
# module configs (alphabetically sorted)
module_conf_dspdl_dm644x = "options dspdl_dm644x fw_name=${BTS_FIRMWARE_NAME}.out debug=0"
module_conf_fpgadl_par = "options fpgadl_par fw_name=${BTS_FIRMWARE_NAME}.bit"
module_conf_msgqueue = "options msgqueue fw_name=${BTS_FIRMWARE_NAME}.out"
module_conf_rtfifo = "options rtfifo fw_name=${BTS_FIRMWARE_NAME}.out"
RDEPENDS_kernel-module-dspdl-dm644x += "sysmobts-firmware"
RDEPENDS_kernel-module-fpgadl-par += "sysmobts-firmware"
RDEPENDS_kernel-module-msgqueue += "sysmobts-firmware"
RDEPENDS_kernel-module-rtfifo += "sysmobts-firmware"
DEFAULT_PREFERENCE = "-1"

View File

@ -0,0 +1,29 @@
# included by kernel recipes if they want to build/provide
# perf functionality from their tree.
do_compile_perf_libc-uclibc () {
:
}
do_install_perf_libc-uclibc () {
:
}
do_compile_perf() {
oe_runmake -C ${S}/tools/perf CC="${CC}" LD="${LD}" prefix=${prefix} NO_NEWT=1 NO_DWARF=1
}
do_install_perf() {
oe_runmake -C ${S}/tools/perf CC="${CC}" LD="${LD}" prefix=${prefix} DESTDIR=${D} install NO_NEWT=1 NO_DWARF=1
}
# perf tasks
# TODO: enable with newer kernels
#addtask compile_perf after do_compile before do_install
#addtask install_perf after do_install before do_package
PERFDEPENDS = "virtual/libc:do_populate_sysroot elfutils:do_populate_sysroot"
PERFDEPENDS_libc-uclibc = ""
PERFRDEPENDS = "python perl elfutils"
PERFRDEPENDS_libc-uclibc = ""
do_compile_perf[depends] = "${PERFDEPENDS}"
RDEPENDS_perf += "${PERFRDEPENDS}"

View File

@ -0,0 +1,20 @@
inherit kernel
require linux-sysmocom.inc
LINUX_VERSION ?= "${PV}"
PR = "r15"
SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v2.6/linux-${PV}.tar.bz2 \
ftp://ftp.servus.at/linux-kernel/patch-2.6.39.4.bz2;apply=yes;name=stablepatch \
file://mISDN_loop.patch \
file://defconfig"
COMPATIBLE_MACHINE = "(sysmocom-bsc)"
require linux-tools.inc
do_configure() {
install -m 0644 ${WORKDIR}/defconfig ${S}/.config
oe_runmake oldconfig
}

View File

@ -0,0 +1,9 @@
# Depend on the osmocom toolchain
require recipes-osmocom/meta/meta-toolchain-osmo.bb
# Change the name
TOOLCHAIN_OUTPUTNAME = "${SDK_NAME}-toolchain-sysmobts-${DISTRO_VERSION}-${DATETIME}"
# Add API headers..
TOOLCHAIN_TARGET_TASK += "femtobts-api-dev"

View File

@ -0,0 +1,8 @@
# TODO: When dropping netbase for edison we can rename it
SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/netbase-${PV}:${SYSMOCOM}/netbase:"
PRINC = "4"
# systemd does not look at /etc/rcS.d for the script. Make sure
# there is a symlink available
INITSCRIPT_PARAMS = "start 40 S 2 . stop 40 0 6 1 ."

View File

@ -0,0 +1,16 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
#eth0 is our gateway to the network. ifplugd will run ifup/ifdown for us
iface eth0 inet dhcp
#eth0 will provide dhcp to clients
#auto eth0:1
#iface eth0:1 inet static
# address 10.42.123.1
# netmask 255.255.255.0
# network 10.42.123.0

View File

@ -0,0 +1,16 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
#eth0 is our gateway to the network. ifplugd will run ifup/ifdown for us
iface eth0 inet dhcp
#eth0 will provide dhcp to clients
#auto eth0:1
#iface eth0:1 inet static
# address 10.42.123.1
# netmask 255.255.255.0
# network 10.42.123.0

View File

@ -0,0 +1,22 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
#eth0 is our gateway to the network. ifplugd will run ifup/ifdown for us
iface eth0 inet dhcp
#eth1 will provide dhcp to clients
auto eth1
iface eth1 inet static
address 10.23.24.1
netmask 255.255.255.0
network 10.23.24.0
auto eth1:1
iface eth1:1 inet static
address 10.23.123.1
netmask 255.255.255.0
network 10.23.123.0

View File

@ -0,0 +1,16 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
auto lo eth0 eth1
# The loopback interface
iface lo inet loopback
# eth0
iface eth0 inet dhcp
# eth1
iface eth1 inet static
address 192.168.4.11
netmask 255.255.255.0

View File

@ -0,0 +1,7 @@
SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/${PN}-${PV}:${SYSMOCOM}/${PN}:"
PRINC = "18"
# bug in poky meta/classes/base.bbclass
PACKAGE_ARCH = "${MACHINE_ARCH}"

View File

@ -0,0 +1,31 @@
#! /bin/sh
FLAGS="defaults 23"
test -f /usr/bin/ntpd || exit 0
case "$1" in
start)
echo -n "Starting NTP server: ntpd"
start-stop-daemon --start --quiet --exec /usr/bin/ntpd
echo "."
;;
stop)
echo -n "Stopping NTP server: ntpd"
start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
echo "."
;;
restart|force-reload)
echo -n "Restarting NTP server: ntpd... "
start-stop-daemon --stop --quiet --exec /usr/bin/ntpd
sleep 2
start-stop-daemon --start --quiet --exec /usr/bin/ntpd
echo "done."
;;
*)
echo "Usage: /etc/init.d/ntp {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,17 @@
--- a/include/ntp_syscall.h.orig 2009-05-19 16:44:55.048156467 -0400
+++ b/include/ntp_syscall.h 2009-05-19 16:46:19.293323686 -0400
@@ -14,6 +14,14 @@
# include <sys/timex.h>
#endif
+#if defined(ADJ_NANO) && !defined(MOD_NANO)
+#define MOD_NANO ADJ_NANO
+#endif
+
+#if defined(ADJ_TAI) && !defined(MOD_TAI)
+#define MOD_TAI ADJ_TAI
+#endif
+
#ifndef NTP_SYSCALLS_LIBC
#ifdef NTP_SYSCALLS_STD
# define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))

View File

@ -0,0 +1,14 @@
# This is the most basic ntp configuration file
# The driftfile must remain in a place specific to this
# machine - it records the machine specific clock error
driftfile /etc/ntp.drift
# This obtains a random server which will be close
# (in IP terms) to the machine. Add other servers
# as required, or change this.
server pool.ntp.org
# Using local hardware clock as fallback
# Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself
server 127.127.1.0
fudge 127.127.1.0 stratum 14
# Defining a default security setting
restrict default

View File

@ -0,0 +1,62 @@
#! /bin/sh
#
# ntpd init.d script for ntpdc from ntp.isc.org
test -x /usr/bin/ntpd -a -r /etc/ntp.conf || exit 0
# rcS contains TICKADJ
test -r /etc/default/rcS && . /etc/default/rcS
# Functions to do individual actions
settick(){
# If TICKADJ is set we *must* adjust it before we start, because the
# driftfile relies on the correct setting
test -n "$TICKADJ" -a -x /usr/bin/tickadj && {
echo -n "Setting tick to $TICKADJ: "
/usr/bin/tickadj "$TICKADJ"
echo "done"
}
}
startdaemon(){
# The -g option allows ntpd to step the time to correct it just
# once. The daemon will exit if the clock drifts too much after
# this. If ntpd seems to disappear after a while assume TICKADJ
# above is set to a totally incorrect value.
echo -n "Starting ntpd: "
start-stop-daemon --start -x /usr/bin/ntpd -- -p /var/run/ntp.pid "$@"
echo "done"
}
stopdaemon(){
echo -n "Stopping ntpd: "
start-stop-daemon --stop -p /var/run/ntp.pid
echo "done"
}
case "$1" in
start)
settick
startdaemon -g
;;
stop)
stopdaemon
;;
force-reload)
stopdaemon
settick
startdaemon -g
;;
restart)
# Don't reset the tick here
stopdaemon
startdaemon -g
;;
reload)
# Must do this by hand, but don't do -g
stopdaemon
startdaemon
;;
*)
echo "Usage: ntpd { start | stop | restart | reload }" >&2
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,11 @@
[Unit]
Description=Network Time Service
After=network.target
[Service]
Type=forking
PIDFile=/run/ntpd.pid
ExecStart=/usr/bin/ntpd -p /run/ntpd.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,49 @@
#!/bin/sh
PATH=/sbin:/bin:/usr/bin
test -x /usr/bin/ntpdate || exit 0
if test -f /etc/default/ntpdate ; then
. /etc/default/ntpdate
else
NTPSERVERS="pool.ntp.org"
fi
test -n "$NTPSERVERS" || exit 0
# This is a heuristic: The idea is that if a static interface is brought
# up, that is a major event, and we can put in some extra effort to fix
# the system time. Feel free to change this, especially if you regularly
# bring up new network interfaces.
if [ "$METHOD" = static ]; then
OPTS="-b"
fi
if [ "$METHOD" = loopback ]; then
exit 0
fi
(
LOCKFILE=/var/lock/ntpdate
# Avoid running more than one at a time
if [ -x /usr/bin/lockfile-create ]; then
lockfile-create $LOCKFILE
lockfile-touch $LOCKFILE &
LOCKTOUCHPID="$!"
fi
if /usr/bin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then
if [ "$UPDATE_HWCLOCK" = "yes" ]; then
hwclock --systohc || :
fi
fi
if [ -x /usr/bin/lockfile-create ] ; then
kill $LOCKTOUCHPID
lockfile-remove $LOCKFILE
fi
) &

View File

@ -0,0 +1,11 @@
[Unit]
Description=Network Time Service (one-shot ntpdate mode)
Before=ntpd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/ntpd -q -g -x
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,32 @@
Index: ntp-4.2.2p3-r0/ntp-4.2.2p3/util/tickadj.c
===================================================================
--- ntp-4.2.2p3/util/tickadj.c 2004-02-25 06:58:33.000000000 +0100
+++ ntp-4.2.2p3/util/tickadj.c 2007-07-07 01:00:54.000000000 +0200
@@ -21,7 +21,8 @@
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE___ADJTIMEX /* Linux */
+/* proper handling here has been moved to upstream ntp bugzilla */
+#ifdef linux
#include <sys/timex.h>
struct timex txc;
@@ -91,7 +92,7 @@
}
if (!errflg) {
- if (__adjtimex(&txc) < 0)
+ if (adjtimex(&txc) < 0)
perror("adjtimex");
else if (!quiet)
printf("tick = %ld\ntick_adj = %d\n",
@@ -146,7 +147,7 @@
#endif
}
- if (__adjtimex(&txc) < 0)
+ if (adjtimex(&txc) < 0)
{
perror("adjtimex");
}

View File

@ -0,0 +1,35 @@
DESCRIPTION = "The Network Time Protocol (NTP) is used to \
synchronize the time of a computer client or server to \
another server or reference time source, such as a radio \
or satellite receiver or modem."
HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome"
SECTION = "console/network"
LICENSE = "ntp"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670"
RSUGGESTS_${PN} = "iana-etc"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://ipv6only-workaround.patch \
file://ntpd \
file://ntp.conf \
file://ntpdate \
file://ntpd.service \
"
inherit autotools update-rc.d
INITSCRIPT_NAME = "ntpd"
# No dependencies, so just go in at the standard level (20)
INITSCRIPT_PARAMS = "defaults"
# The ac_cv_header_readline_history is to stop ntpdc depending on either
# readline or curses
EXTRA_OECONF = "--without-openssl --without-crypto ac_cv_header_readline_history_h=no"
CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
PACKAGES += "ntpdate ${PN}-bin ${PN}-tickadj ${PN}-utils"
# NOTE: you don't need ntpdate, use "ntpd -q -g -x"
# or the ntpdate systemd service
# This should use rc.update
FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/init.d/ntpdate"

View File

@ -0,0 +1,63 @@
require ntp.inc
PR = "r5"
#inherit systemd
#SYSTEMD_PACKAGES = "${PN}-systemd"
#SYSTEMD_SERVICE_${PN}-systemd = "ntpd.service"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://tickadj.c.patch \
file://ntp-4.2.4_p6-nano.patch \
file://ntpd \
file://ntp.conf \
file://ntpdate \
file://ntpdate.service \
file://ntpd.service \
"
SRC_URI[md5sum] = "59876a9009b098ff59767ee45a88ebd2"
SRC_URI[sha256sum] = "6e84d4ddfa14b911c3ed88463af10867e1fa9b287e7b34d8a02e78be85a7c40e"
EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
install -d ${D}/${sysconfdir}/network/if-up.d
install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/network/if-up.d
#install -d ${D}${systemd_unitdir}/system
#install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
#install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
}
#PACKAGES =+ "${PN}-systemd"
#FILES_${PN}-systemd = "${systemd_unitdir}/system/"
#RDEPENDS_${PN}-systemd = "${PN}"
FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
FILES_${PN}-tickadj = "${bindir}/tickadj"
FILES_ntp-utils = "${bindir}/*"
FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate"
# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
# with wonky clocks (e.g. OpenSlug)
RDEPENDS_${PN} = "${PN}-tickadj"
pkg_postinst_ntpdate() {
if test "x$D" != "x"; then
exit 1
else
if ! grep -q -s ntpdate /var/spool/cron/root; then
echo "adding crontab"
test -d /var/spool/cron || mkdir -p /var/spool/cron
echo "30 * * * * /usr/bin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root
fi
fi
}

View File

@ -0,0 +1,57 @@
#!/bin/sh
cd /sys/class/gpio
# !mdm1_pwr_ind
echo 22 > export
echo in > ./gpio22/direction
# mdm1_rst=0
echo 26 > export
echo out > ./gpio26/direction
echo 0 > ./gpio26/value
# !mdm1_shdn=1
echo 59 > export
echo out > ./gpio59/direction
echo 1 > ./gpio59/value
# mdm_ldo_en=1
echo 58 > export
echo out > ./gpio58/direction
echo 1 > ./gpio58/value
# !mdm2_pwr_ind
echo 57 > export
echo in > ./gpio57/direction
# mdm2_rst=0
echo 55 > export
echo out > ./gpio55/direction
echo 0 > ./gpio55/value
# mdm2_on=1
echo 50 > export
echo out > ./gpio50/direction
echo 1 > ./gpio50/value
# !gnss_rst=1
echo 114 > export
echo out > ./gpio114/direction
echo 1 > ./gpio114/value
# !adsb_rst=1
echo 53 > export
echo out > ./gpio53/direction
echo 1 > ./gpio53/value
# adsb_frame
echo 54 > export
echo in > ./gpio54/direction
# !hub_reset
echo 62 > export
echo out > ./gpio62/direction
echo 0 > ./gpio62/value
sleep 1
echo 1 > ./gpio62/value

View File

@ -0,0 +1,335 @@
/*
i2c-dev.h - i2c-bus driver, char device interface
Copyright (C) 1995-97 Simon G. Vogl
Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA.
*/
/* $Id: i2c-dev.h 5894 2010-12-12 13:22:29Z khali $ */
#ifndef LIB_I2CDEV_H
#define LIB_I2CDEV_H
#include <linux/types.h>
#include <sys/ioctl.h>
/* -- i2c.h -- */
/*
* I2C Message - used for pure i2c transaction, also from /dev interface
*/
struct i2c_msg {
__u16 addr; /* slave address */
unsigned short flags;
#define I2C_M_TEN 0x10 /* we have a ten bit chip address */
#define I2C_M_RD 0x01
#define I2C_M_NOSTART 0x4000
#define I2C_M_REV_DIR_ADDR 0x2000
#define I2C_M_IGNORE_NAK 0x1000
#define I2C_M_NO_RD_ACK 0x0800
short len; /* msg length */
char *buf; /* pointer to msg data */
};
/* To determine what functionality is present */
#define I2C_FUNC_I2C 0x00000001
#define I2C_FUNC_10BIT_ADDR 0x00000002
#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
#define I2C_FUNC_SMBUS_PEC 0x00000008
#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
#define I2C_FUNC_SMBUS_QUICK 0x00010000
#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
I2C_FUNC_SMBUS_WRITE_BYTE)
#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
I2C_FUNC_SMBUS_WRITE_WORD_DATA)
#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
/* Old name, for compatibility */
#define I2C_FUNC_SMBUS_HWPEC_CALC I2C_FUNC_SMBUS_PEC
/*
* Data for SMBus Messages
*/
#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
#define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */
union i2c_smbus_data {
__u8 byte;
__u16 word;
__u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
/* and one more for PEC */
};
/* smbus_access read or write markers */
#define I2C_SMBUS_READ 1
#define I2C_SMBUS_WRITE 0
/* SMBus transaction types (size parameter in the above functions)
Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
#define I2C_SMBUS_QUICK 0
#define I2C_SMBUS_BYTE 1
#define I2C_SMBUS_BYTE_DATA 2
#define I2C_SMBUS_WORD_DATA 3
#define I2C_SMBUS_PROC_CALL 4
#define I2C_SMBUS_BLOCK_DATA 5
#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
#define I2C_SMBUS_I2C_BLOCK_DATA 8
/* ----- commands for the ioctl like i2c_command call:
* note that additional calls are defined in the algorithm and hw
* dependent layers - these can be listed here, or see the
* corresponding header files.
*/
/* -> bit-adapter specific ioctls */
#define I2C_RETRIES 0x0701 /* number of times a device address */
/* should be polled when not */
/* acknowledging */
#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */
/* this is for i2c-dev.c */
#define I2C_SLAVE 0x0703 /* Change slave address */
/* Attn.: Slave address is 7 or 10 bits */
#define I2C_SLAVE_FORCE 0x0706 /* Change slave address */
/* Attn.: Slave address is 7 or 10 bits */
/* This changes the address, even if it */
/* is already taken! */
#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
#define I2C_FUNCS 0x0705 /* Get the adapter functionality */
#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/
#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */
#define I2C_SMBUS 0x0720 /* SMBus-level access */
/* -- i2c.h -- */
/* Note: 10-bit addresses are NOT supported! */
/* This is the structure as used in the I2C_SMBUS ioctl call */
struct i2c_smbus_ioctl_data {
char read_write;
__u8 command;
int size;
union i2c_smbus_data *data;
};
/* This is the structure as used in the I2C_RDWR ioctl call */
struct i2c_rdwr_ioctl_data {
struct i2c_msg *msgs; /* pointers to i2c_msgs */
int nmsgs; /* number of i2c_msgs */
};
static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
int size, union i2c_smbus_data *data)
{
struct i2c_smbus_ioctl_data args;
args.read_write = read_write;
args.command = command;
args.size = size;
args.data = data;
return ioctl(file,I2C_SMBUS,&args);
}
static inline __s32 i2c_smbus_write_quick(int file, __u8 value)
{
return i2c_smbus_access(file,value,0,I2C_SMBUS_QUICK,NULL);
}
static inline __s32 i2c_smbus_read_byte(int file)
{
union i2c_smbus_data data;
if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data))
return -1;
else
return 0x0FF & data.byte;
}
static inline __s32 i2c_smbus_write_byte(int file, __u8 value)
{
return i2c_smbus_access(file,I2C_SMBUS_WRITE,value,
I2C_SMBUS_BYTE,NULL);
}
static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command)
{
union i2c_smbus_data data;
if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
I2C_SMBUS_BYTE_DATA,&data))
return -1;
else
return 0x0FF & data.byte;
}
static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
__u8 value)
{
union i2c_smbus_data data;
data.byte = value;
return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
I2C_SMBUS_BYTE_DATA, &data);
}
static inline __s32 i2c_smbus_read_word_data(int file, __u8 command)
{
union i2c_smbus_data data;
if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
I2C_SMBUS_WORD_DATA,&data))
return -1;
else
return 0x0FFFF & data.word;
}
static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,
__u16 value)
{
union i2c_smbus_data data;
data.word = value;
return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
I2C_SMBUS_WORD_DATA, &data);
}
static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value)
{
union i2c_smbus_data data;
data.word = value;
if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
I2C_SMBUS_PROC_CALL,&data))
return -1;
else
return 0x0FFFF & data.word;
}
/* Returns the number of read bytes */
static inline __s32 i2c_smbus_read_block_data(int file, __u8 command,
__u8 *values)
{
union i2c_smbus_data data;
int i;
if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
I2C_SMBUS_BLOCK_DATA,&data))
return -1;
else {
for (i = 1; i <= data.block[0]; i++)
values[i-1] = data.block[i];
return data.block[0];
}
}
static inline __s32 i2c_smbus_write_block_data(int file, __u8 command,
__u8 length, const __u8 *values)
{
union i2c_smbus_data data;
int i;
if (length > 32)
length = 32;
for (i = 1; i <= length; i++)
data.block[i] = values[i-1];
data.block[0] = length;
return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
I2C_SMBUS_BLOCK_DATA, &data);
}
/* Returns the number of read bytes */
/* Until kernel 2.6.22, the length is hardcoded to 32 bytes. If you
ask for less than 32 bytes, your code will only work with kernels
2.6.23 and later. */
static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command,
__u8 length, __u8 *values)
{
union i2c_smbus_data data;
int i;
if (length > 32)
length = 32;
data.block[0] = length;
if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
length == 32 ? I2C_SMBUS_I2C_BLOCK_BROKEN :
I2C_SMBUS_I2C_BLOCK_DATA,&data))
return -1;
else {
for (i = 1; i <= data.block[0]; i++)
values[i-1] = data.block[i];
return data.block[0];
}
}
static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command,
__u8 length,
const __u8 *values)
{
union i2c_smbus_data data;
int i;
if (length > 32)
length = 32;
for (i = 1; i <= length; i++)
data.block[i] = values[i-1];
data.block[0] = length;
return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
I2C_SMBUS_I2C_BLOCK_BROKEN, &data);
}
/* Returns the number of read bytes */
static inline __s32 i2c_smbus_block_process_call(int file, __u8 command,
__u8 length, __u8 *values)
{
union i2c_smbus_data data;
int i;
if (length > 32)
length = 32;
for (i = 1; i <= length; i++)
data.block[i] = values[i-1];
data.block[0] = length;
if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
I2C_SMBUS_BLOCK_PROC_CALL,&data))
return -1;
else {
for (i = 1; i <= data.block[0]; i++)
values[i-1] = data.block[i];
return data.block[0];
}
}
#endif /* LIB_I2CDEV_H */

View File

@ -0,0 +1,180 @@
/* usb2514 - small utility to set configuration of USB2514 hub chip
* (C) 2013-2014 by sysmocom - s.f.m.c. GmbH, Author: Harald Welte
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
/* #include <linux/i2c-dev.h> */
#include "i2c-dev.h"
#define USB2514_SLAVE_ADDR 0x2C
/* Default configuration as per data sheet */
static const uint8_t usb2514_default[256] = {
0x24, 0x04, 0x14, 0x25, 0xB3, 0x0B, 0x9B, 0x20, /* 0x00 */
0x02, 0x00, 0x00, 0x00, 0x01, 0x32, 0x01, 0x32, /* 0x08 */
0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 0xf8 */
};
/* Default configuration as per data sheet */
static const uint8_t usb2514_odu[256] = {
0x24, 0x04, 0x14, 0x25, 0xB3, 0x0B, 0x9B, 0x20, /* 0x00 */
0x02, 0x00, 0x00, 0x00, 0x01, 0x32, 0x01, 0x32, /* 0x08 */
0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0 */
#if 1 /* swap modem + AIS ports (1,2,3) */
0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x01, /* 0xf8 */
#else
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 0xf8 */
#endif
};
static int g_fd;
static unsigned long get_support(void)
{
int rc;
unsigned long funcs;
rc = ioctl(g_fd, I2C_FUNCS, funcs);
printf("supported functions: 0x%lx\n", funcs);
return funcs;
}
static int write_regs(const uint8_t *regs)
{
unsigned int i;
int rc;
for (i = 0; i < 256; i+= 32) {
printf("Writing block of %u bytes at index %u\n", 32, i);
rc = i2c_smbus_write_block_data(g_fd, i, 32, regs+i);
if (rc < 0)
fprintf(stderr, "Error writing registers at "
"offset %u: %d\n", i, rc);
}
return rc;
}
int main(int argc, char **argv)
{
int rc;
int adapter_nr;
long slave_addr = USB2514_SLAVE_ADDR;
char filename[PATH_MAX];
if (argc < 2) {
fprintf(stderr, "You have to specify I2C bus number\n");
exit(2);
}
adapter_nr = atoi(argv[1]);
snprintf(filename, sizeof(filename)-1, "/dev/i2c-%d", adapter_nr);
rc = open(filename, O_RDWR);
if (rc < 0) {
fprintf(stderr, "Error opening the device: %d\n", rc);
exit(1);
}
g_fd = rc;
get_support();
rc = ioctl(g_fd, I2C_SLAVE, slave_addr);
if (rc < 0) {
fprintf(stderr, "Error setting slave addr: %d\n", rc);
exit(1);
}
rc = write_regs(usb2514_odu);
if (rc < 0) {
fprintf(stderr, "Error writing default regs: %d\n", rc);
exit(1);
}
exit(0);
}

View File

@ -0,0 +1,9 @@
[Unit]
Description=Power-on and configurate usb-hub and devices
[Service]
Type=oneshot
ExecStart=/usr/bin/gpio_usb2514 ; /usr/bin/usb2514 1
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,31 @@
SUMMARY = "small utility to set configuration of USB2514 hub chip on the sysmo-odu"
HOMEPAGE = ""
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://${WORKDIR}/usb2514.c;beginline=1;endline=18;md5=3b8421a1c05d21add65cc20fccfa29cd"
DEPENDS += "lmsensors-apps"
PR = "r1"
SRC_URI = "file://usb2514.c \
file://gpio_usb2514 \
file://i2c-dev.h \
file://usb2514.service \
"
SRC_URI[md5sum] = ""
SRC_URI[sha256sum] = ""
do_compile() {
${CC} -o ${WORKDIR}/usb2514 ${WORKDIR}/usb2514.c
}
do_install() {
install -d ${D}${bindir}/
install -m 0755 ${WORKDIR}/usb2514 ${D}${bindir}/
install -m 0755 ${WORKDIR}/gpio_usb2514 ${D}${bindir}/
install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
install -m 0644 /${WORKDIR}/usb2514.service ${D}${systemd_unitdir}/system/
ln -sf ../usb2514.service ${D}${systemd_unitdir}/system/multi-user.target.wants/
}
FILES_${PN} += "${systemd_unitdir}"

View File

@ -0,0 +1,81 @@
#!/bin/sh
#/etc/init.d/watchdog: start watchdog daemon.
#based on debian/init of watchdog
### BEGIN INIT INFO
# Provides: watchdog
# Short-Description: Start software watchdog daemon
# Required-Start: $local_fs
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop:
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
test -x /usr/sbin/watchdog || exit 0
# For configuration of the init script use the file
# /etc/default/watchdog, do not edit this init script.
# Set run_watchdog to 1 to start watchdog or 0 to disable it.
# Specify additional watchdog options here (see manpage).
watchdog_options=""
# Specify module to load
watchdog_module="none"
run_watchdog=1
[ -e /etc/default/watchdog ] && . /etc/default/watchdog
NAME=watchdog
DAEMON=/usr/sbin/watchdog
case "$1" in
start)
if [ $run_watchdog = 1 ]
then
# do we have to load a module?
[ ${watchdog_module:-none} != "none" ] && /sbin/modprobe $watchdog_module
# Unconditionally start watchdog daemon because we want to run it even
# if wd_keepalive wasn't running
echo "Starting watchdog daemon..."
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $watchdog_options
fi
;;
stop)
if [ $run_watchdog = 1 ]
then
echo "Stopping watchdog daemon..."
start-stop-daemon --stop -s 9 --quiet \
--pidfile /var/run/$NAME.pid
fi
;;
restart)
$0 force-reload
;;
force-reload)
if [ $run_watchdog = 0 ]; then exit 0; fi
echo "Restarting ${NAME}"
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/watchdog {start|stop|restart|force-reload}"
exit 1
esac
exit 0

View File

@ -0,0 +1,41 @@
#ping = 172.31.14.1
#ping = 172.26.1.255
#interface = eth0
#file = /var/log/messages
#change = 1407
# Uncomment to enable test. Setting one of these values to '0' disables it.
# These values will hopefully never reboot your machine during normal use
# (if your machine is really hung, the loadavg will go much higher than 25)
#max-load-1 = 24
#max-load-5 = 18
#max-load-15 = 12
# Note that this is the number of pages!
# To get the real size, check how large the pagesize is on your machine.
#min-memory = 1
#repair-binary = /usr/sbin/repair
#repair-timeout =
#test-binary =
#test-timeout =
watchdog-device = /dev/watchdog
# Defaults compiled into the binary
#temperature-device =
#max-temperature = 120
# Defaults compiled into the binary
#admin = root
#interval = 1
#logtick = 1
#log-dir = /var/log/watchdog
# This greatly decreases the chance that watchdog won't be scheduled before
# your machine is really loaded
realtime = yes
priority = 1
# Check if syslogd is still running by enabling the following line
#pidfile

View File

@ -0,0 +1,41 @@
#ping = 172.31.14.1
#ping = 172.26.1.255
#interface = eth0
#file = /var/log/messages
#change = 1407
# Uncomment to enable test. Setting one of these values to '0' disables it.
# These values will hopefully never reboot your machine during normal use
# (if your machine is really hung, the loadavg will go much higher than 25)
#max-load-1 = 24
#max-load-5 = 18
#max-load-15 = 12
# Note that this is the number of pages!
# To get the real size, check how large the pagesize is on your machine.
#min-memory = 1
#repair-binary = /usr/sbin/repair
#repair-timeout =
#test-binary =
#test-timeout =
watchdog-device = /dev/watchdog
# Defaults compiled into the binary
#temperature-device =
#max-temperature = 120
# Defaults compiled into the binary
#admin = root
#interval = 1
#logtick = 1
#log-dir = /var/log/watchdog
# This greatly decreases the chance that watchdog won't be scheduled before
# your machine is really loaded
realtime = yes
priority = 1
# Check if syslogd is still running by enabling the following line
#pidfile

View File

@ -0,0 +1,41 @@
#ping = 172.31.14.1
#ping = 172.26.1.255
#interface = eth0
#file = /var/log/messages
#change = 1407
# Uncomment to enable test. Setting one of these values to '0' disables it.
# These values will hopefully never reboot your machine during normal use
# (if your machine is really hung, the loadavg will go much higher than 25)
#max-load-1 = 24
#max-load-5 = 18
#max-load-15 = 12
# Note that this is the number of pages!
# To get the real size, check how large the pagesize is on your machine.
#min-memory = 1
#repair-binary = /usr/sbin/repair
#repair-timeout =
#test-binary =
#test-timeout =
watchdog-device = /dev/watchdog
# Defaults compiled into the binary
#temperature-device =
#max-temperature = 120
# Defaults compiled into the binary
#admin = root
#interval = 1
#logtick = 1
#log-dir = /var/log/watchdog
# This greatly decreases the chance that watchdog won't be scheduled before
# your machine is really loaded
realtime = yes
priority = 1
# Check if syslogd is still running by enabling the following line
#pidfile

View File

@ -0,0 +1,26 @@
SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/${PN}-${PV}:${SYSMOCOM}/${PN}"
PRINC = "9"
inherit update-rc.d
SRC_URI_append_sysmobts-v1 = " file://watchdog.conf file://init"
SRC_URI_append_sysmobts-v2 = " file://watchdog.conf file://init"
SRC_URI_append_sysmobts-2050 = " file://watchdog.conf file://init"
do_install_append() {
if [ -e ${WORKDIR}/watchdog.conf ]; then
install -D -m 0644 ${WORKDIR}/watchdog.conf ${D}/${sysconfdir}/
fi
install -D -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/watchdog
}
CONFFILES_${PN} = "${sysconfdir}/watchdog.conf"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "watchdog"
INITSCRIPT_PARAMS_${PN} = "start 06 S ."
# bug in poky meta/classes/base.bbclass?
PACKAGE_ARCH = "${MACHINE_ARCH}"

View File

@ -0,0 +1,88 @@
##############################################################################
#
# Sample ggsn configuration file
#
##############################################################################
# TAG: fg
# Include this flag if process is to run in the foreground
#
#fg
# TAG: debug
# Include this flag to include debug information.
#debug
# TAG: conf
# Configuration file to use. This file is the configuration file,
# so changing this parameter in the configuration file does not make
# sense. Use it on the command line instead.
# TAG: pidfile
# File to store information about the process id of the program.
# The program must have write access to this file/directory.
#pidfile /var/run/ggsn.pid
# TAG: statedir
# Directory to use for nonvolatile storage.
# The program must have write access to this directory.
#statedir /var/lib/ggsn/
# TAG: listen
# Specifies the local IP address to listen to
#listen 10.0.0.240
listen 10.23.123.1
# TAG: net
# IP network address of external packet data network
# Used to set up network interface.
net 10.23.42.0/24
# TAG: ipup
# Script executed after network interface has been brought up.
# Executed with the following parameters: <devicename> <ip address>
#ipup /etc/ggsn/ip-up
# TAG: ipdown
# Script executed after network interface has been taken down.
# Executed with the following parameters: <devicename> <ip address>
#ipdown /etc/ggsn/ip-down
# TAG: dynip
# Dynamic IP address pool.
# Used for allocation of dynamic IP address when address is not given
# by HLR.
# If this option is not given then the net option is used as a substitute.
#dynip 192.168.0.0/24
# TAG: statip
# Use of this tag is currently UNSUPPORTED
# Static IP address pool.
# Used for allocation of static IP address by means of HLR.
#statip 192.168.1.0/24
# TAG: pcodns1
# Protocol configuration option domain name system server 1.
pcodns1 8.8.8.8
# TAG: pcodns2
# Protocol configuration option domain name system server 2.
#pcodns2 0.0.0.0
# TAG: timelimit
# Exit after timelimit seconds.
# Setting timelimit to zero will cause the program not to exit.
#timelimit 0
# TAG: apn
# Use of this tag is EXPERIMENTAL
# Access point name to connect to when run in client mode.
#apn internet
# TAG: qos
# Use of this tag is EXPERIMENTAL
# Requested Quality of Service used when run in client mode.
# 3 bytes corresponding to ????
#qos 0x0b921f

View File

@ -0,0 +1,23 @@
#!/bin/sh
NAME=gprs_routing
set -e
case "$1" in
start)
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
echo "Enabled masquerading"
;;
stop)
echo 0 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
esac
exit 0

View File

@ -0,0 +1,88 @@
##############################################################################
#
# Sample ggsn configuration file
#
##############################################################################
# TAG: fg
# Include this flag if process is to run in the foreground
#
#fg
# TAG: debug
# Include this flag to include debug information.
#debug
# TAG: conf
# Configuration file to use. This file is the configuration file,
# so changing this parameter in the configuration file does not make
# sense. Use it on the command line instead.
# TAG: pidfile
# File to store information about the process id of the program.
# The program must have write access to this file/directory.
#pidfile /var/run/ggsn.pid
# TAG: statedir
# Directory to use for nonvolatile storage.
# The program must have write access to this directory.
#statedir /var/lib/ggsn/
# TAG: listen
# Specifies the local IP address to listen to
#listen 10.0.0.240
listen 127.0.0.2
# TAG: net
# IP network address of external packet data network
# Used to set up network interface.
net 10.23.42.0/24
# TAG: ipup
# Script executed after network interface has been brought up.
# Executed with the following parameters: <devicename> <ip address>
#ipup /etc/ggsn/ip-up
# TAG: ipdown
# Script executed after network interface has been taken down.
# Executed with the following parameters: <devicename> <ip address>
#ipdown /etc/ggsn/ip-down
# TAG: dynip
# Dynamic IP address pool.
# Used for allocation of dynamic IP address when address is not given
# by HLR.
# If this option is not given then the net option is used as a substitute.
#dynip 192.168.0.0/24
# TAG: statip
# Use of this tag is currently UNSUPPORTED
# Static IP address pool.
# Used for allocation of static IP address by means of HLR.
#statip 192.168.1.0/24
# TAG: pcodns1
# Protocol configuration option domain name system server 1.
pcodns1 8.8.8.8
# TAG: pcodns2
# Protocol configuration option domain name system server 2.
#pcodns2 0.0.0.0
# TAG: timelimit
# Exit after timelimit seconds.
# Setting timelimit to zero will cause the program not to exit.
#timelimit 0
# TAG: apn
# Use of this tag is EXPERIMENTAL
# Access point name to connect to when run in client mode.
#apn internet
# TAG: qos
# Use of this tag is EXPERIMENTAL
# Requested Quality of Service used when run in client mode.
# 3 bytes corresponding to ????
#qos 0x0b921f

View File

@ -0,0 +1,23 @@
#!/bin/sh
NAME=gprs_routing
set -e
case "$1" in
start)
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
echo "Enabled masquerading"
;;
stop)
echo 0 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
esac
exit 0

View File

@ -0,0 +1,88 @@
##############################################################################
#
# Sample ggsn configuration file
#
##############################################################################
# TAG: fg
# Include this flag if process is to run in the foreground
#
#fg
# TAG: debug
# Include this flag to include debug information.
#debug
# TAG: conf
# Configuration file to use. This file is the configuration file,
# so changing this parameter in the configuration file does not make
# sense. Use it on the command line instead.
# TAG: pidfile
# File to store information about the process id of the program.
# The program must have write access to this file/directory.
#pidfile /var/run/ggsn.pid
# TAG: statedir
# Directory to use for nonvolatile storage.
# The program must have write access to this directory.
#statedir /var/lib/ggsn/
# TAG: listen
# Specifies the local IP address to listen to
#listen 10.0.0.240
listen 10.23.123.1
# TAG: net
# IP network address of external packet data network
# Used to set up network interface.
net 10.23.42.0/24
# TAG: ipup
# Script executed after network interface has been brought up.
# Executed with the following parameters: <devicename> <ip address>
#ipup /etc/ggsn/ip-up
# TAG: ipdown
# Script executed after network interface has been taken down.
# Executed with the following parameters: <devicename> <ip address>
#ipdown /etc/ggsn/ip-down
# TAG: dynip
# Dynamic IP address pool.
# Used for allocation of dynamic IP address when address is not given
# by HLR.
# If this option is not given then the net option is used as a substitute.
#dynip 192.168.0.0/24
# TAG: statip
# Use of this tag is currently UNSUPPORTED
# Static IP address pool.
# Used for allocation of static IP address by means of HLR.
#statip 192.168.1.0/24
# TAG: pcodns1
# Protocol configuration option domain name system server 1.
pcodns1 8.8.8.8
# TAG: pcodns2
# Protocol configuration option domain name system server 2.
#pcodns2 0.0.0.0
# TAG: timelimit
# Exit after timelimit seconds.
# Setting timelimit to zero will cause the program not to exit.
#timelimit 0
# TAG: apn
# Use of this tag is EXPERIMENTAL
# Access point name to connect to when run in client mode.
#apn internet
# TAG: qos
# Use of this tag is EXPERIMENTAL
# Requested Quality of Service used when run in client mode.
# 3 bytes corresponding to ????
#qos 0x0b921f

View File

@ -0,0 +1,23 @@
#!/bin/sh
NAME=gprs_routing
set -e
case "$1" in
start)
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
echo "Enabled masquerading"
;;
stop)
echo 0 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
esac
exit 0

View File

@ -0,0 +1,21 @@
DESCRIPTION = "OpenGGSN GPRS routing to the real world"
RDEPENDS_${PN} = "iptables kernel-module-ipt-masquerade"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
SRC_URI = "file://gprs_routing"
PR = "r1"
inherit update-rc.d
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "gprs_routing"
INITSCRIPT_PARAMS_${PN} = "defaults 28 28"
do_install() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/gprs_routing ${D}${sysconfdir}/init.d/gprs_routing
}

View File

@ -0,0 +1,11 @@
DESCRIPTION = "OpenGGSN config by sysmocom"
SRC_URI = "file://ggsn.conf"
LICENSE = "closed"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
do_install() {
install -d ${D}${sysconfdir}
install -m 0660 ${WORKDIR}/ggsn.conf ${D}${sysconfdir}/
}
CONFFILES_${PN} = "${sysconfdir}/ggsn.conf"

View File

@ -0,0 +1,11 @@
#OpenVPN client conf
tls-client
client
dev tun
proto udp
tun-mtu 1500
remote admin.sysmocom.de
remote 78.46.147.238
comp-lzo
pkcs12 sysmocom-client-cert.p12
cipher BF-CBC

View File

@ -0,0 +1,16 @@
HOMEPAGE = "http://www.sysmocom.de"
RDEPENDS_${PN} = "openvpn"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
SRC_URI = "file://sysmocom-vpn.conf"
PR = "r3"
CONFFILES_${PN} = "${sysconfdir}/openvpn/sysmocom-vpn.conf"
PACKAGE_ARCH = "all"
do_install() {
install -d ${D}${sysconfdir}/openvpn
install -m 0644 ${WORKDIR}/sysmocom-vpn.conf ${D}${sysconfdir}/openvpn
}

Some files were not shown because too many files have changed in this diff Show More