Sunday, January 5, 2014

Android development - Fedora 20 and Nexus 7

On Nexus 7

Follow this post to enable USB debugging on the Nexus 7

If you do not see "Developer Options", go into "About device" in Settings and tap on the "Build number" entry seven times, which will unlock "Developer Options".

Then, to get the ADB to recognize the device -

[steve@localhost ~]$ sudo Development/adt-bundle-linux-x86-20131030/sdk/platform-tools/adb devices
List of devices attached
????????????    no permissions


Following this post -

[steve@localhost ~]$ lsusb |grep Nexus
Bus 002 Device 014: ID 18d1:4e42 Google Inc. Nexus 7 (debug)


Edit as below -

[steve@localhost ~]$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"

[steve@localhost ~]$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
 
Restart udev and adb server -
 
[steve@localhost ~]$ sudo systemctl restart systemd-udevd.service
[steve@localhost ~]$ sudo Development/adt-bundle-linux-x86-20131030/sdk/platform-tools/adb kill-server
 
[steve@localhost ~]$ sudo Development/adt-bundle-linux-x86-20131030/sdk/platform-tools/adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
015d3f18d1281012 unauthorized

Authorize the PC on the device, and re-check -

[steve@localhost ~]$ sudo Development/adt-bundle-linux-x86-20131030/sdk/platform-tools/adb devices
List of devices attached 
015d3f18d1281012 device

Monday, December 30, 2013

Compiling qemu on ubuntu 12.04

I hit a seemingly common issue running configure

ERROR: glib-2.12 required to compile QEMU

I tried the usual suspects -

~/qemu-1.7.0$ sudo apt-get install libglib2.0-dev
Reading package lists... Done
Building dependency tree    
Reading state information... Done
libglib2.0-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.

to no avail...
After poking through the configure script, I suspected a pkg-config issue.
The export below resolved my issue -

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig

Monday, September 23, 2013

Headless install of Fedora 19

I need to do a headless install of fedora at work, and want to test the process at home first.
Approach is, use kvm/qemu on my ubuntu machine, and install fedora as a guest

virt-install \

 --name=guest1-fedora19-64 \
 --disk /var/lib/libvirt/images/guest1-fedora19-64.img,size=10 \
 --graphics none \
 --vcpus=1 --ram=2048 \
 --location=/home/steve/Downloads/Fedora-19-x86_64-DVD.iso \
 --network bridge=virbr0 \
 --os-type=linux \
 --os-variant=fedora16 \
 --extra-args="console=ttyS0,115200"


This works well, and anaconda gives me the choice of vnc or text based install

Trying text first -

Worked very smoothly.
After install, added tigervncserver, configured for lxde, disabled firewall, and was able to connect with vncviewer.


Reconnect after restart -

root@steve-GA-880GMA-UD2H:~# virsh list --inactive Id Name State ---------------------------------- - guest1-fedora19-64 shut off root@steve-GA-880GMA-UD2H:~# virsh start guest1-fedora19-64 Domain guest1-fedora19-64 started

root@steve-GA-880GMA-UD2H:~# virsh console guest1-fedora19-64
Connected to domain guest1-fedora19-64 Escape character is ^] [ 0.535212] 00:04: ttyS Fedora release 19 (Schrödinger’s Cat) Kernel 3.9.5-301.fc19.x86_64 on an x86_64 (ttyS0) localhost login:



Then vnc via anaconda

Network was configured automatically
vnc worked fine

and vnc via qemu/kvm

apt-get install virt-viewer

virt-install \

 --name=guest2-fedora19-64 \
 --disk /var/lib/libvirt/images/guest2-fedora19-64.img,size=10 \
 --graphics vnc \
 --vcpus=1 --ram=2048 \
 --location=/home/steve/Downloads/Fedora-19-x86_64-DVD.iso \
 --network bridge=virbr0 \
 --os-type=linux \
 --os-variant=fedora16

Also went smoothly.



UEFI & GPT

The real hardware had some UEFI support, and this led to some extra issues. Enough for another post, later...

Thursday, September 5, 2013

Migrating to grub2

Well, this was also relatively painless. Following the instructions from the FedUp page -

grub2-install /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg

