From e6f4c59b6a4ac9c600e9e0138ec89775cf3f545e Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 16 Nov 2012 16:09:18 +0100 Subject: [PATCH] del-image-minimal: Add initial version. del-image-minimal is the command line non graphical busybox based minimal root filesystem for Digi Embedded Linux. It uses a base task-del-core task, and defines core-ssh-dropbear as image feature. It also will default to using shadow passwords unless debug-tweak is selected in which case root can log in with an empty password. Signed-off-by: Alex Gonzalez --- .../recipes-core/images/del-image-minimal.bb | 16 +++++- .../recipes-core/tasks/task-del-core.bb | 50 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 meta-digi-arm/recipes-core/tasks/task-del-core.bb diff --git a/meta-digi-arm/recipes-core/images/del-image-minimal.bb b/meta-digi-arm/recipes-core/images/del-image-minimal.bb index 62227a058..9acf7449d 100644 --- a/meta-digi-arm/recipes-core/images/del-image-minimal.bb +++ b/meta-digi-arm/recipes-core/images/del-image-minimal.bb @@ -3,7 +3,7 @@ # DESCRIPTION = "DEL busybox based image (non graphical)." -IMAGE_INSTALL = "task-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}" +IMAGE_INSTALL = "task-del-core ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}" IMAGE_LINGUAS = " " @@ -11,6 +11,20 @@ LICENSE = "MIT" inherit core-image +IMAGE_FEATURES = "core-ssh-dropbear" + +# Adding debug-tweaks will enable empty password login. +# Note that adding debug-tweaks to EXTRA_IMAGE_FEATURES will not +# allow for empty password logins. +#IMAGE_FEATURES =+ "debug-tweaks" + +# core-image disables the root password if debug-tweak is not enabled. +# This override will use the shadow file instead. +zap_root_password () { + sed 's%^root:[^:]*:%root:x:%' < ${IMAGE_ROOTFS}/etc/passwd >${IMAGE_ROOTFS}/etc/passwd.new + mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd +} + IMAGE_ROOTFS_SIZE = "8192" # remove not needed ipkg informations diff --git a/meta-digi-arm/recipes-core/tasks/task-del-core.bb b/meta-digi-arm/recipes-core/tasks/task-del-core.bb new file mode 100644 index 000000000..33e588235 --- /dev/null +++ b/meta-digi-arm/recipes-core/tasks/task-del-core.bb @@ -0,0 +1,50 @@ +# +# Copyright (C) 2012 Digi International. +# +DESCRIPTION = "Core task for DEL image" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" +PACKAGE_ARCH = "${MACHINE_ARCH}" +DEPENDS = "virtual/kernel" +ALLOW_EMPTY = "1" +PR = "r0" + +# +# Set by the machine configuration with packages essential for device bootup +# +MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= "" +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= "" + +# Distro can override the following VIRTUAL-RUNTIME providers: +VIRTUAL-RUNTIME_dev_manager ?= "" +VIRTUAL-RUNTIME_login_manager ?= "tinylogin" +VIRTUAL-RUNTIME_passwd_manager ?= "shadow" +VIRTUAL-RUNTIME_init_manager ?= "sysvinit" +VIRTUAL-RUNTIME_initscripts ?= "initscripts" +VIRTUAL-RUNTIME_keymaps ?= "keymaps" + +PACKAGES = "\ + task-del-core \ + task-del-core-dbg \ + task-del-core-dev \ + " + +RDEPENDS_task-del-core = "\ + base-files \ + base-passwd \ + busybox \ + ${VIRTUAL-RUNTIME_passwd_manager} \ + ${VIRTUAL-RUNTIME_initscripts} \ + ${@base_contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ + modutils-initscripts \ + netbase \ + ${VIRTUAL-RUNTIME_login_manager} \ + ${VIRTUAL-RUNTIME_init_manager} \ + ${VIRTUAL-RUNTIME_dev_manager} \ + ${VIRTUAL-RUNTIME_update-alternatives} \ + ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}" + +RRECOMMENDS_task-del-core = "\ + ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}" + +