Skip to contentSkip to conversation

Set ssh server using IMAGE_FEATURES

PATCH New Scott Garman 1 participant 7 messages Mar 11, 2011

lore
Share & tools
lore
#0 lore raw

cover Set ssh server using IMAGE_FEATURES

From: Scott Garman <[email protected]>

Hi Saul,

This pull request refactors the way an ssh server can be specified, making it simpler to switch between dropbear and openssh. It fixes [YOCTO #378]

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: sgarman/ssh-switch
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=sgarman/ssh-switch

Thanks,
Scott Garman <[email protected]>
---

Scott Garman (6):
task-base, task-poky-basic, task-poky: Remove hard-coded references
to dropbear
openssh: allow the openssh meta package to be empty task-poky-ssh.bb: new task for ssh services poky-image.bbclass: add ssh-server as an IMAGE_FEATURES option poky-image-sato.bb: add ssh-server to IMAGE_FEATURES
poky-image-lsb: add ssh-server to IMAGE_FEATURES

 meta/classes/poky-image.bbclass                    |    6 ++++-
 meta/recipes-connectivity/openssh/openssh_5.6p1.bb |    4 ++-
 meta/recipes-core/tasks/task-base.bb               |    8 +------
 meta/recipes-core/tasks/task-poky-ssh.bb           |   22 ++++++++++++++++++++
 meta/recipes-extended/images/poky-image-lsb-dev.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb-sdk.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb.bb     |    2 +-
 meta/recipes-extended/tasks/task-poky-basic.bb     |    3 +-
 meta/recipes-sato/images/poky-image-sato-dev.bb    |    2 +-
 meta/recipes-sato/images/poky-image-sato-sdk.bb    |    2 +-
 meta/recipes-sato/images/poky-image-sato.bb        |    2 +-
 meta/recipes-sato/tasks/task-poky.bb               |    3 +-
 12 files changed, 39 insertions(+), 19 deletions(-)
 create mode 100644 meta/recipes-core/tasks/task-poky-ssh.bb
#1 lore raw

PATCH 1/6 task-base, task-poky-basic, task-poky: Remove hard-coded references to dropbear

From: Scott Garman <[email protected]>

This is the first step in refactoring the SSH server selection to be done in IMAGE_FEATURES instead of as hardcoded in these tasks.

---
 meta/recipes-core/tasks/task-base.bb           |    8 +-------
 meta/recipes-extended/tasks/task-poky-basic.bb |    3 +--
 meta/recipes-sato/tasks/task-poky.bb           |    3 +--
 3 files changed, 3 insertions(+), 11 deletions(-)
meta/recipes-core/tasks/task-base.bb +1 -7
index d613bb2..138e617 100644
@@ -2,7 +2,7 @@ DESCRIPTION = "Merge machine and distro options to create a basic machine task/p
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${POKYBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-PR = "r69"
+PR = "r70"
 
 inherit task
 
@@ -60,11 +60,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 HOTPLUG ?= "${@base_contains("MACHINE_FEATURES", "kernel24",  "linux-hotplug","",d)} "
 
 #
-# dropbear, openssh or none
-#
-DISTRO_SSH_DAEMON ?= "dropbear"
-
-#
 # pcmciautils for >= 2.6.13-rc1, pcmcia-cs for others
 #
 PCMCIA_MANAGER ?= "${@base_contains('MACHINE_FEATURES', 'kernel26','pcmciautils','pcmcia-cs',d)} "
@@ -81,7 +76,6 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
 RDEPENDS_task-base = "\
     task-distro-base \
     task-machine-base \
-    ${DISTRO_SSH_DAEMON} \
     ${HOTPLUG} \
     \
     ${@base_contains('MACHINE_FEATURES', 'kernel26','task-base-kernel26','task-base-kernel24',d)} \
meta/recipes-extended/tasks/task-poky-basic.bb +1 -2
index d7beafe..3d313f0 100644
@@ -3,7 +3,7 @@
 #
 
 DESCRIPTION = "Create Basic Image Tasks"
-PR = "r2"
+PR = "r3"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${POKYBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
@@ -55,7 +55,6 @@ RDEPENDS_task-poky-basic = "\
 
 RDEPENDS_task-poky-base-utils = "\
     busybox \
-    dropbear \
     "
 
 RDEPENDS_task-poky-basic-libs = "\
meta/recipes-sato/tasks/task-poky.bb +1 -2
index cfcbacb..72d4d0d 100644
@@ -6,7 +6,7 @@ DESCRIPTION = "Tasks for OpenedHand Poky"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${POKYBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-PR = "r33"
+PR = "r34"
 
 PACKAGES = "\
     task-poky-apps-console \
@@ -37,7 +37,6 @@ FILEMANAGER_mips ?= ""
 
 RDEPENDS_task-poky-apps-console = "\
     avahi-daemon \
-    dropbear \
     dbus \
     portmap \
     ${SPLASH}"
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/6 openssh: allow the openssh meta package to be empty

In reply to Scott Garman

From: Scott Garman <[email protected]>

This allows the openssh meta-package to be used in the poky-ssh task. Otherwise there will be no package named openssh to install during image creation.

---
 meta/recipes-connectivity/openssh/openssh_5.6p1.bb |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
meta/recipes-connectivity/openssh/openssh_5.6p1.bb +3 -1
index be9ae09..d93a773 100644
@@ -7,7 +7,7 @@ SECTION = "console/network"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENCE;md5=7ae09218173be1643c998a4b71027f9b"
 
-PR = "r0"
+PR = "r1"
 
 DEPENDS = "zlib openssl"
 DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
@@ -67,6 +67,8 @@ do_install_append () {
 	rmdir ${D}/var/run/sshd ${D}/var/run ${D}/var
 }
 
+ALLOW_EMPTY_${PN} = "1"
+
 PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
 FILES_${PN}-scp = "${bindir}/scp.${PN}"
 FILES_${PN}-ssh = "${bindir}/ssh.${PN} ${sysconfdir}/ssh/ssh_config"
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/6 task-poky-ssh.bb: new task for ssh services

In reply to Scott Garman

From: Scott Garman <[email protected]>

This task can then be used in image recipes to include a configurable ssh server. Currently dropbear and openssh are supported.

---
 meta/recipes-core/tasks/task-poky-ssh.bb |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-core/tasks/task-poky-ssh.bb
meta/recipes-core/tasks/task-poky-ssh.bb new file +22 -0
new file mode 100644
index 0000000..37a0241
@@ -0,0 +1,22 @@
+DESCRIPTION = "SSH tasks for Poky"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
+                    file://${POKYBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PR = "r0"
+
+PACKAGES = "\
+    task-poky-ssh-server \
+    task-poky-ssh-server-dbg \
+    task-poky-ssh-server-dev \
+    "
+
+ALLOW_EMPTY = "1"
+
+# Default to dropbear for historical reasons
+IMAGE_SSH_PROVIDER ?= "dropbear"
+
+RDEPENDS_task-poky-ssh-server = "${IMAGE_SSH_PROVIDER}" 
+
+RDEPENDS_task-poky-ssh-server-dbg = "${IMAGE_SSH_PROVIDER}-dbg"
+
+RDEPENDS_task-poky-ssh-server-dev = "${IMAGE_SSH_PROVIDER}-dev"
Signature · 1 line
1.7.1
#4 lore raw

PATCH 4/6 poky-image.bbclass: add ssh-server as an IMAGE_FEATURES option

In reply to Scott Garman

From: Scott Garman <[email protected]>

Images which want to include an ssh server can then add ssh-server to their IMAGE_FEATURES.

---
 meta/classes/poky-image.bbclass |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
meta/classes/poky-image.bbclass +5 -1
index 225584b..896ef94 100644
@@ -24,6 +24,7 @@ LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3
 # - tools-profile       - profiling tools
 # - tools-testapps      - tools usable to make some device tests
 # - nfs-server          - NFS server (exports / over NFS to everybody)
+# - ssh-server          - SSH server (dropbear vs. openssh)
 # - dev-pkgs            - development packages
 # - dbg-pkgs            - debug packages
 #
@@ -79,9 +80,12 @@ POKY_BASE_INSTALL = '\
     \
     ${@base_contains("IMAGE_FEATURES", "nfs-server", "task-poky-nfs-server", "",d)} \
     ${@base_contains("IMAGE_FEATURES", ["nfs-server", "dbg-pkgs"], "task-poky-nfs-server-dbg", "",d)} \
-    \
     ${@base_contains("IMAGE_FEATURES", ["nfs-server", "dev-pkgs"], "task-poky-nfs-server-dev", "",d)} \
     \
+    ${@base_contains("IMAGE_FEATURES", "ssh-server", "task-poky-ssh-server", "",d)} \
+    ${@base_contains("IMAGE_FEATURES", ["ssh-server", "dbg-pkgs"], "task-poky-ssh-server-dbg", "",d)} \
+    ${@base_contains("IMAGE_FEATURES", ["ssh-server", "dev-pkgs"], "task-poky-ssh-server-dev", "",d)} \
+    \
     ${@base_contains("IMAGE_FEATURES", "package-management", "${ROOTFS_PKGMANAGE}", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)} \
     ${@base_contains("IMAGE_FEATURES", "qt4-pkgs", "task-poky-qt-demos", "",d)} \
     ${POKY_EXTRA_INSTALL} \
Signature · 1 line
1.7.1
#5 lore raw

PATCH 5/6 poky-image-sato.bb: add ssh-server to IMAGE_FEATURES

In reply to Scott Garman

From: Scott Garman <[email protected]>

---
 meta/recipes-sato/images/poky-image-sato-dev.bb |    2 +-
 meta/recipes-sato/images/poky-image-sato-sdk.bb |    2 +-
 meta/recipes-sato/images/poky-image-sato.bb     |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
meta/recipes-sato/images/poky-image-sato-dev.bb +1 -1
index 429095e..71d44e2 100644
@@ -2,7 +2,7 @@
 # Copyright (C) 2007 OpenedHand Ltd.
 #
 
-IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} dev-pkgs"
+IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} dev-pkgs ssh-server"
 
 LICENSE = "MIT"
 
meta/recipes-sato/images/poky-image-sato-sdk.bb +1 -1
index 9f8eef9..7ee2f95 100644
@@ -2,7 +2,7 @@
 # Copyright (C) 2007 OpenedHand Ltd.
 #
 
-IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} tools-debug tools-profile tools-sdk dev-pkgs qt4-pkgs"
+IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} tools-debug tools-profile tools-sdk dev-pkgs qt4-pkgs ssh-server"
 
 LICENSE = "MIT"
 
