czwartek, 26 września 2013

MPD na CLFS

MPD - Music Played Daemon,
CLFS - Cross Linux from Scratch.

Wygląda na to, że MPD działa (po spełnieniu zależności) out-of-the-box na CLFS:
  cd ../mpd-0.17.5
  ./configure --prefix=/usr
  make -j2
  make install

Jeszcze trzeba wszystko posprawdzać. To tylko pierwsze próby.

środa, 25 września 2013

WA-2204C jako klient WiFi

Od jakiegoś czasu poszukiwałem wygodnego urządzenia, które pozwoli mi na połączenie się z routerem wifi za pomocą urządzenia z interfejsem ethernet. Schematycznie:

Dostawca - Ethernet - WiFi Router -> <- WiFi Client - Ethernet - PC

Czemu tak, a nie użyć WiFi na USB? Otóż urządzenia takie jak Wyse 1125 na pewno nie dogada się z nowymi urządzeniami USB a Ethernet to stary, dobry standard.

Do rzeczy, jak to zrobić. Nieodzowną pomoc przyniósł mi temat Proncjusza.

1. Basic Setup:
Ustawienia Routera i Klienta na  ten sam typ sieci (b, g lub b+g).
Mode: Client
Network Type: Infrastructure
SSID: Nazwa sieci rozgłaszanej przez router (choć nie wiem, czy niezbędne)

2. Security:
Encryption, WPA(2) Cipher Suite jak w Routerze
Key Format: Passpharse
Pre-Shared Key: Hasło ustalone na Routerze

3. Site Survey:
Tutaj odświeżamy i wybieramy sieć z którą chcemy się połączyć.

4. TCP/IP ustalamy wymarzony adres IP (najlepiej uwzględniając to co najpewniej przydzieli nam router). DHCP - disabled pozwala na przydzielanie IP Klientom przez Router (choć za pośrednictwem WA).

I to tyle... działa!

wtorek, 24 września 2013

Cross linux from scratch na Wyse S10 (i innych Sx0)

Nieodzowną pomocą podczas kompilowania jądra dla Wyse (winterm) S10 są przewodniki tinkering-is-fun oraz (oczywiście) parkytowers.

[PT] .configure (tj. konfiguracja wyjściowa)

[TIF]:
The CPU used is an AMD Geode LX800, so it's x86-compatible. And the board itself is almost PC-compatible. This means you can run stock x86 Debian on it.

To give you some idea on the insides, here's the output of lspci:

00:01.0 Host bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] Host Bridge (rev 33)
00:01.2 Entertainment encryption device: Advanced Micro Devices [AMD] Geode LX AES Security Block
00:09.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
00:0a.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
00:0b.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)

00:0f.0 ISA bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] ISA (rev 03)
00:0f.2 IDE interface: Advanced Micro Devices [AMD] CS5536 [Geode companion] IDE (rev 01)
00:0f.4 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] OHC (rev 02)
00:0f.5 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] EHC (rev 02)

