Merge branch 'cockpit' into telephony
This commit is contained in:
commit
f75988662e
|
|
@ -0,0 +1,4 @@
|
|||
# This is a backport of http://git.yoctoproject.org/cgit.cgi/poky/commit/meta/recipes-core/glibc?id=c57ba52b70d803c737d694eb3046d8ede6703749 can be removed with newer poky versions
|
||||
SRC_URI_append = " \
|
||||
file://strcoll-Remove-incorrect-STRDIFF-based-optimization-.patch \
|
||||
"
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
require nmrouter-image.bb
|
||||
|
||||
SUMMARY = "nmrouter image for developement only"
|
||||
|
||||
IMAGE_FEATURES_append = " \
|
||||
tools-debug \
|
||||
"
|
||||
|
||||
BENCH_TOOLS = " \
|
||||
tcpdump \
|
||||
lrzsz \
|
||||
lmbench \
|
||||
dbench \
|
||||
memtester \
|
||||
nbench-byte \
|
||||
tiobench \
|
||||
iozone3 \
|
||||
iperf \
|
||||
strongswan \
|
||||
"
|
||||
|
||||
EASY_EDITOR = " \
|
||||
nano \
|
||||
"
|
||||
|
||||
BENCH_TOOLS_cortexa9hf-neon_append = " cpuburn-neon "
|
||||
BENCH_TOOLS_cortexa8hf-neon_append = " cpuburn-neon "
|
||||
|
||||
|
||||
IMAGE_INSTALL_append = " \
|
||||
lrzsz \
|
||||
${BENCH_TOOLS} \
|
||||
${EASY_EDITOR} \
|
||||
"
|
||||
|
||||
|
|
@ -1,45 +1,27 @@
|
|||
inherit core-image
|
||||
|
||||
SUMMARY = "Test image"
|
||||
SUMMARY = "nmrouter image"
|
||||
|
||||
KERNEL_IMAGETYPE = "uImage"
|
||||
|
||||
IMAGE_FSTYPES_append = " tar.gz "
|
||||
|
||||
IMAGE_FEATURES_append = " \
|
||||
tools-debug \
|
||||
"
|
||||
|
||||
IMAGE_FEATURES_append = " \
|
||||
package-management \
|
||||
ssh-server-openssh \
|
||||
"
|
||||
|
||||
BENCH_TOOLS = " \
|
||||
tcpdump \
|
||||
lrzsz \
|
||||
lmbench \
|
||||
dbench \
|
||||
memtester \
|
||||
nbench-byte \
|
||||
tiobench \
|
||||
iozone3 \
|
||||
iperf \
|
||||
strongswan \
|
||||
"
|
||||
|
||||
EASY_EDITOR = " \
|
||||
nano \
|
||||
"
|
||||
|
||||
BENCH_TOOLS_cortexa9hf-neon_append = " cpuburn-neon "
|
||||
BENCH_TOOLS_cortexa8hf-neon_append = " cpuburn-neon "
|
||||
|
||||
PREFERED_VERSION-pn_nodejs = "4.4.5"
|
||||
|
||||
IMAGE_INSTALL_append = " \
|
||||
linux-firmware \
|
||||
FIRMWARE ?= "linux-firmware"
|
||||
FIRMWARE_am335x-nbhw16 = " \
|
||||
linux-firmware-ath6k \
|
||||
linux-firmware-ath9k \
|
||||
linux-firmware-wl12xx\
|
||||
linux-firmware-wl18xx\
|
||||
"
|
||||
|
||||
IMAGE_INSTALL_append = " \
|
||||
hostapd \
|
||||
iw \
|
||||
crda \
|
||||
|
|
@ -48,22 +30,19 @@ IMAGE_INSTALL_append = " \
|
|||
bash \
|
||||
iproute2 \
|
||||
ethtool \
|
||||
i2c-tools \
|
||||
lrzsz \
|
||||
devmem2 \
|
||||
openvpn \
|
||||
iptables \
|
||||
pciutils \
|
||||
kernel-modules \
|
||||
kernel-devicetree \
|
||||
node \
|
||||
python-subprocess \
|
||||
networkmanager \
|
||||
modemmanager \
|
||||
cockpit \
|
||||
board-descriptor \
|
||||
sw-update \
|
||||
${BENCH_TOOLS} \
|
||||
${EASY_EDITOR} \
|
||||
${FIRMWARE} \
|
||||
"
|
||||
|
||||
IMAGE_INSTALL_cortex9hf-neon_append = " kernel-devicetree "
|
||||
|
|
@ -71,6 +50,7 @@ IMAGE_INSTALL_cortex9hf_append = " kernel-devicetree "
|
|||
IMAGE_INSTALL_append_am335x-nbhw16 = " \
|
||||
nbhw16-ctrl \
|
||||
tibluetooth \
|
||||
bluez5-obex \
|
||||
"
|
||||
|
||||
LICENSE = "BSD"
|
||||
|
|
|
|||
|
|
@ -1,20 +1,23 @@
|
|||
inherit core-image
|
||||
DISTRO_FEATURES_BACKFILL_CONSIDERED = " wifi bluetooth"
|
||||
|
||||
inherit image
|
||||
|
||||
SUMMARY = "Minimal image for bringup"
|
||||
|
||||
IMAGE_FEATURES += " \
|
||||
package-management \
|
||||
ssh-server-openssh \
|
||||
"
|
||||
#IMAGE_FEATURES += " \
|
||||
# "
|
||||
|
||||
IMAGE_INSTALL += " \
|
||||
openssh-sftp-server \
|
||||
bash \
|
||||
ethtool \
|
||||
i2c-tools \
|
||||
lrzsz \
|
||||
devmem2 \
|
||||
"
|
||||
#IMAGE_INSTALL += " \
|
||||
# lrzsz \
|
||||
# devmem2 \
|
||||
# "
|
||||
|
||||
|
||||
IMAGE_INSTALL = " \
|
||||
packagegroup-core-boot \
|
||||
e2fsprogs \
|
||||
lrzsz \
|
||||
devmem2 \
|
||||
"
|
||||
LICENSE = "BSD"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ source /etc/default/sw_update_config
|
|||
log() {
|
||||
local level=${1?}
|
||||
shift
|
||||
local code= line="[$(date '+%F %T')] $level: $*"
|
||||
local code=
|
||||
local line="[$(date '+%F %T')] $level: $*"
|
||||
if [ -t 2 ]
|
||||
then
|
||||
case "$level" in
|
||||
|
|
@ -190,18 +191,44 @@ check_file()
|
|||
fi
|
||||
}
|
||||
|
||||
get_bin()
|
||||
{
|
||||
echo $(dd if=$IMAGE_LOCATION bs=1 count=$2 skip=$1 2>/dev/null | hexdump -ve '1/1 "%.2x"')
|
||||
}
|
||||
|
||||
update_linux()
|
||||
{
|
||||
log INFO "Starting linux update ..."
|
||||
check_file $1
|
||||
|
||||
#extract_header_infos
|
||||
#check_image_compatibility
|
||||
head=$(get_bin 0 2)
|
||||
if [ "a$head" == "a1f8b" ]; then
|
||||
log INFO "Found valid gzip archive"
|
||||
# gzip header found, normal image
|
||||
# Don't use the header stuff for now, move the file instead
|
||||
EXTRACTED_IMAGE=$IMAGE_LOCATION
|
||||
else
|
||||
log INFO "Search gzip archive in image"
|
||||
for i in $(seq 0 1024); do
|
||||
head=$(get_bin $i 2)
|
||||
if [ "a$head" == "a1f8b" ]; then
|
||||
log INFO "Found gzip archive in image, extracting now"
|
||||
EXTRACTED_IMAGE=$(mktemp)
|
||||
dd if=$IMAGE_LOCATION bs=$i skip=1 of=$EXTRACTED_IMAGE 2>/dev/null
|
||||
break
|
||||
fi
|
||||
done
|
||||
test $i -eq 1024 && echo "Could not find a vaild gzip archive" && exit -1
|
||||
fi
|
||||
|
||||
# This is not the original sw-update, we use plain tar.gz
|
||||
# extract_header_infos
|
||||
# check_image_compatibility
|
||||
# extract_image
|
||||
# Don't use the header stuff for now, move the file instead
|
||||
EXTRACTED_IMAGE=$IMAGE_LOCATION
|
||||
# Also don't check the md5 sum
|
||||
# check_image_md5
|
||||
log INFO "Installing linux update ..."
|
||||
|
||||
flash_firmware
|
||||
cleanup
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,35 @@
|
|||
PLATFORM_FIRST_PARTITION="/dev/mmcblk0p2"
|
||||
PLATFORM_SECOND_PARTITION="/dev/mmcblk0p3"
|
||||
PLATFORM_BOOT_PARTITION="/dev/mmcblk0p1"
|
||||
PLATFORM_FIRST_PARTITION="/dev/mmcblk0p1"
|
||||
PLATFORM_SECOND_PARTITION="/dev/mmcblk0p2"
|
||||
PLATFORM_PROD_COMPATIBILITY=
|
||||
PLATFORM_HW_VERSION=
|
||||
PLATFORM_ACTIVE_PARTITION=$(bd -r boot_part)
|
||||
get_active_partition()
|
||||
{
|
||||
boot_part=$(bd read boot_part)
|
||||
if [ "$boot_part" == "None" ]; then
|
||||
flag=$(bd read partition64.flags)
|
||||
if [ $flag -ne 0 ]; then
|
||||
boot_part=0
|
||||
else
|
||||
boot_part=1
|
||||
fi
|
||||
fi
|
||||
echo $boot_part
|
||||
}
|
||||
PLATFORM_ACTIVE_PARTITION=$(get_active_partition)
|
||||
|
||||
set_active_partition()
|
||||
{
|
||||
bd -w boot_part -v $1
|
||||
boot_part=$(bd read boot_part)
|
||||
if [ "$boot_part" == "None" ]; then
|
||||
if [ $1 -eq 0 ]; then
|
||||
bd write partition64.flags=128
|
||||
bd write partition64_1.flags=0
|
||||
else
|
||||
bd write partition64_1.flags=128
|
||||
bd write partition64.flags=0
|
||||
fi
|
||||
else
|
||||
bd write boot_part=$1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,39 +30,96 @@ def write_to_modem(data, read=False):
|
|||
return data
|
||||
|
||||
|
||||
def get_modem():
|
||||
interface = "eth2"
|
||||
try:
|
||||
call_and_throw("ifconfig {0} &> /dev/null".format(interface))
|
||||
except:
|
||||
interface = "usb0"
|
||||
# Make sure that we now have a valid modem
|
||||
call_and_throw("ifconfig {0} &> /dev/null".format(interface))
|
||||
return interface
|
||||
|
||||
|
||||
def setup_modem(provider):
|
||||
if provider == "swisscom":
|
||||
write_to_modem("AT^NDISDUP=1,1,\"gprs.swisscom.ch\"\r\n")
|
||||
|
||||
apn = "gprs.swisscom.ch"
|
||||
if provider == "salt":
|
||||
write_to_modem("AT^NDISDUP=1,1,\"click\"\r\n")
|
||||
apn = "click"
|
||||
|
||||
call_and_throw("udhcpc -i {0}".format(get_modem()))
|
||||
modem_config = """[connection]
|
||||
id=Modem
|
||||
type=gsm
|
||||
interface-name=ttyUSB2
|
||||
permissions=
|
||||
secondaries=
|
||||
|
||||
[gsm]
|
||||
apn={0}
|
||||
number=*99#
|
||||
|
||||
[ipv4]
|
||||
dns-search=
|
||||
method=auto
|
||||
|
||||
[ipv6]
|
||||
dns-search=
|
||||
method=auto
|
||||
""".format(apn)
|
||||
|
||||
f = open("/etc/NetworkManager/system-connections/Modem", "w")
|
||||
f.write(modem_config)
|
||||
f.close()
|
||||
|
||||
call_and_throw("chmod 600 /etc/NetworkManager/system-connections/Modem")
|
||||
call_and_throw("nmcli c load /etc/NetworkManager/system-connections/Modem")
|
||||
call_and_throw("nmcli c up Modem")
|
||||
|
||||
|
||||
def setup_ap():
|
||||
call_and_throw("ifconfig {0} 192.168.0.1".format(WLAN_INTERFACE))
|
||||
# Start udhcpd with config from /etc/udhcpd.conf
|
||||
call_and_throw("udhcpd")
|
||||
ap_config = """ [connection]
|
||||
id=Wifi
|
||||
type=wifi
|
||||
interface-name=wlan0
|
||||
autoconnect=true
|
||||
permissions=
|
||||
secondaries=
|
||||
|
||||
[wifi]
|
||||
band=bg
|
||||
mac-address-blacklist=
|
||||
mode=ap
|
||||
seen-bssids=
|
||||
ssid=test
|
||||
|
||||
[wifi-security]
|
||||
auth-alg=open
|
||||
group=ccmp;
|
||||
key-mgmt=wpa-psk
|
||||
pairwise=ccmp;
|
||||
proto=rsn;
|
||||
psk=NetModu1e
|
||||
|
||||
[ipv4]
|
||||
address1=192.168.0.1/24
|
||||
dns-search=
|
||||
method=manual
|
||||
|
||||
[ipv6]
|
||||
dns-search=
|
||||
method=auto
|
||||
"""
|
||||
f = open("/etc/NetworkManager/system-connections/Wifi", "w")
|
||||
f.write(ap_config)
|
||||
f.close()
|
||||
call_and_throw("chmod 600 /etc/NetworkManager/system-connections/Wifi")
|
||||
call_and_throw("nmcli c load /etc/NetworkManager/system-connections/Wifi")
|
||||
call_and_throw("nmcli c up Wifi")
|
||||
|
||||
dnsmasq_config = """
|
||||
domain-needed
|
||||
bogus-priv
|
||||
dhcp-range=192.168.0.100,192.168.0.200,12h
|
||||
"""
|
||||
f = open("/etc/dnsmasq.conf", "w")
|
||||
f.write(dnsmasq_config)
|
||||
f.close()
|
||||
call_and_throw("systemctl restart dnsmasq")
|
||||
|
||||
|
||||
def setup_routing():
|
||||
f = open("/proc/sys/net/ipv4/ip_forward", "w")
|
||||
f.write("1\n")
|
||||
f.close()
|
||||
call_and_throw("iptables -t nat -A POSTROUTING -o {0} -j MASQUERADE".
|
||||
format(get_modem()))
|
||||
call_and_throw("iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE")
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
#%PAM-1.0
|
||||
auth required pam_unix.so
|
||||
account required pam_unix.so
|
||||
session required pam_unix.so
|
||||
auth required pam_unix.so
|
||||
auth optional pam_reauthorize.so prepare
|
||||
auth optional pam_ssh_add.so
|
||||
account required pam_unix.so
|
||||
session required pam_unix.so
|
||||
session optional pam_reauthorize.so prepare
|
||||
session optional pam_ssh_add.so
|
||||
password required pam_unix.so nullok obscure min=4 max=12
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ SECTION = "console/network"
|
|||
LICENSE = "GPLv2+"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
|
||||
|
||||
inherit systemd
|
||||
|
||||
SRCREV = "39be0a69e4b03907a947d957afe20d394179677e"
|
||||
SRC_URI = "git://github.com/cockpit-project/cockpit.git;protocol=https \
|
||||
file://cockpit.pam \
|
||||
|
|
@ -13,10 +15,13 @@ SRC_URI = "git://github.com/cockpit-project/cockpit.git;protocol=https \
|
|||
S = "${WORKDIR}/git"
|
||||
|
||||
DEPENDS = "node-native json-glib libssh libpam keyutils krb5 systemd polkit glib-networking"
|
||||
RDEPENDS_${PN} = "json-glib libssh libpam keyutils krb5 libsystemd polkit bash glib-networking"
|
||||
# opnessh-misc gets ssh-agent which is needed to execute ssh commands on the target
|
||||
RDEPENDS_${PN} = "json-glib libssh libpam keyutils krb5 libsystemd polkit bash glib-networking openssh-misc libpwquality"
|
||||
|
||||
EXTRA_AUTORECONF_append = " -I ${STAGING_DATADIR}/aclocal"
|
||||
|
||||
SYSTEMD_SERVICE_${PN} = "cockpit.socket"
|
||||
|
||||
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
|
||||
INHIBIT_PACKAGE_STRIP = "1"
|
||||
|
||||
|
|
@ -38,6 +43,9 @@ do_install() {
|
|||
sed -i "s#install-data-local:: doc/guide/html/index.html#bla-install-data-local:: doc/guide/html/index.html#" ./Makefile
|
||||
oe_runmake DESTDIR=${D} install
|
||||
|
||||
mkdir -p ${D}/lib
|
||||
mv ${D}/usr/local/lib/security ${D}/lib/
|
||||
|
||||
mkdir -p ${D}/etc/pam.d/
|
||||
cp ${WORKDIR}/cockpit.pam ${D}/etc/pam.d/cockpit
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
PACKAGECONFIG_append = " dbus"
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
SUMMARY = "Library for password quality checking and generating random passwords"
|
||||
HOMEPAGE = "https://launchpad.net/libpwquality"
|
||||
LICENSE = "GPLv2+"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2"
|
||||
|
||||
SRC_URI = "https://launchpad.net/${BPN}/trunk/${PV}/+download/${BPN}-${PV}.tar.bz2"
|
||||
SRC_URI[md5sum] = "2a3d4ba1d11b52b4f6a7f39622ebf736"
|
||||
SRC_URI[sha256sum] = "74d2ea90e103323c1f2d6a6cc9617cdae6877573eddb31aaf31a40f354cc2d2a"
|
||||
|
||||
inherit autotools-brokensep pkgconfig gettext pythonnative
|
||||
|
||||
DEPENDS = "zlib cracklib libpam"
|
||||
|
||||
EXTRA_OECONF = " \
|
||||
--with-securedir=${base_libdir}/security \
|
||||
--with-python-binary=${PYTHON} \
|
||||
"
|
||||
|
||||
do_compile() {
|
||||
# make distustils part for python bindings happy
|
||||
export STAGING_INCDIR=${STAGING_INCDIR}
|
||||
export STAGING_LIBDIR=${STAGING_LIBDIR}
|
||||
export BUILD_SYS=${BUILD_SYS}
|
||||
export HOST_SYS=${HOST_SYS}
|
||||
base_do_compile
|
||||
}
|
||||
|
||||
do_install() {
|
||||
# make distustils part for python bindings happy
|
||||
export STAGING_INCDIR=${STAGING_INCDIR}
|
||||
export STAGING_LIBDIR=${STAGING_LIBDIR}
|
||||
export BUILD_SYS=${BUILD_SYS}
|
||||
export HOST_SYS=${HOST_SYS}
|
||||
autotools_do_install
|
||||
}
|
||||
|
||||
FILES_${PN} += " \
|
||||
${base_libdir}/security/*.so \
|
||||
"
|
||||
|
||||
PACKAGE_BEFORE_PN += "${PN}-python"
|
||||
|
||||
FILES_${PN}-python = " \
|
||||
${PYTHON_SITEPACKAGES_DIR} \
|
||||
"
|
||||
|
||||
FILES_${PN}-staticdev += " \
|
||||
${PYTHON_SITEPACKAGES_DIR}/*.a \
|
||||
${base_libdir}/security/*.a \
|
||||
"
|
||||
FILES_${PN}-dev += " \
|
||||
${PYTHON_SITEPACKAGES_DIR}/*.la \
|
||||
${base_libdir}/security/*.la \
|
||||
"
|
||||
|
||||
FILES_${PN}-dbg += "\
|
||||
${PYTHON_SITEPACKAGES_DIR}/.debug \
|
||||
${base_libdir}/security/.debug \
|
||||
"
|
||||
Loading…
Reference in New Issue