Saturday, August 20, 2016

How to enable serial console on LS-VL

Why do need to connect to your linkstation via a serial console?
  1. You can see the actual messages the linkstation prints when it is booted
  2. You can log in to the linkstation without using the network interface
  3. Just for fun :)
What do you need?
  1. Patience
  2. soldering skills
  3. a serial cable. (I have a cheap PL2303HX USB to TTL serial cable ordered from ebay)

If you are a amateur to soldering, my recommendation is do not try this.

Main board modifications


First you need to disassemble the linkstation and remove the main board. Then you have to connect four points in the main board as shown in the picture. These four holes can be found between the processor and the SATA connector.
This is where you need patience and soldering skills. It's bit difficult task to connect the holes using small wires.


Serial Header


The serial header can be found near the SATA connector as shown in the picture. You can solder a pin header so that you can easily plug a serial cable.




Once the main board and serial header are modified, you can plug a serial cable and use the screen program to view the console.

I used PL2303HX USB to TTL serial cable and didn't attach the power cable (red color) to the serial header. The white color cable connected to TxD pin, The green color cable connected to RxD pin  and the black color cable connected to the GND pin

screen command I used,

screen /dev/ttyUSB0 115200

console output,



If you need to find u-boot output messages, you can do another modification to the main board. However this is extremely difficult. You shouldn't attempt to do this unless you have good experience in SMD soldering.
The modification is, remove R60 and solder it on space allocated for R59.

I almost screwed up my main board trying to moving R60 to R59. It took hours to make things worked.
You have been warned!!!


Console output with u-boot messages, 




References: 

Saturday, April 16, 2016

How to enable nested VM in KVM

1. Uncomment below line in /etc/modprobe.d/kvm.conf
options kvm_intel nested=1


[root@localhost ~]# cat /etc/modprobe.d/kvm.conf 
###
### This configuration file was provided by the qemu package.
### Feel free to update as needed.
###

###
### Set these options to enable nested virtualization
###

options kvm_intel nested=1
#options kvm_amd nested=1


2. Remove and Add the kvm_intel module

modprobe -r kvm_intel
modprobe  kvm_intel


3. Verify whether the change has been applied or not,

cat /sys/module/kvm_intel/parameters/nested
Y

4.Use 'Copy host CPU configuration' in VM's CPU configurations

Sunday, March 13, 2016

My first experience with beaglebone serial port

Yesterday, I received beaglebone and PL2303HX USB to TTL serial cable I ordered few weeks a go. First thing I tried to do with the beaglebone was to try it's serial port.

So I connected the serial cable with the beaglebone and PC. I use fedora on my PC, so I used screen program to communicate with the serial port.

Then I powered up the beaglebone using the mini USB port and was waiting for the messages to be printed in the serial console.

Well, the good news was that messages were printed. but there were bad news.
sometimes it showed garbled messages. Also when it showed messages correctly, I wasn't able to type. It was simply a read only screen session.

What went wrong? I started googling and couldn't find any clue. finally I landed on a page where it lists beaglebone HW faults and it listed a similar scenario described as a HW fault. But it was a very old issue and cannot believe it still exists in new boards.

So I started diagnosing the issue.
First I tried to check whether it is an issue with the PC. Therefore I connected the beaglebone and the serial cable setup with my windows laptop. I did't get garbled messages on my screen session this time (I used Putty) but still I couldn't type.

So this must be an issue with either the beaglebone or the serial cable. If it's an issue with the beaglebone, I do not have any option. So I decided to diagnose the serial cable. I opened the USB side of the cable to check the circuit. the USB side can be easily opened since it was not sealed.

Huh, Found the issue!!!. The green wire was detached from the PCB due to a bad soldering job.
I soldered the green wire to the PCB again and reconnected the setup with the PC.

voila, screen session is bidirectional now. :)


Sunday, January 10, 2016

How to fix Unibeast's "Selected Mac OS X Installer is Incomplete" error

Selected Mac OS X Installer is Incomplete

Your selected Mac OS X Installer is incomplete. Please delete all copies of the installer from all mounted volumes and redownload it again from the Mac App Store.

Do you receive above error message when you try to prepare a bootable USB  using Unibeast and a OS X installer downloaded from another machine, or a torrent? and you are 100% sure the downloaded installer is genuine copy?

Actually you can resolve this by doing either,
1. Simply changing the system time or
2. Patching Unibeast to remove a validation. 
(Changing 0000000100003262         je         0x1000032a2 to a NOP in Unibeast 6.1.1)

Both can be done easily. But I'm going to describe only the first option here. 

First let me explain few validations which are done by Unibeast before it allows you to create the bootable USB.

1. First validation it does is the Installer name and the path. Installer should be available at the /Applications directory with the correct name.

E.g.: 
/Applications/Install OS X Yosemite.app
/Applications/Install OS X El Capitan.app

2. Second validation is that,

If the installer is for Yosemite, then it checks for the string "com.apple.InstallAssistant.Yosemite" in the /Applications/Install OS X Yosemite.app/Contents/_MASReceipt/receipt file using "grep -q" command.

If the installer is for El Capitan, then it checks for "
com.apple.InstallAssistant.ElCapitan" in the /Applications/Install OS X El Capitan.app/Contents/_MASReceipt/receipt file using "grep -q" command.

3. The third validation is that it validates the signature of the receipt. This is the moment you get the "Installer is Incomplete" error message. This can happen either your receipt file is actually changed by someone or the certificates included in the receipt file are expired.

You can view the certificate information executing below command, (first change directory to /Applications/Install OS X xxx.app/Contents/_MASReceipt/ directory)

