Showing posts with label satellite. Show all posts
Showing posts with label satellite. Show all posts

Monday, March 30, 2009

slackware 12.2 - kernel recompile

Last edited: 2013/05/03
Links: slackware compile simple   good: includes LILO   full Debian   gentoo instructions w/LILO   arch instructions   kernel performance
Kernel builds are straightforward and can be done in user mode in /usr/src/[version]
$ make mrproper
$ cp /boot/config /usr/src/[version]/.config
$ make menuconfig
$ make dep
$ make bzImage (or just "make")
$ make modules
# make modules_install
Recompiles are mostly the same, but we use same source version repeatedly. That is, each recompile uses source with the same version number. That causes a modules problem.

the problem and solution

A problem with using the same version source repeatedly is that modules are installed according to kernel version numbers. The modules go into /lib/modules/[version]. We don't want modules for each recompile overwriting or mixing with the prior recompile. We want a unique directory for each build's modules. How do we do that? We could just change $MOD_INSTALL_PATH, in the Makefile. However, we also need our new kernel to be able to find its modules. A better option then, is to change $EXTRAVERSION to something unique. This will then be incorporated into $KERNELRELEASE, and everything downstream -- the module directory, and pointers to those modules within System.map --- will be properly named and installed. So, before running "make menuconfig", change the top-level $EXTRAVERSION (or occasionally "$EXTRAVER") variable in Makefile to a different suffix for each build. Before running "make", double check the Makefile for your identifier. There is also apparently an option for "local version" suffix creation within the make menuconfig process beginning with kernel 2.6.

Note: to examine the running kernel settings in a GUI without changing the settings, run "make xconfig". This displays the configuration of the booted kernel. Select "discard changes" before exiting. To do the same in an ncurses CLI interface, the command is "make menuconfig" (also discard changes when exiting).

Other - unintended effects

There's a small chance one's video drivers or other hardware will act odd with the new kernel and modules. It's therefore worthwhile to back-up the old modules in case one needs to use the old kernel. If one recompiles GLibC, it's nearly certain some applications will have to be recompiled.

Other - what is /boot/vmlinuz?

When bzImage is created in /usr/src/[version]/arch/i386/and we copy the bzImage to /boot, we change its name. The file is the same, but we change it to "vmlinuz". We also append a suffix to its file name to distinguish it from other kernels in /boot. For example, we might title it "vmlinuz-20120604" or "vmlinuz-test". We add this same suffix to the "config" and "System.map", files for that build when they are copied to /boot.

pre-compile: patches, optimizations, modules

Patches are accomplished prior to opening the configuration files; they potentially expand the kernel options with new features. To patch, put the patch in the same directory as the source, consider the level for "p" (in this example I'll use "1") and:
$ patch -p1 < patchname

For optimizing the kernel, hardware information: # lshw or # lspci. Save this to a file, and print it. For example, I have one older laptop with
    AMD Athlon(tm) X2 Dual-Core QL-60 64 bits, 1900MHz,L1 256 capacity, L2 2x512KB capacity
It appears the processor will be able to run an i686 instruction set (using amd 64 / i686). Instruction sets are backwards compatible to 386,486,586. It's also worth reading here about CFLAGS (SLKCFLAGS for Slackware) CHOST, and so on, for compilation notes, since the compilation of the kernel is just another compile. Also examine these two
$ cat /proc/cpuinfo
$ echo | gcc -dM -E - -march=native
I save march info to the lshw file. Of course, we can adjust the march to something forced, but it's valuable to start with examining what's automatically selected (by gcc).

compiling

So "vmlinuz" is simply "bzImage" renamed and copied into /boot. If we compile using the standard make install technique, the vmlinuz file in /boot will be overwritten during that step. Instead, use make (or make bzImage) without "install". Later, we'll manually copy the new kernel, "bzImage" into /boot, changing its name to, say, vmlinuz_20090312 as we do so, and preventing overwrites.
$ make mrproper
$ make menuconfig
$ make dep
$ make bzImage (or just "make")
$ make modules
# make modules_install
Kernel compilation varies depending on the processor speed and the number of cores. See "j" flag options for "make".

post-compile

Booting requires System.map and vmlinuz. And, each kernel requires its own System.map file. These both need to be in /boot. Also the ".config" file should be placed in /boot for future reference. Make them easy to locate within /boot. Eg, supposing the unique identifier for that build were "20090312", then I would move the files to /boot from /usr/src/linux/) as
# cp /arch/i386/bzImage /boot vmlinuz-20090312
# cp /usr/src/linux/System.map /boot/System.map-20090312
# cp /usr/src/.config /boot/config-20090312
# rm /boot/vmlinuz
# ln -s /boot/vmlinuz-200903312 /boot/vmlinuz

