diff options
Diffstat (limited to 'distribution/yocto-advanced/meta-schulung-extended')
28 files changed, 1120 insertions, 0 deletions
diff --git a/distribution/yocto-advanced/meta-schulung-extended/classes/exportsrc.bbclass b/distribution/yocto-advanced/meta-schulung-extended/classes/exportsrc.bbclass new file mode 100644 index 0000000..c123111 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/classes/exportsrc.bbclass @@ -0,0 +1,8 @@ +do_exportsrc () { + DEPLOY_DIR_SRC="${DEPLOY_DIR}/src-export/${MACHINE}" + mkdir -p "${DEPLOY_DIR_SRC}" + tar cjf "${DEPLOY_DIR_SRC}/${PN}-${PV}-${PR}.tar.bz2" -C "${WORKDIR}" "${BP}" +} + +addtask exportsrc after do_configure before do_compile + diff --git a/distribution/yocto-advanced/meta-schulung-extended/conf/bblayers.conf.sample b/distribution/yocto-advanced/meta-schulung-extended/conf/bblayers.conf.sample new file mode 100644 index 0000000..89e9964 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/conf/bblayers.conf.sample @@ -0,0 +1,12 @@ +# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +POKY_BBLAYERS_CONF_VERSION = "2" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-poky \ + ##OEROOT##/../meta-schulung-extended \ + " diff --git a/distribution/yocto-advanced/meta-schulung-extended/conf/distro/schulung-poky.conf b/distribution/yocto-advanced/meta-schulung-extended/conf/distro/schulung-poky.conf new file mode 100644 index 0000000..4a0d6cf --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/conf/distro/schulung-poky.conf @@ -0,0 +1,19 @@ +# whatever poky does +require conf/distro/poky.conf + +# but call it schulung-poky +DISTRO = "schulung-poky" + +# and keep named compatibility with poky +DISTROOVERRIDES = "poky" + +# debian/jessie works great +SANITY_TESTED_DISTROS = "DebianGNULinux-8" + +# if this distribution is designed for internal use, it may +# be appropriate to set PREMIRRORS here for internal mirrors +#PREMIRRORS ?= "" + +# set preferred kernel and version for this distribution +PREFERRED_PROVIDER_virtual/kernel ?= "linux-basic" +PREFERRED_VERSION_virtual/kernel ?= "4.4" diff --git a/distribution/yocto-advanced/meta-schulung-extended/conf/distro/schulung.conf b/distribution/yocto-advanced/meta-schulung-extended/conf/distro/schulung.conf new file mode 100644 index 0000000..9a2c552 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/conf/distro/schulung.conf @@ -0,0 +1,27 @@ +# whatever poky does +require conf/distro/poky.conf + +# but call it schulung-poky +DISTRO = "schulung" +DISTRO_NAME = "Schulung (Yocto Schulung Example Distro)" +DISTRO_VERSION = "1.0" +DISTRO_CODENAME = "pyro" +SDK_VENDOR = "-schulungsdk" + +MAINTAINER = "YourName <you@schulung>" + +TARGET_VENDOR = "-schulung" + +# and keep named compatibility with poky +DISTROOVERRIDES = "poky" + +# debian/jessie works great +SANITY_TESTED_DISTROS = "debian-8" + +# remove some distro features added in poky.conf +DISTRO_FEATURES_remove = "alsa argp bluetooth irda pcmcia usbgadget usbhost wifi zeroconf 3g nfc x11 ipv6 opengl ptest wayland pulseaudio bluez5 gobject-introspection-data" + +# enable systemd as init daemon +#DISTRO_FEATURES_remove = "sysvinit" +#DISTRO_FEATURES += "systemd" +#VIRTUAL-RUNTIME_init_manager = "systemd" diff --git a/distribution/yocto-advanced/meta-schulung-extended/conf/layer.conf b/distribution/yocto-advanced/meta-schulung-extended/conf/layer.conf new file mode 100644 index 0000000..874701b --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/conf/layer.conf @@ -0,0 +1,26 @@ +# add this layer to the search path for bitbake +BBPATH .= ":${LAYERDIR}" + +# specify where all bb and bbappend files for this layer are +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb" +BBFILES += "${LAYERDIR}/recipes-*/*/*.bbappend" + +# name this layer +# (...and add it to bitbake's list of known layers) +BBFILE_COLLECTIONS += "schulung" + +# specify the pattern that can be used to match file paths with this layer +BBFILE_PATTERN_schulung = "^${LAYERDIR}/" + +# specify the priority of this layer +BBFILE_PRIORITY_schulung = "10" + +# specify the version of this layer +# (should only be incremented on significant changes that will cause +# compatibility issues with other layers) +LAYERVERSION_schulung = "1" + +# layers this layer depends on +# (look at the BBFILE_COLLECTIONS value in a layer's +# layer.conf to see what its name is) +LAYERDEPENDS_schulung = "core" diff --git a/distribution/yocto-advanced/meta-schulung-extended/conf/local.conf.sample b/distribution/yocto-advanced/meta-schulung-extended/conf/local.conf.sample new file mode 100644 index 0000000..6d66139 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/conf/local.conf.sample @@ -0,0 +1,7 @@ +DISTRO ?= "schulung" +MACHINE ?= "vexpress" +PACKAGE_CLASSES ?= "package_ipk" +PATCHRESOLVE ?= "noop" +DL_DIR ?= "/home/devel/downloads" +SSTATE_DIR ?= "/home/devel/sstate-cache" +CONF_VERSION = "1" diff --git a/distribution/yocto-advanced/meta-schulung-extended/conf/machine/vexpress.conf b/distribution/yocto-advanced/meta-schulung-extended/conf/machine/vexpress.conf new file mode 100644 index 0000000..3c542eb --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/conf/machine/vexpress.conf @@ -0,0 +1,69 @@ +# build hardware floating point binaries +# (tune-coretexa8.inc sets "armv7a-neon" as default) +DEFAULTTUNE ?= "armv7athf-neon" + +# build for cortex a8 +# (for our vexpress board we could use tune-cortexa9.inc, but +# we wanted to stay compatible with beaglebone/cortex-a8) +require conf/machine/include/tune-cortexa8.inc + +# for generating a qemu-boot.conf file +require conf/machine/include/qemu.inc +QB_SYSTEM_NAME = "qemu-system-arm" +QB_MACHINE = "-machine vexpress-a9" +QB_DEFAULT_KERNEL = "u-boot.uimg" +# for using tftpboot set QB_NETWORK_DEVICE to "-net user,tftp=tmp/deploy/images/vexpress" +QB_NETWORK_DEVICE = "-device virtio-net-device,mac=@MAC@ -net user" +QB_DEFAULT_FSTYPE = "wic" +QB_DRIVE_TYPE = "/dev/mmcblk" +QB_OPT_APPEND = "-nographic" +KERNEL_IMAGETYPE ?= "u-boot.uimg" + +# machine features are used to install additional packages and can +# be set to values like: +# MACHINE_FEATURES="alsa bluetooth usbgadget screen rtc qemu-usermode" +MACHINE_FEATURES="" + +# build tarballs of root filesystems +IMAGE_FSTYPES += "tar.gz" + +# build ext4 images +IMAGE_FSTYPES += "ext4" + +# build ext2 images +IMAGE_FSTYPES += "ext2" + +# build sdcard image +IMAGE_FSTYPES += "wic wic.bmap" +WKS_FILE ?= "vexpress.wks" +do_image_wic[depends] += "qemu-boot-files:do_deploy mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot" +# files that should be stored on the /boot partition of the sdcard +IMAGE_BOOT_FILES = "image.fit" + +# build ubi images +# (the "ubi" image type requires addition hardware-specific details for +# creating the image... what variables are needed and how they are used +# can be seen in image_types.bbclass, in the IMAGE_CMD_ubifs function) +MKUBIFS_ARGS = "-m 1 -e 524160 -c 256" +UBINIZE_ARGS = "-m 1 -p 524288 -s 1" +UBI_VOLNAME = "rootfs" +IMAGE_FSTYPES += "ubi" + +# set the default device tree for this board +# (this is a variable we created, used by the linux-basic recipe) +DTB ?= "vexpress-v2p-ca9.dtb" + +# set the baud rate and device for the serial console +# (bitbake.conf adds value to a ${SERIAL_CONSOLES} list, but it is up to +# invididual recipes to do something useful with this information +SERIAL_CONSOLE = "115200 ttyAMA0" + +# use linux-basic as kernel recipe +PREFERRED_PROVIDER_virtual/kernel = "linux-basic" +# and install the kernel modules into the rootfs +MACHINE_EXTRA_RRECOMMENDS = "kernel-modules" + +# use u-boot as bootloader +PREFERRED_PROVIDER_virtual/bootloader = "u-boot" +# build the make target 'u-boot-nodtb' +UBOOT_MACHINE = "u-boot-nodtb" diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello-init.sh b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello-init.sh new file mode 100644 index 0000000..1d40092 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello-init.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +case $1 in +start) + exec hello + ;; +stop) + exit 0 + ;; +esac + +exit 1 diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello.c b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello.c new file mode 100644 index 0000000..aea8503 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +/* + * A simple application to greet the world. + */ + +int main(void) +{ + printf("Hello, world!\n"); + return 0; +} + diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/hello_1.0.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/hello_1.0.bb new file mode 100644 index 0000000..3f9b9c2 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/hello_1.0.bb @@ -0,0 +1,49 @@ +# packages require licenses! +LICENSE = "MIT" + +# if the license is not "CLOSED", a checksum is required +# (we are using a common license file since this +# application does not provide LICENSE text) +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +# specify files needed to build the package +SRC_URI = " \ + file://hello.c \ + file://hello-init.sh \ +" + +S = "${WORKDIR}" + +# specify a new compile task +# - by default, poky calls "make", but we have no Makefile +# - this task is called from the ${S} directory, ${WORKDIR}/${PN}/${PV} +# - poky appropriately sets ${CC}, ${CFLAGS}, ${LDFLAGS} and exports +# them to the shell process environment +do_compile () { + $CC $CFLAGS $LDFLAGS -o${B}/hello ${S}/hello.c +} + +# specify an install task +# - by default, do_install is empty +# - this task is called from the ${S} directory, ${WORKDIR}/${PN}-${PV} +# - anything copy to ${D} will be packaged +# - by default, poky sets ${base_bindir} to "/bin" +do_install () { + install -D -m 0755 ${B}/hello ${D}${base_bindir}/hello + + # install the init script + install -D -m 0755 ${WORKDIR}/hello-init.sh \ + ${D}${sysconfdir}/init.d/hello +} + +# specify the name of the init script +# (it is will be expected to be in /etc/init.d) +INITSCRIPT_NAME="hello" + +# setup the init script +# (this will create the link: /etc/rcS.d/S20hello) +INITSCRIPT_PARAMS = "start 20 S ." + +# use the update-rc.d class to setup the init scripts +# (this class uses INITSCRIPT_NAME and INITSCRIPT_PARAMS) +inherit update-rc.d diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/boot/files/signed-config.its b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/boot/files/signed-config.its new file mode 100644 index 0000000..9fcfe22 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/boot/files/signed-config.its @@ -0,0 +1,47 @@ +/dts-v1/; + +/ { + description = "my u-boot dtb"; + #address-cells = <1>; + + images { + kernel@1 { + description = "my kernel"; + data = /incbin/("zImage"); + type = "kernel_noload"; + arch = "arm"; + os = "linux"; + compression = "none"; + load = <0x4>; + entry = <0x8>; + kernel-version = <1>; + hash@1 { + algo = "sha256"; + }; + }; + fdt@1 { + description = "my dtb"; + data = /incbin/("dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + fdt-version = <1>; + hash@1 { + algo = "sha256"; + }; + }; + }; + configurations { + default = "conf@1"; + conf@1 { + description = "my conf"; + kernel = "kernel@1"; + fdt = "fdt@1"; + signature@1 { + algo = "sha256,rsa4096"; + key-name-hint = "dev"; + sign-images = "fdt", "kernel"; + }; + }; + }; +}; diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/boot/qemu-boot-files.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/boot/qemu-boot-files.bb new file mode 100644 index 0000000..e885d25 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/boot/qemu-boot-files.bb @@ -0,0 +1,62 @@ +# specify build dependencies +DEPENDS += "linux-basic" +DEPENDS += "u-boot" +DEPENDS += "u-boot-mkimage-native" +DEPENDS += "keys-native" + +# fit image configuration file +SRC_URI = "file://signed-config.its" + +# license information +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +# create signed fit image for kernel/devicetree and uimage for qemu booting +do_compile () { + # extract TEXT_BASE from u-boot configuration + TEXT_BASE=`grep CONFIG_SYS_TEXT_BASE \ + ${PKG_CONFIG_SYSROOT_DIR}${datadir}/u-boot/u-boot.cfg | \ + awk '{print $3}'` + + cp ${DEPLOY_DIR_IMAGE}/devicetree-${DTB} dtb + cp ${DEPLOY_DIR_IMAGE}/zImage . + cp ${WORKDIR}/signed-config.its . + + # create fit image with signed configuration + # and update the dtb to contain the public key + uboot-mkimage -f signed-config.its \ + -k ${STAGING_DIR_NATIVE}${datadir_native}/keys \ + -K dtb -r image.fit + + # create the final u-boot image by appending the new dtb + cat ${DEPLOY_DIR_IMAGE}/u-boot-nodtb.bin dtb > u-boot-dtb.bin + + # pack u-boot into a uimage file so we can + # trick qemu into booting u-boot + uboot-mkimage -A ${HOST_ARCH} -C none -T kernel -O linux \ + -d u-boot-dtb.bin -a $TEXT_BASE -e $TEXT_BASE u-boot.uimg +} + +# specify task dependencies for compiling +# - bitbake only knows about dependencies that are specified +# otherwise it assumes it can do things in parallel +# - the build dependencies ${DEPEND} only create a task dependency +# on do_install (do_deploy comes after do_install) +# - for linux-basic and u-boot-sample we need to wait for do_deploy +# to complete because our do_compile uses their deployed files +do_compile[depends] += "linux-basic:do_deploy" +do_compile[depends] += "u-boot:do_deploy" + +# use the deploy class (poky/meta/deploy.bbclass) +# - this officially creates a deploy task +# - this creates and sets ${DEPLOYDIR} +inherit deploy + +# deploy fit image (kernel/devicetree) and uimage (u-boot) +do_deploy () { + install -D -m 0644 image.fit ${DEPLOYDIR}/image.fit + install -D -m 0644 u-boot.uimg ${DEPLOYDIR}/u-boot.uimg +} + +# set do_deploy to occur after do_install +addtask do_deploy after do_install diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/files/vexpress/defconfig b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/files/vexpress/defconfig new file mode 100644 index 0000000..2344d27 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/files/vexpress/defconfig @@ -0,0 +1,151 @@ +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_SYSVIPC=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_CGROUPS=y +CONFIG_CPUSETS=y +# CONFIG_UTS_NS is not set +# CONFIG_IPC_NS is not set +# CONFIG_PID_NS is not set +# CONFIG_NET_NS is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_PROFILING=y +CONFIG_OPROFILE=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set +CONFIG_ARCH_VEXPRESS=y +CONFIG_ARCH_VEXPRESS_DCSCB=y +CONFIG_ARCH_VEXPRESS_TC2_PM=y +CONFIG_SMP=y +CONFIG_HAVE_ARM_ARCH_TIMER=y +CONFIG_MCPM=y +CONFIG_VMSPLIT_2G=y +CONFIG_NR_CPUS=8 +CONFIG_ARM_PSCI=y +CONFIG_AEABI=y +CONFIG_CMA=y +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="console=ttyAMA0" +CONFIG_CPU_IDLE=y +CONFIG_VFP=y +CONFIG_NEON=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_INET_LRO is not set +# CONFIG_IPV6 is not set +# CONFIG_WIRELESS is not set +CONFIG_NET_9P=y +CONFIG_NET_9P_VIRTIO=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_DEVTMPFS=y +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_CFI=y +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_PLATRAM=y +CONFIG_MTD_UBI=y +CONFIG_VIRTIO_BLK=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +CONFIG_SCSI_VIRTIO=y +CONFIG_ATA=y +# CONFIG_SATA_PMP is not set +CONFIG_NETDEVICES=y +CONFIG_VIRTIO_NET=y +CONFIG_SMC91X=y +CONFIG_SMSC911X=y +# CONFIG_WLAN is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIO_AMBAKMI=y +CONFIG_LEGACY_PTY_COUNT=16 +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_I2C=y +CONFIG_I2C_VERSATILE=y +CONFIG_SENSORS_VEXPRESS=y +CONFIG_REGULATOR_VEXPRESS=y +CONFIG_FB=y +CONFIG_FB_ARMCLCD=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_SOUND=y +CONFIG_SND=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_PCM_OSS=y +# CONFIG_SND_DRIVERS is not set +CONFIG_SND_ARMAACI=y +CONFIG_HID_DRAGONRISE=y +CONFIG_HID_GYRATION=y +CONFIG_HID_TWINHAN=y +CONFIG_HID_NTRIG=y +CONFIG_HID_PANTHERLORD=y +CONFIG_HID_PETALYNX=y +CONFIG_HID_SAMSUNG=y +CONFIG_HID_SONY=y +CONFIG_HID_SUNPLUS=y +CONFIG_HID_GREENASIA=y +CONFIG_HID_SMARTJOYPLUS=y +CONFIG_HID_TOPSEED=y +CONFIG_HID_THRUSTMASTER=y +CONFIG_HID_ZEROPLUS=y +CONFIG_USB=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_MON=y +CONFIG_USB_STORAGE=y +CONFIG_USB_ISP1760=y +CONFIG_MMC=y +CONFIG_MMC_ARMMMCI=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_PL031=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_JFFS2_FS=y +CONFIG_UBIFS_FS=y +CONFIG_CRAMFS=y +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_LZO=y +CONFIG_NFS_FS=y +CONFIG_ROOT_NFS=y +CONFIG_9P_FS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_FS=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_DEBUG_KERNEL=y +CONFIG_DETECT_HUNG_TASK=y +# CONFIG_SCHED_DEBUG is not set +CONFIG_DEBUG_USER=y +# CONFIG_CRYPTO_HW is not set diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/linux-basic_4.11.1.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/linux-basic_4.11.1.bb new file mode 100644 index 0000000..f02c964 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/linux-basic_4.11.1.bb @@ -0,0 +1,60 @@ +# use the kernel class (poky/meta/kernel.bbclass) +inherit kernel + +KERNEL_IMAGETYPE = "zImage" + +# license information/checksum +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +# specify kernel source (named as "upstream" for later reference) +# SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=upstream" + +# provide git reference for the exact commit +# - references must be used with git if no network available +# - reference for "v4.4" tag discovered with: git show-ref v4.4 +#SRCREV_upstream = "b5be40b90dbaa6bd337f3b77de361bfc0723468b" + +# by default for the git protocol, the repository is checked out into +# ${WORKDIR}/git, so bitbake must look there for the source code +# (the "destsuffix" SRC_URI option defaults to "git/" for git) +#S = "${WORKDIR}/git" + +SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz" + +# checksums for the downloaded file +SRC_URI[md5sum] = "9a75a70346aff3be6147e2478a581c18" +SRC_URI[sha256sum] = "7e46f9e216907942b0b07f2bb59708dc33501d4e2a0938164396386ebd21e608" + +# the https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.11.1.tar.xz extracts +# into a directory called linux-4.11.1 set this as source directory +S = "${WORKDIR}/linux-4.11.1" + +# specify kernel config (automatically searched in ./files/${MACHINE}/) +SRC_URI += "file://defconfig" + +# set a weak default for our DTB variable +# (this ensures that DTB definitely has a value and because of +# how we named the dummy value, will generate a useful message +# if DTB is not specified in some .conf somehwere) +DTB ??= "no-devicetree-specified.dtb" + +# create a compile function for the device tree +# - DTB is a variable we created +build_dtb () { + oe_runmake -f ${B}/Makefile ${DTB} +} +# ...and have it called after the compile task is finished +do_compile[postfuncs] += "build_dtb" + +# create a deploy function for the device tree +# - ${B} is set to the kernel build directory (set in kernel.bbclass) +# - ${ARCH} is set to the kernel architecture (set in kernel-arch.bbclass) +# - anything copied to ${DEPLOYDIR} will also appear as a deployed file +# (for example: tmp/deploy/images/vexpress/myfile) +deploy_dtb () { + install -D -m 0644 ${B}/arch/${ARCH}/boot/dts/${DTB} \ + ${DEPLOYDIR}/devicetree-${DTB} +} +# ...and have it called after the deploy task is finished +do_deploy[postfuncs] += "deploy_dtb" diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/linux-basic_4.4.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/linux-basic_4.4.bb new file mode 100644 index 0000000..7301b6e --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/kernel/linux-basic_4.4.bb @@ -0,0 +1,48 @@ +# use the kernel class (poky/meta/kernel.bbclass) +inherit kernel + +# license information/checksum +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +# specify kernel source (named as "upstream" for later reference) +SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=upstream" + +# specify kernel config (automatically searched in ./files/${MACHINE}/) +SRC_URI += "file://defconfig" + +# provide git reference for the exact commit +# - references must be used with git if no network available +# - reference for "v4.4" tag discovered with: git show-ref v4.4 +SRCREV_upstream = "b5be40b90dbaa6bd337f3b77de361bfc0723468b" + +# by default for the git protocol, the repository is checked out into +# ${WORKDIR}/git, so bitbake must look there for the source code +# (the "destsuffix" SRC_URI option defaults to "git/" for git) +S = "${WORKDIR}/git" + +# set a weak default for our DTB variable +# (this ensures that DTB definitely has a value and because of +# how we named the dummy value, will generate a useful message +# if DTB is not specified in some .conf somehwere) +DTB ??= "no-devicetree-specified.dtb" + +# create a compile function for the device tree +# - DTB is a variable we created +# build_dtb () { +# oe_runmake ${DTB} +#} +# ...and have it called after the compile task is finished +do_compile[postfuncs] += "build_dtb" + +# create a deploy function for the device tree +# - ${B} is set to the kernel build directory (set in kernel.bbclass) +# - ${ARCH} is set to the kernel architecture (set in kernel-arch.bbclass) +# - anything copied to ${DEPLOYDIR} will also appear as a deployed file +# (for example: tmp/deploy/images/vexpress/myfile) +deploy_dtb () { + install -D -m 0644 ${B}/arch/${ARCH}/boot/dts/${DTB} \ + ${DEPLOYDIR}/devicetree-${DTB} +} +# ...and have it called after the deploy task is finished +do_deploy[postfuncs] += "deploy_dtb" diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/files/0001-setup-bootcmd-for-tftp.patch b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/files/0001-setup-bootcmd-for-tftp.patch new file mode 100644 index 0000000..18b0171 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/files/0001-setup-bootcmd-for-tftp.patch @@ -0,0 +1,27 @@ +From 284f9ad599ec5809ba9c06d4ba5945f4e9d0a369 Mon Sep 17 00:00:00 2001 +From: Your Name <you@example.com> +Date: Fri, 19 May 2017 23:10:09 +0200 +Subject: [PATCH] setup bootcmd for tftp + +Signed-off-by: Your Name <you@example.com> +--- + include/configs/vexpress_common.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/include/configs/vexpress_common.h b/include/configs/vexpress_common.h +index 0bc4ea5..da37125 100644 +--- a/include/configs/vexpress_common.h ++++ b/include/configs/vexpress_common.h +@@ -186,8 +186,7 @@ + + /* Basic environment settings */ + #define CONFIG_BOOTCOMMAND \ +- "run distro_bootcmd; " \ +- "run bootflash; " ++ "fatload mmc 0 0x64000000 image.fit; setenv bootargs console=ttyAMA0,115200 root=/dev/mmcblk0p2 ip=192.168.7.2::192.168.7.1:255.255.255.0; bootm 0x64000000" + + #define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 1) \ +-- +2.1.4 + diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/files/defconfig b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/files/defconfig new file mode 100644 index 0000000..c5149b7 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/files/defconfig @@ -0,0 +1,25 @@ +CONFIG_ARM=y +CONFIG_TARGET_VEXPRESS_CA9X4=y +CONFIG_DISTRO_DEFAULTS=y +# CONFIG_SYS_MALLOC_F is not set +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_FIT_SIGNATURE=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set +# CONFIG_CMD_CONSOLE is not set +# CONFIG_CMD_BOOTD is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_EDITENV is not set +# CONFIG_CMD_ENV_EXISTS is not set +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +# CONFIG_CMD_FPGA is not set +# CONFIG_CMD_ITEST is not set +# CONFIG_CMD_SETEXPR is not set +# CONFIG_CMD_NFS is not set +# CONFIG_CMD_MISC is not set +CONFIG_OF_CONTROL=y +CONFIG_DM=y diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/u-boot_%.bbappend b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/u-boot_%.bbappend new file mode 100644 index 0000000..64bd6c5 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-bsp/u-boot/u-boot_%.bbappend @@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://defconfig" + +# only alter the default bootcmd if we build for the vexpress machine +SRC_URI_append_vexpress = " file://0001-setup-bootcmd-for-tftp.patch" +# take care +# SRC_URI_vexpress += "file://0001-setup-bootcmd-for-tftp.patch" +# is NOT the same. The result is that the old content of SRC_URI is lost!! + +do_configure_prepend () { + cp ${WORKDIR}/defconfig ${S}/.config + cd ${S}; oe_runmake oldconfig +} + +do_compile () { + export HOST_EXTRACFLAGS="${BUILD_CFLAGS}" + export HOST_EXTRACXXFLAGS="${BUILD_CXXFLAGS}" + export HOSTLDFLAGS="${BUILD_LDFLAGS}" + cd ${S}; oe_runmake u-boot-nodtb.bin + # instead of hardcoding the dtb it would be nicer to use the varialbe + # specified in vexpress.conf: UBOOT_MACHINE = "u-boot-nodtb" + # cd ${S}; oe_runmake ${UBOOT_MACHINE}.bin +} + +do_install () { + cd ${S}; install -D -m 0644 u-boot.cfg ${D}${datadir}/u-boot/u-boot.cfg +} + +FILES_${PN}-dev_append = " ${datadir}/u-boot/u-boot.cfg" + +do_deploy () { + cd ${S}; install -D -m 0644 u-boot-nodtb.bin ${DEPLOYDIR}/u-boot-nodtb.bin +} diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.24.1.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.24.1.bb new file mode 100644 index 0000000..de441f7 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.24.1.bb @@ -0,0 +1,64 @@ +# source file +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=upstream" + +# source file checksums +SRC_URI[upstream.md5sum] = "be98a40cadf84ce2d6b05fa41a275c6a" +SRC_URI[upstream.sha256sum] = "37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d" + +# license information +LICENSE = "GPLv2 & bzip2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb" + +# specify additional arguments used by "oe_runmake" +# - busybox requires "CROSS_COMPILE" to specify the toolchain prefix +# (${TARGET_PREFIX} is correctly set to this in bitbake.conf) +# - busybox requires "CONFIG_SYSROOT" to specify the sysroot +# - if V=1 is used the busybox Makefiles produce verbose build output, +# which helps to investigate any possible build errors +EXTRA_OEMAKE += "CROSS_COMPILE=${TARGET_PREFIX}" +EXTRA_OEMAKE += "CONFIG_SYSROOT=${PKG_CONFIG_SYSROOT_DIR}" +EXTRA_OEMAKE += "V=1" + +# configure busybox using the shipped defconfig +do_configure () { + oe_runmake defconfig +} + +# build busybox and the links file +# - the links file is a text file listing all the links that +# should be created to use all configured busybox features +# - ${TARGET_CC_ARCH} is set in bitbake.conf and specifies the architecture- +# specific compiler options (for example, hardware floating point) +# (busybox needs this additional information in CFLAGS) +do_compile () { + export CFLAGS="${TARGET_CC_ARCH} ${CFLAGS}" + oe_runmake busybox_unstripped + oe_runmake busybox.links +} + +# install the busybox binary and the links file +# - the links file needs to be adjusted if non-default definitions +# for ${prefix}, ${base_sbindir}, ${base_bindir} are used +do_install () { + # fixup the links file if bitbake is using different paths + test "${prefix}" != "/usr" && \ + sed -i -e "s:^/usr/:${prefix}/:" busybox.links + test "${base_sbindir}" != "/sbin" && \ + sed -i -e "s:^/sbin/:${base_sbindir}/:" busybox.links + test "${base_bindir}" != "/bin" && \ + sed -i -e "s:^/bin/:${base_bindir}/:" busybox.links + + install -D -m 0755 busybox_unstripped ${D}${base_bindir}/busybox + install -D -m 0644 busybox.links ${D}${datadir}/busybox/busybox.links + + # NOTE: We do _not_ create the busybox links here because it should + # _not_ be busybox's decision which files appear on the + # root filesystem. That is a decision to be made by the root + # filesystem recipe. A root filesystem recipe can use the + # links file to determine what links can be created. +} + +# the links file belongs in the -dev package +# (it will not be installed in the root filesystem) +# - the links file will be used when building the root filesystem +FILES_${PN}-dev_append = " ${datadir}/busybox/busybox.links" diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.26.2.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.26.2.bb new file mode 100644 index 0000000..8eaf3f8 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/busybox_1.26.2.bb @@ -0,0 +1,83 @@ +# source file +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=upstream \ + file://hwclock.sh \ + file://busybox-udhcpd \ +" + +# source file checksums +SRC_URI[upstream.md5sum] = "bb59d25ee2643db20f212eec539429f1" +SRC_URI[upstream.sha256sum] = "da3e44913fc1a9c9b7c5337ea5292da518683cbff32be630777f565d6036af16" + +# license information +LICENSE = "GPLv2 & bzip2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb" + +# specify additional arguments used by "oe_runmake" +# - busybox requires "CROSS_COMPILE" to specify the toolchain prefix +# (${TARGET_PREFIX} is correctly set to this in bitbake.conf) +# - busybox requires "CONFIG_SYSROOT" to specify the sysroot +# - if V=1 is used the busybox Makefiles produce verbose build output, +# which helps to investigate any possible build errors +EXTRA_OEMAKE += "CROSS_COMPILE=${TARGET_PREFIX}" +EXTRA_OEMAKE += "CONFIG_SYSROOT=${PKG_CONFIG_SYSROOT_DIR}" +EXTRA_OEMAKE += "V=1" + +# configure busybox using the shipped defconfig +do_configure () { + oe_runmake defconfig +} + +# build busybox and the links file +# - the links file is a text file listing all the links that +# should be created to use all configured busybox features +# - ${TARGET_CC_ARCH} is set in bitbake.conf and specifies the architecture- +# specific compiler options (for example, hardware floating point) +# (busybox needs this additional information in CFLAGS) +do_compile () { + export CFLAGS="${TARGET_CC_ARCH} ${CFLAGS}" + oe_runmake busybox_unstripped + oe_runmake busybox.links +} + +# install the busybox binary and the links file +# - the links file needs to be adjusted if non-default definitions +# for ${prefix}, ${base_sbindir}, ${base_bindir} are used +do_install () { + # fixup the links file if bitbake is using different paths + test "${prefix}" != "/usr" && \ + sed -i -e "s:^/usr/:${prefix}/:" busybox.links + test "${base_sbindir}" != "/sbin" && \ + sed -i -e "s:^/sbin/:${base_sbindir}/:" busybox.links + test "${base_bindir}" != "/bin" && \ + sed -i -e "s:^/bin/:${base_bindir}/:" busybox.links + + install -D -m 0755 busybox_unstripped ${D}${base_bindir}/busybox + install -D -m 0644 busybox.links ${D}${datadir}/busybox/busybox.links + + # NOTE: We do _not_ create the busybox links here because it should + # _not_ be busybox's decision which files appear on the + # root filesystem. That is a decision to be made by the root + # filesystem recipe. A root filesystem recipe can use the + # links file to determine what links can be created. + + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ +} + +# the links file belongs in the -dev package +# (it will not be installed in the root filesystem) +# - the links file will be used when building the root filesystem +FILES_${PN}-dev_append = " ${datadir}/busybox/busybox.links" + + +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock" + +FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" +FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc" +FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh" + +INITSCRIPT_PACKAGES = "${PN}-udhcpd ${PN}-hwclock" + +INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh" +INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/busybox-udhcpd b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/busybox-udhcpd new file mode 100755 index 0000000..c43903e --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/busybox-udhcpd @@ -0,0 +1,43 @@ +#!/bin/sh +DAEMON=/usr/sbin/udhcpd +NAME=udhcpd +DESC="Busybox UDHCP Server" +ARGS="/etc/udhcpd.conf" + +test -f $DAEMON || exit 1 + +set -e + +case "$1" in + start) + echo -n "starting $DESC: $NAME... " + if [ ! -f /etc/udhcpd.conf ]; then + echo "error: /etc/udhcpd.conf is missing." + exit 1 + fi + /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS + echo "done." + ;; + stop) + echo -n "stopping $DESC: $NAME... " + /sbin/start-stop-daemon -K -n $NAME + echo "done." + ;; + restart) + echo "restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + reload) + echo -n "reloading $DESC: $NAME... " + killall -HUP $(basename ${DAEMON}) + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/hwclock.sh b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/hwclock.sh new file mode 100644 index 0000000..be5f94d --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/busybox/files/hwclock.sh @@ -0,0 +1,83 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: hwclock +# Required-Start: +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Set system clock +# Description: Set system clock to hardware clock, according to the UTC +# setting in /etc/default/rcS (see also rcS(5)). +### END INIT INFO +# +# WARNING: If your hardware clock is not in UTC/GMT, this script +# must know the local time zone. This information is +# stored in /etc/localtime. This might be a problem if +# your /etc/localtime is a symlink to something in +# /usr/share/zoneinfo AND /usr isn't in the root +# partition! The workaround is to define TZ either +# in /etc/default/rcS, or in the proper place below. + +[ ! -x /sbin/hwclock ] && exit 0 + +[ -f /etc/default/rcS ] && . /etc/default/rcS + +[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime" +case "$1" in + start) + if [ "$VERBOSE" != no ] + then + echo "System time was `date`." + echo "Setting the System Clock using the Hardware Clock as reference..." + fi + + if [ "$HWCLOCKACCESS" != no ] + then + if [ -z "$TZ" ] + then + hwclock $tz --hctosys + else + TZ="$TZ" hwclock $tz --hctosys + fi + fi + + if [ "$VERBOSE" != no ] + then + echo "System Clock set. System local time is now `date`." + fi + ;; + stop|restart|reload|force-reload) + # + # Updates the Hardware Clock with the System Clock time. + # This will *override* any changes made to the Hardware Clock. + # + # WARNING: If you disable this, any changes to the system + # clock will not be carried across reboots. + # + if [ "$VERBOSE" != no ] + then + echo "Saving the System Clock time to the Hardware Clock..." + fi + if [ "$HWCLOCKACCESS" != no ] + then + hwclock $tz --systohc + fi + if [ "$VERBOSE" != no ] + then + echo "Hardware Clock updated to `date`." + fi + exit 0 + ;; + show) + if [ "$HWCLOCKACCESS" != no ] + then + hwclock $tz --show + fi + ;; + *) + echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2 + echo " start sets kernel (system) clock from hardware (RTC) clock" >&2 + echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2 + exit 1 + ;; +esac diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/images/core-image-schulung.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/images/core-image-schulung.bb new file mode 100644 index 0000000..516bca3 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/images/core-image-schulung.bb @@ -0,0 +1,50 @@ +# use the core-image class (poky/meta/core-image.bbclass) +inherit core-image + +# add package management to the image +# (the package management type depends on PACKAGE_CLASSES) +IMAGE_FEATURES += "package-management" + +# do not install any particular locales +# (they are big and we don't need them) +IMAGE_LINUGUAS = " " + +# set the size of the partition for the image +# (see image.bbclass for related limits) +IMAGE_ROOTFS_SIZE ?= "32768" + +# specify packages for the root filesystem +# (IMAGE_INSTALL is defined in and used by core-image.bbclass +# for a list of packages to be installed, use = to ignore the +# packages added by 'packagegroup-core-boot') +# IMAGE_INSTALL += "hello schulung-rootfs openssh" +IMAGE_INSTALL = "hello schulung-rootfs" + +# set a root password +# inherit extrausers +# EXTRA_USERS_PARAMS = "usermod -P foo root;" + +# busybox must be installed so we have access to busybox.links +# (for DEPENDS packages, the -dev variant of the package +# is also installed in the sysroot) +DEPENDS += "busybox" + +# create a function to create the busybox links +# - anything copied to ${IMAGE_ROOTFS} will also appear in the root filesystem +# (this is set in bitbake.conf to ${WORKDIR}/rootfs) +setup_busybox_links () { + for lnfile in `cat ${PKG_CONFIG_SYSROOT_DIR}${datadir}/busybox/busybox.links`; do + # do not create /linuxrc link, we do not need it + test $lnfile = /linuxrc && continue + + # create parent directory if necessary + install -d ${IMAGE_ROOTFS}`dirname $lnfile` + + # link creation is allowed to fail if a file is already there + ln -s ${base_bindir}/busybox ${IMAGE_ROOTFS}$lnfile || true + done +} +# ...and have it called after the rootfs task is finished +do_rootfs[postfuncs] += "setup_busybox_links" + +# using "do_rootfs_append ()" as function would have the same effect diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys/keys-native.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys/keys-native.bb new file mode 100644 index 0000000..0d97038 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/keys/keys-native.bb @@ -0,0 +1,27 @@ +# openssl is needed during build time to generate the keys +DEPENDS += "openssl-native dtc-native" + +# specify a license (required for packages) +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +# perform key generation as the compile task +do_compile () { + openssl genpkey -algorithm RSA -out dev.key \ + -pkeyopt rsa_keygen_bits:4096 + openssl req -batch -new -x509 -sha512 -key dev.key -out dev.crt + openssl x509 -noout -text -in dev.crt + + # this combined file could be used by kernel module signing + cat dev.crt dev.key > dev.pem +} + +# install the keys to the datadir +do_install () { + install -D -m 0644 dev.key ${D}/${datadir}/keys/dev.key + install -D -m 0644 dev.crt ${D}/${datadir}/keys/dev.crt + install -D -m 0644 dev.pem ${D}/${datadir}/keys/dev.pem +} + +# this is a native package +inherit native diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/files/busybox_inittab b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/files/busybox_inittab new file mode 100644 index 0000000..66942e4 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/files/busybox_inittab @@ -0,0 +1,13 @@ +# Boot-time system configuration/initialization script. +# This is run first except when booting in single-user mode. +::sysinit:/etc/init.d/rcS + +# start an "askfirst" shell on the console (whatever that may be) +::askfirst:-/bin/sh + +# stuff to do when restarting the init process +::restart:/sbin/init + +# stuff to do before rebooting +::ctrlaltdel:/sbin/reboot +::shutdown:/bin/umount -a -r diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/files/rcS b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/files/rcS new file mode 100644 index 0000000..e0d039a --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/files/rcS @@ -0,0 +1,18 @@ +#!/bin/sh + +# mount important virtual filesystems +mount -t devtmpfs none /dev +mount -t proc none /proc +mount -t sysfs none /sys + +# make sure there is a startup direcdtory +test -d /etc/rcS.d || exit 0 + +# start all startup scripts in startup directory +for scr in `ls /etc/rcS.d`; do + case $scr in + S*) + /etc/rcS.d/$scr start + ;; + esac +done diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/schulung-rootfs_1.0.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/schulung-rootfs_1.0.bb new file mode 100644 index 0000000..4c4992a --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/rootfs/schulung-rootfs_1.0.bb @@ -0,0 +1,36 @@ +# license information +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +# increase this value to force a rebuild of the recipe +PR = "r0" + +# specify _runtime_ dependency on busybox (for package manager) +# (i.e. busybox can't be uninstalled because schulung-rootfs depends on it) +# - since runtime dependencies are related to specific packages, they are +# specified in per package variables (i.e. RDEPENDS_${PN}, not RDEPENDS) +RDEPENDS_${PN} = "busybox" + +# specify inittab configuration file and master startup script +SRC_URI = "file://busybox_inittab file://rcS" + +# install scripts, configurations, important empty directories +do_install () { + # install the scripts/configurations + install -D -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS + install -D -m 0644 ${WORKDIR}/busybox_inittab ${D}${sysconfdir}/inittab + + # create skeleton directories + install -d ${D}/tmp + install -d ${D}/dev + install -d ${D}/proc + install -d ${D}/sys +} + +# manually add some directories because they are not automatically identified +# (if this is not done, poky will complain about files +# in ${D} that do not belong to any package) +FILES_${PN} += "/tmp" +FILES_${PN} += "/dev" +FILES_${PN} += "/proc" +FILES_${PN} += "/sys" diff --git a/distribution/yocto-advanced/meta-schulung-extended/scripts/lib/wic/canned-wks/vexpress.wks b/distribution/yocto-advanced/meta-schulung-extended/scripts/lib/wic/canned-wks/vexpress.wks new file mode 100644 index 0000000..89ef56b --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/scripts/lib/wic/canned-wks/vexpress.wks @@ -0,0 +1,8 @@ +# short-description: Create a Phytec AM335x disk image (SD card) +# long-description: Creates a partitioned disk image for Phytec AM335x BSPs +# boards that the user can directly dd to an SD card and boot. + +part /boot --source bootimg-partition --fstype=vfat --label boot --ondisk mmc --active --align 4096 --size 20 +part / --source rootfs --fstype=ext2 --label root --ondisk mmc --align 1024 --use-uuid + +bootloader --timeout=0 |
