Category Archives: Tips&tricks

Installing Replicant 4.2 on Galaxy S1

Yesterday, I decided to install Replicant on a Samsung Galaxy S1 ( i9000, also referred to as galaxysmtd in the builds ). However, it already had some version of Cyanogen Mod on it – apparently, not the one that was installed. Also, I had to blacklist some drivers for heimdall tool to work on my Linux laptop.

When flashing recovery – if you connect a Galaxy S1 in download mode to a Linux laptop, it’ll present itself as a serial port, then the cdc_acm driver will load and, apparently, send some AT commands (to check if the device is a modem), which crashes something in the download mode code, apparently, so it stops responding to the heimdall tool and there’s always this “Protocol initialization failed” message, and if you get further, there are still problems

To solve this, I added two lines: “blacklist cdc_acm” and “blacklist visor” to an /etc/modprobe.d/blacklist.conf file, and then rebooted. I don’t know if that could be solved without rebooting, only after reboot it seemed to be solved for me.

After this, I could easily flash Replicant-provided recovery image to the phone. However, it’d give this error all the time:

DSCN4600

“Error in replicant-4.2-galaxysmtd.zip (Status 0)”. Not the most informative error message. Basically, the scripts returns “ran normally” but the install doesn’t continue. I opened the .zip and saw the updater.sh there, which ought to have been the file causing that error. After debugging the script execution path with some ui_print macros, I found a section in the middle of the script (in the section for “new mtd layouts” or something) that would stop the process, but exit 0 (erroneously assuming something IIRC).  I removed that section, and it went further – but got stuck on some thing that would “exit 7”. I removed that exit statement too, and Replicant finally got installed. TODO: understand what that “exit 7” thing was complaining about.

However, Replicant is running great now, so all is well =)

Advertisements

Raspberry Pi audio jack part number

The part number for that black audio+video jack that can be seen on Raspberry Pi B+ / A+ / 2 / 3 is FC68125. I found it by accident, when I needed to source them for ZeroPhone, so I had to find the part number – and here it is =) I had to find it once again, and it appears it’s ungooglable, so I leave the part number here, hoping that it helps somebody in the future.

Disabling Raspberry Pi 3 WiFi via config.txt

Today, I had to quickly debug a Pi which had a problem – it’d kernel panic right after boot due to the WiFi driver. It was probably a software problem since it would only happen on that specific SD card – on any of the Pi 3 I have. I had to solve it quickly – and all the solutions on the internet involved editing files on the Pi ext4 filesystem. I couldn’t log in the Pi, since, well, kernel panic, and I couldn’t mount the ext4 FS because I didn’t have a Linux machine handy. I did have access to config.txt, though.

I finally found a solution on OSMC forums. The way to disable the interface that Pi uses to communicate with Broadcom WiFi is:

dtoverlay=sdhost

Insert that in config.txt and the WiFi is going to be ignored. It’s not a power-saving solution – I can’t be sure it actually turns the WiFi chipset off, but it does prevent the OS from detecting it.

Flashing BIOS on MSI FM2 boards with a Richland processor

Say you, like me, had a motherboard with an incorrectly flashed BIOS. What do you do in that case? Well, best case, you use DualBIOS or an integrated BIOS recovery tool. What if neither is available? Well, you get a programmer and flash it. What if then you’re stuck with non-matching motherboard and CPU because:

  • The latest BIOS version which is available as binary is not compatible with the CPU you’re on (“please update BIOS for Richland”)
  • You can’t get another CPU in less than a month and a lot of money
  • All the versions which support your CPU are available only as self-unpacking EXEs which seem to work only when you’re in Windows, which you don’t seem to be able to do because the BIOS is not letting you:

20160306_120756

Fuckers.
Well, there actually is a solution.

  1. Get a flash drive, put MS-DOS on it (either format it using Windows =<7 and that checkbox which is there)
  2. Put that damned EXE on this drive and insert it into the motherboard (rear USB 2.0 ports preferred, the ideal orifice would be located on the body of the person responsible for a decision of not providing ROMs)
  3. Boot and press F1 to go into that damn BIOS
  4. Go “Settings”->”Save and Exit” -> override boot order and boot into that flash drive
  5. Enter “dir” to see the filename of the BIOS flashing tool
  6. Run it and reboot when it allows you.

Voila!

The boards on which this should work, according to the BIOS release notes:

FM2-A55M-E33 /FM2-A55M-E23 / FM2-A55M-P33 / FM2-A75MA-P33 / FM2-A85XMA-P33

You might have some luck with other boards, too. This approach worked for me with FM2-A75MA-P33.

Making luakit play YouTube videos

Luakit, even though it’s a quite awesome (and fast!) browser, doesn’t play YouTube videos out-of-the-box. At least, when installing it from Raspberry Pi Debian repos, it doesn’t pull the dependencies need and doesn’t even list the packages as ‘recommended’. Nowhere I could find it, but one Arch Linux forum page had a hint, which I decrypted:
Install gstreamer1.0-libav and gstreamer1.0-alsa – the latter being responsible for sound in YouTube videos.
That’s it. Hope it helps =) If you find it’s still not working for you – comment below, I’ll try to debug the issue.

Debian Jessie, VirtualBox – driver compilation failing because kernel sources cannot be found

I installed the Debian Jessie (testing) system from an around 3-month-old CD. Then I installed virtualbox and while installing it has complained that kernel sources are not found. I’ve installed linux-headers package and all the linux-headers packages that I could have found, but still no luck. I kept getting the following message:


The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

‘/etc/init.d/vboxdrv setup’

as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.


/etc/init.d/vboxdrv didn’t even exist! As I knew VirtualBox used DKMS, I did aptitude reinstall virtualbox-dkms, and it still outputted “Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed.” I even installed linux-source – it didn’t help. So what was it?

My distribution had an older kernel, as it was on the CD I installed everything from. Since then, things changed – 3.13 was replaced by 3.14. The repository only had linux headers for 3.14 – and when I installed linux-headers metapackage, I installed headers for 3.14, even though system used the 3.13 kernel. So – when a vboxdrv can’t be build, check if you really have headers for the kernel version you are using =)

Now I just need to learn how to read properly. And to reboot my PC =)

What I use for making GIFs in tutorials – small yet powerful collection of free tools as a starters kit

I’ve recently got a job making tutorials, and it seems that I’ve already found a set of free tools that help. I’ll be updating this post, should my opinion change =)

Soooo… I’ve had a task of making GIF depicting a process in Eagle CAD. I need free tools, being a poor student who, however, doesn’t want to crack software just because it’s the first thing I’ve found. Also, I use Windows XP, so, for example, Snipping Tool isn’t available to me.

Continue reading