Set ssh server using IMAGE_FEATURES, v2
cover Set ssh server using IMAGE_FEATURES, v2
From: Scott Garman <[email protected]>
Hi Saul,
Based on feedback from you and Joshua, here is an updated pull request for refactoring the way an ssh server can be specified in images. 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 (7):
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.bbclass: add ssh-server to SATO_IMAGE_FEATURES
poky-image-lsb: add ssh-server to IMAGE_FEATURES
poky-image-basic: add ssh-server to IMAGE_FEATURES
meta/classes/poky-image.bbclass | 8 +++++- 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-basic.bb | 4 ++- meta/recipes-extended/images/poky-image-lsb-dev.bb | 4 ++- meta/recipes-extended/images/poky-image-lsb-sdk.bb | 4 ++- meta/recipes-extended/images/poky-image-lsb.bb | 4 ++- meta/recipes-extended/tasks/task-poky-basic.bb | 4 +-- meta/recipes-sato/tasks/task-poky.bb | 3 +- 10 files changed, 46 insertions(+), 19 deletions(-) create mode 100644 meta/recipes-core/tasks/task-poky-ssh.bb
PATCH 1/7 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
@@ -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
@@ -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
@@ -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
PATCH 2/7 openssh: allow the openssh meta package to be empty
In reply to Scott GarmanFrom: 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
@@ -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
PATCH 3/7 task-poky-ssh.bb: new task for ssh services
In reply to Scott GarmanFrom: 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
@@ -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
PATCH 4/7 poky-image.bbclass: add ssh-server as an IMAGE_FEATURES option
In reply to Scott GarmanFrom: 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
@@ -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
PATCH 5/7 poky-image.bbclass: add ssh-server to SATO_IMAGE_FEATURES
In reply to Scott GarmanFrom: Scott Garman <[email protected]>
--- meta/classes/poky-image.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
meta/classes/poky-image.bbclass +1 -1
@@ -97,7 +97,7 @@ IMAGE_INSTALL ?= "${POKY_BASE_INSTALL}" X11_IMAGE_FEATURES = "x11-base apps-x11-core package-management" ENHANCED_IMAGE_FEATURES = "${X11_IMAGE_FEATURES} apps-x11-games apps-x11-pimlico package-management" -SATO_IMAGE_FEATURES = "${ENHANCED_IMAGE_FEATURES} x11-sato" +SATO_IMAGE_FEATURES = "${ENHANCED_IMAGE_FEATURES} x11-sato ssh-server" inherit image
Signature · 1 line
1.7.1
PATCH 6/7 poky-image-lsb: add ssh-server to IMAGE_FEATURES
In reply to Scott GarmanFrom: Scott Garman <[email protected]>
And set the default IMAGE_SSH_PROVIDER to openssh.
--- meta/recipes-extended/images/poky-image-lsb-dev.bb | 4 +++- meta/recipes-extended/images/poky-image-lsb-sdk.bb | 4 +++- meta/recipes-extended/images/poky-image-lsb.bb | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-)
meta/recipes-extended/images/poky-image-lsb-dev.bb +3 -1
@@ -1,4 +1,6 @@ -IMAGE_FEATURES += "apps-console-core dev-pkgs " +IMAGE_SSH_PROVIDER = "openssh" + +IMAGE_FEATURES += "apps-console-core dev-pkgs ssh-server" IMAGE_INSTALL = "\ ${POKY_BASE_INSTALL} \
meta/recipes-extended/images/poky-image-lsb-sdk.bb +3 -1
@@ -1,4 +1,6 @@ -IMAGE_FEATURES += "apps-console-core tools-debug tools-profile tools-sdk dev-pkgs" +IMAGE_SSH_PROVIDER = "openssh" + +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 +3 -1
@@ -1,4 +1,6 @@ -IMAGE_FEATURES += "apps-console-core " +IMAGE_SSH_PROVIDER = "openssh" + +IMAGE_FEATURES += "apps-console-core ssh-server" IMAGE_INSTALL = "\ ${POKY_BASE_INSTALL} \
Signature · 1 line
1.7.1
PATCH 7/7 poky-image-basic: add ssh-server to IMAGE_FEATURES
In reply to Scott GarmanFrom: Scott Garman <[email protected]>
And set the default IMAGE_SSH_PROVIDER to openssh.
--- meta/recipes-extended/images/poky-image-basic.bb | 4 +++- meta/recipes-extended/tasks/task-poky-basic.bb | 1 - 2 files changed, 3 insertions(+), 2 deletions(-)
meta/recipes-extended/images/poky-image-basic.bb +3 -1
@@ -1,4 +1,6 @@ -IMAGE_FEATURES += "apps-console-core " +IMAGE_SSH_PROVIDER = "openssh" + +IMAGE_FEATURES += "apps-console-core ssh-server" IMAGE_INSTALL = "\ ${POKY_BASE_INSTALL} \
meta/recipes-extended/tasks/task-poky-basic.bb +0 -1
@@ -99,7 +99,6 @@ RDEPENDS_task-poky-basic-extended = "\ module-init-tools \ openssl \ " -# openssh RDEPENDS_task-poky-dev-utils = "\ byacc \
Signature · 1 line
1.7.1