修改配置文件:
sudo vim /etc/netatalk/AppleVolumes.default
配置如下
# The line below sets some DEFAULT, starting with Netatalk 2.1.
:DEFAULT: options:upriv,usedots
# By default all users have access to their home directories.
~/ "Home Directory"
/media/usbdisk/mactimebak "Time Machine" allow:pi cnidscheme:dbd options:usedots,upriv,tm
$ sudo dd bs=4m if=2014-01-07-wheezy-raspbian.img of=/dev/rdisk1
706+1 records in
706+1 records out
2962227200 bytes transferred in 470.754370 secs (6292511 bytes/sec)
diskutil unmountDisk卸载设备
$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
Raspberry Pi Source List
sudo vi /etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi
sudo apt-get update
sudo apt-get install vim binutils-dev build-essential git zsh iptraf iftop screen
Solved: Infuriating CPU Spike issue on External HDs. Turned out to be a bad USB Hub, Belkin F5U701. Plugging in w/o a hub is current workaround. Always check the list of RPi Verified Hardware, Kiddos
Just wanted a quick start guide for myself so that I wouldn't have to keep rooting through Google to remember all this stuff. Hopefully it helps other people.
If you had other ideas or suggestions please leave a comment.
Useful things to own before you buy a Pi
The first time I bought a Pi I was enormously frustrated with myself because I didn't own all of this stuff. Kept having to order things off of Amazon and wait to get started... very irritating. This is all good stuff to have laying around anyway:
Come up with a project and set up your Pi for that. Don't try to make the Pi into another workstation for yourself - it's a nice idea but you'll forget how to set everything up.
I suppose you could make a disk image (see below) if you wanted, but I find it easier to plow ahead with a single Pi dedicated to a specific goal. That way I know when I turn that Pi on it'll always do what I wanted it to... and nothing else.
In other words don't try to use one Pi for everything. If you don't need Processing and openFrameworks then don't install them both!
What size Flash drive to buy?
If you're doing anything besides running startx on the machine I'd go with an 8GB class 10 SDHC drive. Class 10 will run a tinsy bit faster I've read, though I'm betting the performance gain is negligible. Thanks to Stacey for the advice on this... just wish I had asked BEFORE I purchased myself. :)
IMPORTANT :: If you're going to use the Pi for openFrameworks dev you want to make sure you're using the Raspbian "wheezy" distro. Again, either buy your flash drive with it pre-installed or download it here.
Setting up the SD Card yourself
Assumes you're on a Mac.
Download the version of the distro you're into from Raspberry Pi's download page. Unzip it that and you should have a .img file.
Pop your SD card into your Mac and then in Terminal do the following:
diskutil list
Remember the identifier of your SD card (should be something like disk1 or disk4 or along those lines).
WARNING :: Updating and upgrading can take awhile. It also requires a connection to the Internet. I'd recommend a physical connection for the initial setup of your Pi for your initial install so that you don't encounter issues setting up the wireless stuff later.
RPI Update
Way easier for managing updates to the lower level stuff on the Pi.
Reboot and test. You should be able to share screen off of OSX or type in the IP address in your VNC client and see the Pi. If you need a port number to connect I believe it's 5900 but if that's wrong someone tell me in a comment and I'll update.
Thanks to the tutorial here and for more detailed information check out eLinux.org's post.
Git
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
Whatever it prints out is your SSH Key. Feel free to add that to your Github settings so you can pull.
openFrameworks
Wanted my openFrameworks stuff set up separate from anything else I might do on the Pi. I put it in [user directory/Programming/openFrameworks.
Here's how I do it:
cd ~
mkdir Programming
cd Programming
git clone https://github.com/openFrameworks-RaspberryPi/openFrameworks/
cd openFrameworks/scripts/linux/debian_armv6l
sudo ./install_codecs.sh
sudo ./install_dependencies.sh
cd ~/Programming/openFrameworks/libs/openFrameworksCompiled/project
make
You can also type make Debug instead of make here. Release vs. Debug configurations. Up to you.
WARNING :: This takes a long time to compile. Brace yourself.
Once all that's done:
cd ~/Programming/openFrameworks/scripts/linux/template/linuxarmv6l
cp Makefile ~/
cd ~/Programming/openFrameworks/apps/devApps/raspberrypi_hello_world
cp ~/Makefile ./
make clean
make
Once compiled it'll tell you how to run the application, most likely by typing "make run". Quit the application with Ctrl+C.
At this point I typically switch over to my Mac and either ssh in or mount the Pi as a remote volume. I copy and paste the raspberrypi_hello_world project for re-use, much like I would the emptyExample on a OSX development.
Create a local user, and put it in the users and sudo group:
sudo adduser YOURUSERIDHERE
sudo usermod -a -G users YOURUSERIDHERE
sudo usermod -a -G sudo YOURUSERIDHERE
Rebooting
Update the system to ensure that it has the latest and greatest copies of all the libraries:
sudo apt-get update; sudo apt-get upgrade
At this point, you're ready to go headless! Shut down the Raspberry Pi:
sudo /sbin/shutdown -h now
Once it's down (monitor the green status LEDs on the Raspberry Pi circuit board to know when it has finished shutting down), unplug the monitor, keyboard, mouse and power cord. Attach the USB storage, then restart the Raspberry Pi by plugging the power back in.
Once the Raspberry Pi starts up (again, those green LEDs are the clue to its state), you can ssh in to the RPi from any other machine on the network and finish all the configuration remotely from here on out (modify the following for your static IP):
This gist is now rather old gist, as such it details a lot of problems which are not present in recent releases and patches required. Patches may not work nor be correct anymore. Use everything at your own risk.
Tips
OpenSSL has been problematic in the past, use --without-ssl first to determine if it's a problem with node or OpenSSL.
Install or download a cross-compiler. The pre-compiled cross-compilers from raspberrypi/tools may work for you, however please ensure you get the correct one for your system (e.g. use the hardfp version for Raspbian) and install the compilers in your PATH by editing your .profile file, ensuring to add the /tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin directory.
Run the cross-compiler helper script to get a shell with the correct variables.
If compiling for a soft float system or using a different toolchain besides the default (which is arm-bcm2708hardfp-linux-gnueabi), use the HOST envrionmental variable to set the correct HOST prefix, e.g. :
HOST=arm-bcm2708-linux-gnueabi ~/crosscompile.sh
otherwise:
~/crosscompile.sh
It seems that the arm ld doesn't work with the makefile arguments, so set the following export:
export LD="$CXX"
If you are compiling Node.js 0.8.4 or lower, set the following exports: