SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I tried to search for answers to this question, and without success. The new MacBooks are intel based...like slackware is. What would it take to install Slack on one of these? I know that Yellow Dog linux was meant for this and Slackintosh was, but these were for the PowerPC platform.
Some work has been done on getting ix86-Linux to boot on the new mac hardware. But YellowDog is for the Motorola arch. I couldn't get YellowDog or Ubuntu for mac to install on my iMac. Then I found Slackintosh and installed 10.2. Right away recompiled the kernel to use 2.4 series and compiled some extra sources that I use to make a desktop with.
You can find the ppc bins here: http://distro.ibiblio.org/pub/linux/...kages/PowerPC/
Yea, but thats PPC not Mactel. You can get Slackware on the new intel chips from what I hear. Ubuntu has a Mactel live Cd that you can use. I read where some guy did that, extracted pkgtools on the liveCD system and then did installpkg -root to another partition from a dowloaded slackware directory on his HFS+ partition, starting at "a" then "ap" and so on. He said it worked after fiddling with fstab and a few other configs. Of course, you'll need to chroot and patch/build the 2.6 kernel with the relevant mactel patch set before it will boot. LOTS of other stuff needs to be tweaked in order to get the extras working but I've read many success stories in general with Linux and Mactel. Hit google, there's lots of stuff out there.
I just blew everything I had on a new MacBook Pro. It's in transit right now. I'll post back here if you want and tell you how to go about it. Can most certainly be done. The Tricky part is getting a tri boot with Windows, OSX and Slackware. That's my aim.
Also, Fedora is in the process of porting to the new Macs. I've been getting conflicting reports with concern to the boot loader. supposedly elilo for EFI systems is what your supposed to use but I hear lilo and now grub will work as well. You can also go the bootcamp route. XOM? rEFIt? Whew, just how do you get it to boot? I still have lots of reading to do and so do you.
I'll post back here if you want and tell you how to go about it.
Yes, please do. I've thought about getting a Macbook, but I'll probably wait for Mac OS X 10.5. And although my aim would be to run it mainly with MacOSX, a dual boot with Slackware is interesting.
I spent hours last night reading more about this. Actually, that link I gave will turn into MANY more links if you follow them all. It looks to be alot easier than I first anticipated. I still need to do more research but it seems that:
BootCamp is only used for making a driver CD that you plop into your drive after you hit the Windows Desktop. It's also a frontend for DiskUtil so you can partition your HDD... You may still have to "officially" install it tho. Not sure. Most people were just talking about using a terminal as in "diskutil list".
The main thing is to use either XOM or rEFIt. Those are your graphical bootloaders. I think you'll still need either elilo or lilo/grub. rEFIt may not actually boot a vmlinuz but instead try to chainload lilo to boot your linux partition. If you just want a dual boot system with OSX and Linux, you can use XOM. For a tri-boot system, use rEFIt. Here is a screen shot of rEFIt after you turn on your computer. http://refit.sourceforge.net/screen.html
Pretty nice looking and sticks with the Mac look. If you don't use one of the above, then you have to hold down the OPTION key after boot to get Apple's "built in" boot menu, otherwise, it boot's OSX by default. No good.
I'm not so sure what those Mactel patches are used for now. Read a couple places where you can use a regular gentoo 2006 minimal CD to boot into. That would tell me the Vanilla kernel can recognize the new Macs just fine. Maybe those patches are for making the backlit keyboard work and extras like that.
The BIG deal is that, if you intend on installing Windows, we have to take into account GPI AND MBR implementation. GPI does'nt allow extended partitions AND MBR only allows for 4 primary partitions. That means on an intel Mac with intent to run windows, we only have a max of 4 partitions and Apple is already using one for the GPI boot. That leaves the 2nd one for OSX, the 3rd one for Windows and the last one for Linux. Can't have a /boot or /home or even a seperate swap partition. You have to use a /swap file.
This makes it especially problematic as I was going to rebuild my DIY system but I have no free partitions left. I'll have to build it on my Slackware host in a seperate directory or something and then tarball it up, boot with a LiveCD and untar it on my freshly formated Slackware partition.
Sorry, just talking to myself I guess. I won't really know the particulars until I get my laptop in a couple days. This is the link that really helped me out the most:
Think I'm going to use 15gb OSX, 15gb Linux and the other 90gb FAT32 Windows. I'm making a custom Boot CD with fat32format.exe on it so I can get such a large FAT32 partition. This way, OSX and Linux will be able to read/write to Windows. C: drive will be a storage area for all 3 OS'es along with having plenty of space to install games. That's the idea anyway.
This was done on a Mac Book Pro 15.4 widescreen 2.16Gz Dual Core 2 Duo. There are mac-mini and imac how-to's out there but alot of the stuff seems specific to those models.
Well, I have a tri-boot on my macbook pro now. Slackware 11.0, OSX and Windows... Wasn't overly bad. The instructions on the link above is what I followed. I added the part about BartPE to the wiki but it doesn't work. Windows will choke when you try to boot it with just a black screen so I redid windows on an NTFS partition. Seems the later part about making sure windows formats the partition is correct and who ever put in the part about fat32format is in error.
The Slackware DVD chokes with no keyboard just like it does on some regular x86 boxes. Wish he'd fix that. So I used a gentoo minimal 2006.1 livecd only I hacked it to have the entire slackware/ directory on the root of the CD. There is only one drive on the macbook pro and gentoo will not relinquish it seeing as how we are running off of it. I suppose you could put it on your NTFS or HFSPLUS partition. That's assuming the gentoo cd has support for them in the kernel. I would imagine it does.
I'm recalling this from memory but it should still be spot on.
13. installpkg -root . /mnt/cdrom/slackware/ap/*.tgz
and so on and so forth until you install all the package sets that you want. NOTE: bind-* in series n/ choked on me. It just hung there with the install script so I did a ctrl+c and
"cp -R /mnt/cdrom/slackware/n /root"
"rm -rf /root/n/bind-*"
"installpkg -root . /root/n/*.tgz"
20. make oldconfig
If you used the 2.6.17 config, you'll have some answers to dish out. Maybe you should use the 2.6.18 config instead, unless you know what the new options are.
21. make menuconfig
Add reiserfs support as built in. Look around while your here but be carefull.
boot=/dev/sda3
timeout=5
default=Linux
image=/boot/vmlinuz
## Uncomment the next line if your MacBook locks up
## during boot with an APIC-related error message
## or if you see strange keyboard problems (double-chars).
#append="noapic acpi=force irqpoll"
## If using elilo to boot, enable the FB_MAC kernel option
## and use the below append option:
#append="video=imacfb:i17"
## If using refit/lilo to boot, then use this instead:
vga=791
label= Linux
read-only
root=/dev/sda3
35. pkgtool (run some setup scripts if you wish. Stuff like gpm and whatnot)
36. mount proc /proc -t proc
37. /sbin/lilo
38. exit
39. reboot
Now boot into MacOSX and do the part about cp'ing the elilo/efi folder to the root of your OSX partition.
Now you should be triple booting. I'm having a hell of a time with getting the synaptics touchpad going and madwifi... It should be a pre-n Atheros 5008 series which isn't supported yet acording to madwifi's compat list. SVN/CVS is my next stop.
Oh... Build evdev as a module and not built in otherwise you get no /dev/input/event* nodes. There are a few other gotchas and most of them revolve around the damn kernel .config. /proc/bus/input/devices lists "apple touchpad" crap so synaptics is choking on me when I try to startx with my xorg.conf. Getting really frustrated between synaptics and my non-existent ath0...
I used Xorg -configure for my initial xorg.conf. The mouse was whacky and only covered the right side of the screen. I switched the protocol to IMPS/2 and startx works. usbmouse module siezes control of the touchpad so we have no right click. One of the reasons why I'm working on synaptics. Supposedly xmodmap can be used to remap the keys to have a right click and middle click button but the only examples I've found are for a german keyboard.
It's all still quite the mess on the Linux front. I fully expect to still be screwing with it a week or 2 from now. I'll do a more detailed walk-thru once I figure everything out... I haven't even gotten around to messing with ATI's drivers tho I hear they work. I'm still stuck at a console because I have no right click (fluxbox rendered useless)... :-) At an ugly-huge-font console at that! Frustrating. So much work to do it's not even funny.
The prefix in Makefile is already set to /usr/X11R6 so just do a make and then make install. Or make a slak-pak if you wish. I never use middle click and only right click so this is what I did.
Code:
xmodmap -e 'keycode 116 = Pointer_Button3'
xkbset m
That gives me a right click on the right apple key. Have that start up with your xsession some how. I use Gnome so I'll probably just add the above lines to a new file in /usr/bin and then add the new script command to my startup session list.
The touchpad is still really senstive for "fine tuned" work. It jumps too much when you want to move it just a hair. All this is temporary I suppose until I can figure out synaptics.
Next thing on my TODO list is to ditch the 25' CAT5 cable going thru my living room and dining room.
Code:
#!/bin/sh
CWD=`pwd`
TMP=/tmp
PKGNAME=xkbset
PKG=$TMP/package-$PKGNAME
VERSION=0.5
PKGVER=${VERSION}
ARCH=i486
BUILD=1
CFLAGS="-march=i486 -mtune=i686 -pipe -O2"
rm -rf $PKG
mkdir -p $PKG/{install,usr/X11R6/{bin,man/man1}}
cd $TMP
echo
echo "$PKGNAME-$VERSION source is now extracting..."
rm -rf $PKGNAME-$VERSION
tar xzf $CWD/$PKGNAME-$VERSION.tar.gz
cd $PKGNAME-$VERSION
chown -R root.root .
make
make install DESTDIR=$PKG
# Compress and strip
gzip -9 $PKG/usr/X11R6/man/man?/*.?
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null )
# Make the package description:
cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler---------------------------------------------------------|
xkbset: xkbset (XKB modifier)
xkbset:
xkbset: This is a program to help manage many of the XKB features of X window.
xkbset: This includes such features as MouseKeys, AccessX, StickyKeys,
xkbset: BounceKeys, and SlowKeys. It includes a gui program to help with
xkbset: MouseKeys acceleration management.
xkbset:
xkbset:
xkbset:
xkbset:
xkbset:
EOF
# Build the package:
cd $PKG
makepkg -l y -c n $TMP/$PKGNAME-$PKGVER-$ARCH-$BUILD.tgz
Oh, and the ATI drivers work just fine, for the most part anyway. glxgears only reports in the 200's tho... But atleast I DO have hardware accel now.. I'll fine tune that stuff later.
UPDATE 12-02-06
I upgraded to the latest ATI drivers and now I'm getting in the 3,600 range for glxgears and in the 700's for fgl_glxgears. They must have just fixed something in the latest drivers. Don't know. The version I'm using that works is:
ati-driver-installer-8.31.5-x86.x86_64.run
UPDATE 01-11-07
If your using Bootcamp/Windows you'll probably want to ditch apple's ATI drivers and use these instead:
Finally got the synaptics drivers to work. Apple shipped a new revision of touchpads with the latest Core 2 Duo Notebooks. Atleast they did on the 15".... It was staring me in the face the whole time too. Check the output of /proc/bus/input/devices and look for the product number on the entry that coresponds to the 'mouse handler'.... Mine listed "Product=021a" but if you check /usr/src/linux-2.6.18.2/drivers/usb/input/appletouch.c it lists
Code:
#define GEYSER3_JIS_PRODUCT_ID 0x0219
Change the 0x0219 to 0x021A, recompile your kernel, reboot and now you have the synaptics driver being registered. Also, if you used the usbhid.patch from mactel's SVN 2.6.18 directory, change that as well.
The 2 finger tap for right-click is pretty nice. I also left my xmodmap settings in place so I can still use the right apple key...
Here is my xorg.conf so far. The touchpad's "jumpyness" is gone now that synaptics is being used. You can get the pointer on small things alot better. The only issue I'm having now with it is, if you VERY lightly put your finger on the touchpad and then try to move the pointer, nothing happens. I've never used the synaptics driver before but I'm hoping that can be fixed with one of the options in xorg.conf. It's fairly pronouced so NEEDS to be adjusted.
Isn't that what this is? The wiki might be a good place for it but expierence here shows that people tend not to check it and ask on the forums anyway. I spent alot of time adding audio conversion scripts to the wiki a year or two ago and people still post "How do I convert a .wav to mp3?" We'll see. Google should catch this on it's next crawl.. That'll help tremendously.
They are pretty pricey, but man.... You can run Unix, Linux, OSX, Windows and Solaris on this thing. I see no need for any other platform now that Apple went with intel. I feel bad for spending so much time in Linux tho. I've hardly used OSX at all.
As for the touchpad options, do a "man synaptics" and that clears a few things up. Pretty confusing at first but keep reading. My problem with 'touches' not being registered were due to the FingerLow and FingerHigh options. Decrease them and it's better. I put FingerLow on 0 and it still doesn't register an event if I'm soft on the touchpad. Guess I'll have to live with it. I also adjusted ALL *Edge options to encompass the entire touchpad. I don't use RightEdge or BottomEdge scrolling so might as well have the entire touchpad used. Do a "synclient -m 1" to see the cordinates of any given 'touch' event.
Next stop. Wireless.
Code:
#!/bin/sh
#
# http://web.telia.com/~u89404340/touchpad/
CWD=`pwd`
TMP=/tmp
PKGNAME=synaptics
PKG=$TMP/package-$PKGNAME
VERSION=0.14.6
PKGVER=${VERSION}
ARCH=i486
BUILD=1
rm -rf $PKG
mkdir -p $PKG/install
cd $TMP
echo
echo "$PKGNAME-$VERSION source is now extracting..."
rm -rf $PKGNAME-$VERSION
tar xjf $CWD/$PKGNAME-$VERSION.tar.bz2
cd $PKGNAME-$VERSION
chown -R root.root .
sed -i 's@/usr/local@/usr/X11R6@' Makefile
make
make install DESTDIR=$PKG
# Compress and strip
gzip -9 $PKG/usr/X11R6/man/man?/*.?
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null )
# Make the package description:
cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler-----------------------------------------------------|
synaptics: synaptics (touchpad driver)
synaptics:
synaptics: This is a driver for the Synaptics TouchPad for XOrg/XFree86 4.x.
synaptics: A Synaptics touchpad by default operates in compatibility mode by
synaptics: emulating a standard mouse. However, by using a dedicated driver,
synaptics: more advanced features of the touchpad becomes available.
synaptics:
synaptics:
synaptics:
synaptics:
synaptics:
EOF
# Build the package:
cd $PKG
makepkg -l y -c n $TMP/$PKGNAME-$PKGVER-$ARCH-$BUILD.tgz
O.K... More stuff done. I have the LCD brightness up/down keys working, Keyboard Backlight off/on/halfway keys working and I have the eject key working... Here is a build script. I got a little carried away with it. I put the option to build xkbset as well along with autoconfiguring everything for you (if you use gnome). Read it for more info. The only thing I need to add to the script is handling the volume up/down/mute keys...
Code:
#!/bin/sh
#
# Let's incorporate macbook-tools and xbindkeys into the same package.
# You can also add XKBSET and automatic right-click/right-apple-key support (gnome)
#
# http://www.boichat.ch/nicolas/macbook-tools/
# http://hocwp.free.fr/xbindkeys/xbindkeys.html
# http://www.math.missouri.edu/~stephen/software/
CWD=`pwd`
TMP=/tmp
PKGNAME=macbook-tools
PKG=$TMP/package-$PKGNAME
MACBOOKTOOLS=0.1.1
XBINDKEYS=1.7.3
XKBSET=0.5
PKGVER=${MACBOOKTOOLS}
ARCH=i486
BUILD=1
# Make sure XKBSET is correct in the script below:
# I don't think you can sed a variable...
MAC_PREFIX=/usr
CFLAGS="-march=i486 -mtune=i686 -pipe -O2"
# This part is rather unorthodox so we'll use it as an option.
# Not a big fan of multiple packages and manual configuration. :-)
# Scroll down some to see what it does.
INSTALLXKBSET=yes
HOMEDIR=/root
rm -rf $PKG
mkdir -p $PKG/{install,$MAC_PREFIX/{bin,doc/macbook-tools-$MACBOOKTOOLS}}
cd $TMP
echo
echo "macbook-tools-$MACBOOKTOOLS source is now extracting..."
rm -rf macbook-tools-$MACBOOKTOOLS
tar xjf $CWD/macbook-tools-$MACBOOKTOOLS.tar.bz2
cd macbook-tools-$MACBOOKTOOLS
chown -R root.root .
make
install -m 755 -o root -g root applesmc $PKG/$MAC_PREFIX/bin
install -m 755 -o root -g root backlight $PKG/$MAC_PREFIX/bin
cd $TMP
echo
echo "xbindkeys-$XBINDKEYS source is now extracting..."
rm -rf xbindkeys-$XBINDKEYS
tar xzf $CWD/xbindkeys-$XBINDKEYS.tar.gz
cd xbindkeys-$XBINDKEYS
chown -R root.root .
# It's crapping out on guile. We don't need it anyway.
./configure --prefix=$MAC_PREFIX \
--disable-guile
make
make install DESTDIR=$PKG
# Add a wrapper script for eject:
cat << EOF > $PKG/$MAC_PREFIX/bin/maceject
#!/bin/sh
if mount | grep /dev/hda 2>/dev/null 1>/dev/null ;then
umount /dev/hda
fi
eject /dev/hda
EOF
chmod 755 $PKG/$MAC_PREFIX/bin/maceject
# Add a wrapper script for mount:
#!/bin/sh
cat << EOF > $PKG/$MAC_PREFIX/bin/macmount
#!/bin/sh
if ! mount | grep /dev/hda 2>/dev/null 1>/dev/null ;then
mount /dev/hda /mnt/cdrom
fi
EOF
chmod 755 $PKG/$MAC_PREFIX/bin/macmount
# Throw a ~/.xbindkeysrc and README in /usr/doc
# We could also put .xbindkeysrc in $PKG/etc/skel...
cat << EOF > $PKG/$MAC_PREFIX/doc/macbook-tools-$MACBOOKTOOLS/.xbindkeysrc
###########################
# xbindkeys configuration #
###########################
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# To specify a key, you can use 'xbindkeys --key' or
# 'xbindkeys --multikey' and put one of the two lines in this file.
#
# The format of a command line is:
# "command to start"
# associated key
#
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier:
# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# The release modifier is not a standard X modifier, but you can
# use it if you want to catch release events instead of press events
# By defaults, xbindkeys does not pay attention with the modifiers
# NumLock, CapsLock and ScrollLock.
# Uncomment the lines above if you want to pay attention to them.
#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable
# Run "xbindkeys --multikey" for the keycode of multiple key presses
# Run "xbindkeys --key" for the keycode of a single key press
#################
# Mac Book Pro: #
#################
# [fn]+[F1] Lower LCD backlight by a factor of 10
"backlight -10"
m:0x0 + c:67
# [fn]+[F2] Raise LCD backlight by a factor of 10
"backlight +10"
m:0x0 + c:68
# [fn]+[F8] Turn Keyboard backlight OFF
"applesmc 0"
m:0x0 + c:74
# [fn]+[F9] Turn Keyboard backlight ON HALFWAY
"applesmc 127"
m:0x0 + c:75
# [fn]+[F10] Turn Keyboard backlight ON all the way
"applesmc 255"
m:0x0 + c:76
# Top right eject key ( next to [F12] )
"maceject"
m:0x0 + c:204
# Might as well have a mount key too for us non-hal users [F12]
"macmount"
m:0x0 + c:96
##################################
# End of xbindkeys configuration #
##################################
EOF
cat << EOF > $PKG/$MAC_PREFIX/doc/macbook-tools-$MACBOOKTOOLS/README
The sample .xbindkeysrc in this directory is for Macintosh
computers. It was specifically made for a MacBook Pro. To
use it, copy it to your home directory and then have "xbindkeys"
start up with your xsession.
With Gnome use:
Desktop --> Preferences --> Sessions --> Startup Programs
If you opted to use the INSTALLXKBSET variable in the build script
then you shouldn't have to do any configuring. It will just
work the next time you start your X server (if running Gnome). Not
only will LCD Backlight, Keyboard Backlight and the eject key work,
but your right apple key will function as a right click too.
EOF
# I'm lazy. And prefer monolithic packages. If they have ANYTHING
# to do with each other then why not clump them all together?
# You should see my Python build script.... :-)
if [ "$INSTALLXKBSET" = "yes" ]; then
mkdir -p $PKG/$MAC_PREFIX/{bin,man/man1}
cd $TMP
echo
echo "xkbset-$XKBSET source is now extracting..."
rm -rf xkbset-$XKBSET
tar xzf $CWD/xkbset-$XKBSET.tar.gz
cd xkbset-$XKBSET
chown -R root.root .
if [ "$MAC_PREFIX" = "/usr" ]; then
sed -i 's@usr/X11R6@usr@' Makefile
fi
make
make install DESTDIR=$PKG
# Wrapper script:
cat << EOF > $PKG/$MAC_PREFIX/bin/right-click
#!/bin/sh
xmodmap -e 'keycode 116 = Pointer_Button3'
xkbset m
EOF
chmod 755 $PKG/$MAC_PREFIX/bin/right-click
# Throw the xbindkeys config in your home directory:
mkdir -p $PKG/$HOMEDIR/.config/autostart
cp $PKG/$MAC_PREFIX/doc/macbook-tools-$MACBOOKTOOLS/.xbindkeysrc $PKG/$HOMEDIR
# Now add both startup programs to Gnome:
cat << EOF > $PKG/$HOMEDIR/.config/autostart/xbindkeys.desktop
[Desktop Entry]
Name=xbindkeys
Encoding=UTF-8
Version=1.0
Exec=$MAC_PREFIX/bin/xbindkeys
X-GNOME-Autostart-enabled=true
EOF
cat << EOF > $PKG/$HOMEDIR/.config/autostart/right-click.desktop
[Desktop Entry]
Name=right-click
Encoding=UTF-8
Version=1.0
Exec=$MAC_PREFIX/bin/right-click
X-GNOME-Autostart-enabled=true
EOF
fi
# Compress and strip
gzip -9 $PKG/$MAC_PREFIX/man/man?/*.?
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null )
# Make the package description:
cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler-------------------------------------------------|
macbook-tools: macbook-tools (MacBook Tools)
macbook-tools:
macbook-tools: Utilities for Apple MacBook and MacBook Pro. It contains the
macbook-tools: backlight tool for screen backlight handling and the applesmc
macbook-tools: tool for keyboard backlight, light and motion sensors. This
macbook-tools: package also contains 'xbindkeys' to use the above mentioned
macbook-tools: utilities from their respective function keys on the keyboard.
macbook-tools:
macbook-tools: Read $MAC_PREFIX/doc/macbook-tools-$MACBOOKTOOLS/README for more info.
macbook-tools:
macbook-tools:
EOF
# Build the package:
cd $PKG
makepkg -l y -c n $TMP/$PKGNAME-$PKGVER-$ARCH-$BUILD.tgz
EDIT 11-27-06
Here is a crazy new macbook-tools build script. It now also has 'coretemp', 'hddtemp' and 'cpufreq' which is a wrapper script I wrote to overcome some problems I was having with adjusting the speed of the 2nd processor. Jump to the second page to read more about that.
Code:
#!/bin/sh
#
# Let's incorporate macbook-tools and xbindkeys into the same package.
# You can also add XKBSET and automatic right-click/right-apple-key support (gnome).
# This also comes with 'coretemp', 'hddtemp' and a wrapper script for
# cpufreq-selector called 'cpufreq'...
#
# http://www.boichat.ch/nicolas/macbook-tools/
# http://hocwp.free.fr/xbindkeys/xbindkeys.html
# http://www.math.missouri.edu/~stephen/software/
# http://svn.sourceforge.net/viewvc/mactel-linux/trunk/tools/temperature/
# http://www.guzu.net/linux/hddtemp.php
CWD=`pwd`
TMP=/tmp
PKGNAME=macbook-tools
PKG=$TMP/package-$PKGNAME
MACBOOKTOOLS=0.1.1
XBINDKEYS=1.7.3
XKBSET=0.5
HDDTEMP=0.3-beta15
PKGVER=${MACBOOKTOOLS}
ARCH=i486
BUILD=1
# Make sure XKBSET is correct in the script below:
# I don't think you can sed a variable...
X11_PREFIX=/usr/X11R6
CFLAGS="-march=i486 -mtune=i686 -pipe -O2"
# This part is rather unorthodox so we'll use it as an option.
# Not a big fan of multiple packages and manual configuration. :-)
# Scroll down some to see what it does. HOMEDIR is also used for
# the cpufreq part. Make sure it's set to your home dir.
INSTALLXKBSET=yes
HOMEDIR=/root
# Select the CPU frequency governer you wish to use. Available options are:
# performance, powersave, ondemand, conservative and userspace.
GOVERNER=ondemand
rm -rf $PKG
mkdir -p $PKG/{install,usr/{bin,doc/macbook-tools-$MACBOOKTOOLS}}
cd $TMP
echo
echo "macbook-tools-$MACBOOKTOOLS source is now extracting..."
rm -rf macbook-tools-$MACBOOKTOOLS
tar xjf $CWD/macbook-tools-$MACBOOKTOOLS.tar.bz2
cd macbook-tools-$MACBOOKTOOLS
chown -R root.root .
make
install -m 755 -o root -g root applesmc $PKG/usr/bin
install -m 755 -o root -g root backlight $PKG/usr/bin
cd $TMP
echo
echo "Building coretemp..."
gcc -o coretemp $CWD/coretemp.c
strip coretemp
install -m 755 -o root -g root coretemp $PKG/usr/bin
rm -rf coretemp
cd $TMP
echo
echo "hddtemp-$HDDTEMP source is now extracting..."
rm -rf hddtemp-$HDDTEMP
tar xjf $CWD/hddtemp-$HDDTEMP.tar.bz2
cd hddtemp-$HDDTEMP
chown -R root.root .
./configure --prefix=/usr
make
make install DESTDIR=$PKG
if [ ! -f $PKG/usr/share/misc/hddtemp.db ]; then
mkdir -p $PKG/usr/share/misc
if [ ! -f $CWD/hddtemp.db ]; then
( cd $PKG/usr/share/misc
wget http://www.guzu.net/linux/hddtemp.db )
else
install -m 644 -g root -o root $CWD/hddtemp.db $PKG/usr/share/misc
fi
fi
cd $TMP
echo
echo "xbindkeys-$XBINDKEYS source is now extracting..."
rm -rf xbindkeys-$XBINDKEYS
tar xzf $CWD/xbindkeys-$XBINDKEYS.tar.gz
cd xbindkeys-$XBINDKEYS
chown -R root.root .
# It's crapping out on guile. We don't need it anyway.
./configure --prefix=$X11_PREFIX \
--disable-guile
make
make install DESTDIR=$PKG
# Add a wrapper script for eject:
cat << EOF > $PKG/usr/bin/maceject
#!/bin/sh
if mount | grep /dev/hda 2>/dev/null 1>/dev/null ;then
umount /dev/hda
fi
eject /dev/hda
EOF
chmod 755 $PKG/usr/bin/maceject
# Add a wrapper script for mount:
cat << EOF > $PKG/usr/bin/macmount
#!/bin/sh
if ! mount | grep /dev/hda 2>/dev/null 1>/dev/null ;then
mount /dev/hda /mnt/cdrom
fi
EOF
chmod 755 $PKG/usr/bin/macmount
# Throw a ~/.xbindkeysrc and README in /usr/doc
# We could also put .xbindkeysrc in $PKG/etc/skel...
cat << EOF > $PKG/usr/doc/macbook-tools-$MACBOOKTOOLS/.xbindkeysrc
###########################
# xbindkeys configuration #
###########################
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# To specify a key, you can use 'xbindkeys --key' or
# 'xbindkeys --multikey' and put one of the two lines in this file.
#
# The format of a command line is:
# "command to start"
# associated key
#
#
# A list of keys is in $X11_PREFIX/include/X11/keysym.h and in
# $X11_PREFIX/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier:
# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# The release modifier is not a standard X modifier, but you can
# use it if you want to catch release events instead of press events
# By defaults, xbindkeys does not pay attention with the modifiers
# NumLock, CapsLock and ScrollLock.
# Uncomment the lines above if you want to pay attention to them.
#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable
# Run "xbindkeys --multikey" for the keycode of multiple key presses
# Run "xbindkeys --key" for the keycode of a single key press
#################
# Mac Book Pro: #
#################
# [fn]+[F1] Lower LCD backlight by a factor of 10
"backlight -10"
m:0x0 + c:67
# [fn]+[F2] Raise LCD backlight by a factor of 10
"backlight +10"
m:0x0 + c:68
# [fn]+[F8] Turn Keyboard backlight OFF
"applesmc 0"
m:0x0 + c:74
# [fn]+[F9] Turn Keyboard backlight ON HALFWAY
"applesmc 127"
m:0x0 + c:75
# [fn]+[F10] Turn Keyboard backlight ON all the way
"applesmc 255"
m:0x0 + c:76
# Top right eject key ( next to [F12] )
"maceject"
m:0x0 + c:204
# Might as well have a mount key too for us non-hal users [F12]
"macmount"
m:0x0 + c:96
##################################
# End of xbindkeys configuration #
##################################
EOF
cat << EOF > $PKG/usr/doc/macbook-tools-$MACBOOKTOOLS/README
The sample .xbindkeysrc in this directory is for Macintosh
computers. It was specifically made for a MacBook Pro. To
use it, copy it to your home directory and then have "xbindkeys"
start up with your xsession.
With Gnome use:
Desktop --> Preferences --> Sessions --> Startup Programs
If you opted to use the INSTALLXKBSET variable in the build script
then you shouldn't have to do any configuring. It will just
work the next time you start your X server (if running Gnome). Not
only will LCD Backlight, Keyboard Backlight and the eject key work,
but your right apple key will function as a right click too.
EOF
# Wrapper script for cpufreq-selector and GNOME autostart:
cat << EOF > $PKG/usr/bin/cpufreq
#!/bin/sh
#
# This is a wrapper script for 'cpufreq-selector'.
# The second processor doesn't respond to user calls via
# applets or directly thru cpufreq-selector. It's a hack
# to set both procs with the same governer at once.
CLONE="cp /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor"
# Load all the modules:
if ! lsmod | grep speedstep_centrino 2>/dev/null 1>/dev/null ;then
modprobe speedstep_centrino > /dev/null 2>&1
modprobe cpufreq_conservative > /dev/null 2>&1
modprobe cpufreq_ondemand > /dev/null 2>&1
modprobe cpufreq_powersave > /dev/null 2>&1
modprobe cpufreq_userspace > /dev/null 2>&1
modprobe cpufreq_stats > /dev/null 2>&1
modprobe freq_table > /dev/null 2>&1
fi
case "@1" in
performance)
cpufreq-selector -c 0 -g performance
@CLONE
;;
powersave)
cpufreq-selector -c 0 -g powersave
@CLONE
;;
ondemand)
cpufreq-selector -c 0 -g ondemand
@CLONE
;;
conservative)
cpufreq-selector -c 0 -g conservative
@CLONE
;;
userspace)
cpufreq-selector -c 0 -g userspace
@CLONE
;;
*)
echo "Usage: @0 {performance|powersave|ondemand|conservative|userspace}"
exit 1
;;
esac
EOF
sed -i 's/@/$/' $PKG/usr/bin/cpufreq
chmod 755 $PKG/usr/bin/cpufreq
mkdir -p $PKG/$HOMEDIR/.config/autostart
cat << EOF > $PKG/$HOMEDIR/.config/autostart/cpufreq.desktop
[Desktop Entry]
Name=cpufreq
Encoding=UTF-8
Version=1.0
Exec=/usr/bin/cpufreq $GOVERNER
X-GNOME-Autostart-enabled=true
EOF
# I'm lazy. And prefer monolithic packages. If they have ANYTHING
# to do with each other then why not clump them all together?
# You should see my Python build script.... :-)
if [ "$INSTALLXKBSET" = "yes" ]; then
mkdir -p $PKG/$X11_PREFIX/{bin,man/man1}
cd $TMP
echo
echo "xkbset-$XKBSET source is now extracting..."
rm -rf xkbset-$XKBSET
tar xzf $CWD/xkbset-$XKBSET.tar.gz
cd xkbset-$XKBSET
chown -R root.root .
if [ "$X11_PREFIX" = "/usr" ]; then
sed -i 's@usr/X11R6@usr@' Makefile
fi
make
make install DESTDIR=$PKG
# Wrapper script:
cat << EOF > $PKG/usr/bin/right-click
#!/bin/sh
xmodmap -e 'keycode 116 = Pointer_Button3'
xkbset m
EOF
chmod 755 $PKG/usr/bin/right-click
# Throw the xbindkeys config in your home directory:
mkdir -p $PKG/$HOMEDIR/.config/autostart
cp $PKG/usr/doc/macbook-tools-$MACBOOKTOOLS/.xbindkeysrc $PKG/$HOMEDIR
# Now add both startup programs to Gnome:
cat << EOF > $PKG/$HOMEDIR/.config/autostart/xbindkeys.desktop
[Desktop Entry]
Name=xbindkeys
Encoding=UTF-8
Version=1.0
Exec=$X11_PREFIX/bin/xbindkeys
X-GNOME-Autostart-enabled=true
EOF
cat << EOF > $PKG/$HOMEDIR/.config/autostart/right-click.desktop
[Desktop Entry]
Name=right-click
Encoding=UTF-8
Version=1.0
Exec=/usr/bin/right-click
X-GNOME-Autostart-enabled=true
EOF
fi
# Compress and strip
gzip -9 $PKG/$X11_PREFIX/man/man?/*.?
gzip -9 $PKG/usr/man/man?/*.?
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null )
# Make the package description:
cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler-------------------------------------------------|
macbook-tools: macbook-tools (MacBook Tools)
macbook-tools:
macbook-tools: Utilities for Apple MacBook and MacBook Pro. It contains:
macbook-tools:
macbook-tools: backlight - Screen backlight handling
macbook-tools: applesmc - Keyboard backlight, light and motion sensors
macbook-tools: xbindkeys - Maps the above utilities to their respective keys.
macbook-tools: coretemp - CPU temperature
macbook-tools: hddtemp - Hard drive temperature
macbook-tools: cpufreq - Wrapper script for cpufreq-selector
macbook-tools:
EOF
# Build the package:
cd $PKG
makepkg -l y -c n $TMP/$PKGNAME-$PKGVER-$ARCH-$BUILD.tgz
Here is a listing of $CWD incase your confused about all the crap...
Figured out how to get a higher res on the frame buffer along with the 2 penguins up top. The Gentoo LiveCD Spalsh worked so I booted that up and looked at it's dmesg to see what it was using.
Get into the Graphics section of your kernel config and disable
Intel-based Macintosh Framebuffer Support
and just use the regular old vesa FB by specifying vga=791 in lilo.conf.
UPDATE 11-27-06
append="video=imacfb:i17"
is used for elilo. If your using refit/lilo then use vga=791
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.