Skip to main content

Posts

Grokking Linux Modules

A lot of the functionality of Linux is contained in the kernel modules. These small pieces of software link the Linux kernel to your hardware, but it's not all that easy to get information about them if you are having trouble with a particular module. The command lsmod will list all currently loaded modules. The command modinfo will list general information about a particular module. The command get_module will list specific information about a particular module as loaded in your kernel. My system was generating an error message about the shpchp module. To see what other modules might be associated with it: # lsmod | grep shpchp shpchp 33556 0 pci_hotplug 29476 1 shpchp To get the general information about the module: # modinfo shpchp filename: /lib/modules/2.6.27.5-desktop-2mnb/kernel/drivers/pci/hotplug/shpchp.ko.gz license: GPL description: Standard Hot Plug PCI Controller Driver author: Dan Zin...

Trusted Platform Module

TPM, or Trusted Platform Module can be used to authenticate computer hardware or protect encrypted disks. A HOWTO can be found here . The Wikipedia entry is here . TPM is supported only on devices that have TPM hardware support and is typically enabled in the BIOS. A guide to actually using TPM is included in the references.  It's mentioned here only because I was curious about it.I stumbled upon this while looking at the parameters for the libata module. It has an option named allow_tpm which, when enabled (it's disabled by default) permits the use of the TPM modules and functions. It can be enabled with an entry in /etc/modprobe.conf as: option libata allow_tpm=1 Do you have TPM support in your Linux kernel? If so, the modules will be listed with the command: # ls -la /lib/modules/`uname -r`/kernel/drivers/char/tpm If you are using TPM to secure your hard drive, it makes sense to use a bootloader that can access it. That bootloader would be TrustedGRUB, a mod...

Sharing an Internet Connection on Mandriva 2009.0

Sadly and frustratingly, the Mandriva Linux wizard intended to set up Internet sharing, drakgw , is broken* and has not been well maintained. Until they fix it, here's how to do it by hand, assuming that ppp0 is your Internet-facing connection and eth0 connects to your local LAN. Thanks in part to mheanre and the folks at TWUUG . 1. Mandriva uses shorewall as the default firewall. It needs to be told to pass the data we want to allow. Edit the contents of /etc/shorewall/policy to look like this: loc net ACCEPT fw loc ACCEPT fw net ACCEPT net all DROP info all all REJECT info loc $FW ACCEPT - 2. Set up ip-masquerade in the kernel: # echo 1 > /proc/sys/net/ipv4/ip_forward To make this permanent, add the following to /etc/sysctl.conf : net.ipv4.conf.default.forwarding = 1 3. Tell iptables to use NAT: # /sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE I found that I needed to add that line to the end of /etc...

DOS4GW.EXE Version 2.01a and Alternative DOS Extenders

DOS4GW.EXE The Tenberry DOS extender DOS4GW.EXE was used by many early DOS games. I still enjoy playing many of these games and DOS4GW.EXE is usable with DOSBox , so they can be played on Linux. However, the version of DOS4GW.EXE that was included with the game was whatever was current at the time. The most recent version that includes many bugfixes that possibly affected the games when used with DOSBox have been fixed in the latest version, 2.01a. It's not free at US$49, but you can downloaded it here . Simply substitute it for whatever version of DOS4GW.EXE your game provided and enjoy the bug-fixed goodness. Tenberry also makes a "high-performance" "pro" version of DOS4GW.EXE, but it costs $300. I think that they could sell quite a few of these to hobby users (since, you know, DOS is dead) for US$5. Open Souce to the Rescue There are better performing, free and Open Source alternatives available and worth a look. DPMI Explained Let's unders...

Mandriva urpmi

Mageia linux package management has added some enhancements to their urpmi tool. One of the newest is the ability to remove 'orphaned' packages from the system. Orphans are rpm packages that were installed as a dependency for some other package and said other package has been removed, but the orphan remains. The canonical source of information about urpmi can be found at the Mageia Wiki . The file /var/lib/rpm/installed-through-deps.list contains a list of packages installed indirectly and the package manager uses this list to determine 'orphans' when the follow command is run to remove orphans: # urpme --auto-orphans If you run that command and the list of orphans is incorrect (it wants to remove packages that you know should not be uninstalled), the fix is simple. Just edit the file /var/lib/rpm/installed-through-deps.list and remove the names of the packages you don't consider 'orphans'. Re-running the command to remove orphans should now sh...

nail, mailx, and Gmail

UPDATED 2017-11-11 I'm setting up a web server for my business and I need to email error messages and notifications to myself so I can keep track of things, but I don't have a sendmail or postfix installation for my domain and DO NOT want to futz with that since it's just overkill for what I need. Thankfully, a minimal mail user agent is installed with Mageia (and likely in many more variants of Linux as part of their base package) called mailx (this was formerly called nail , which explains the names of a few files). The system-wide configuration file is located at /etc/nail.rc . Each user can have a ~/.nailrc file, but since my server is running headless, I put everything in /etc/nail.rc . As well, you can put per-user modifications in the more common ~/.mailrc . There seems to be a general problem for people getting mailx to work with Gmail. Here's what I did: 1. Make sure that POP is enabled in your Gmail Settings. 2. Add the following to /etc/nail...