DISCLAIMER. English language used here only for compatibility (ASCII only), so any suggestions about my bad grammar (and not only it) will be greatly appreciated.

четверг, 4 августа 2011 г.

LVM snapshots and corresponding DM tables

Here is just a few illustrations (with some text) for chapter about snapshot
and snapshot-origin device mapper's targets from
RedHat's Logical Volume Manager Administration Guide.
Also, here i make some assumptions about how this works, which seems logical,
but unproved since i don't check LVM's sources.

понедельник, 11 июля 2011 г.

This icq..

Upd5. 2012-11-16. Suggested here stunnel config is insecure. See icq through stunnel: enable certificate verification for improvement.

This icq, this damned icq.. doesn't log in! As i expected, though.

воскресенье, 8 мая 2011 г.

Variable assignment in bash `eval`

Here is example of variable assignment in eval:

    (
        v="a\" b";
        eval "r=\"$v\"";
        declare -p r
    )

Such assignment lead to error due to unmatched double quote. Here is corrected
version of above example

    (
        v="a\" b";
        eval "r=\"\$v\"";
        declare -p r
    )

And here is example of executing arbitrary command through such incorrect eval
construction:

    (
        v="a\"; ls; \":";
        eval "r=\"$v\"";
        declare -p r
    )

Note a colon (':') in 'v' value: bash does not even complain about incorrect
syntax - all is correct and all will work fine!

So, it's safe (perhaps) to use parameter expansion to form variable's name for
assign to, like

    (
        v="arr";
        eval "${v}[1]=123";
        declare -p arr;
        eval "r=\${${v}[1]}";
        declare -p r
    )

because here bash's own constrains on characters in variable name applied, and
bash checks this. But it's _not_ safe to expand variable up to value in the
main script - do it in eval script instead.

Note, the same also applies to indirect reference: do not use it to expand up
to value in main script in eval constructions. Here is flawed example:

    (
        j=var;
        var="a\"; ls; \":";
        i=r;
        eval "$i=\"${!j}\"";
        declare -p r;
    )

and now corrected version

    (
        j=var;
        var="a\"; ls; \":";
        i=r;
        eval "$i=\"\${$j}\"";
        declare -p r;
    )

or with indirect reference

    (
        j=var;
        var="a\"; ls; \":";
        i=r;
        eval "$i=\"\${!j}\"";
        declare -p r;
    )


вторник, 22 марта 2011 г.

Отчет об автопробеге "Весенний Quest" 6-8 марта 2011 года. Экипаж №47

(отформатированная версия оригинала с форума "Магистрали" )

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFomDVmMswxWxNsBmGC3fQ6aZCnaKISZOKeKq8BKKlEul-LMazw8-T8zW3jRj9Tdwb1IXTZNEvjDn8DLla4IHLCbYYozoCyRWk_oXOmV3XRkFC1B_LM_5H6ntsKWARjPwJ6Ye7YZa7Oagc/s800/IMG_9269_360x480.JPG

06 марта. День первый. Москва - Поленово - Савино - Дворяниново - Тула

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj790ThyYSPfY0Yq_PVx9FuWlcVXvq0_bcJyLHrdFWPkQbkUjB_VWIIKeKiDQOaGl6rG2Y-F_9H5RZABlgq3NM1gh_o-ZAGP9IbiM9sJ4fPlRNZ9yJLZOlDn_gtpc5fcbH1fD71GIIRoPYH/s800/IMG_9166_480x360.JPG

Стартовали в Москве не рано: чуть-чуть поспали-поели, скачали задание, поразгадывали, нашли все точки и выехали около 16 часов. Заехали в Поленово. Пожалели, что надо быстро уезжать, решили приехать как-нибудь не спеша и отправились в Савино искать музей Руднева. Уже стемнело, но в музее еще горел свет - сидел охранник - поэтому нашли быстро и поехали дальше. В Русятино оказалось на удивление много прохожих, спросили у них про усадьбу. На подъезде к Дворяниново встречные собаки бросались под колеса и лаяли. В полной темноте остановились перед шлагбаумом и потихоньку пошли с фонарем искать усадебный дом и памятник Болотову. Тихо, звезды в небе, никого... Нашли! Что ж уже поздно, в Острецово решили не ехать - поехали в Тулу.

