HOWTO configure Slackware System+Userland
Posted by notKlaatu , 30 March 2008 · 35 views
If you're reading this, you've probably just read my HOWTO Install Slackware post. This article assumes you have read that. Or that you've managed to install Slackware on your own.First, have you rebooted after the install? Slackware doesn't force you to do this after you install, so be sure you do that before you start attempting to set up your system or else you'll be attempting to set up a system running on an installer disc.So reboot, and login as root using the passPHRASE you created whilst installing.Oh look you have mail! Type "mail" to read it._____________SYSTEM__________________________WIRELESS CARD DRIVER_________This where I can only do so much to explain things; getting wireless to work can be difficult because there are so many wireless cards out there and so few have linux drivers. I got a Centrino system, meaning that all internal parts of any great significance are intel. Intel happens to offer freely available drivers for Linux.On other machines, however, I have had to do weird firmware hacks. But interestingly, the concept is the same with both. The one thing I have never had to use is Ndiswrapper, so I can't help you there. But for firmware cutting explained, read my post about putting Fedora on an iBook. That was fun.The following example is what I had to do in Slackware 12. But if you are using certain wifi cards, such as the one in the example (the Intel 3945) then in Slackware 12.1 everything will work without much involvement from you. Oh, sure, you will have to bring the card up with ifconfig commands (later in this post) but in terms of installing the firmware and stuff like that, no worries, it's all included. You can find out if your card is already being recognized by typing in# iwconfigand see what results you get. If nothing, then your computer doesn't know you have a wireless card and you do need to install something. If, however, you get a result (most likely it will be called wlan0) then it is being seen by the kernel and you are free to get online.So here's what I did...and even though it might not be the same process for you, the steps are similar; find the drivers, figure out where the firmware blobs go in the system, compile the daemon, set up your default network.Because I had an Intel card, I found that the drivers I needed were included on the Slackware DVD in the "extra" directory, as were some very clear and helpful instructions (much more helpful than Intel’s documentation included with the drivers).A short break so you'll know how to mount discs:$ su(password)mount /dev/hda /media/cdromthe only variable there is the /dev/hda....I'm assuming the device name is /dev/hda. It might be /dev/hdc or /dev/sdb or anything. You can usually find that out with cfdisk -l Back to installing the drivers:1. Here's what you do:$ cd /tmp$ tar -xzf /media/cdrom/extra/intel-wlan-ipw3945-ucode-1.14.2.tgz$ cp ipw3945-ucode-1.14.2/ipw3945.ucode /lib/firmware/$ ls /lib/firmwareThe last step there will confirm that the blob got copied over. 2. Now we need to compile the module itself.$ pwd // where are we?/tmp // yep, we're still in tmp$ tar -xzf /media/cdrom/extra/intel-wlan-ipw3945/kernel-module/ipw3945-1.2.1.tar.gz$ cd ipw3945-1.2.1$ make$ make install3. Now we need to install the daemon$ pwd/tmp$ tar -xzf /media/cdrom/extra/intel-wlan-ipw3945/regulatory-daemon/ipw3945d-1.7.22.tgz$ cp ipw3945d-1.7.22/x86/ipw3945d /sbin$ ls /sbin | grep ipwAgain, the final command is to verify that the file successfully copied. I like visual verification.And that's it, that has caused all the components of a wireless card's drivers to be installed. In other cases it will be more difficult, in other cases different. But it's all pretty much the same idea; the code has to be present on the system, and it's nice to have some daemon keeping it all running._________GETTING NETWORKD_____________There are four important commands to know for basic networking:$ iwconfig# which is wireless-specific$ ifconfig# which is for all network devices$ modprobe# which loads a “module” into the kernel; in Mac terms, it would load an “Extension”.$ dhcpcd# which requests a dhcp address from the networkSo at this point, we could get online by doing this:$ su(password)$ modprobe ipw3945# which brings the module into the kernel.$ifconfig eth1up$ iwconfig eth1 essid XXXXX# assigns the card to a network; name is defined by me in the Airport Setup Utility% iwconfig eth1 channel 10# because I set my router to broadcast on Channel 10% iwconfig eth1 key XXXXXXX# where key = the HEX code (or whatever)...be aware that some brands (especially our friends at Apple) might have you make a password that is not really your key. There is sometims a button hidden away in your configuration app that will tell you what your key actually is. If at all possible, just avoid a router's configuration "wizards" and set the thing up yourself.% ifconfig eth1 up# to bring the network device up% dhcpcd eth1# to receive the DHCP information from the wireless router.___________AUTOMATING ONLINE-NESS________________The /etc/rc.d directory contains two kinds of files. There are rc.XXXXXX files, and there are rc.XXXXXX.conf files. The conf files are what we edit, providing data that will be read by the rc.XXXXX files, which are basically scripts themselves and are executed during bootup.The first thing to do is to tell the computer that there is a wireless card in existence.To do this, add to /etc/rc.d/rc.modules this:$ /sbin/modprobe ipw3945OK, that loaded the module or the Extension.The next thing to be loaded during bootup are the iwconfigThe default /etc/rc.d/rc.wireless.conf looked like this:INFO="Any ESSID"ESSID="Any";;And so I changed it to read:INFO="Any ESSID"ESSID="XXXXXX"KEY=XXXXXXXXX;;Now open up in vim or some text editor:/etc/rc.d/rc.inet1.confNotice that the variables reserved for eth1 (or whatever your wireless interface is being called) are all empty? So.. you'll need to plug in the numbers for:IPADDR (ip address)NETMASK (the usual 255.255.255.0and changeUSE_DHCP=""to read:USE_DHCP="yes"Save. If you want, you can reboot to see that you're now online automagically.___________________The hidden EXTRAS___________________There's a folder on that Slackware installer disc, and it's called "extra". They call it this because it's got extra stuff in it that you may or may not want to install. For me, the Intel wireless drivers were key. But just as useful are the slackpkg program and the mpg123 apps. These two packages, and more, are in the extra folder and are really easy to install. Why? because they're all slackpackages (.tgz)Please please please do NOT forget that Slackware actually has packages!! A lot of people think that it doesn't and for the longest time I used to fall pray to that misinformation. But installpkg is your friend! so use it!The way you use installpkg is simply to cd into the directory that contains the package you want to install, and type installpkg NameOfPackage.tgzSo it would be something like this:# mount /dev/hda /mnt/dvd# cd /mnt/dvd/extra/slackpkg # installpkg slackpkg-2.61-noarch-2.tgz______________USER LAND_______________OK.. we'll want to make a user or two. This is really easy; type in:adduserand follow the prompts; enter the username (all lowercase, 8 characters or shorter), userID (default should be fine), and so on.You'll be asked what group you'd like to add the user to. The defaults is "users" and that is good unless you know something about your setup that I don't.You can add the user to MORE groups next. You may want to add them to "sys" for permission to play sound through the internal sound card and things like that...and you may or may not want to add them to "wheel" for permission to use the su command.You can define what their home directory will be called; by default this is their username.Choose their default shell...the default is bash.Expiration date? probably not....and then you have one last chance to bail out, or you hit RETURN and the user is created!Are you sorry you added that user? Don't be; you can always use userdel to zap them later on.You'll be asked to add further info about the user, like their full name and contact information. And finally a passPHRASE for their account.So now that you have a user(s) created, you may as well stop being root. Type in exit, and re-log-in as yourself._________START X________________________-So now, if you want, you can start the GUI interface. As your normal user self, type in:startxYou should see a very basic X setup...TWM, I think. Whatever it is, it's a very basic windowmanager. You may wish to run some other window manager, and the great thing about Linux is that you can do just that! You can even have each different user have a different window manager depending on their preference. You can exit out of this X environment by typing in "exit" in each open xterm window. You'll be dropped back into a shell.To define which X environment starts when you type in "startx" you'll need to edit your xinitrc file, but instead of editing the system's xinitrc file, you can make a .xinitrc (note the preceding dot) file in a user's home folder so that when that user types in startx, the window manager of their choice will start, and not just the system's default.It's easiest to start from a template, and this template is the system's default xinitrc. So we'll copy that file to our home folder.The dollar signs here indicate a user prompt:klaatu@karl: $ cp /var/X11R6/xinit/xinitrc ./.xinitrcklaatu@karl: $ vim .xinitrcThis copies the configuration file to your home directory as a hidden file. The vim command obviously opens that file in vim text editor but you can use any text editor you like.Everything in this file is fine until the very bottom few lines; these lines are preceded by this comment: # start some nice programsIt then tells the computer that you want to start twm along with some xterms and an xclock. But you want to start KDE, don't you? Then get rid of those lines and add:exec startkdeThe beauty of this is that if you screw this up, you always have the system default to use as backup. And to change your preferred window manager, you can always edit this file! It's so easy!! Tell me you don't love Slackware now.By the way, to start some other window manager, you may have to find out what command that window manager uses to be started. XFCE for instance uses startxfce4 and fluxbox uses startfluxboxTo find out what exactly your window manager of choice uses, you can simply do this:klaatu@karl: $ ls /usr/bin/ | grep startor something like that; maybe grep enlightenment or openbox...whatever you're looking for. Or just pipe it through less and have a look at everything in your /usr/bin but eventually you'll find what you're looking for.So if you're starting KDE for the first time, you'll go through a Personalizer. It's easy and GUI and you can't possibly need me to tell you how to do it. _________________EVERYTHING ELSE___________________You can set your system up so that things are able to be mounted by certain people or not mounted by others, you can set up cron jobs, you can use svn or git or whatever, you can install stuff....and all that would be way too much to cover here. So keep looking through my posts for more HOWTO's on various Slackware and Linux related tasks. Be sure to read my documentation of the little app sbopkg to help you get lots of cool SlackBuilds!