openssl pkcs7 -inform der -in receipt -print_certs -text

If your machine time is not within the validity period of the certificates, the signature validation is failed and Unibeast prompts the "Installer is Incomplete" error message.

e.g.:
openssl pkcs7 -inform der -in receipt -print_certs -text | egrep 'Not Before|Not After'
            Not Before: Nov 11 21:58:01 2010 GMT
            Not After : Nov 11 21:58:01 2015 GMT
            Not Before: Feb 14 18:56:35 2008 GMT
            Not After : Feb 14 18:56:35 2016 GMT
            Not Before: Apr 25 21:40:36 2006 GMT
            Not After : Feb  9 21:40:36 2035 GMT

In this case, the lowest "Not After time" is Nov 11 21:58:01 2015 GMT and the highest "Not Before time" is Nov 11 21:58:01 2010 GMT. Therefore the time of your machines should be within Nov 11 21:58:01 2010 GMT and Nov 11 21:58:01 2015 GMT.

Therefore if you change the machine time appropriately, let's say 2015/01/01 then Unibeast will proceed without prompting the  "Installer is Incomplete" error message. :)

Note: I think above validation was introduced by Unibeast developers to address a legal issue rather than making sure you have a genuine copy, because you can still have a modified installer files even when the receipt validation is passed.  So if you download the MAC OS X Installer from a torrent site or any other place, check the MD5 or SHA1 of the InstallESD.dmg file.

For Further reads about apple receipts,

Sunday, January 3, 2016

Building a hackintosh

First you need to read a lot about working builds before going in to building a hackintosh.
tonymacx86 is a very good resource on this subject and the community is very helpful.

I had only few options selecting motherboard and processes due to the availability in local computer market. Online purchasing was not an option due to the shipping cost.

Finally I decided to go with ASUS H97M-E and Intel i3-4330 haswell processor with integrated intel graphics (Intel HD 4600)
Make sure that the keyboard and mouse are USB and the monitor supports digital input (i.e. DVI-D or HDMI).

First you need to create a bootable USB with the target OS X. If you don't have a mac, you can prepare the USB using a VM. If you have a mac, then you can create the bootable USB easily.

Please note that this is not a step by step guide to build a hackintosh. However I have mentioned links which have the step by step guides useful in this process.

Download VMware Workstation

I was using Fedora 21, so I downloaded "VMware Workstation 12 Pro for Linux 64-bit".
Link: http://www.vmware.com/products/workstation/workstation-evaluation

Make sure that the version of the kernel and the version of the kernel-headers of your system are same. Otherwise the VMware installer will complain that it is unable to find the proper header files.

In my case they had different versions. So I updated the kernel.

[root@desktop9 ~]# rpm -q kernel-headers
kernel-headers-4.1.13-100.fc21.x86_64

[root@desktop9 ~]# uname -r
4.0.4-201.fc21.x86_64

[root@desktop9 ~]# yum update kernel

Unlock VMWare Workstation

You need to "unlock" VMware workstation to use your target OS X.

Download unlocker from here,
Link: http://www.daveparsons.net/downloads/unlocker207.zip

Run the unlocker script,
[root@desktop9 unlocker208]# ./lnx-install.sh 

Now it's the time to start the VMware workstation. Unfortunately VMware workstation threw errors and it was unable to start.

Could not open /dev/vmmon: No such file or directory.
Please make sure that the kernel module `vmmon' is loaded.

So I tried to load the required kernel module manually using modprobe.

[root@desktop9 ~]# modprobe vmmon
modprobe: ERROR: could not insert 'vmmon': Required key not available

After doing a google search I found out that the real reason for this error was the BIOS option "Secure Boot". I set the value for this bios option to "Other OS". After that the VMware workstation started.

Prepare ISO

Now you need an iso of the target OS X. I had Appstore copies of Mountain Lion and Yosemite operating systems. The original OS X comes as a dmg file. So you need to convert the dmg file to an iso.

I used dmg2img to convert Mountain Lion dmg file to an iso since the iso generated by the dmg2img for the Yosemite dmg didn't work with VMware workstation.

yum install dmg2img
dmg2img InstallESD.dmg InstallESD.iso

After that you will be able to use the iso on VMware workstation to create a new VM. Then you can use the VM to prepare a bootable USB with Yosemite or El Capitan using Unibeast.

Step by step instructions for preparing a Mac OS X VM on VMware workstation are available in this blog,
Link: https://mizitechinfo.wordpress.com/2014/07/13/installing-mac-osx-10-8-on-vmware-workstation/

Prepare the bootable USB using Unibeast

Unibeast seems very sensitive when it comes to finding the OS X from /Applications directory with correct names and files. It does not support to load an OS X installer from a user provided location.

If you already have a downloaded OS X installer, you need to copy that to the /Applications directory. However sometimes it complains that it couldn't locate the installer or the "installer is incomplete" if you copy the installer manually to /Applications directory.

If OS selection is greyed out in Unibeast, make sure that the OS X installer has the correct name and copied to the correct location.
e.g.: "Install OS X Yosemite.app" in /Applications directory.

Sometimes it still does not work even though the OS X installer is placed correctly. Try setting the system time to a previous year, e.g.: 2010 and rerunning the Unibeast in such a scenario.

Update: Please read this blog post if you are unable to make the OS X Installer recognized by Unibeast.
http://swapoff.blogspot.com/2016/01/how-to-resolve-unibeasts-selected-mac.html

Install the OS X

Once you have prepared the bootable USB, you should be able to use it to install the OS X on your build.

Step by step instructions on preparing the USB and installing it on your build using Unibeast and Multibeast are available in tonymacx86 site.