07 марта. День второй. Тула - Новомосковск - Куликово поле - Богородицк - Дедилово - Тула

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_xcR-XGnHoH1GkUZB5KNXJv75XhaQsdxynKOCaYTudvkPrLrQ5Y71s3Ufml90MCV74m2NfHYkusveWJa5MsSf65aaaysWzC6Q6IxMhwuTN1ZvM01IGMK-5JKdRnyvbQQrc-Jm6AkId-Cz/s800/IMG_9086_480x360.JPG

Утром в 7 часов около тульского Кремля были остановлены для проверки документов стражем ДПС, получили от него добрые напутствия и поехали собирать КП. Большинство адресов нашли еще дома. А вот памятник хвосту искали долго: проехали дважды, не ожидали, что он такой маленький. Очень симпатичный дракоша! Потом запаслись пряниками на фабрике, позавтракали и поехали на Куликово поле.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRTPOl8dCp54XkFIb90QX7SB1WsZaemigt8TGufIGCP_NnKPKkfLknn_O8wPqdLp9dAGoV8xtqebwvrALeLljh_D3f3iRtxrSAZaumlacIpE5SNpVKK81oNN-4W7uSp89ZzDhcdEh9yglv/s800/IMG_9141_480x360.JPG

В Бородинском встретились с экипажем 10 (привет!), постояли у Кургана Бессмертия, потом - Новомосковск и Куликово поле. Здесь, конечно, трудно заблудиться - указатели кругом понаставлены. Проехали по степям, собрали все КП. Два раза Дон пересекали. Особенно понравился большой голубой фургон среди степи с надписью "Живая рыба". К сожалению, не успели заснять.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQLdEHxtoSO3HaN4RsqtHHkR0JWqBCxG1S3m2xofzzTBWu4APhnOihg7f6hco3iYFWiBmCAwMtwePyb86mJbAPxfYkY803wOE1tav1R570gC9CzwgVHjuE3UWHoHw_NS2YJFPOeluJeD8p/s800/IMG_9152_480x360.JPG

Обратно повернули в Крестах (чтобы не возвращаться той же дорогой) и по Р142 поехали в Богородицк. В поисках КП объехали в городе все парки-скверы (их оказалось три). Наконец, нашли усадьбу и памятник Болотову. Сфотографировали колокольню в лучах заходящего солнца и решили возвращаться в Тулу, поскольку поняли, что намеченный на день план мы уже не выполним и до Малоярославца, где нас ждет заказанная гостиница, уже не доедем. По пути отыскали красивую церковь (КП-59) в Дедилово. Для фото подсветили ее своими фарами, и тут включили подсветку.

08 марта. День третий. Тула - Алексин - Таруса - Кременки - Жуков - Малоярославец - Москва

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioXr_cKkZmQEBfjlfAZWlMospTPgvpZIWr0JeRRp27bTZ5rd6QLSMCPMyA-aeFvt1qns1yAcebUNnpjsGPZWWlVBDTbJKsD-zBUsqUYeLHnJiaxAYLjXFoASw99vAf31uZ-q5Q7gYub0jp/s800/IMG_9278_480x360.JPG

