All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1 v2] kbd: Limit the kbdrate application to x86, mips and sparc
@ 2013-07-12  5:42 jackie.huang
  2013-07-12  5:42 ` [PATCH 1/1 " jackie.huang
  0 siblings, 1 reply; 4+ messages in thread
From: jackie.huang @ 2013-07-12  5:42 UTC (permalink / raw)
  To: openembedded-core

From: Jackie Huang <jackie.huang@windriver.com>

v2 comments:
Drop the patch that detects the arch in runtime and print an error, and just
detect the target platform in the build system and skip installing the kbdrate
for architectures it won't work.

tested for qemux86, qemux86-64, qemuppc, qemuarm, qemumips, qemumips64

--
The following changes since commit 4f5009dcbbeb27bdf5dcaebb3b457fecef410ebe:

  security_flags: Add addition recipes to the non pie list (2013-07-10 09:40:42 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib jhuang0/r_bbappend_kbd-rework_0712_2
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jhuang0/r_bbappend_kbd-rework_0712_2

Jackie Huang (1):
  kbd: Limit the kbdrate application to x86, mips and sparc

 meta/recipes-core/kbd/kbd_1.15.2.bb |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

-- 
1.7.4.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1 v2] kbd: Limit the kbdrate application to x86, mips and sparc
  2013-07-12  5:42 [PATCH 0/1 v2] kbd: Limit the kbdrate application to x86, mips and sparc jackie.huang
@ 2013-07-12  5:42 ` jackie.huang
  2013-07-12  8:34   ` Phil Blundell
  0 siblings, 1 reply; 4+ messages in thread
From: jackie.huang @ 2013-07-12  5:42 UTC (permalink / raw)
  To: openembedded-core

From: Jackie Huang <jackie.huang@windriver.com>

The code relies on hardware specific memory locations to access
and modify the keyboard repeat rate.  It also requires read/write
access to /dev/port which doesn't exist on every architecture's
root fs. The defect was raised for Qemu PowerPC but it also fails on
ARM.  The keyboard emulation in qemuppc is for an ADB (Apple Desktop
Bus) device and not compatible with an Intel driver.  There's also no
indication in the documentation that the code should work on anything
other than Intel architecture but it also works on MIPS.

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
 meta/recipes-core/kbd/kbd_1.15.2.bb |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-core/kbd/kbd_1.15.2.bb b/meta/recipes-core/kbd/kbd_1.15.2.bb
index 79ea468..25ca8be 100644
--- a/meta/recipes-core/kbd/kbd_1.15.2.bb
+++ b/meta/recipes-core/kbd/kbd_1.15.2.bb
@@ -28,3 +28,11 @@ inherit update-alternatives
 
 ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt"
 ALTERNATIVE_PRIORITY = "100"
+
+do_install_append() {
+        # Limit the kbdrate application to x86, mips and sparc.
+        if [ ${TARGET_ARCH} != "i586" -a ${TARGET_ARCH} != "x86_64" -a ${TARGET_ARCH} != "mips" \
+             -a ${TARGET_ARCH} != "mips64" -a ${TARGET_ARCH} != "sparc" ]; then
+                rm ${D}/${bindir}/kbdrate
+        fi
+}
-- 
1.7.4.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1 v2] kbd: Limit the kbdrate application to x86, mips and sparc
  2013-07-12  5:42 ` [PATCH 1/1 " jackie.huang
@ 2013-07-12  8:34   ` Phil Blundell
  2013-07-15  3:02     ` jhuang0
  0 siblings, 1 reply; 4+ messages in thread
From: Phil Blundell @ 2013-07-12  8:34 UTC (permalink / raw)
  To: jackie.huang; +Cc: openembedded-core

On Fri, 2013-07-12 at 13:42 +0800, jackie.huang@windriver.com wrote:
> The code relies on hardware specific memory locations to access
> and modify the keyboard repeat rate.  It also requires read/write
> access to /dev/port which doesn't exist on every architecture's
> root fs. The defect was raised for Qemu PowerPC but it also fails on
> ARM.  The keyboard emulation in qemuppc is for an ADB (Apple Desktop
> Bus) device and not compatible with an Intel driver.  There's also no
> indication in the documentation that the code should work on anything
> other than Intel architecture but it also works on MIPS.

This reasoning seems slightly spurious.  There do exist ARM and PPC
machines where kbdrate works, it's just that the hardware emulated by
qemuarm and qemuppc doesn't happen to fall into that category.  Equally,
there are certainly mips machines (and might conceivably be some
x86/sparc ones) where it doesn't work.  So I don't think you can make
any sensible determination about the supportedness or not of kbdrate
based on TARGET_ARCH alone.  

Of course, the right answer really is for rate setting to go through the
kernel driver (which knows what sort of hardware it is using) rather
than for kbdrate to go poking at random I/O ports.

p.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1 v2] kbd: Limit the kbdrate application to x86, mips and sparc
  2013-07-12  8:34   ` Phil Blundell
@ 2013-07-15  3:02     ` jhuang0
  0 siblings, 0 replies; 4+ messages in thread
From: jhuang0 @ 2013-07-15  3:02 UTC (permalink / raw)
  To: Phil Blundell; +Cc: openembedded-core



On 7/12/2013 4:34 PM, Phil Blundell wrote:
> On Fri, 2013-07-12 at 13:42 +0800, jackie.huang@windriver.com wrote:
>> The code relies on hardware specific memory locations to access
>> and modify the keyboard repeat rate.  It also requires read/write
>> access to /dev/port which doesn't exist on every architecture's
>> root fs. The defect was raised for Qemu PowerPC but it also fails on
>> ARM.  The keyboard emulation in qemuppc is for an ADB (Apple Desktop
>> Bus) device and not compatible with an Intel driver.  There's also no
>> indication in the documentation that the code should work on anything
>> other than Intel architecture but it also works on MIPS.
>
> This reasoning seems slightly spurious.  There do exist ARM and PPC
> machines where kbdrate works, it's just that the hardware emulated by
> qemuarm and qemuppc doesn't happen to fall into that category.  Equally,
> there are certainly mips machines (and might conceivably be some
> x86/sparc ones) where it doesn't work.  So I don't think you can make
> any sensible determination about the supportedness or not of kbdrate
> based on TARGET_ARCH alone.
>
> Of course, the right answer really is for rate setting to go through the
> kernel driver (which knows what sort of hardware it is using) rather
> than for kbdrate to go poking at random I/O ports.

Thanks Phil, I will re-work and do more anaysis on it.

Thanks,
Jackie

>
> p.
>
>
>
>

-- 
Jackie Huang
WIND RIVER | China Development Center
MSN:jackielily@hotmail.com
Tel: +86 8477 8594
Mobile: +86 138 1027 4745


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-15  3:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12  5:42 [PATCH 0/1 v2] kbd: Limit the kbdrate application to x86, mips and sparc jackie.huang
2013-07-12  5:42 ` [PATCH 1/1 " jackie.huang
2013-07-12  8:34   ` Phil Blundell
2013-07-15  3:02     ` jhuang0

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.