LVM volume resizing jots

These are my jots as I resized a partition containing an encrypted LVM physical volume, and then took advantage of that extra space by extending a logic volume containing an ext4 file system. The system is an Ubuntu 14.04.1 with a 3.13.0-35-generic kernel. There are several HOWTOs on this, but somehow I struggled a bit [...]

systemd jots

I not an expert on this These are just my what-on-earth-is-going-on-here notes as I tried to understand how my Debian 8.2 (“Jessie”) machine boots up. Conclusion: It’s a mess. More specifically, it’s a weird mix between good-old SystemV init scripts and a nasty flavor of upstart. And they say it’s here to stay. Maybe. But [...]

Reading the firmware ROM from a Renesas uPD720202 USB 3.0 Host Controller using Linux

Pretty much as a side note, I should mention that the firmware should and can be loaded with a Windows utility named K2024FWUP1.exe. Get it from whereever you can, and verify it isn’t dirty with $ shasum K2024FWUP1.exe c9414cb825af79f5d87bd9772e10e87633fbf125  K2024FWUP1.exe If this isn’t done, Window’s Device Manager will say that the device can’t be started, [...]

Cursor control characters in a bash script

To control the cursor’s position with a plain bash “echo” command, use the fact that the $’something‘ pseudo-variable interprets that something more or less like a C escape sequence. So the ESC character, having ASCII code 0x1b, can be generated with $’0x1b’. $’\e’ is also OK, by the way. There are plenty of sources for [...]

Using Linux’ setpci to program an EEPROM attached to an PLX / Avago PCIe switch

Introduction These are my notes as I programmed an Atmel AT25128 EEPROM, attached to a PEX 8606 PCIe switch, using PCIe configuration-space writes only (that is, no I2C / SMBus cable). This is frankly quite redundant, as Avago supplies software tools for doing this. In fact, in order to get their tools, register at Avago’s [...]

Linux kernel hack for calming down a flood of PCIe AER messages

While working on a project involving a custom PCIe interface, Linux’ message log became flooded with messages like pcieport 0000:00:1c.6: device [8086:a116] error status/mask=00001081/00002000 pcieport 0000:00:1c.6: [ 0] Receiver Error pcieport 0000:00:1c.6: [ 7] Bad DLLP pcieport 0000:00:1c.6: [12] Replay Timer Timeout pcieport 0000:00:1c.6: Error of this Agent(00e6) is reported first pcieport 0000:02:00.0: PCIe Bus [...]

syslogd notes

A few jots on playing with the system logger (the one that writes to /var/log/messages) on an ancient CentOS 5.5. First, check the version: It says Oct 6 15:12:06 diskless syslogd 1.4.1: restart. So it’s a quite old revision of syslogd, unfortunately. There are no filter conditions to rely on. The relevant configuration file is [...]

Hexdump notes

General notes For plain byte-per-byte hex dump, $ hexdump -C To dump a limited number of bytes, use the -n flag: $ hexdump -C -n 64 /dev/urandom 00000000  9c 72 b0 43 da 6e 27 2f  f9 f1 34 06 60 d5 71 ad  |.r.C.n’/..4.`.q.| 00000010  cc 07 89 02 f7 f9 5f 85  f6 [...]

Linux kernel compilation jots

General These are a few random notes to self regarding kernel compilation. The preferred vanilla kernel rep to use is Linux Stable: $ git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ It’s often a good idea to pick a kernel version that was released a while ago, but with a high sub-subversion number. So it has been tested properly and [...]

Instead of using “rm -rf”

The slightly safer alternative  is $ rm –one-file-system -vrf delme-junk/ There are two additional flags: The -v flag causes “rm” to display the files as it deletes them. This gives the user a chance to stop the process if something completely wrong happens. Not as good as thinking before making the mistake, but much better [...]