Искали неправильное Богучарово, у тракториста выяснили, что до бывшей усадьбы не добраться, да и колокольни там нет. Развернулись, уехали на Алексин. В Алексине были в 9 часов. Остановились посмотреть карту, смотрим - стоим около магазина при хлебзаводе, и он работает, и в нем продают свежий хлеб! Купили. Очень вкусный был батон. Поехали искать КП. Чтобы не бегать по всему парку Жалка в поисках скульптуры, решили взять "языка": пожилой мужчина вызвался нас проводить. Двигаясь неспешным ходом, он рассказывал об истории парка, замечательных деревянных скульптурах - сказочный городок - и даже прочитал отрывки из своих стихов, за которые когда-то получил награду, а теперь с трудом вспомнил.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK6vtmhOuL0PIT8b31KV0Q78Q5bK53p4KS2vQ1n8xCi12DK8XqlnTbjHn3U6B4JXDr9T0YXcjFySPXt-CslqEPlbfkCAwEJW2USfPg8f3kS5R3GQM_uudMq_RR8es9chawp_LU5OAhQWRC/s800/IMG_9267_480x360.JPG

Дальше - Таруса. По нашему маршруту мы должны были ехать через Колосово и Вознесенье, но слегка промахнулись с нужным поворотом и поехали по кольцевой дороге через деревни (Савватеево, Жуково, Кузнецы). Сделав почетный круг по полям, местами скребя брюхом, вырулили на Колосово. Там - налево проулком в одну машину, не без труда преодолев крутой скользкий подъем за речкой и никого не встретив, добрались до Тарусы. Город понравился, давно хотели сюда попасть. Жаль, что точки нашли быстро и не пришлось поездить по городу.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhhahwZdQ3oV96P9j8V9fT9pXpGrCD6oWVsNpitBDLG3jmXlgp22YJa61R2DsnzjWKOj3GcNAyFajFUEVUIXMoVtnZfqAm4HUZzwTaGqEO2VcBU9W5VFoeaXmnbIgvGSxcw1EVKm64GxMF/s800/IMG_9295_360x480.JPG

Дальше - Кременки, Стрелковка, Жуков. Очень понравилась дорога вдоль Протвы. Времени оставалось немного - завтра на работу, - из оставшихся точек в районе Обнинска выбрали Малоярославец. Правда, на пересечении М3 и А101 свернули не туда - на Калугу. Зато в поселке Спас-Загорье, через который мы теперь ехали на Малоярославец, увидели красивую церковь. В Малоярославце очень понравился Черноостровсикй монастырь и памятник солдату, возлагающему венок (КП-31), в Сквере 1812 года. К сожалению не попали в Боровск, Калугу. Как-нибудь вернемся.

Заключение.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9UmMcUDe2yjq5j4BmTHf5TeuHW_ygxrcNr85NGP03Si6mSDoOvCmbkKcCTRAkuHGBZdiPo29U2PRs9JAiGlwja8rt1W95_L9k8uDU8kXKNUw_jn1pXNHMwvmJaKejBIw2sPkjfBVyf3H/s800/IMG_9314_360x270.JPG

Общий пробег составил 958 км. Маршрут понравился, но было мало дней, жаль, что все не успели. Это наша вторая поездка. Первой был Новогодний quest, недавно получили дипломы по почте. Обрадовались! Спасибо организаторам! Ждем новых встреч!

А также отдельная благодарность создателям открытой и бесплатной карты OpenStreetMap и навигационной программы Navit.

вторник, 1 февраля 2011 г.

Intel AMT IDE Redirection and linux

