Q:

Mounting only a specific part of sysfs

I wonder if it is possible to mount only part of sysfs for usage in chroot. Example I would require only /sys/class/gpio and rest is not required. 
mount -t sysfs sys/some/folder /mnt/temp_sys

A:

The generic way to do this for any kind of file systems is bind mount.
This example is using /tmp. To do that on /sys you may replace /tmp/sysall by /sys:
mkdir /tmp/sysall
mkdir -p /tmp/mychroot/sys/class/gpio

mount -t sysfs sysfs /tmp/sysall/
mount --bind  /tmp/sysall/class/gpio  /tmp/mychroot/sys/class/gpio
umount /tmp/sysall/

