[meta-intel] [Patch v2 02/11] machinesetuptool: add nuc machine config to the intel-corei7-64 BSP

Darren Hart dvhart at linux.intel.com
Fri Oct 10 10:27:59 PDT 2014


On 10/8/14, 5:32, "nitin.a.kamble at intel.com" <nitin.a.kamble at intel.com>
wrote:

>From: Nitin A Kamble <nitin.a.kamble at intel.com>
>
>Add machine configuration for the NUC platform in the intel-corei7-64 BSP
>image.


Hi Nitin,

A few comments inline below...

>
>Signed-off-by: Nitin A Kamble <nitin.a.kamble at intel.com>
>---
> .../machinesetuptool/intel-corei7-64/nuc-alsa.conf |  24 ++
> .../intel-corei7-64/nuc-alsa.state                 | 309
>+++++++++++++++++++++
> .../nuc-bootscript-hdmi_port_audio.sh              |  19 ++
> .../intel-corei7-64/nuc-formfactor.machconfig      |   3 +
> .../intel-corei7-64/nuc-network.interfaces         |  20 ++
> .../machinesetuptool/intel-corei7-64/nuc.vars      |  14 +
> .../machinesetuptool/machinesetuptool_git.bbappend |  18 ++
> 7 files changed, 407 insertions(+)
> create mode 100644
>common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc-a
>lsa.conf
> create mode 100644
>common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc-a
>lsa.state
> create mode 100755
>common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc-b
>ootscript-hdmi_port_audio.sh
> create mode 100644
>common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc-f
>ormfactor.machconfig
> create mode 100644
>common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc-n
>etwork.interfaces
> create mode 100644
>common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc.v
>ars
> create mode 100644
>common/recipes-bsp/machinesetuptool/machinesetuptool_git.bbappend
>


>
>diff --git 
>a/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-bootscript-hdmi_port_audio.sh
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-bootscript-hdmi_port_audio.sh
>new file mode 100755
>index 0000000..3c77ac9
>--- /dev/null
>+++ 
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-bootscript-hdmi_port_audio.sh
>@@ -0,0 +1,19 @@
>+#!/bin/sh
>+#
>+# If both HDMI ports are connected then use HDMI0 for default ALSA audio
>out..
>+
>+ALSA_CONF_FILE="/etc/asound.conf"
>+
>+HDMI0_STATUS_FILE="/sys/class/drm/card0-HDMI-A-1/status"
>+HDMI1_STATUS_FILE="/sys/class/drm/card0-HDMI-A-2/status"
>+
>+HDMI0_ALSA_CONF="hw:0,3"
>+HDMI1_ALSA_CONF="hw:0,7"
>+
>+if [ -f "${HDMI0_STATUS_FILE}" ] && [ "`cat ${HDMI0_STATUS_FILE}`" ==
>"connected" ]
>+then
>+	sed -i "s/pcm *\"hw:[0-9]*,[0-9]*\"/pcm \"${HDMI0_ALSA_CONF}\"/"
>${ALSA_CONF_FILE}
>+elif [ -f "${HDMI1_STATUS_FILE}" ] && [ "`cat ${HDMI1_STATUS_FILE}`" ==
>"connected" ]
>+then
>+	sed -i "s/pcm \"hw:[0-9]*,[0-9]*\"/pcm \"${HDMI1_ALSA_CONF}\"/"
>${ALSA_CONF_FILE}
>+fi


This approach really strikes me as a hack. I understand it's coming from
the existing NUC BSP... But is this actually how this is done by the major
distros as well?


>diff --git 
>a/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-formfactor.machconfig
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-formfactor.machconfig
>new file mode 100644
>index 0000000..ffce012
>--- /dev/null
>+++ 
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-formfactor.machconfig
>@@ -0,0 +1,3 @@
>+# Assume a USB mouse and keyboard are connected
>+HAVE_TOUCHSCREEN=0
>+HAVE_KEYBOARD=1


This is the default for basically all the BSPs, and it would be preferable
not to have to duplicate this across all the MACHINE config files. Having
this be the default for intel-corei7-64 and only overwrite it if the
configured machine provides the file seems like a reasonable approach to
me.


>diff --git 
>a/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-network.interfaces
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-network.interfaces
>new file mode 100644
>index 0000000..4ed0a85
>--- /dev/null
>+++ 
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>-network.interfaces
>@@ -0,0 +1,20 @@
>+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
>+
>+# The loopback interface
>+auto lo
>+iface lo inet loopback
>+
>+# Wireless interfaces
>+iface wlan0 inet dhcp
>+	wireless_mode managed
>+	wireless_essid any
>+	wpa-driver wext
>+	wpa-conf /etc/wpa_supplicant.conf
>+
>+# Wired or wireless interfaces
>+auto eth0
>+iface eth0 inet dhcp
>+
>+# Bluetooth networking
>+iface bnep0 inet dhcp
>+


Same with this particular network interface.

--
Darren

>diff --git 
>a/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>.vars 
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>.vars
>new file mode 100644
>index 0000000..c6f373f
>--- /dev/null
>+++ 
>b/common/recipes-bsp/machinesetuptool/machinesetuptool/intel-corei7-64/nuc
>.vars
>@@ -0,0 +1,14 @@
>+FORMFACTOR_FILE="nuc-formfactor.machconfig"
>+ALSA_CONFIG_FILE="nuc-alsa.conf"
>+ALSA_STATE_FILE="nuc-alsa.state"
>+XORG_CONFIG_FILE=""
>+NETWORK_INTERFACES_FILE="nuc-network.interfaces"
>+AUTOLOAD_KERNEL_MODULES="uio iwlwifi"
>+PROHIBIT_KERNEL_MODULES=""
>+EXTRA_KERNEL_PARAMETERS=""
>+SYSLINUX_SERIAL_CONFIG=""
>+GRUB_SERIAL_CONFIG=""
>+GETTY_SERIAL_CONSOLES=""
>+SETUP_SCRIPTS=""
>+BOOT_SCRIPTS="nuc-bootscript-hdmi_port_audio.sh"
>+REBOOT_AFTER_SETUP="no"
>diff --git 
>a/common/recipes-bsp/machinesetuptool/machinesetuptool_git.bbappend
>b/common/recipes-bsp/machinesetuptool/machinesetuptool_git.bbappend
>new file mode 100644
>index 0000000..46894c2
>--- /dev/null
>+++ b/common/recipes-bsp/machinesetuptool/machinesetuptool_git.bbappend
>@@ -0,0 +1,18 @@
>+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
>+
>+DEFAULT_MACHINE_SELECTION_intel-corei7-64 = "nuc"
>+
>+SUPPORTED_MACHINES_intel-corei7-64 = "nuc"
>+
>+MACHINE_CONFIG_FILES_intel-corei7-64 = " \
>+	${NUC_MACHINE_CONFIG_FILES} \
>+	"
>+
>+NUC_MACHINE_CONFIG_FILES = " \
>+	nuc.vars \
>+	nuc-formfactor.machconfig \
>+	nuc-alsa.conf \
>+	nuc-alsa.state \
>+	nuc-network.interfaces \
>+	nuc-bootscript-hdmi_port_audio.sh \
>+	"
>-- 
>1.8.1.4
>
>


-- 
Darren Hart
Intel Open Source Technology Center





More information about the meta-intel mailing list