got some work done on the uvc-controller today.. finally managed to turn of auto-* on the logitech c910 in mac os x (haven’t tried on the other boxes yet). heres a dump:

// sluggo
think i wrote the most useless script i’ve ever produced today. the embarrassing thing was i didn’t realize what the hell i was doing til it was almost done.. to make some use of it i figured i’d comment it and put it here.
#!/bin/bash
# check if number of arguments ($#) is less than (-lt) 2
if [ $# -lt 2 ]; then
echo "usage: $0 dst src [src1 src2 ...]"
# wrong usage means non zero exit code
exit 1
fi
# make sure first argument ($1) is a directory
if [ ! -d $1 ]; then
echo "target dir must exist!"
exit 1
fi
# store arguments to script in args (only reason is i dunno
# how to do the following line with $@).
args=$@
# loop through args-array from element 2 to <last>
for a in ${args[@]:2}; do
if [ ! -d $a ]; then
echo "\"$a\" is not a directory, skipping.."
# if it's not a dir skip this iteration
continue
fi
echo "creating dir \"$1/$a\""
mkdir "$1/$a"
# check exit code of last call (mkdir), if it's not equal (-ne)
# to 0 we've got an error.
if [ $? -ne 0 ]; then
echo "could not create \"$1/$a\", skipping.."
continue
fi
# list all files (-A), including symbolic links (-P) in $a, one per line (-1), with trailing / on dirs (-p) |
# select the ones with without trailing / |
# make xargs replace {} in the cp-call with result
ls -1APp $a | grep '[^/]$' | xargs -I '{}' cp "$a/{}" "$1/$a/{}"
# list files in $a as above but recursively (-R) |
# select the lines containing a : |
# remove the : and loop thru the result
for b in `ls -ARPp $a | grep ":" | sed -e 's/://'`
do
mkdir "$1/$b"
if [ $? -ne 0 ]; then
echo "could not create \"$1/$b\", skipping.."
continue
fi
ls -1APp $b | grep '[^/]$' | xargs -I '{}' cp "$b/{}" "$1/$b/{}"
done
done
exit 0
notice how lines 23-46 can be replaced by
cp -R "$a" "$1/."
// sluggo
working on a cross-platform thingy to friggin kill all auto-adjustments (focus, exposure, etc) on uvc-compliant webcams. being short on time, as usual, i’ve realized i hate usb. thats right, i hate universal serial bus. if it wasn’t for libusb i’d probably shot my self dead, at least three times already.
if you think controlling uvc-cams seems super-duper-interesting and wanna read all about it here’s a guy who has done pretty much what im doing.
// sluggo
i’ve been working on some cross-platform video thingies, the natural choice of lib was opencv. since i had some trouble building the latest stable version on os x 10.6.8 i thought i’d share how i solved it.. right now im not using tbb even tho im on an intel machine (the mba).
first off, if you don’t have an svn-client i’d recommend installing Martin Otts pkg. also, i got some errors with os xs libjpeg, so i downloaded a binary package of it bundled with libpng from Ethan Thira-Thompsons OS X ports site, it was listed as an unofficial binary package on the official libpng site.
To build opencv you need cmake, universal binaries are available from the link. When everything is downloaded and installed it’s very straight forward,
svn co https://code.ros.org/svn/opencv/trunk/opencv cd opencv sudo cmake -G "Unix Makefiles" . sudo make -j8 sudo make install
note that it’s quite a big project, the checkout is around ~50mb.
// sluggo
been fiddling around with freebsd and openbsd for a while (mainly on the mac mini as both laptops have been tied up at school/work) and after reading about kernel.org’s skynet mirror i made the full move. This means there will be no more updates regarding linux software/installation/drivers/kernel.
my main project at the moment, an rtorrent-xmlrpc-wrapper-lib together with a simple gtk-frontend and a ssl-only webbserver serving only rtorrent-info, compiles nicely on freebsd – which ended up being my bsd of choice for the mini. the lib is still in early pre-alpha but can send requests and receive the responses by itself (this means you do not need to install any software, i.e webserver to run a frontend). Hopefully ill get some more work done on it during the summer.
Had a couple of beers now so this might have been a bit rambling but i hope you get the gist of it..
// sluggo
update: just realized im still administrating some debian-based servers at work.. so there might come some vague posts about that.
no time to write a long post. this is one way to get rid of the plaintext passwords, using sasl when running a svn server on ubuntu or pretty much any debian-based distro. this assumes that you have svnserve up and running, also /svn/root means your svn root folder, not necessarily that path. the indented parts are supposed to be entered in files (here i use vim, you can change it to <your-editor-of-choice>).
sudo apt-get install libsasl2-2 libsasl2-modules sasl2-bin
sudo vim /etc/default/saslauthd
# change the row that says START=no to START=yes
cd /svn/root
sudo svnadmin create newrepo
sudo vim newrepo/conf/svnserve.conf
# insert the following
[general]
anon-access = none
auth-access = write
# realmname may not contain special chars (this includes spaces, dashes and pretty much anything except a through z)
realm = realmname
[sasl]
use-sasl = true
min-encryption = 256
max-encryption = 256
# EOF
sudo vim /usr/lib/sasl2/svn.conf
# this is the basic setup.. alotta settings can be used
pwcheck_method: auxprop
auxprop_plugin: sasldb
# i used /etc/svn_sasldb here
sasldb_path: /path/db_name
mech_list: DIGEST-MD5
# EOF
sudo ln -s /usr/lib/sasl2/svn.conf /usr/lib/sasl2/subversion.conf
# add as many users as you need
sudo saslpasswd2 -f /path/db_name -c -u realmname username
sudo /etc/init.d/svnserve restart
# and ya done!!
// sluggo
Status
11-04-17: haven’t found any time to update anything. school and work is still getting in the way, have literally been at the uni every day since last update.
11-03-02: Tiny typos and some other stuff. the upcoming three weeks are insane so probably won’t be any updates during that time.
11-02-26: woha.. long time no see! did a reinstallation today with the new archboot and updated the packages- and kernel-section. will update the link to the new archboot later.
11-01-31: ran into another site which i remembered visiting while getting the mba to work.. so thats another reference!
11-01-29: The grub2-efi pkg has been moved to the official testing repo, again Keshav (skodabenz) provided the updated info. Also added the reference Debian on the MacBookAir3,1, it really was a good reference while installing.. dunno why i forgot it!
11-01-28: added a link to the grub2 article in archwiki, thank you Keshav (skodabenz) for the info (see comment). sorry bout the delay, school and work getting in the way again.
11-01-17: just remembered that you might need to sudo the dd in os x.
11-01-16: Added new (empty) section regarding hotkeys and one (with a quick pointer, not done) for offline installs.
11-01-15: Updated the empty sections with some pointers, far from a full guide yet tho.. but haven’t got more time than this right now.
11-01-11: First couple of sections published.
TOC
Work in progress, disclaimer, etc etc
This guide is far from done, still missing a bunch of sections and is not very well written.. and as always, if your macbook air should burst into flames, grow legs and go on a murderous rampage or just plainly slap you in the face – stop using guides you find on the internet!
also, <enter> or <tab> means the keys “enter” or “tab”..
enjoy!
Hardware needed
| > Macbook air 3,1 or 3,2 (duh!) |
| > usb-to-ethernet adapter (unless you’re doing an offline install) |
| > mac os x usb stick (the one that comes with the mba) |
| > two usb sticks > 512mb (or one and an external cd-drive) |
Software needed
| > Archboot 2010.12 | |
| > rEFIt iso | |
| If installing without internet connection | |
| > mba3 kernel binaries | |
| > grub2 | |
| > hfsprogs (which requires the libbsd package) | |
| > pommed |
Preparations for offline installation
All you really have to do is download the packages (including the source and patches for pommed, not just the aur tarball) and store them somewhere..
USB preparation
Start by booting into mac os x, download archboot and refit and unpack the latter (which for me got done automatically).
Now plug in your first usb stick (if you only got the one and a cd-drive use the usb here) and fire up the terminal (Applications >> Utilities >> Terminal). First of you need to unmount the volume by typing
diskutil umount /Volumes/your-usb-stick
where your-usb-stick is the name of your usb-stick. when the volume is unmounted you navigate to the folder with the refit-iso which should be called rEFIt-0.14.cdr (the version may vary). if you downloaded it to your home folder you’re already there, otherwise it’s prolly just to
cd Downloads
Now it’s time to write the image to the disk but to make sure you write it to the right one you can run
diskutil info /dev/disk1
alotta info will be listed, there will be a “Vendor”-line which should help you figure out whether it’s the right one, if it’s not just try /dev/disk2,3… til you find the right one (i’ll continue using disk1 here so if that’s not right for you don’t copy the commands!). write the iso to your usb with
dd if=rEFIt-0.14.cdr of=/dev/disk1
if you get an error regarding permissions just slap in a sudo:
sudo dd if=rEFIt-0.14.cdr of=/dev/disk1
after you’re done unmount the disk completely by
diskutil unmountDisk /dev/disk1
and unplug the usb.
Now do the same with your second usb and the archboot iso (plug in, unmount volume, dd if=archlinux-2010.12-1-archboot.iso of=/dev/disk1, unmount disk), if you only got one usb burn the iso to a cd.
Archbooting
Plugin both usb sticks (i’ll just stick to the sticks from now on, it’s basically the same if you use a cd), reboot and hold down the option-key (left alt-key, third from the left). You will be presented with a nice graphical menu where you can choose between rEFIt and Mac OS X, select rEFIt. In the next menu, before you go ahead and boot from your usb, step down and select “about rEFIt” (the one in the middle of the smaller icons), in the screen that follows you will see a line which says either
Screen Output: UGA Draw (EFI 1.10), 1440 x 900
or
Screen Output: Graphics Output (UEFI), 1440 x 900
if it’s the first one remember to add the lines
set debug=video insmod efi_gop
to your grub.cfg later on, if it’s the second one
set debug=fb insmod efi_uga
should be used.. whats grub.cfg? you ask (unless you’re familiar with grub2 =), don’t you worry your sweet little head, we’ll get to that!
Now, go back and boot from your smokin hot archboot usb!
When presented with the Archboot-menu step down to the first x86_64-kernel (not the lts-one!), press <tab> and add the argument reboot=pci to the kernel argument list (feel free to add any kernel args you please, but reboot=pci you gotta have), if you’re on a non-US keyboard the =-sign is located on the first key left of the backspace. Hit enter and the booting will commence!
Preparing the drive
When you’re all booted up, unplug the rEFIt-disk and plugin your usb-to-ethernet adapter. Hit enter to get into the installation menu, here you can setup your keyboard and to get your network going you can go down to “3 Select Source”, choose “FTP/HTTP” and “Set up Network”. When that’s done return to the main menu and select “Exit Install”.. were gonna do this by hand! you’re now all alone on the ever so scary command line! but fear not little one, i shall guide you through this.. start gdisk by entering the command
gdisk /dev/sda
We use gdisk, as opposed to fdisk since we want to have a gpt and not mbr. if you’re interested in the differences see the references section.
if you want some kinda clue of what you’re doing hit “?”<enter> (without the quotes) and read through the different commands, otherwise just go ahead and do as i tell you, minion!
This is the moment of truth, here you will erase all your data from the drive! if you’re ready to do this hit “o”<enter> (without the quotes), this will erase your current partition-scheme. After that hit “n”<enter><enter><enter>+100MiB<enter>af00<enter> (without the quotes) this will, if i remember the number of <enter>s correctly create a (ridiculously big, but im really not sure how big grub2 can get) Apple HFS/HFS+ partition at the beginning of your drive..
if you’re an experienced user you can now go ahead and partition your drive as you please, i will however assume that your using a boot partition (here it’ll be formatted with ext2).
Here is the setup i use
Number Size Code Name 1 64 MiB AF00 Apple HFS/HFS+ 2 100 MiB 0700 Boot 3 4 GiB 8200 Linux Swap 4 11 GiB 0700 Root 5 98 GiB 0700 Home
You should be able to create a similar layout, use “n” to create new partitions, select the default partition numbers and start sectors, when asked for “Last sector” enter +SizeKiB/MiB/GiB and the “Hex code”s are the ones listed above under Code.
If you want to change the partition’s name use the command “c”<enter>. It’s wise to first print out the layout (“p”<enter>), that way you dont have to remember the partition numbers.
when you’re happy with your layout, verify it with “v”<enter> (without the quotes). unless you’ve made some funky layout you’ll probably be fine. to write it to disk use “w”<enter>.. if the writing is successful you’ll be back on the command line.
Installing packages
Start the setup again by
/arch/setup
Step down to alternative number 2 Prepare Hard Drive and press <enter>. In the new menu you select the 4:th alternative, Set Filesystem Mountpoints. Here you’ll have your newly created partitions, all you have to do is to press ok and the select your swap-partition, root and others. If you’re using the same layout as me then swap is /dev/sda3, root is /dev/sda4, after that you’re asked to select any additional partitions; start by selecting /dev/sda2 and enter the mountpoint /boot (I used the filesystem ext4 for boot, root and home without any extra parameters). Then do the same for /dev/sda5 but with the mountpoint /home (labels are practical, use them), skip the hfs+-partition – well get to that later. When you’re done, select DONE, look over your mount-options and if theyr all ok then proceed. What kind of device name scheme you want is completely up to you, i use UUIDs.
When you’re done with this return to the main menu and proceed by selecting source, this you’ll have to manage on your own!
Now you select the packages you want, i went for “base”, “base-devel” and nothing else. When you’re done selecting packages just continue by installing them.. After that configure your system (if you’re on a non-english system remember to set up your /etc/rc.conf and /etc/locale.gen).
So far this part has been pretty standard but now it’s time to enter the darkness again, so when you’re done configuring your system dont install any bootloader but exit..
Installing the mba3 kernel
To install the kernel into your new system you first have to chroot into it, but before we do that we have to make some preparations. First of we mount our “real” /dev onto our new one:
mount --bind /dev /tmp/install/dev
other than that we also need a sysfs and a proc:
mount -t proc /tmp/install/proc mount -t sysfs /tmp/install/sys
now were ready to start messing about so we chroot in:
chroot /tmp/install
The first thing you need to do if you’re installing with an internet connection is to set it up,
dhcpcd -d eth0
(The -d is for debug, gives a more verbose output). if you’re not, just install your kernel and continue. When you’re connected download and install the kernel and the headers by issuing the following commands
wget -O kernel26-mba3-2.6.37-1-x86_64.pkg.tar.xz http://www.dm9.se/?dl_id=11 wget -O kernel26-mba3-headers-2.6.37-1-x86_64.pkg.tar.xz http://www.dm9.se/?dl_id=12 pacman -U kernel26-mba3-2.6.37-1-x86_64.pkg.tar.xz pacman -U kernel26-mba3-headers-2.6.37-1-x86_64.pkg.tar.xz
If you trust the internet, here embodied by me, blindly you can now uninstall the old kernel.. or you can keep it until you’re done installing!
Installing grub2
this is not done yet, but here’s what you gotta do:
install hfsprog and mkfs.hfsplus /dev/sda1, mkdir /efi and mount it there then mkdir /efi/EFI. install grub2-efi-x86_64 then follow the instructions on the GRUB2 page page on the wiki (see “Bootloader Installation for UEFI systems”)..
Blessing your installation
This is pretty much a one step procedure but i’ll cover it better later (as with the other ones):
plugin your mac os x usb stick and reboot into os x. start the terminal and
bless --folder=/Volumes/something --file=/Volumes/something/EFI/grub2/grub.efi --setBoot
(see how i stole that from TestingOnMacbook) where something is the name of your volume.
ya done!
Post installation
Set up the necessary symbolic links to masquerade the mba3-kernel as a regular one.. not a great way to do it but i didn’t think of it until now.
The nvidia drivers
still haven’t got this done..
Hotkeys
Just started messing around with pommed..
References
| > Testing grub2 on macbook |
| > |
| > archwiki UEFI |
| > archwiki GPT |
| > archwiki Grub2 |
| > MacBook Air 3,2 thread on the ubuntu-forum |
| > Debian on the MacBookAir3,1 |
| > Pure EFI Linux Boot on Macbooks |
| > pommed (hotkeys) |
// sluggo
so here are the binaries, both the kernel and the headers.. ive started writing on a howto but it’ll prolly take a few days (work and school are time-hoggers).
| kernel26-mba3: | |
kernel26-mba3-2.6.37-1-x86_64.pkg.tar.xz (24.7 MiB, 607 downloads) |
|
| kernel26-mba3-headers: | |
kernel26-mba3-headers-2.6.37-1-x86_64.pkg.tar.xz (4.1 MiB, 567 downloads) |
|
// sluggo
ok, heres the first working aur-pkg that builds and installs properly on my mba3,2, its based on the official kernel 2.6.37 package from arch linux testing repo. i fudged up and lost the binary package when messing around with the boot partitions so ill have to upload that when ive had time to recompile it.. it looks like crap since i havent fixed the kernel26-headers nor kernel26-docs parts (thats why i havent uploaded it to the aur yet).
the patches that are applied are the official arch linux patch(set), mba-alsa, mba-applesmc, mba-backlight, mba-bcm5974-touchpad, mba-efi, mba-hid (see earlier post for more info on these patches)..
| kernel26-mba3: | kernel26-mba3.tar.gz (40.7 KiB, 490 downloads) |
update:
just a note, since kernel26-headers is not installed with this package (yet) you cannot compile any kernel modules (read broadcom-driver) but the new and improved kernel brcm-driver works just fine with the mba3 wl-card! all you have to do is
sudo modprobe brcm80211
and/or add it to the modules section in rc.conf (doesnt work with udev yet).
update:
updated the package and now it builds the kernel headers as well.
// sluggo
i just walked through most of my apartment balancing a beer on my head! you might think that this doesnt have anything to do with my last posts but beer lord you’re mistaking! i did this to pass the time while compiling the stable version of kernel 2.6.37.. unfortunately i messed up when applying some of the patches so now im doing it again (compiling that is, im out of beer). will prolly upload both an “kernel26-mba3″ aur-pkg and a binary-pkg (the binary will be placed here somewhere) so the ones that are not interested in looking at the ~40min compiling dont have to.
Still havent got the nvidia-crap to work yet..
// sluggo