Got me a working grub2 system - however, my poor man's install option was lost.
This I corrected as below, adding it's entry in the file below

[steve@aspireone753 ~]$ sudo cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry Fedora-17-x86_64-Live-Desktop {
  set root=(hd0,msdos8)
  linux /isolinux/vmlinuz0 root=UUID=B381-1423 rootfstype=auto rw liveimg quiet  rhgb
  initrd /isolinux/initrd0.img
}

and then re-running 
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

There were some syntax changes from how it was in grub.conf ->

title Fedora-17-x86_64-Live-Desktop.is
  root (hd0,7)
  kernel /isolinux/vmlinuz0 root=UUID=B381-1423 rootfstype=auto rw liveimg quiet  rhgb
  initrd /isolinux/initrd0.img

Note especially the change in partition numbering.

Friday, August 30, 2013

Upgrade Fedora 17 to 19 using FedUp

Whilst a fairly time consuming process, it went very smoothly. The only minor issue I encountered was Chrome not working, but this and a simple solution was documented on the FedUp page.

Dare I tackle a grub update?

Also worth noting... my issue with

rfkill: WLAN soft blocked

occurring randomly some minutes after boot, although not solved... I seem to have found a remedy.
After installing the rfkill util, I'm able to re-enable via the command

rfkill unblock WLAN

Wednesday, October 3, 2012

DNS-323 based home security camera

Quite some time ago, I bought a wireless IP camera from Amazon UK, intending to set it up at home as a DIY security camera. Whilst it was great value for money, the web based user interface was quite limited and basically I wasn't able to do what I wanted.

After some googling, I found out about 'motion', motion detection software, seemingly designed for the job. I figured if I could run 'motion' on my DNS-323, I could make a workable solution.

EasyN FS-613A-M136 Wireless Pan & Tilt IP Camera
Motion

Recently I got around to trying it, and am pleased with the results so far, his how I did it -

Download and install development tools (thanks fonz) necessary to build motion using -

wget http://www.inreto.de/dns323/fun-plug/0.7/oabi/packages/
funpkg -i

for each of the packages below -

autoconf-2.68-oarm-2.txz
automake-1.11.3-oarm-1.txz
binutils-2.22-oarm-3.txz
gcc-4.5_20120202-oarm-1.txz
gcc-solibs-4.5_20120202-oarm-1.txz
libjpeg-8c-oarm-2.txz
linux-libc-headers-2.6.12.0-oarm-2.txz
make-3.81-oarm-2.txz
mpfr-3.1.0-oarm-2.txz
uClibc-0.9.30.3-oarm-1.txz
uClibc-solibs-0.9.30.3-oarm-1.txz

Download motion source, configure, and make -

motion-3.2.12.tar.gz
./configure --without-v4l
make

A small patch afterwards, to get it to link properly -

gcc  -o motion motion.o conf.o draw.o jpegutils.o video.o video2.o video_common.o netcam.o netcam_ftp.o netcam_jpeg.o netcam_wget.o track.o alg.o event.o picture.o rotate.o webhttpd.o webcam.o  -lm  -ljpeg -lpthread

root@dlink-EEF76A:/mnt/HD_b2/tmp/motion-3.2.12# cat motion.conf 
netcam_url http://192.168.0.111:81/videostream.cgi?showlength=1
netcam_userpass admin:password
locate on

framerate 2

And voila -


root@dlink-EEF76A:/mnt/HD_b2/tmp/motion-3.2.12# ./motion -c motion.conf 
[0] Processing thread 0 - config file motion.conf
[0] Motion 3.2.12 Started
[0] Thread 1 is from motion.conf
[1] Thread 1 started
[1] Resizing pre_capture buffer to 1 items


Works nicely!

Friday, September 21, 2012

Re-enabling autofs (aka automount) after Fedora 17 upgrade



$ sudo systemctl enable autofs.service
ln -s '/usr/lib/systemd/system/autofs.service' '/etc/systemd/system/multi-user.target.wants/autofs.service'
$ sudo systemctl start autofs.service

Modify auto.smb to avoid se-linux denial on root password request when auto-mounting smb shares

Change line ->
#opts="-fstype=cifs"
to ->
opts="-fstype=cifs,guest"