While looking into how to look up Debian packages based on hardware
-information, to find the packages that support a given piece of
-hardware, I refreshed my memory regarding modalias values, and decided
-to document the details. Here are my findings so far, also available
-in
-the
-Debian Edu subversion repository:
-
-
Modalias decoded
-
-
This document try to explain what the different types of modalias
-values stands for. It is in part based on information from
-<URL: https://wiki.archlinux.org/index.php/Modalias >,
-<URL: http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device >,
-<URL: http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c > and
-<URL: http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&view=markup >.
-
-
The modalias entries for a given Linux machine can be found using
-this shell script:
-
-
-find /sys -name modalias -print0 | xargs -0 cat | sort -u
-
-
-
The supported modalias globs for a given kernel module can be found
-using modinfo:
-
-
-% /sbin/modinfo psmouse | grep alias:
-alias: serio:ty05pr*id*ex*
-alias: serio:ty01pr*id*ex*
-%
-
-
-
PCI subtype
-
-
A typical PCI entry can look like this. This is an Intel Host
-Bridge memory controller:
-
-
-pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
-
-
-
This represent these values:
-
-
- v 00008086 (vendor)
- d 00002770 (device)
- sv 00001028 (subvendor)
- sd 000001AD (subdevice)
- bc 06 (bus class)
- sc 00 (bus subclass)
- i 00 (interface)
-
-
-
The vendor/device values are the same values outputted from 'lspci
--n' as 8086:2770. The bus class/subclass is also shown by lspci as
-0600. The 0600 class is a host bridge. Other useful bus values are
-0300 (VGA compatible card) and 0200 (Ethernet controller).
-
-
Not sure how to figure out the interface value, nor what it
-means.
-
-
USB subtype
-
-
Some typical USB entries can look like this. This is an internal
-USB hub in a laptop:
-
-
-usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
-
-
-
Here is the values included in this alias:
-
-
- v 1D6B (device vendor)
- p 0001 (device product)
- d 0206 (bcddevice)
- dc 09 (device class)
- dsc 00 (device subclass)
- dp 00 (device protocol)
- ic 09 (interface class)
- isc 00 (interface subclass)
- ip 00 (interface protocol)
-
-
-
The 0900 device class/subclass means hub. Some times the relevant
-class is in the interface class section. For a simple USB web camera,
-these alias entries show up:
-
-
-usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
-
usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
-
usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
-
usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
-
-
-
Interface class 0E01 is video control, 0E02 is video streaming (aka
-camera), 0101 is audio control device and 0102 is audio streaming (aka
-microphone). Thus this is a camera with microphone included.
-
-
ACPI subtype
-
-
The ACPI type is used for several non-PCI/USB stuff. This is an IR
-receiver in a Thinkpad X40:
-
-
-acpi:IBM0071:PNP0511:
-
-
-
The values between the colons are IDs.
-
-
DMI subtype
-
-
The DMI table contain lots of information about the computer case
-and model. This is an entry for a IBM Thinkpad X40, fetched from
-/sys/devices/virtual/dmi/id/modalias:
-
-
-dmi:bvnIBM:bvr1UETB6WW(1.66):bd06/15/2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
-
-
-
The values present are
-
-
- bvn IBM (BIOS vendor)
- bvr 1UETB6WW(1.66) (BIOS version)
- bd 06/15/2005 (BIOS date)
- svn IBM (system vendor)
- pn 2371H4G (product name)
- pvr ThinkPadX40 (product version)
- rvn IBM (board vendor)
- rn 2371H4G (board name)
- rvr NotAvailable (board version)
- cvn IBM (chassis vendor)
- ct 10 (chassis type)
- cvr NotAvailable (chassis version)
-
-
-
The chassis type 10 is Notebook. Other interesting values can be
-found in the dmidecode source:
-
-
- 3 Desktop
- 4 Low Profile Desktop
- 5 Pizza Box
- 6 Mini Tower
- 7 Tower
- 8 Portable
- 9 Laptop
- 10 Notebook
- 11 Hand Held
- 12 Docking Station
- 13 All In One
- 14 Sub Notebook
- 15 Space-saving
- 16 Lunch Box
- 17 Main Server Chassis
- 18 Expansion Chassis
- 19 Sub Chassis
- 20 Bus Expansion Chassis
- 21 Peripheral Chassis
- 22 RAID Chassis
- 23 Rack Mount Chassis
- 24 Sealed-case PC
- 25 Multi-system
- 26 CompactPCI
- 27 AdvancedTCA
- 28 Blade
- 29 Blade Enclosing
-
-
-
The chassis type values are not always accurately set in the DMI
-table. For example my home server is a tower, but the DMI modalias
-claim it is a desktop.
-
-
SerIO subtype
-
-
This type is used for PS/2 mouse plugs. One example is from my
-test machine:
-
-
-serio:ty01pr00id00ex00
-
-
-
The values present are
-
-
- ty 01 (type)
- pr 00 (prototype)
- id 00 (id)
- ex 00 (extra)
-
-
-
This type is supported by the psmouse driver. I am not sure what
-the valid values are.
-
-
Other subtypes
-
-
There are heaps of other modalias subtypes according to
-file2alias.c. There is the rest of the list from that source: amba,
-ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
-mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
-vmbus, x86cpu and zorro. I did not spend time documenting all of
-these, as they do not seem relevant for my intended use with mapping
-hardware to packages when new stuff is inserted during run time.
-
-
Looking up kernel modules using modalias values
-
-
To check which kernel modules provide support for a given modalias,
-one can use the following shell script:
-
-
- for id in $(find /sys -name modalias -print0 | xargs -0 cat | sort -u); do \
- echo "$id" ; \
- /sbin/modprobe --show-depends "$id"|sed 's/^/ /' ; \
- done
-
-
-
The output can look like this (only the first few entries as the
-list is very long on my test machine):
-
-
- acpi:ACPI0003:
- insmod /lib/modules/2.6.32-5-686/kernel/drivers/acpi/ac.ko
- acpi:device:
- FATAL: Module acpi:device: not found.
- acpi:IBM0068:
- insmod /lib/modules/2.6.32-5-686/kernel/drivers/char/nvram.ko
- insmod /lib/modules/2.6.32-5-686/kernel/drivers/leds/led-class.ko
- insmod /lib/modules/2.6.32-5-686/kernel/net/rfkill/rfkill.ko
- insmod /lib/modules/2.6.32-5-686/kernel/drivers/platform/x86/thinkpad_acpi.ko
- acpi:IBM0071:PNP0511:
- insmod /lib/modules/2.6.32-5-686/kernel/lib/crc-ccitt.ko
- insmod /lib/modules/2.6.32-5-686/kernel/net/irda/irda.ko
- insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/irda/nsc-ircc.ko
- [...]
-
-
-
If you want to help implementing a system to let us propose what
-packages to install when new hardware is plugged into a Debian
-machine, please send me an email or talk to me on
-#debian-devel.
-
-
Update 2013-01-15: Rewrite "cat $(find ...)" to
-"find ... -print0 | xargs -0 cat" to make sure it handle directories
-in /sys/ with space in them.
+
+
27th July 2013
+
The first wheezy based beta release of Debian Edu was wrapped up
+today. This is the release announcement:
+
+
New features for Debian Edu 7.1+edu0~b0 released
+2013-07-27
+
+
These are the release notes for for Debian Edu / Skolelinux
+7.1+edu0~b0, based on Debian with codename "Wheezy".
+
+
About Debian Edu and Skolelinux
+
+
Debian Edu, also known as
+Skolelinux, is a Linux distribution based on Debian providing an
+out-of-the box environment of a completely configured school
+network. Immediately after installation a school server running all
+services needed for a school network is set up just waiting for users
+and machines being added via GOsa², a comfortable Web-UI. A netbooting
+environment is prepared using PXE, so after initial installation of
+the main server from CD, DVD or USB stick all other machines can be
+installed via the network. The provided school server provides LDAP
+database and Kerberos authentication service, centralized home
+directories, DHCP server, web proxy and many other services. The
+desktop contains
+more
+than 60 educational software packages and more are available from
+the Debian archive, and schools can choose between KDE, Gnome, LXDE
+and Xfce desktop environment.
+
+
This is the fifth test release based on Debian Wheezy. Basically
+this is an updated and slightly improved version compared to the
+Squeeze release.
+
+
ALERT: Alpha based installations should reinstall or downgrade the
+versions of gosa and libpam-mklocaluser to the ones used in this beta
+release.
+
+
Software updates
+
+
+
+- Switched roaming workstation profiles from wicd to network-manager
+ for network configuration, as wicd didn't work any more.
+- Changed version numbers of patched gosa and libpam-mklocaluser
+ packages to make sure our locally patched versions will be replaced
+ by the official packages when they are released from Debian. Those
+ installing alpha version need to reinstall or manually downgrade gosa
+ and libpam-mklocaluser.
+- Added bluetooth tools to the default desktop (bluedevil, blueman).
+- Added tools for sharing the desktop on KDE (krdc, krfb).
+- Added valgrind to the default installation for easier debugging of
+ crash bugs.
+
+
+
+
Other changes
+
+
+
+- Fixed artwork package to work with gnome, no longer break
+ desktop=gnome installations.
+- Adjusted installer to now work when forced to use a proxy with the
+ netinst CD.
+- Fixed code detecting and setting/loading hardware specific
+ setup/firmware to work more robust out of the box.
+- Adjusted Kerberos setup to detect realm and server settings at
+ install time instead of dynamically at run time. This avoid a crash
+ with krb5-auth-dialog on diskless workstations without a DNS name.
+- Worked around misfeature in network-manager not calling the dhclient
+ exit hooks, causing automatic proxy configuration and automatic host
+ name setting at run time to work again.
+- Fixed feature setting the default Iceweasel start page from URL
+ fetched from LDAP, to allow schools to set the global default by
+ updating the dc=skole,dc=skolelinux,dc=no LDAP object.
+- Changed default host name on all networked machines to be unique
+ (generated from MAC or reverse DNS) after boot.
+- Adjusted partition sizes to make sure they are big enough.
+
+
+
+
Known issues
+
+
+
+- Grub is missing the new artwork.
+- KDE fail to understand the wpad.dat file provided, causing it to
+ not use the http proxy as it should.
+- Chromium also fail to use the proxy.
+
+
+
+
Where to get it
+
+
To download the multiarch netinstall CD release you can use
+
+
+
+
The MD5SUM of this image is: 55d5de9765b6dccd5d9ec33cf1a07109
+
The SHA1SUM of this image is: 996a1d9517740e4d627d100de2d12b23dd545a3f
+
+
To download the multiarch USB stick ISO release you can use
+
+
+
+
The MD5SUM of this image is: d8f0818c51a78d357de794066f289f69
+
The SHA1SUM of this image is: 49185ca354e8d0543240423746924f76a6cee733
+
+
+
How to report bugs
+
+
http://wiki.debian.org/DebianEdu/HowTo/ReportBugs
@@ -598,31 +390,112 @@ in /sys/ with space in them.
-
-
10th January 2013
-
As part of my investigation on how to improve the support in Debian
-for hardware dongles, I dug up my old Mark and Spencer USB Rocket
-Launcher and updated the Debian package
-pymissile to make
-sure udev will fix the device permissions when it is plugged in. I
-also added a "Modaliases" header to test it in the Debian archive and
-hopefully make the package be proposed by jockey in Ubuntu when a user
-plug in his rocket launcher. In the process I moved the source to a
-git repository under collab-maint, to make it easier for any DD to
-contribute. Upstream
-is not very active, but the software still work for me even after five
-years of relative silence. The new git repository is not listed in
-the uploaded package yet, because I want to test the other changes a
-bit more before I upload the new version. If you want to check out
-the new version with a .desktop file included, visit the
-gitweb
-view or use "git clone
-git://anonscm.debian.org/collab-maint/pymissile.git".
+
+
17th July 2013
+
Today I switched to
+my
+new laptop. I've previously written about the problems I had with
+my new Thinkpad X230, which was delivered with an
+180
+GB Intel SSD disk with Lenovo firmware that did not handle
+sustained writes. My hardware supplier have been very forthcoming in
+trying to find a solution, and after first trying with another
+identical 180 GB disks they decided to send me a 256 GB Samsung SSD
+disk instead to fix it once and for all. The Samsung disk survived
+the installation of Debian with encrypted disks (filling the disk with
+random data during installation killed the first two), and I thus
+decided to trust it with my data. I have installed it as a Debian Edu
+Wheezy roaming workstation hooked up with my Debian Edu Squeeze main
+server at home using Kerberos and LDAP, and will use it as my work
+station from now on.
+
+
As this is a solid state disk with no moving parts, I believe the
+Debian Wheezy default installation need to be tuned a bit to increase
+performance and increase life time of the disk. The Linux kernel and
+user space applications do not yet adjust automatically to such
+environment. To make it easier for my self, I created a draft Debian
+package ssd-setup to handle this tuning. The
+source
+for the ssd-setup package is available from collab-maint, and it
+is set up to adjust the setup of the machine by just installing the
+package. If there is any non-SSD disk in the machine, the package
+will refuse to install, as I did not try to write any logic to sort
+file systems in SSD and non-SSD file systems.
+
+
I consider the package a draft, as I am a bit unsure how to best
+set up Debian Wheezy with an SSD. It is adjusted to my use case,
+where I set up the machine with one large encrypted partition (in
+addition to /boot), put LVM on top of this and set up partitions on
+top of this again. See the README file in the package source for the
+references I used to pick the settings. At the moment these
+parameters are tuned:
+
+
+
+- Set up cryptsetup to pass TRIM commands to the physical disk
+ (adding discard to /etc/crypttab)
+
+- Set up LVM to pass on TRIM commands to the underlying device (in
+ this case a cryptsetup partition) by changing issue_discards from
+ 0 to 1 in /etc/lvm/lvm.conf.
+
+- Set relatime as a file system option for ext3 and ext4 file
+ systems.
+
+- Tell swap to use TRIM commands by adding 'discard' to
+ /etc/fstab.
+
+- Change I/O scheduler from cfq to deadline using a udev rule.
+
+- Run fstrim on every ext3 and ext4 file system every night (from
+ cron.daily).
+
+- Adjust sysctl values vm.swappiness to 1 and vm.vfs_cache_pressure
+ to 50 to reduce the kernel eagerness to swap out processes.
+
+
+
+
During installation, I cancelled the part where the installer fill
+the disk with random data, as this would kill the SSD performance for
+little gain. My goal with the encrypted file system is to ensure
+those stealing my laptop end up with a brick and not a working
+computer. I have no hope in keeping the really resourceful people
+from getting the data on the disk (see
+XKCD #538 for an explanation why).
+Thus I concluded that adding the discard option to crypttab is the
+right thing to do.
+
+
I considered using the noop I/O scheduler, as several recommended
+it for SSD, but others recommended deadline and a benchmark I found
+indicated that deadline might be better for interactive use.
+
+
I also considered using the 'discard' file system option for ext3
+and ext4, but read that it would give a performance hit ever time a
+file is removed, and thought it best to that that slowdown once a day
+instead of during my work.
+
+
My package do not set up tmpfs on /var/run, /var/lock and /tmp, as
+this is already done by Debian Edu.
+
+
I have not yet started on the user space tuning. I expect
+iceweasel need some tuning, and perhaps other applications too, but
+have not yet had time to investigate those parts.
+
+
The package should work on Ubuntu too, but I have not yet tested it
+there.
+
+
As for the answer to the question in the title of this blog post,
+as far as I know, the only solution I know about is to replace the
+disk. It might be possible to flash it with Intel firmware instead of
+the Lenovo firmware. But I have not tried and did not want to do so
+without approval from Lenovo as I wanted to keep the warranty on the
+disk until a solution was found and they wanted the broken disks
+back.
@@ -630,93 +503,49 @@ git://anonscm.debian.org/collab-maint/pymissile.git".
-
-
9th January 2013
-
One thing that annoys me with Debian and Linux distributions in
-general, is that there is a great package management system with the
-ability to automatically install software packages by downloading them
-from the distribution mirrors, but no way to get it to automatically
-install the packages I need to use the hardware I plug into my
-machine. Even if the package to use it is easily available from the
-Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
-suggest to automatically install the python-nxt, nbc and t2n packages
-I need to talk to it. When I plug in a Yubikey, it could propose the
-yubikey-personalization package. The information required to do this
-is available, but no-one have pulled all the pieces together.
-
-
Some years ago, I proposed to
-use
-the discover subsystem to implement this. The idea is fairly
-simple:
-
-
-
-- Add a desktop entry in /usr/share/autostart/ pointing to a program
- starting when a user log in.
-
-- Set this program up to listen for kernel events emitted when new
- hardware is inserted into the computer.
-
-- When new hardware is inserted, look up the hardware ID in a
- database mapping to packages, and take note of any non-installed
- packages.
-
-- Show a message to the user proposing to install the discovered
- package, and make it easy to install it.
-
-
-
-
I am not sure what the best way to implement this is, but my
-initial idea was to use dbus events to discover new hardware, the
-discover database to find packages and
-PackageKit to install
-packages.
-
-
Yesterday, I found time to try to implement this idea, and the
-draft package is now checked into
-the
-Debian Edu subversion repository. In the process, I updated the
-discover-data
-package to map the USB ids of LEGO Mindstorms and Yubikey devices to
-the relevant packages in Debian, and uploaded a new version
-2.2013.01.09 to unstable. I also discovered that the current
-discover
-package in Debian no longer discovered any USB devices, because
-/proc/bus/usb/devices is no longer present. I ported it to use
-libusb as a fall back option to get it working. The fixed package
-version 2.1.2-6 is now in experimental (didn't upload it to unstable
-because of the freeze).
-
-
With this prototype in place, I can insert my Yubikey, and get this
-desktop notification to show up (only once, the first time it is
-inserted):
-
-

-
-
For this prototype to be really useful, some way to automatically
-install the proposed packages by pressing the "Please install
-program(s)" button should to be implemented.
-
-
If this idea seem useful to you, and you want to help make it
-happen, please help me update the discover-data database with mappings
-from hardware to Debian packages. Check if 'discover-pkginstall -l'
-list the package you would like to have installed when a given
-hardware device is inserted into your computer, and report bugs using
-reportbug if it isn't. Or, if you know of a better way to provide
-such mapping, please let me know.
-
-
This prototype need more work, and there are several questions that
-should be considered before it is ready for production use. Is dbus
-the correct way to detect new hardware? At the moment I look for HAL
-dbus events on the system bus, because that is the events I could see
-on my Debian Squeeze KDE desktop. Are there better events to use?
-How should the user be notified? Is the desktop notification
-mechanism the best option, or should the background daemon raise a
-popup instead? How should packages be installed? When should they
-not be installed?
-
-
If you want to help getting such feature implemented in Debian,
-please send me an email. :)
+
+
10th July 2013
+
A few days ago, I wrote about
+the
+problems I experienced with my new X230 and its SSD disk, which
+was dying during installation because it is unable to cope with
+sustained write. My supplier is in contact with
+Lenovo, and they wanted to send a
+replacement disk to try to fix the problem. They decided to send an
+identical model, so my hopes for a permanent fix was slim.
+
+
Anyway, today I got the replacement disk and tried to install
+Debian Edu Wheezy with encrypted disk on it. The new disk have the
+same firmware version as the original. This time my hope raised
+slightly as the installation progressed, as the original disk used to
+die after 4-7% of the disk was written to, while this time it kept
+going past 10%, 20%, 40% and even past 50%. But around 60%, the disk
+died again and I was back on square one. I still do not have a new
+laptop with a disk I can trust. I can not live with a disk that might
+lock up when I download a new
+Debian Edu / Skolelinux ISO or
+other large files. I look forward to hearing from my supplier with
+the next proposal from Lenovo.
+
+
The original disk is marked Intel SSD 520 Series 180 GB,
+11S0C38722Z1ZNME35X1TR, ISN: CVCV321407HB180EGN, SA: G57560302, FW:
+LF1i, 29MAY2013, PBA: G39779-300, LBA 351,651,888, LI P/N: 0C38722,
+Pb-free 2LI, LC P/N: 16-200366, WWN: 55CD2E40002756C4, Model:
+SSDSC2BW180A3L 2.5" 6Gb/s SATA SSD 180G 5V 1A, ASM P/N 0C38732, FRU
+P/N 45N8295, P0C38732.
+
+
The replacement disk is marked Intel SSD 520 Series 180 GB,
+11S0C38722Z1ZNDE34N0L0, ISN: CVCV315306RK180EGN, SA: G57560-302, FW:
+LF1i, 22APR2013, PBA: G39779-300, LBA 351,651,888, LI P/N: 0C38722,
+Pb-free 2LI, LC P/N: 16-200366, WWN: 55CD2E40000AB69E, Model:
+SSDSC2BW180A3L 2.5" 6Gb/s SATA SSD 180G 5V 1A, ASM P/N 0C38732, FRU
+P/N 45N8295, P0C38732.
+
+
The only difference is in the first number (serial number?), ISN,
+SA, date and WNPP values. Mentioning all the details here in case
+someone is able to use the information to find a way to identify the
+failing disk among working ones (if any such working disk actually
+exist).