Double check kernels, System.maps, config files and proper softlinks within /boot.

LILO

If you're certain about a single kernel, a single softlink named "vmlinuz" to that kernel will work, as just described. LILO needn't be changed. However, if wanting to select between multiple kernels at boot time, LILO needs additional entries. The one we have been doing above would be added as
/etc/lilo.conf
image=/boot/vmlinuz-20090312
  label= somenameforscreen
  root= /dev/sda1
  read only
Then to update LILO:
# lilo -v

Appendix - Cleaning source

(courtesy http://linuxgazette.net/111/krishnakumar.html)

After we have initiated compilation once on the source if we want to clean the object files and other temporary files then we have to run the following:
make clean
This will remove most generated files but will keep the configuration file. If we need an absolute cleaning, i.e. if we want to return the source to the state in which it was before we started the compilation, then do a
make mrproper
This command will delete all generated files, the configuration file as well as various backup files. This will in effect unwind all the changes we made to the source. The source after this step will be as good as it was just after the download and untar.

Saturday, September 27, 2008

zenwalk 5.2 in Toshiba Satellite (L305D-S5869)

2022 update

The original post from 2008 is at the bottom, but I just couldn't help wanting this dinosaur alive. NB: You must get the replacement battery for the model S5869 which is 11.1 VDC, not the 10.8 VDC of most replacements. I could not get the laptop to boot with a 10.8VDC battery.

battery and sdd

  • $0 CMOS battery: run down, but I don't have an adjustable soldering iron right now, so I installed ntp and ran
    # ntpdate pool.ntp.org
    right after connecting to my local router
  • $19 battery: an inexpensive Chinese "TA3533LH" Li-Ion, 5200mAh, 6 cell. However, when I received it, it was for the
  • $15 hdd -> ssd: I'd read somewhere that SATAIII was backwards compatible with SATAI and II, so I simply bought a new drive and moved stuff over.
  • $0 OS: The latest version of Arch worked fine with the old hardware.

From 2008

These were on-sale recently (9/25) at Fry's and seemed like a good deal although it's understood the Linux factor might be difficult with ATI video and so on. Still for $400:

15.4 WXGA
AMD Athlon 64 X2 Dual Core
1024 MB PC6400 SDRAM
Radeon 3100HD (RS780) w/VGA out
Atheros AR5007EG (wifi)
Realtek RTL8102E (ethernet)
Realtek ALC268 (sound)
120GB 5400 RPM SATA 2.5"
DVD RW, PCMCIA, SD port
3xUSB 2.0
No bluetooth or videocamera

Booted into pre-installed Windows Vista first. The return policy is 15 days for laptops and specifies software and hardware must remain unmodified. After verification of hardware features, I blew out the unbelievably bloaty factory load, dropped in a boot disk, formatted, and mke2fs /dev/sda1. Nice.

Slackware 12.0


I had a Slack 12.0 DVD gathering dust available and Slackware is my favorite. However, errors appeared on installation and it seemed an extensive parameter set was required to tame them:
#boot nosmp noapic irqpoll
To me, these problems meant that, if I continued with the Slack install on the newer hardware, I might be compiling and patching over the weekend, or that I should download and burn Slack 12.1 and begin there. I also had a copy of Slackware-based Zenwalk (formerly Minislack) 5.2 which possessed a newer kernel and a supposedly candy-coated installation process. Choices.

Zenwalk 5.2


Installed smoothly with only irqpoll needed as a parameter.

Atheros AR242x 64 (5007 chipset)
The instructions here were helpful for understanding this newer card. Zenwalk provides ath5k, but it wasn't going well. The Madwifi site has information on ath5k here, and it appears the ath5k module will eventually be effective. Currently however, the steps which worked were:

1. in /etc/modprobe.d/blacklist, blacklist the "ath5k" module
2. reboot and lsmod - make sure the ath5k is gone
3. download madwifi-hal-0.10.5.6-r3861-20080903.tar.gz , or the newest one there, make, and install.
4. reboot again and lsmod
5. iwconfig ath0

WEP and WPA
WEP is trivial, merely need the two iwconfig commands "essid" and "key restricted" to make it work. WPA, on the other hand, is a separate post. It only took 10 minutes to configure, but the description is too long for this overview. If one has a distro which requires kernel modification for WPA, the process becomes longer. This site seems to explain it t I'm also currently building a chart for easier understanding based on this site.

screen brightness and gamma
The default settings for screen brightness and backlighting install maxed at 100%, and the Fn buttons don't seem to work except in Windows - battery life, screen life, eyestrain. Without going into X, one has command-line control over the brightness. Look in /proc/acpi/video/VGA/LCD/brightness to see the possible brightness settings for the card, such as 25, 50, 75%, and so on. I like 25%, so:
#echo -n 25 > /proc/acpi/video/VGA/LCD/brightness
It appears we cannot change the backlighting outside of X, though I haven't researched. Once in X however, open a terminal and select any number between 0.00 and 1.0 for gamma, eg:
xgamma -gamma 0.75

Realtek ALC268 Sound
Some duplicate alsamixer settings were seen. For example, alsamixer showed two microphone capture bars when only one channel was connected. I went to the Realtek downloads site, clicked a link there to the "HD Audio Codec Driver", and agreed to licensing language. After download and unpacking, it turned out this was the latest release of ALSA, so it basically installs the latest ALSA, but apparently with a newer HD driver. The alsamixer showed proper inputs following this ALSA update. and so, after setting levels, it was time for # alsactl store.

Radeon 3100HD RS780MC
Initially, Zenwalk loaded the vesa driver in /etc/xorg.conf, providing resolutions of 800x600. Common sense and #gtf seemed to indicate higher resolutions were available. In /etc/xorg.conf, I replaced "vesa" with, alternately, "ati", "radeon", and "radeonhd"; these did nothing but break X. I then relented for the proprietary driver "fglrx" described on most blogs as bloaty and slow, but operational. The driver was avialable here by selecting the Linux x86_64 -> Radeon -> ATI Radeon HD 3xxx Series and pressing "go". One note about installing this - I received checksum errors when I attemped to install it with #. ati*; I had to explicitly invoke bash #bash ati*. However, following this installation, I simply replaced "vesa" with "fglrx" in the Device section of /etc/X11/xorg.conf, rebooted, and everything worked. With the vesa-fglrx swap, the /etc/X11/xorg.conf file looks like this:
Section "Device"
Identifier "Videocard1"
VendorName "ATI Technologies Inc"
BoardName "Video device"
Driver "fglrx"
BusID "PCI:1:5:0"
Option "RenderAccel" "true"
EndSection
Adjustments to the fglrx module "Options" can come some other weekend; resolution and display appear sharp currently.

additional fglrx considerations for the Radeon 3100HD R5780MC
The fglrx driver, although supplied by Radeon, does appear to have significant Googleland complaints for slowness. For me, it renders well, but very slowly: I'm experience update lines even scrolling through a simple text page on Mousepad, etc. So, it appears something either a)very inefficient, or b)very underpowered, is taking place in terms of memory usage with the fglrx driver. From Google, it appears there are a few things to investigate: 1) does flglrx load as a module? (lsmod |grep fglrx). Mine does not appear in lsmod, and this apparently means xorg.conf loads a substandard fglrx_drv.ko module. Lsmod failed to locate this module either. Odd. 2) Settings in /etc/X11/xorg.conf for the fglrx driver, under "Options" may be important. 3)Settings (don't know syntax or location) for whether the ATI card uses SIDEPORT mode (card uses its own memory),UMA mode (card shares system memory), or another unnamed mode where it uses a mix of SIDEPORT and UMA. One thing for sure, a lifesaver in these forum boards is fglrxinfo or fglrxinfo -v:
# fglrxinfo
display: :0.0 screen: 0
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.4 (2.1 Mesa 7.0.3)

