Hardware Reference
In-Depth Information
Finally (for the Mac), you need to grant permissions to VirtualBox to use the raw
device. Since VirtualBox likely runs under your own login, you need to grant permissions
to it. I'll use the lazy approach here, to grant permissions to everyone on the device (the
device will go away as soon as it is removed anyway):
$ sudo chmod 0666 /dev/disk2
Note that once you remove the SD card, and later insert it, you will need to repeat
this step.
Next, you will need to locate the VBoxManage command. On the Mac you will find it
here (Windows users may find it in C:\Program Files\Sun ):
$ cd /Applications/VirtualBox.app/Contents/MacOS
You can either add that directory to your current PATH , or simply change to that
directory. Then use the VBoxManage command to create a control file ( *.vmdk ). This
control file informs VirtualBox how to access that raw device (place the *.vmdk wherever
you find it convenient):
$ sudo VBoxManage internalcommands createrawvmdk \
-filename /Volumes/VirtualBox/sddisk.vmdk \
-rawdisk /dev/disk2
Now enter your VirtualBox console and open the storage settings. Click the Add
Hard Disk icon and select the control file you created (in the example, it was created on
/Volumes/VirtualBox/sddisk.vmdk ). Make sure you add this device after your current
boot device. Otherwise, VirtualBox will try to boot from your SD card instead.
After starting VirtualBox, you should see your new devices under Linux. In my case,
the SD card devices showed up as /dev/sdb (entire SD card), /dev/sdb1 (partition 1), and
/dev/sdb2 (partition 2). With this success, it is now possible to mount these partitions
after creating mount points (I used ~/mnt1 and ~/mnt2 ):
$ sudo mount /dev/sdb1 ~/mnt1
$ sudo mount /dev/sdb2 ~/mnt2
Now you can list those mount points to see the Raspberry Pi file system content. This
access makes it an easy matter to install your kernel:
$ cd /opt/tools−master/mkimage
$ sudo mv ~/mnt1/kernel.img ~/mnt1/kernel.orig # Rename original kernel
$ sudo dd if=kernel.img ~/mnt1/kernel.img # Install new kernel image
Likewise, you can now update the kernel modules:
$ cd ~/mnt2 # Raspberry Pi' Root file system
$ tar xzvf ~/work/modules/modules.tar.gz # Unpack into ~/mnt2/lib
Search WWH ::




Custom Search