meta/recipes-sato/images/poky-image-sato.bb +1 -1
index 35d1a53..31f74b1 100644
@@ -2,7 +2,7 @@
 # Copyright (C) 2007 OpenedHand Ltd.
 #
 
-IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES}"
+IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} ssh-server"
 
 LICENSE = "MIT"
 
Signature · 1 line
1.7.1
#6 lore raw

PATCH 6/6 poky-image-lsb: add ssh-server to IMAGE_FEATURES

In reply to Scott Garman

From: Scott Garman <[email protected]>

---
 meta/recipes-extended/images/poky-image-lsb-dev.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb-sdk.bb |    2 +-
 meta/recipes-extended/images/poky-image-lsb.bb     |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
meta/recipes-extended/images/poky-image-lsb-dev.bb +1 -1
index d490ee5..35b80a3 100644
@@ -1,4 +1,4 @@
-IMAGE_FEATURES += "apps-console-core dev-pkgs "
+IMAGE_FEATURES += "apps-console-core dev-pkgs ssh-server"
 
 IMAGE_INSTALL = "\
     ${POKY_BASE_INSTALL} \
meta/recipes-extended/images/poky-image-lsb-sdk.bb +1 -1
index 184b5d7..0b1e1e9 100644
@@ -1,4 +1,4 @@
-IMAGE_FEATURES += "apps-console-core tools-debug tools-profile tools-sdk dev-pkgs"
+IMAGE_FEATURES += "apps-console-core tools-debug tools-profile tools-sdk dev-pkgs ssh-server"
 
 IMAGE_INSTALL = "\
     ${POKY_BASE_INSTALL} \
meta/recipes-extended/images/poky-image-lsb.bb +1 -1
index 8424d91..096fed4 100644
@@ -1,4 +1,4 @@
-IMAGE_FEATURES += "apps-console-core "
+IMAGE_FEATURES += "apps-console-core ssh-server"
 
 IMAGE_INSTALL = "\
     ${POKY_BASE_INSTALL} \
Signature · 1 line
1.7.1