| The TrickMe page,
the one with the tricks. |
The Kernel Source Tree This paragraph is based on the Linux Format magazine, September 2003 issue. In general, distros come with generic precompiled kernels, usually set to run in processor families, and not for specific processors. This setting does not have to be modified unless you want to improve the performance of your system. Although it's not necessary to compile another kernel, the source tree must be configured, in order to be able to compile for example: Alsa (Advanced Linux Sound Architecture) source packages Modules from your graphics card vendor Winmodem (software modem) modules The kernel sources can be in /usr/src/linux as a soft link to a specific directory like /usr/src/linux-2.4.20 in my system. To find where the soft link points to, use ls -l. Type for example: ls -l /usr/src/linux to find out about yours. Then find the configuration file with the help of which the precompiled kernel in use is made. ls -l /boot/vmlinuz The output in my system is: lrwxrwxrwx 1 root root 18 Aug 30 03:58 /boot/vmlinuz -> vmlinuz-ide-2.4.20 So, in my system the conf. file is: /boot/config-ide-2.4.20 The entire process in my system would be:
If you proceed to the next step, you will have a kernel compiled, but was not the initial purpose of this paragraph. But instead, you have just made a fully configured source tree. Congradulations. |
CD Burn Problem Remember, you can burn disks in an atapi cd rw if you have passed a parameter to the kernel: append="hdx=ide-scsi" Visit your /etc/lilo.conf: less /etc/lilo.conf (quits with q) hdx: x can be a,b,c,d. hda is the primary master ide or atapi device hdb " " primary slave " " " " hdc " " secondary master " " " " hdd " " secondary slave " " " " You can edit with: su -c 'pico /etc/lilo.conf' The paramener can go on top of the boot parameter. Here's mine: append="hdd=ide-scsi" boot = /dev/hda Then, call lilo su -c 'lilo' Once the parameter is added, the easy way is to reboot. If you know a smarter way, mail me :) But, do not expect to mount the device with it's original device name. For example, secondary slave is my cdwriter. The parameter: append="hdd=ide-scsi" is passed to the kernel. then the command: mount /dev/hdd /mnt/cdrecorder will return error. hdd is now an emulated scsi device. It's name is now sr0 or something like that. Create a soft link: ln -sf /dev/sr0 /dev/cdrecorder Change the device as appropriate, and see below my /etc/fstab line: /dev/cdrecorder /mnt/cdrecorder auto noauto,user,ro, 0 0 Keep in mind that a /dev/cdrom might already be present and it's a soft link to /dev/hdc if your cdrom/dvd is secondary master. Refer to Traime Page to create a cd. |
Booting DOS - Windows in a slave Hard Disk from Linux Using lilo, you can boot to other OSes rather easily. Unix, Linux, *BSD kernels generally need only to know which partition to mount as the "root" directory. Q: What about my Dos- Windows OS? A: Here is a sample lilo.conf section. other = /dev/hda1 label = Windows table = /dev/hda As you can see, nothing "complicated" has to be done for DOS- Windows located in the first patrition of a primary master hard disk. The partition would be named "C:" as a drive letter so things go smootly. But what if you "moved" the Windows disk to the position of a primary slave and put linux in your new primary master hard disk? In this case, nomatter the position of the Windows disk, it has to be named "C:" again to work properly. This is achieved easily by not having any partition recognizable from Windows before the hdb1 (First partition of the Primary Slave Hard Disk). Meaning Not FAT16 FAT32 NTFS BUT DOS- Windows in general, don't like to boot from a Slave Boot Record. The solution may be hard to find, but you will be surprized by how easy it is for lilo: other = /dev/hdb1 label = Windows map-drive = 0x80 to = 0x81 map-drive = 0x81 to = 0x80 table = /dev/hdb In this way, DOS-Windows9x think that the drives are inverted. Even if there is a FAT16-32 or NTFS partition in hda (primary master hard disk), it will be assigned to the "D:" drive. Using this tip. you can boot DOS- Windows OSes nomatter where they are located, using ONLY Lilo in the Master Boot Record of the Primary Master Hard Disk or the Floppy Disk. Q: I can do this from the BIOS also, right? A: I wouldn't go to the BIOS everytime I want to change Operating Systems.
|
Hard time with ide-scsi in kernel 2.6.+ This paragraph takes for granted that the kernel does not lack the scsi support after compilation. If so, kernel reconfiguration recompilation (and reinstallation) is necessary. Kernels 2.6.0 and above support native cd writing. Thus, properly configured cdrecord can write without additional scsi kernel support and xcdroast can - and will - scan and identify the device even if not configured in tne /etc/defaults/cdrecord. However, if we want (because I do), we can instruct the 2.6.+ kernel to use scsi emulation for the device. This is easily instructed as an "append" parameter in the Linux bootable partition section in /etc/lilo.conf:
Explanation: hdd is the secondary slave device. Change appropriately to: hdb the prinary slave hdc the secondary master according to the IDE "position" of our cd recorder Note: The device file for our cd recorder is not /dev/hdd anymore. It can be /dev/sr0 or /dev/scd0 So, we change the /dev/cdrecorder file which is actually a soft link, to the new adress: su <type the root passwd> ln -sf /dev/sr0 /dev/cdrecorder logout Note: in other distros, the name of the soft link might be /dev/cdrom2 or whatever. Difficulties: a) The device name does not work and /dev/hdd does not either. * Kernel might not have loaded the ide_scsi module. Sometimes, the kernel needs the sr_mod module too. Put these two commands in /etc/rc.d/rc.modules: /sbin/modprobe ide_scsi /sbin/modprobe sr_mod this line only if necessary. Relevant files in other distros might be in /etc/init.d. b) The modules are ok but devices do not work. * If you are using soft links, are they properly configured? * Try /dev/sr0 if /dev/scd0 does not work, or the opposite. * Did you try to mount an audio cd? It is normal for an error to happen if so. * Did you try eject /dev/sr0 or eject /dev/scd0 as root with the cdrecorder empty? If this works, you are closer than you think. * add to /etc/modules.conf: alias scsi_hostadapter ide-scsi alias scsi_cd ide-scsi options ide-cd ignore=hdc this last only if still not working c) Buffer underruns, input-output errors etc. * Try disabling dma and enabling 32 bit transfer: hdparm -c1d0 /dev/hdd as root, with the cd recorder in secondary slave position for example. ---- This paragraph to be continued ---- |
Trouble installing new KDE-3.3.1 and/or X11-6.8.1 in Slackware Note: Paragraph referring to current version of Slackware 10.* (back then). Not applicable in the present. In other words, upgrading our 10.0 distro with Kde and X11 packages from the "current". Answers on this issue may also help other Distro users. All Slackware mirror package locations will refer to the Heanet FTP server in Ireland. The difficulties are the following: New X11-6.8.1 will ask for the new Glib library packages. New X11-6.8.1 will have trouble operating with the older /etc/X11/xorg.conf file. New Kde-3.3.1 packages depend on: Arts-1.3.1 Qt-3.3.3 Libidn-0.5.8 Locations: If the top ftp location for Slackware-Current is: ftp://ftp.heanet.ie/mirrors/ftp.slackware.com/pub/slackware/slackware-current/ Then, the Kde (& international) and X11 packages lie in: slackware/kde slackware/kdei slackware/x And their dependencies (glibc, arts, qt, libidn) are the specific links: slackware/a/glibc-solibs-2.3.3-i486-2.tgz slackware/a/glibc-zoneinfo-2.3.3-noarch-2.tgz slackware/l/glib-1.2.10-i386-2.tgz slackware/l/glib2-2.4.7-i486-1.tgz slackware/l/glibc-2.3.3-i486-2.tgz slackware/l/glibc-i18n-2.3.3-noarch-2.tgz slackware/l/glibc-profile-2.3.3-i486-2.tgz slackware/l/arts-1.3.1-i486-1.tgz slackware/l/libidn-0.5.8-i486-1.tgz slackware/kde/qt-3.3.3-i486-3.tgz Notes: Every .tgz package has a .tgz.asc and .txt package, omitted here. Package versions will change frequently. First upgrade the glibc, arts and Qt packages and then install the new libidn package. Afterwards, install all the X11 and Kde packages. You do not need all the language packages from the kdei directory. Choose wisely. New Kde packages are not directly depended on new X11 packages. but why not upgrade tham both?
Making X work: If X now uses the old xorg.conf, it will have trouble with the keyboard module, which is now called "kbd" instead of "Keyboard", and probably with font locations. Be a superuser, make a xorg.conf backup and create one from scratch: su cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old X -configure cp /root/xorg.conf.new /etc/X11/xorg.conf Then, still as root, do all that is needed to make X work the way you want it. xorgcfg -textmode and change keyboard, mouse, resolution etc.etc. If your graphics card installer and/or tv tuner program make modifications in the X dir, do the installations again, and redo the manual xorg.conf modifications as needed. |
Slackware 10.1 sound problem Upgrading to Slackware 10.1 or installing anew, a weird problem might occur: Sound is missing allthough all the permissions in the /dev directory are ok. It appears that Alsa is not properly configured. Quick Solution: 1) Tell the Kde sound system preferences to stop using sound or exit the graphics environment. 2) Become root (su --login) or login as root in another terminal. 3) Run alsaconf, let it stop the modules, reconfigure itself, write modifications to /etc/modprobe.conf and finally fix the mixer settings. By the time the process ends, sound will be initialized. I did this even with Kde up and Arts daemon running. When all finished, the kmix icon changed to the healthy appearance in no time. Slow solution: Remove the alsa packages as root: removepkg alsa-driver-1.0.8_2.4.29-i486-1 alsa-lib-1.0.8-i486-1 \ alsa-oss-1.0.8-i486-1 alsa-utils-1.0.8-i486-1 Obtain the latest Alsa source packages Prepare the running Kernel' Source Tree (see paragraph inside the TrickMe page). Compile and install all packages, or at least alsa drivers and alsa libs. For the compilation process see the CompileMe page. |
Annoying Document relations toolbar This has happened first time in Slackware 10.1 but may be met in other distros too. When opening a new window or tab, not one but possibly many vertical toolbars appear without demand. The quickest fix is to do this: su rm /opt/kde/share/apps/khtml/kpartplugins/plugin_rellinks.rc exit But I would suggest to make a copy of it in a spare backup folder. |
Sound devices missing Without speaking of manual or automated device mechanism issues I will put it simply: Sometimes, even with a module properly loaded, the device file might be missing. Device files are essential as they provide interaction with the real devices through the kernel. In my case, the sequencer device /dev/snd/seq was missing, allthough the snd_seq and snd_seq_devices modules were properly loaded. So, Rosegarden crashed and burned many many times. The case here is simple: manually create the device with mknod. Allthough mknod can easily create popular devices (i.e. hdc), in the sound device case it needs specific parameters. The device has to be a Character or Block one and needs major and minor numbers for kernel recognition. First, let's see what sound devices exist: ls -l /dev/sound /dev/snd adsp* audio* dsp* mixer* Soft links will be shown. ----------------------------------------------------- Example of making a missing sequencer device as root: USE THE COMMANDS ONLY IF THESE DEVICES ARE MISSING. mknod -m 666 /dev/snd/seq c 116 1 mknod -m 666 /dev/snd/timer c 116 33 mknod -m 666 /dev/snd/midiC0D0 c 116 8 mknod -m 666 /dev/snd/controlC0 c 116 0 mknod -m 666 /dev/sound/adsp c 14 12 mknod -m 666 /dev/sound/audio c 14 4 mknod -m 666 /dev/sound/dsp c 14 3 mknod -m 666 /dev/sound/mixer c 14 0 ln -s /dev/sound/adsp /dev/adsp ln -s /dev/sound/audio /dev/audio ln -s /dev/sound/dsp /dev/dsp ln -s /dev/sound/mixer /dev/mixer Soft linking is necessary for applications to work properly. ------------------------------------------------------------ If all issues-devices were covered this paragraph would never end. I use full permissions for all users, but someone might change 666 to 660 and add a secondary audio group to users that would have access to sound. In multiple cards case, the dsp might change to dsp0. Then, dsp1 would need a different minor number and a soft link to the most used card device file would have to be created anyway. That's all. Searching in the net will answer to a wider range of issues. |
I know how to eject a cd, but how can I close the tray again? The command that unmounts (if necessary) and opens the cd tray is called "eject". eject /dev/hdc would unmount and open the secondary master removable drive. eject -t /dev/hdc will close the tray. If a cd is in, then we can mount it. So, if we add in the last line in /etc/profile as root: alias close='eject -t' then when we type "close" would be as if we typed "eject -t" Things to remember: 1) eject and umount will work if the device is not busy. 2) mount will also close an opened tray before mounting. 3) eject reads the /etc/fstab. eject -t /mnt/cdrom would close the opened tray. 4) Not all cd devices understand the eject's "close tray" command. 5) eject works with removable storage media in general. 6) Aliases are very useful in simplifying our work. |
Trouble starting the NFS Service. This paragraph expands the issue mentioned in SlackMe - Specific Issues paragraph. It is related to Slackware only as a problem. The solution is universal to most Linux distros. Slackware nowdays includes a handy "services" scripted tool for easily tweaking the basic configuration init files in /etc/rc.d. This can be found in pkgtools > Setup Choose Slackware installation scripts to run again. It is called simply "Services". However, there is a case where we may need to start the NFS server, where there are two rc scripts to be made executable but only one is mentioned in the "Services" tool. The mentioned one is called rc.portmap. The other needed one is called rc.nfsd. The nfsd is the NFS Daemon. In order to start and function though, the RPC (remote procedure call) service has to initialize too. The Slackware script lacks an option for the nfsd service. To make the solution more generic we will bypass the Slackware tool. We will make the two scripts executable and afterwards we will run them. su Password: <Type the root password> chmod a+x /etc/rc.d/rc.portmap chmod a+x /etc/rc.d/rc.nfsd /etc/rc.d/rc.portmap start /etc/rc.d/rc.nfsd start exit The scripts will run again next time our Linux box starts. For other distros now, remember that many times, instead of an /etc/rc.d directory, there might be an /etc/init.d with many subdirectories which are often soft links of a real one with scripts inside. Slackware or not, these scripts are made with the options "start - stop - restart", for convenience issues. Some scripts - like the SQL Server init script - are just very complicated. Designing scripts that accept the parameters mentioned above greatly simplifies management. The scripts usually check for configuration files related to the daemons. If these are not found - or found with comments - most usually the demons will not start. Remember that allthough Slackware favors manual configuration of the system, other distros rely heavily on complicated tools and wizards. In a non Slackware distro - even in one based on Slackware - use a manual solution only when other actions fail. |
Suse 10.0: Enabling wider features for media play. Suse is a fine distro that respects copyrights and media restrictions. Although having every right to do so for legal reasons, we may need to play video files as well as Dvds. Here is how: We will upgrade Xine (the backend), along with some prequisite packages as well as any frontend we may need, like kaffeine, gxine etc. I will present an example solution for the kaffeine frontend. A very fine repository for searching rpms for Suse is: http://packman.links2linux.org/ Search and install-upgrade these (some can be found in the Multimedia section): speex libvorbis w32codec-all libxine kaffeine If they are installed-upgraded in this order, there will be no package dependency problems. Q: How do I install-upgrade using rpm? A: Go into the directory you saved the packages and do: su <type the root password> rpm -U speex-1.1.10-0.pm.0.i686.rpm (for example) rpm -U ... (continue upgrading-installing) etc.etc. logout (after all is done) There is a slight possibility I have forgotten a package. If so, continue searching the site and upgrade as needed. Prefer the corresponding link for your distro version. |
Suse 10.0: Fixing XMMS inability to present and play mp3. Not that I understand how this has happened, but XMMS, although existing in the Suse packages, may not work well. Solution: There is a library for Mandriva (!!!) that fixes the XMMS problem in Suse. It is called xmms-mad-0.8-2mdk.i586.rpm (or something very similar). We will search it in http://rpm.pbone.net Go to advanced search, select only Mandriva 2006 and check the "Search for rpms by name" option. Download the corresponding to the CPU architecture package and install it. Congradulations. Your XMMS program now works. |
Suse 10.0: Frequent bug starting X in runlevel 3 Case Still being a distro for power users, Suse favors an easy to operate philosophy. While most often Suse users will have a graphics user interface to log into, some of them - including me - might prefer to change that and log into the consoles. This is easy. Either tweak with Suse tools, or go as root and edit /etc/inittab to change the default runlevel to 3 instead of 5. Then, issuing startx we will bring up our desktop. But when we log out of it to return to the console, a bug often happens: /usr/X11R6/bin/startx: line 272: 7485 Segmentation fault xauth remove $removelist and very often we have to press ctrl-c to free the terminal. When we reissue startx, we may find that X comes up but no desktop does. This is because the Xauthority* files have not been erased. Quick solution We locate startx. In my case its complete path is /usr/X11R6/bin/startx We logon as root and edit it: pico -w /usr/X11R6/bin/startx Near line 20, after the comments we add: echo removing previous X Authority files rm ~/.Xauthority* and save the file (this is done in pico with ctrl o) and close the editor (this is done in pico with ctrl x) That's it. No more startx bugs of this kind. |
I need to import KDE Mail into Mozilla There is also a paragraph for Windows Here. Mozilla Mail stores the mail folders as files, while KDE Mail most probably (according to the user initial decisions) will have the mail folders as directories under the ~/Mail dir in the user's home directory. First, open KMail and select each folder. Select all (or the ones you like) messages right click and choose "save as". Choose names like "OldInbox" , "OldSent" etc. In this way, each folder will be saved as file in the mbox format. Now find the Mozilla Mail dir. It is located at ~/.mozilla/default/b4785651.slt/Mail or something like that. Go into the "Local Folders" directory. You will find the "mail folder" files there. Move the files that KMail saved (OldInbox , OldSent) there and start (or close and restart) Mozilla. Mozilla Mail will adjust to the new findings and treat them as Mail Folders. From there, you can go into these folders, select all messages, move them to the appropriate ones (Inbox Sent etc.) and then delete the Old* folders and finally purge them from the Trash folder of Mozilla Mail. Or you can leave them there intact. As the import itself was successful, from here it's up to you. |
Trouble compiling/installing the NVidia module in Slackware 12 If we prepare the kernel source tree properly, then the NVidia installation package will not have any problem compiling and installing itself. Provided that we have already all the packages installed (kernel modules headers and source), we only need to follow the steps mentioned in the first paragraph of this page: The Kernel Source Tree I took a step further and issued (as root) also: make bzImage make modules This took a while but then the latest NVidia package for Linux completed all operations (check compile install depmod and configure X) without any pain. I didn't have to install the compiled kernel or modules. After the NVidia module installation it won't hurt to issue the command make clean to clean the source tree of all the compiled binaries. Notice: The compilation procedure might not be needed, but it appears that it builds everything, therefore even the files that the NVidia packager needs. So don't hesitate to spend sometime and do it, because this simple action made all the answers I found in the Internet obsolete. |
Problem with the PS/2 mouse and/or the pc speaker using the new Slackware kernel Dont worry too much if the plug'n play feature does not always work in some kernel versions. In Slackware we can solve problems using precise and elegant manual solutions. The modules are called psmouse , pcspkr. Add a selective kernel module loading condition in /etc/rc.d/rc.local like this: Selective kernel module loading_through scripts Add only the necessary modules and keep in mind that some kernel versions like 2.6.24.5-smp, are not just numbers. Using uname -r we learn the running kernel version. It is also good to check on the /etc/modprobe.d directory as the /etc/modprobe.conf file is deprecated. |
Problem upgrading Slackware 12.x to the 13th version Although Slackpkg can perform major upgrades transparently, Slackware 13.0 uses an additional compressing method: xz (compression utility based on the LZMA algorithm). Everything will be ok if we first enter the right mirror for 13.0, update slackpkg, install xz, upgrade pkgtools and finally upgrade slackpkg. Note: After the slackpkg upgrade, it might need to perform an additional update. So the steps would be as root: pico /etc/slackpkg/mirrors (issue here the proper mirror) slackpkg update slackpkg install xz slackpkg upgrade pkgtools slackpkg upgrade slackpkg slackpkg update ---- And then: ---- slackpkg install-new slackpkg upgrade-all slackpkg clean-system Caution: Upgrading the kernel will require invoking lilo and reinstalling all modules required like graphics card and virtualization modules. Clean-system is to clean up obsolete packages, but slackpkg will also show the ones that you might have installed manually to expand your system. You may also upgrade in steps like slackpkg upgrade kde I usually prefer this. Note: Slackpkg does not leave the downloaded packages by default, not does it wait to daownload all before upgrading. Slackpkg downloads a package, installs-upgrades and cleans up the downloaded one. |
Lilo Problem after upgrading to Slackware 13.1 13.1 main kernel's difference is that IDE and SATA hard disks are given the same name e.g. sdx instead of the older method hdx for IDE and sdx for SATA. For the solution comprehension, let's say that Slackware's root partition lies in hda1 (first partition of the first IDE drive). Anticipating the problem before the reboot: Issue ls -l /dev/root to be sure that the specific device is a soft link to the actual partition (e.g. /dev/hda1) If it exists, then check /etc/fstab to see that it has this device file for the root "/" mount. If not, edit the line from /dev/hda1 to /dev/root and comment "#" the other mounts that you may have, including cd/dvd readers-recorders. You will see that lilo can not respond to a new configuration because the kernel is still the old one. Lilo will check the boot and root options in /etc/lilo.conf. Add a menu option in lilo like this: image = /boot/vmlinuz # root = /dev/hda1 label = Migrating append = "root=/dev/sda1" read-only # Partitions should be mounted read-only for checking Be sure to comment the "root=" string. Lilo and the kernel will check for errors there. New kernel will panic with the old name, old kernel will return error with the new one. However, the append string will not be checked for errors. Have a reasonable countdown time setup in the configuration. On the boot time, select the "Migrating" option and there you are. Brand new kernel waiting for you. The /dev/root soft link will be pointing to /dev/sda1, so /etc/fstab will not give problems. After the boot, edit to correct /etc/lilo.conf changing boot and root options to /dev/sda1 and run lilo. Leave the "Migrating" menu just in case you make a mistake. Solving the problem after the reboot: Depending on lilo configuration, you may see a menu and reasonable countdown time. If you don't, then better boot with the Slackware cd/dvd installation media. 1) Reboot the computer with the Slackware 13.1 cd/dvd inside and give the option to the bios to boot from there, either by editing and saving the bios to do so, or bringing the option with a function key (like F12) on the bios boot screen. 1a) At the Slackware boot prompt, issue hugesmp.s root=/dev/sda1 initrd= ro and watch the kernel boot to your root partition. 1b) OR Boot all the way to the setup, login as root, issue mkdir /mnt/myroot ; mount /dev/sda1 /mnt/myroot && chroot /mnt/myroot to "goto" the root installation. Either way, edit to correct /etc/lilo/conf changing boot and root options to /dev/sda1 and run lilo. 2) Second solution, without a Slackware installation media, assuming that you see a boot option in lilo. Bring up the lilo prompt by pressing <TAB> and type "<menu option> root=/dev/sda1 ro" followed by enter. for example Slackware root=/dev/sda1 ro Additional tips: Hard disk drive device names will be in sequence because cd/dvd readers-recorders will have names like /dev/sr0 /dev/sr1 and so on. Therefore, you should check thoroughly your device names in /etc/fstab. That's why it's better to comment the other mounts before rebooting with the new kernel. Even cd/dvd mounts will return errors. Q: Why should I know the menu option thingie? A: Because there is a chance that the new kernel finds the disks in a completely different order, such cases being additional PCI IDE-SATA controllers etc. So, if you are unable to spot the correct name, hit the reset button and try again. |
RSS parser returns error for the & (ampersand) character. RSS is built on XML. XML has its own opinion about the & (ampersand) character. The reason is that in XML the characters <>&% are reserved. The workaround & or & instead of & doesn't work always, especially when we edit a raw xml file, because the RSS parser sees & as a symbol again (irony!) We could always avoid using "&" in titles and descriptions but we can't do so in links. Before opening our manuals to substitute "&" with its code in html, let's do a simpler solution: Problem: <link>http://www.tanea.gr/default.asp?pid=2&ct=4&artid=4621633</link> Solution: <link><![CDATA[http://www.tanea.gr/default.asp?pid=2&ct=4&artid=4621633 ]]></link> This way we tell the RSS parser to bypass/ignore the string! The <![CDATA[ string ]]> can work in titles, descriptions etc. So our entire RSS structure can benefit from the solution. And we address the issue with a more generic approach that can solve a wider range of parsing errors. Happy RSSing! |