glxinfo is also important. On my system, glx is not enabled, though this may be a different problem than the overall slowness of screen panning and scrolling that I'm experiencing. A good forum thread for these issues is here, not for solutions but for the many aspects of the problem.

netpkg repos
Each time zenwalk is released, the repositories update to the most current release so that, if one needs a certain package, they generally have to update the rest of their system to be in sync with it. Suppose I like my release and just want to keep it into perpetuity. As long as 1) I have the installation disk 2) have netpkg'ed all the programs from that release I want (they download to /var/packages), and 3) have downloaded a copy of PACKAGES.TXT.gz, I can point netpkg to /var/packages and use the older release. A couple of simple modifications are required with two configuration files since netpkg doesn't inherently recognize URLs of the type "file:///". This link describes the changes to the two files, /usr/libexec/netpkg-functions and /etc/netpkg.config files, which I repeat here.
  • /usr/libexec/netpkg-functions, at or about line 144:


  • if [ $( echo "$url" | egrep -e "ftp:.*|http:.*|file:.*" ) ]; then
  • ...at or about line 205:


  • if [ ! "$(echo $mirror | egrep 'http://|ftp://|file://')" ] ; then
  • /etc/netpkg.conf add another line such as


  • Internet_mirror = file:///var/packages
    Put a copy of PACKAGES.TXT.gz into /var/packages, and you've got a self-contained distribution.

    unsolved: multiple instantiation of mplayer, thunar, etc
    Perhaps because of multiple processors, there's currently a problem when using DVD's. Multiple instances of related applications appear, eg 2 x MPlayer or 2 x Thunar. Working around this by disabling automatic HAL events for the time being. Manually opening one instance of the application for now.