aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-distro
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-distro')
-rw-r--r--meta-amd-distro/README.md14
-rw-r--r--meta-amd-distro/conf/distro/poky-amd.conf59
-rw-r--r--meta-amd-distro/conf/layer.conf13
-rw-r--r--meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend22
-rw-r--r--meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending14
-rw-r--r--meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service16
-rw-r--r--meta-amd-distro/scripts/lib/wic/canned-wks/amd-usbimage.wks5
7 files changed, 143 insertions, 0 deletions
diff --git a/meta-amd-distro/README.md b/meta-amd-distro/README.md
new file mode 100644
index 00000000..69b52ac2
--- /dev/null
+++ b/meta-amd-distro/README.md
@@ -0,0 +1,14 @@
+# meta-amd/meta-amd-distro
+
+This is the location for AMD distro configurations.
+
+Please see the README file contained in the root meta-amd directory
+for general information and usage details.
+
+## Dependencies
+
+This layer depends on:
+
+[bitbake](https://github.com/openembedded/bitbake) layer,
+[oe-core](https://github.com/openembedded/openembedded-core) layer,
+[meta-poky](https://git.yoctoproject.org/cgit/cgit.cgi/poky) layer
diff --git a/meta-amd-distro/conf/distro/poky-amd.conf b/meta-amd-distro/conf/distro/poky-amd.conf
new file mode 100644
index 00000000..71db5ed5
--- /dev/null
+++ b/meta-amd-distro/conf/distro/poky-amd.conf
@@ -0,0 +1,59 @@
+require conf/distro/poky.conf
+
+DISTRO = "poky-amd"
+DISTRO_NAME = "Poky for AMD"
+DISTROOVERRIDES = "${DISTRO}"
+TARGET_VENDOR = "-amd"
+SDK_VENDOR = "-amdsdk"
+MAINTAINER = "Wade Farnsworth <wade_farnsworth@mentor.com>"
+
+DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
+VIRTUAL-RUNTIME_initscripts = ""
+DISTRO_FEATURES_append = " systemd"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+EXTRA_IMAGE_FEATURES_append = " package-management ssh-server-openssh"
+PACKAGE_CLASSES = "package_deb"
+
+DISTRO_EXTRA_RDEPENDS += "connman udev-extraconf"
+
+IMAGE_ROOTFS_EXTRA_SPACE = "51200"
+
+# We want information about package and image contents
+INHERIT += "buildhistory"
+BUILDHISTORY_COMMIT ?= "1"
+
+# We only support IMAGE_FSTYPES "wic" and "iso"
+IMAGE_FSTYPES = "wic wic.bmap iso"
+
+WKS_FILES ?= "amd-usbimage.wks"
+
+# Contents of IMAGE_BOOT_FILES are deployed into "amd-usbimage.wks" wic image
+IMAGE_BOOT_FILES = " \
+ ${EFIIMGDIR}${EFIDIR}/*;EFI/BOOT/ \
+ ${EFIIMGDIR}/startup.nsh;startup.nsh \
+ ${KERNEL_IMAGETYPE} \
+ ${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz;initrd \
+ ${ROOTFS};rootfs.img \
+"
+
+# This makes sure that boot files are deployed before do_image_wic starts execution
+do_image_wic[depends] += "${IMAGE_BASENAME}:do_bootimg"
+
+IMAGE_OVERHEAD_FACTOR = "1.1"
+
+# Exclude complementary (-src,-dbg & -dev) pkgs of the following
+# recipes as they are not required while populate_sdk, and they fail
+# to get installed due to missing dependencies, therefore generate a
+# warning and even the rest of the complementary pkgs in the list
+# don't get installed when using debian based package-managemant.
+PACKAGE_EXCLUDE_COMPLEMENTARY = "dpkg|autoconf|automake|packagegroup-core-buildessential|packagegroup-core-sdk|packagegroup-core-tools-profile|perf|quilt|systemtap|target-sdk-provides-dummy"
+
+# "apt" is an exception to the above PACKAGE_EXCLUDE_COMPLEMENTARY list
+# as oe uses apt itself to install/remove/exclude the above-listed
+# complementary pkgs, and when apt is listed in the above-listed
+# PACKAGE_EXCLUDE_COMPLEMENTARY, it tries to removes itself, and it
+# asks for user input and oe gets out of there and our complementary
+# pkgs don't get installed, but they are required for development and
+# debugging purposes using the SDK.
+TOOLCHAIN_TARGET_TASK_remove = " apt"
diff --git a/meta-amd-distro/conf/layer.conf b/meta-amd-distro/conf/layer.conf
new file mode 100644
index 00000000..b46a08ea
--- /dev/null
+++ b/meta-amd-distro/conf/layer.conf
@@ -0,0 +1,13 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes*/*/*.bb \
+ ${LAYERDIR}/recipes*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "amd-distro"
+BBFILE_PATTERN_amd-distro = "^${LAYERDIR}/"
+BBFILE_PRIORITY_amd-distro = "12"
+
+LAYERSERIES_COMPAT_amd-distro = "warrior"
+
+LAYERDEPENDS_amd-distro = "yocto"
diff --git a/meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend b/meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend
new file mode 100644
index 00000000..099292ab
--- /dev/null
+++ b/meta-amd-distro/recipes-devtools/dpkg/dpkg_%.bbappend
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "dpkg-configure-pending.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+SRC_URI += " \
+ file://dpkg-configure-pending.service \
+ file://dpkg-configure-pending \
+"
+
+do_install_append () {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/dpkg-configure-pending.service ${D}${systemd_unitdir}/system/
+ install -m 755 ${WORKDIR}/dpkg-configure-pending ${D}${sbindir}/dpkg-configure-pending
+}
+
+FILES_${PN} += " \
+ ${systemd_unitdir}/system/dpkg-configure-pending.service \
+ ${sbindir}/dpkg-configure-pending \
+"
diff --git a/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending
new file mode 100644
index 00000000..ba3bf025
--- /dev/null
+++ b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+[ -e /etc/default/postinst ] && . /etc/default/postinst
+if [ "$POSTINST_LOGGING" = "1" ]; then
+ append_log="| tee -a $LOGFILE"
+fi
+
+[ "$POSTINST_LOGGING" = "1" ] && eval echo "Attempting to reconfigure packages on first boot that had failed postinsts..." ${append_log}
+
+dpkg --configure --pending | tee -a $LOGFILE
+
+if [ -n "`which update-rc.d`" ]; then
+ update-rc.d -f dpkg-configure-pending remove | tee -a $LOGFILE
+fi
diff --git a/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service
new file mode 100644
index 00000000..57d582f5
--- /dev/null
+++ b/meta-amd-distro/recipes-devtools/dpkg/files/dpkg-configure-pending.service
@@ -0,0 +1,16 @@
+[Unit]
+Description="Configure pkgs with failed postinsts that Sato GUI depends on."
+DefaultDependencies=no
+After=sysinit.target
+Before=multi-user.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/dpkg-configure-pending
+ExecStartPost=/bin/systemctl --no-reload disable dpkg-configure-pending.service
+RemainAfterExit=No
+TimeoutSec=0
+User=root
+
+[Install]
+WantedBy=graphical.target
diff --git a/meta-amd-distro/scripts/lib/wic/canned-wks/amd-usbimage.wks b/meta-amd-distro/scripts/lib/wic/canned-wks/amd-usbimage.wks
new file mode 100644
index 00000000..96ce8c75
--- /dev/null
+++ b/meta-amd-distro/scripts/lib/wic/canned-wks/amd-usbimage.wks
@@ -0,0 +1,5 @@
+# short-description: Create USB image with files from var IMAGE_BOOT_FILES
+# long-description: Creates a USB image with all files in the IMAGE_BOOT_FILES
+# var e.g. bootloader, initrd, kernel & rootfs.img.
+
+part /boot --source bootimg-partition --ondisk sda --fstype=vfat --label boot --overhead-factor 1.0 --active --align 1024