If you want to customize the kernel yourself (instead of sticking to whatever your distro provides) here are some tips based on my experience:
  • Turn on General setup/Configure standard kernel features (for small systems). This lets you kill off some features that are useless on the ALIX anyway, like PC-speaker and Virtual Terminal support. (uwagi ważne dla lekkości jądra)
  • You probably want to disable any sort of namespaces/virtualization support. (j.w.)
  • In Processor type and features: (ważne ze względu na wydajność)
    • Select Geode GX/LX as the Processor family.
    • There is neither HPET nor MTRR, so turn that off.
  • There's no ACPI/APM, so you can turn that off in Power management and ACPI options. But if you intend to use selective USB suspend, you need to keep Power Management support on. (All other options in this submenu can be off.)
  • In Bus options: There is PCI, so that needs to be enabled. Also turn on NatSemi SCx200 support. But don't turn on NatSemi SCx200 27MHz High-Resolution Timer Support. Enable Geode Multi-Function General Purpose Timer (MFGPT) events. (As the help says this can be use as high-precision timer, turning on Processor type and features/High Resolution Timer Support might be a good idea(?)) (jak i autor, nie wiem, jak to może się przydać, ale może)
  • In Device drivers:
    • Decide if you wish to use the legacy ATA way or the newer libata way. I've been using the libata approach for a long time without any problem, so I suggest you use that. But beware -- switching between those two results in the CF card being visible as either /dev/hda or /dev/sda and this can break you boot.
    • For the old ATA way choose: ATA/ATAPI/MFM/RLL support/CS5536 chipset support (or AMD CS5535 chipset support in older kernels)
    • For the libata way choose: Serial ATA (prod) and Parallel ATA (experimental) drivers/ATA SFF support/CS5536 PATA support (zdecydowanie - nowa infrastruktura jądra - sda)
    • Enable Network device support/Ethernet (10 or 100Mbit)/EISA, VLB, PCI and on board controllers/VIA Rhine support. You can also enable Use MMIO instead of PIO for VIA Rhine. (Works fine for me.)
    • Input device support: Enable if you plan to connect any such thing to your ALIX. If it's just gonna sit on your shelf chewing some network traffic you don't need that.
    • Character devices: Feel free to disable Virtual terminal as it's of no use on an ALIX 2 anyway. To use the HW random number generator that the Geode contains enable Hardware Random Number Generator Core support/AMD Geode HW Random Number Generator support. Don't forget to enable the serial console: Serial drivers/8250/16550 and compatible serial support and Console on 8250/16550 and compatible serial port.
    • Enable Hardware Monitoring support/National Semiconductor LM90 and compatibles to be able to see what's going on inside your ALIX. (You also need to enable I2C Support for this.)
    • There's hadware watchdog too. To use it, enable Watchdog Timer Support/AMD Geode CS5535/CS5536 Watchdog. In debian, look into the package "watchdog" for an app to use it. (w naszym przypaku watchdog jest niewykrywany)
    • Graphics support: Feel free to uncheck everything there. :-)
    • Sound card support: The same, unless you buy some USB sound thingy. :-) (fb dla naszego CS'a już jest w jądrze)
    • USB support: To get USB functionality enable EHCI HCD (USB 2.0) support and OHCI HCD support.
    • To get access to the ALIX leds, enable LED Support/LED Support for ALIX.2 and ALIX.3 series and also select some LED Triggers.
    • You can freely uncheck Real Time Clock. While there's an option to add a battery to the board so that it keeps the time, even if I enable RTC, I don't get /dev/rtc. Either way, without the battery you'll always boot into Jan 1st 2000, so I think RTC support is useless here. (kwestia sporna. i u nas rtc zawsze się restartuje)
    • You can enable GPOI Support/AMD CS5535/CS5536 GPIO (Geode Companion Device) -- This can probably used to read the status of the front ALIX button (?) Also I2C Support/I2C Hardware Bus support/Geode ACCESS.bus support seems relevant. But I don't know more and so far was too lazy to look for it. Any info is welcome. :-)
  • To use the hardware AES crypto engine enable Cryptographic API/Hardware crypto devices/Support for the Geode LX AES engine. (nie ma)
  • I suggest you enable Magic SysRq key (Kernel hacking/Magic SysRq key), as it works also over serial (instead of SysRq, you send a break, see Documentation/sysrq.txt).

(The menu items are as per the 2.6.31.6 kernel, but they should be reasonably similar for any kernel version that is not too distant.)

The other options pretty much depend on your specific requirements and there's not anything board-specific that influences them.

 Części z tych rzeczy nie ma lub nie były wypróbowany. Dalszy 'research' będzie potrzebny.

Wkrótce udostępnię moje dmesg i config (uwzględniające sterowniki dla wirtualnej maszyny, tj. VirtualBox).

poniedziałek, 23 września 2013

Montowanie partycji /dev dla chroot

Czasem programy wymagają do skompilowania plików z drzewa /dev.
Podobnie sytuacja wygląda przy Python3 (/dev/urandom). Proste
mount --bind /dev <chroot dir>/dev 
rozwiązuje problem.

niedziela, 22 września 2013

Brak partycji root gdy system uruchamiany z usb

Unable to detect/mount root device.

Znowu walcząc z Wyse S10 musiałem się naszukać, by odkryć powód, dla którego mój system nie wstaje. Oczywiście wszystkie niezbędne (i kilka zbędnych) sterowniki zostały wkompilowane w jądro. Gdy walczyłem z tinycorem utkwił mi w pamięci parametr dla jądra usbdelay=5 ale to akurat nie pomogło.
Nie wiadomo jak i kiedy trafiłem jednak na rootdelay, który to, ustawiony na 3 (sekundy) dawał urządzeniom USB czas na przedstawienie się systemowi.


Zmiana daty wszystkich plików w okolicy

Dziś walczę z kompilacją mpd oraz bibliotek na terminalu Wyse S10.
Pudełko małe i zgrabne, i z niedziałającym RTC.

./configure zatrzymuje się z powodu plików, które mają nowszą datę utworzenia od obecnej. quirkasaurus podaje na to proste rozwiązanie:
find . -exec touch {} \;
Które świetnie rozwiązuje problem.
Przy okazji okazuje się, że find to świetne narzędzie i nadaje się nie tylko do robienia listy plików.