(updated version)

    Shortly: it works -)

    Now with more details.  Module 'ata_generic' (CONFIG_ATA_GENERIC) may drive
    IDER controller.  Though, it will not take over this device without option
    'all_generic_ide=1' (perhaps, because IDER controller match with "any"
    alias, but not device-specific one?):

        # modinfo ata_generic
        ..
        alias:          pci:v*d*sv*sd*bc01sc01i*
        ..

    So, we should load it like

        # modprobe ata_generic all_generic_ide=1

    Now we can check, that it successfully takes over IDER controller

        # lspci -nn | grep IDER
        00:03.2 IDE interface [0101]: Intel Corporation Mobile PM965/GM965 PT IDER Controller [8086:2a06] (rev 0c)
        # ls -l /sys/bus/pci/devices/0000:00:03.2/driver
        lrwxrwxrwx 1 root root 0 Jan 31 17:44 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/ata_generic

    But in order to have kernel see scsi targets on this IDER controller, we
    need to enable IDE Redirection in remote management console (you may use
    Manageability Commander Tool from Intel Manageability Developer Tool Kit
    for testing). There will be two scsi targets on this scsi host: floppy
    (bus=0, id=0, lun=0)  and cdrom (bus=0, id=1, lun=0). Floppy will be
    handled by sd, and cdrom by sr_mod:

        # ls -l /sys/bus/pci/devices/0000:00:03.2/host21/
        total 0
        drwxr-xr-x 2 root root    0 Jan 31 18:16 power
        drwxr-xr-x 3 root root    0 Jan 31 18:16 scsi_host
        lrwxrwxrwx 1 root root    0 Jan 31 17:44 subsystem -> ../../../../bus/scsi
        drwxr-xr-x 4 root root    0 Jan 31 17:44 target21:0:0
        drwxr-xr-x 4 root root    0 Jan 31 17:44 target21:0:1
        -rw-r--r-- 1 root root 4096 Jan 31 17:44 uevent
        # ls -l /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:0/21:0:0:0/driver
        lrwxrwxrwx 1 root root 0 Jan 31 17:44 /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:0/21:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sd
        # ls -l /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:1/21:0:1:0/driver
        lrwxrwxrwx 1 root root 0 Jan 31 17:45 /sys/bus/pci/devices/0000:00:03.2/host21/target21:0:1/21:0:1:0/driver -> ../../../../../../bus/scsi/drivers/sr

    And now the only left is to make these modules autoload during boot.  Here
    is one thing to note: we should load all specific ata modules (for other
    hardware, if any) _before_ 'ata_generic'.  Otherwise with parameter
    'all_generic_ide' it'll take over all available ata controllers.  Order of
    ata drivers and scsi drivers (sr_mod, sd) does not matter. So, something
    like this should be written in modprobe.conf:
    
        modprobe.conf:

            options ata_generic all_generic_ide=1
            install ata_generic /sbin/modprobe ata_piix ; /sbin/modprobe --ignore-install ata_generic

    or

        modprobe.conf:

            options ata_generic all_generic_ide=1
            install ata_generic /sbin/modprobe ata_piix ; /sbin/modprobe --ignore-install ata_generic $CMDLINE_OPTS

    though, adding $CMDLINE_OPTS (to add all options from the command line) is
    useless here - 'ata_generic' has only one option.


    Also there is another one module, which can drive IDER controller -
    'ide_pci_generic' (CONFIG_BLK_DEV_GENERIC). Unlike 'ata_generic', which
    uses libata, this module uses old ATA subsystem (CONFIG_IDE) (are terms
    here used correctly?). If you use this driver, cdrom drive will no longer
    be present as scsi device. Now it'll be handled by 'ide_cd' driver
    (CONFIG_BLK_DEV_IDECD).  'ide_pci_generic' driver also requires option
    'all_generic_ide' set in order to take over any device.

    Here are some results from booting linux with different ATA drivers used
    (though root partition in these tests is on the hard drive).

    All three boot scenarios require SATA AHCI controller to be in
    compatibility mode, otherwise ATA drivers can not work with it and kernel
    can't access root partition.
    1. ata_piix.  Here ata_piix driver is compiled in and handles all ATA
       controllers.  It correctly takes over AHCI controller (in
       compatiblility mode) and over PATA controller.  ata_generic was loaded
       as module later to handle IDER controller.

       Here is some info about such system config:

            # ls -l /sys/bus/pci/devices/*/driver
            ..
            lrwxrwxrwx 1 root root 0 Feb  1 13:06 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/ata_generic
            ..
            lrwxrwxrwx 1 root root 0 Feb  1 13:06 /sys/bus/pci/devices/0000:00:1f.2/driver -> ../../../bus/pci/drivers/ata_piix
            ..
            # lspci -nn | grep IDE
            00:03.2 IDE interface [0101]: Intel Corporation Mobile PM965/GM965 PT IDER Controller [8086:2a06] (rev 0c)
            00:1f.2 IDE interface [0101]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA IDE Controller [8086:2828] (rev 03)
            # ls -l /sys/bus/pci/devices/0000\:00\:1f.2/
            total 0
            ..
            lrwxrwxrwx 1 root root    0 Feb  1 13:06 driver -> ../../../bus/pci/drivers/ata_piix
            ..
            drwxr-xr-x 5 root root    0 Feb  1  2011 host0
            drwxr-xr-x 5 root root    0 Feb  1  2011 host1
            ..
            # ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host0/
            total 0
            drwxr-xr-x 2 root root    0 Feb  1 13:13 power
            drwxr-xr-x 3 root root    0 Feb  1  2011 scsi_host
            lrwxrwxrwx 1 root root    0 Feb  1  2011 subsystem -> ../../../../bus/scsi
            drwxr-xr-x 4 root root    0 Feb  1  2011 target0:0:0
            -rw-r--r-- 1 root root 4096 Feb  1  2011 uevent
            # ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host0/target0\:0\:0/0\:0\:0\:0/driver
            lrwxrwxrwx 1 root root 0 Feb  1 13:13 /sys/bus/pci/devices/0000:00:1f.2/host0/target0:0:0/0:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sd
            # ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host1/
            total 0
            drwxr-xr-x 2 root root    0 Feb  1 13:11 power
            drwxr-xr-x 3 root root    0 Feb  1  2011 scsi_host
            lrwxrwxrwx 1 root root    0 Feb  1  2011 subsystem -> ../../../../bus/scsi
            drwxr-xr-x 4 root root    0 Feb  1  2011 target1:0:0
            -rw-r--r-- 1 root root 4096 Feb  1  2011 uevent
            # ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host1/target1\:0\:0/1\:0\:0\:0/driver
            lrwxrwxrwx 1 root root 0 Feb  1 13:09 /sys/bus/pci/devices/0000:00:1f.2/host1/target1:0:0/1:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sr


    2. ata_generic.  Here ata_generic driver is compiled in and handles all
       ATA controllers.  It successfully takes over AHCI controller (in
       compatibility mode), PATA controller and IDER controller. Though, if
       IDE Redirection is enabled in management console (kernel can see
       devices attached to IDER controller), ATA devices may be named in not
       the order you expect, so 'root=' kernel parameter should be adjust
       correspondingly (or udev from initramfs should be used).  To take over
       any device this driver requires 'all-generic-ide' option set at kernel
       command line:

            ata_generic.all_generic_ide=1

       or

            ata-generic.all-generic-ide=1

       Here is some info about such system config:

            # ls -l /sys/bus/pci/devices/*/driver
            ..
            lrwxrwxrwx 1 root root 0 Feb  1 14:20 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/ata_generic
            ..
            lrwxrwxrwx 1 root root 0 Feb  1 14:20 /sys/bus/pci/devices/0000:00:1f.2/driver -> ../../../bus/pci/drivers/ata_generic
            ..
            # lspci -nn | grep IDE
            00:03.2 IDE interface [0101]: Intel Corporation Mobile PM965/GM965 PT IDER Controller [8086:2a06] (rev 0c)
            00:1f.2 IDE interface [0101]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA IDE Controller [8086:2828] (rev 03)
            # ls -l /sys/bus/pci/devices/0000\:00\:03.2/
            ..
            lrwxrwxrwx 1 root root    0 Feb  1 14:20 driver -> ../../../bus/pci/drivers/ata_generic
            ..
            drwxr-xr-x 6 root root    0 Feb  1  2011 host0
            drwxr-xr-x 4 root root    0 Feb  1  2011 host1
            ..
            # readlink -f /sys/class/block/sda/device
            /sys/devices/pci0000:00/0000:00:03.2/host0/target0:0:0/0:0:0:0
            # ls -l /sys/bus/pci/devices/0000\:00\:1f.2/host2/
            total 0
            drwxr-xr-x 2 root root    0 Feb  1 14:23 power
            drwxr-xr-x 3 root root    0 Feb  1  2011 scsi_host
            lrwxrwxrwx 1 root root    0 Feb  1  2011 subsystem -> ../../../../bus/scsi
            drwxr-xr-x 4 root root    0 Feb  1  2011 target2:0:0
            -rw-r--r-- 1 root root 4096 Feb  1  2011 uevent
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/host2/target2:0:0/2:0:0:0/driver
            lrwxrwxrwx 1 root root 0 Feb  1 14:23 /sys/bus/pci/devices/0000:00:1f.2/host2/target2:0:0/2:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sd
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/host3/
            total 0
            drwxr-xr-x 2 root root    0 Feb  1 14:24 power
            drwxr-xr-x 3 root root    0 Feb  1  2011 scsi_host
            lrwxrwxrwx 1 root root    0 Feb  1  2011 subsystem -> ../../../../bus/scsi
            drwxr-xr-x 4 root root    0 Feb  1  2011 target3:0:0
            -rw-r--r-- 1 root root 4096 Feb  1  2011 uevent
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/host3/target3:0:0/3:0:0:0/driver
            lrwxrwxrwx 1 root root 0 Feb  1 14:24 /sys/bus/pci/devices/0000:00:1f.2/host3/target3:0:0/3:0:0:0/driver -> ../../../../../../bus/scsi/drivers/sr
            # ls -l /sys/class/block/sd*
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sda -> ../../devices/pci0000:00/0000:00:03.2/host0/target0:0:0/0:0:0:0/block/sda
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sdb -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sdb1 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb1
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sdb2 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb2
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sdb3 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb3
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sdb4 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb4
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sdb5 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb5
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/sdb6 -> ../../devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sdb/sdb6


    3. ide_pci_generic.  Here ide_pci_generic driver is compiled in and
       handles all ATA controllers. This driver represents old IDE subsystem,
       and noticeable difference from new ATA subsystem (libata) is that it
       names devices as /dev/hd* instead of /dev/sd*.  As well as ata_generic
       it successfully takes over all AHCI, PATA and IDER controllers. Device
       names here are also different from all what was before, so, 'root='
       kernel parameter should be adjusted. To take over any device this
       driver requires 'all-generic-ide' option set at kernel command line:

            ide-pci-generic.all-generic-ide

       or

            ide-pci-generic.all-generic-ide

       Here is some info about such system config:

            # ls -l /sys/bus/pci/devices/*/driver
            ..
            lrwxrwxrwx 1 root root 0 Feb  1 14:49 /sys/bus/pci/devices/0000:00:03.2/driver -> ../../../bus/pci/drivers/PCI_IDE
            ..
            lrwxrwxrwx 1 root root 0 Feb  1 14:49 /sys/bus/pci/devices/0000:00:1f.2/driver -> ../../../bus/pci/drivers/PCI_IDE
            ..
            # ls -l /sys/bus/pci/devices/0000:00:03.2/
            total 0
            ..
            lrwxrwxrwx 1 root root    0 Feb  1 14:49 driver -> ../../../bus/pci/drivers/PCI_IDE
            ..
            drwxr-xr-x 6 root root    0 Feb  1  2011 ide0
            drwxr-xr-x 4 root root    0 Feb  1  2011 ide1
            ..
            # ls -l /sys/bus/pci/devices/0000:00:03.2/ide0/
            total 0
            drwxr-xr-x 3 root root    0 Feb  1  2011 0.0
            drwxr-xr-x 5 root root    0 Feb  1  2011 0.1
            drwxr-xr-x 3 root root    0 Feb  1  2011 ide_port
            drwxr-xr-x 2 root root    0 Feb  1 14:49 power
            -rw-r--r-- 1 root root 4096 Feb  1  2011 uevent
            # ls -l /sys/bus/pci/devices/0000:00:03.2/ide0/0.0/
            (no 'driver' symlink - module required for floppy to work was not compiled (what module is needed?))
            # ls -l /sys/bus/pci/devices/0000:00:03.2/ide0/0.1/
            ..
            lrwxrwxrwx 1 root root    0 Feb  1 14:50 driver -> ../../../../../bus/ide/drivers/ide-cdrom
            ..
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/
            ..
            lrwxrwxrwx 1 root root    0 Feb  1 14:49 driver -> ../../../bus/pci/drivers/PCI_IDE
            ..
            drwxr-xr-x 5 root root    0 Feb  1  2011 ide2
            drwxr-xr-x 5 root root    0 Feb  1  2011 ide3
            ..
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/ide2/
            total 0
            drwxr-xr-x 5 root root    0 Feb  1  2011 2.0
            drwxr-xr-x 3 root root    0 Feb  1  2011 ide_port
            drwxr-xr-x 2 root root    0 Feb  1 14:51 power
            -rw-r--r-- 1 root root 4096 Feb  1  2011 uevent
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/ide2/2.0/
            ..
            lrwxrwxrwx 1 root root    0 Feb  1 14:51 driver -> ../../../../../bus/ide/drivers/ide-gd
            ..
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/ide2/2.0/block/
            total 0
            drwxr-xr-x 12 root root 0 Feb  1  2011 hde
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/ide3/
            total 0
            drwxr-xr-x 5 root root    0 Feb  1  2011 3.0
            drwxr-xr-x 3 root root    0 Feb  1  2011 ide_port
            drwxr-xr-x 2 root root    0 Feb  1 14:51 power
            -rw-r--r-- 1 root root 4096 Feb  1  2011 uevent
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/ide3/3.0/
            ..
            lrwxrwxrwx 1 root root    0 Feb  1 14:52 driver -> ../../../../../bus/ide/drivers/ide-cdrom
            ..
            # ls -l /sys/bus/pci/devices/0000:00:1f.2/ide3/3.0/block/
            total 0
            drwxr-xr-x 6 root root 0 Feb  1  2011 hdg
            # ls -l /sys/class/block/hd*
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hdb -> ../../devices/pci0000:00/0000:00:03.2/ide0/0.1/block/hdb
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hde -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hde1 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde1
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hde2 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde2
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hde3 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde3
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hde4 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde4
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hde5 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde5
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hde6 -> ../../devices/pci0000:00/0000:00:1f.2/ide2/2.0/block/hde/hde6
            lrwxrwxrwx 1 root root 0 Feb  1  2011 /sys/class/block/hdg -> ../../devices/pci0000:00/0000:00:1f.2/ide3/3.0/block/hdg
            # ls -l /sys/bus/pci/drivers/PCI_IDE/module
            lrwxrwxrwx 1 root root 0 Feb  1 15:01 /sys/bus/pci/drivers/PCI_IDE/module -> ../../../../module/ide_pci_generic


    Hence, to boot linux from cdrom drive on IDER controller, we just need to
    have compiled into the kernel either ata_generic or ide_pci_generic
    driver.  I test this with gentoo livecd and SystemRescueCd. First one has
    ide_pci_generic driver compiled in and should be booted like

        gentoo ide-pci-generic.all-generic-ide

    second one has ata_generic driver compiled and should be booted like

        <..system rescue cd boot options..> ata-generic.all-generic-ide=1

    PS. This was tested on motherboard with Intel PM965 chipset (Centrino
    vPro) with AMT 2.6 (or 2.5?) and kernel 2.6.36.