💾 Archived View for ecs.d2evs.net › feed.xml captured on 2021-12-04 at 18:04:22.
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>ecs's blog</title> <description>I do stuff, most of which does not involve writing blog posts.</description> <link>gemini://ecs.d2evs.net</link> <atom:link href="gemini://ecs.d2evs.net/feed.xml" rel="self" type="application/rss+xml" /> <item> <title>Apple sucks and I'm tired of it</title> <description># Apple sucks and I'm tired of it All Apple products that I've ever used are incredibly shoddy. Let's break down why. ## General issues Apple, in general, views its products as, well, products. It attempts to control what its users can and cannot do with their computers, waging constant warfare on the concept of general-purpose computing. ## Software For obvious reasons, I haven't purposefully come within a ten-foot radius of Apple software since I've become tech-literate, so I'm positive that there are more issues with Apple software. Patches are welcome! macOS's POSIX implementation is extraordinarily buggy. All the good parts are stolen from BSD and Mach. Contrary to popular belief, the UI is terrible - it doesn't give users the tools to become more knowledgeable. Lack of access to the source code makes users reliant on Apple to provide support. Proprietary APIs abound, locking developers into Apple's platform. macOS is increasingly similar to iOS, I would be surprised if it lasted another five years without becoming a thinly rebranded iOS knockoff. There's so much wrong with iOS that I can't even begin to fathom how to express it all. The UI is the literal worst interface I could possibly imagine. The amount of lock-in and lockdown should be a criminal offence punishable by dismemberment of the executives responsible. The advertising and tracking APIs are violations of the trust that users put in the software vendor to look out for them. The propaganda about Apple being committed to privacy is a disgrace to any vendor even remotely privacy-conscious. The walled garden of apps is a crude mockery of any semblance of sane package management. I don't have any first-hand experience with watchOS or tvOS, but from what I've seen they exhibit all the problems that other Apple software has - putting Apple's interests before the user's and having dubious technical merit. ## Firmware OpenFirmware isn't actually open, and USB booting on the only PowerBook I've used caused the system to hang indefinitely. EFI is a pain to deal with on MacBooks. I haven't yet had the "joy" of dealing with ARM MacBooks, but I bet the boot story won't be pretty. iOS bootup is a nightmare hellscape, the only good thing is that at least there's an exploit which allows arbitrary code execution early in the boot sequence. The fact that this requires an exploit is exactly the issue. As of the time of publication, there are no known watchOS/tvOS bootloader exploits, therefore these devices are worth less than an equivalently sized pile of toxic gas. ## Hardware I use Apple hardware (currently a MacBook 3,1, previously a MacBook 5,1, both running Alpine Linux) as my daily driver, so I have the most first-hand experience with the hardware side of things (lucky me!). Update 2020-01-06: I have replaced my MacBooks with an Optiplex 9010 and a ThinkPad T420, both corebooted. Best decision I've made in quite a while. The MacBook 3,1 runs extraordinarily loudly, the MacBook 5,1 runs extraordinarily hot. Regardless of what it tries, Apple seems to be incapable of coping with the fact that electronics produce heat. The (proprietary, yay) chargers break (3,1's charger is extraordinarily frayed, had to buy a replacement for the PowerBook G4 charger). All Apple products are extraordinarily overpriced (or extraordinarily slow, depending on how you look at it). They somehow manage to make the laptop look (subjectively) uglier than a Thinkpad in exchange for terrible thermals. The 5,1 recently straight up died. Locks up completely somewhere inside the initramfs. I'd try to debug that, but it's practically impossible to take a MacBook apart. Update 2020-01-06 (though the events in question happened a while ago): The issue with the 5,1 was a dead HDD. It worked mostly fine with an SSD, though the GPU is ridiculously terrible - it's actually /faster/ with LIBGL_ALWAYS_SOFTWARE set globally, and without that it randomly locks up. Remember the iPhone 4 "you're holding it wrong" fiasco? 'Nuff said. In conclusion, all Apple executives deserve to be drawn, quartered, resurrected, have lemon juice poured in their eyes, be launched into space with no protective equipment, brought back, cut up into small chunks, powdered, and used as animal feed.</description> <pubDate>24 Oct 2020 00:00:00 +0000</pubDate> <link>https://ecs.d2evs.net/posts/2020-10-24-Apple.gmi</link> <guid isPermaLink="true">gemini://ecs.d2evs.net/posts/2020-10-24-Apple.gmi</guid> </item> <item> <title>Self-hosting my life</title> <description># Self-hosting my life Over the last few months, I've grown to despise the way most people now interact with computers. A typical person:
dd if=openbsd.iso of=/dev/sdb
boot hd:,\ofwboot /6.6/macppc/bsd.rd
I recently found an old computer lying around in my house -- an old 17" PowerBook G4 (A1085, or 5,5). It had stopped working years ago, but with a new charger, I got it to boot to OS X. However, I wanted to run an open-source OS on it. 32-bit PowerPC is old enough that practically no-one still supports it. I ended up choosing OpenBSD, because I managed to boot it before I managed to boot NetBSD or FreeBSD, and I didn't want to have to deal with Gentoo's compilation hell on a computer that old. I downloaded the OpenBSD install ISO, and got to work. The first challenge was booting to it. The CD drive wasn't working, so I couldn't boot from there, and for whatever reason, OpenFirmware would hang whenever I tried to boot from a USB. So I booted to MacOS (which could read the USB) and used it to copy the contents of the ISO onto the HFS partition. It worked... almost. I realized my mistake as soon as I had repartitioned the hard drive. The sets (gzipped tarballs that are untarred over the new root) were on the now-destroyed HFS partition. In addition, I had completely messed up `/dev` earlier (by running `sh /dev/MAKEDEV all` and running out of space on the ramdisk), so I wasn't able to copy over sets from my USB. I ended up accidentally killing my shell without a `/dev/console`, leading to a wedged system. However, I still had the OpenBSD kernel running, so I was hoping that maybe, just maybe, if I hot-swapped the hard drive... So I pulled out a stick of RAM, unplugged the internal keyboard, and it must have touched some circuit because there was a flash and magic smoke was leaking out of the logic board. I quickly unplugged it and removed the battery (thank God for easily removable batteries!). Note to future self: DO NOT try to take apart a computer while it is running! When I turned it on, it no longer chimed on boot, but was otherwise unharmed. However, I still had a bit of a problem. I needed to boot to OpenBSD, but I had no way of booting a CD or USB, and the hard drive was wiped. Thankfully, a quick `dd if=openbsd.iso of=/dev/sdb` after plugging the hard drive into my computer worked, and the installer booted just fine from there:
boot hd:,\ofwboot /6.6/macppc/bsd.rd
This time, I made sure that I could access the sets before I partitioned the hard drive. After putting the ISO in the first partition of an MBR, I was able to mount `/dev/sd0i`. Success! Now I just had to finish the installer, and reboot. Not so fast. The install didn't work, and I wasn't able to debug because I wasn't able to mount the OpenBSD partition on Linux. So I re-installed the installer (by this point, I was quite proficient at taking the PowerBook apart), reinstalled OpenBSD, and got a shell after the install process, in order to see what was going on. It went fine, but my custom partitioning had put the kernel in the second partition (with the first partition being swap), which apparently confused the bootloader. Once I fixed that, it worked!</description> <pubDate>13 Jan 2020 00:00:00 +0000</pubDate> <link>https://ecs.d2evs.net/posts/2020-01-13-PowerBook-G4-OpenBSD.gmi</link> <guid isPermaLink="true">gemini://ecs.d2evs.net/posts/2020-01-13-PowerBook-G4-OpenBSD.gmi</guid> </item> <item> <title>Adventures installing OpenWRT</title> <description># Adventures installing OpenWRT I recently got my MikroTik RB2011U, and I wanted to install OpenWRT on it. => https://openwrt.org/toh/mikrotik/rb2011uias MikroTik RB2011U The MikroTik RouterBOARD has a "Netinstall" mode, in which it connects to `eth1` and receives a kernel to boot from using TFTP (the Trivial File Transfer Protocol). I ended up with this small script, based on something from the OpenWRT documentation:
TFTP_DIR=~/tmp/openwrt
TFTP_FILE=stable.elf
sudo ifconfig enp2s0f1 192.168.1.10 up
sudo dnsmasq -i enp2s0f1 --dhcp-range=192.168.1.100,192.168.1.200 \
--dhcp-boot=$TFTP_FILE --enable-tftp --tftp-root=$TFTP_DIR \
--enable-tftp -d -u $USER -p0 -K --log-dhcp --bootp-dynamic
Once the router attempted to connect to the DHCP server with the hostname `OpenWrt`, I killed the TFTP server. This worked - the router was now running OpenWRT from RAM. Then, I disconnected my laptop from `eth1` and plugged it into `eth2`. The OpenWRT initramfs is configured to act as a DHCP server on `eth2` through `eth10`. At this point, I `ssh`ed into the router:
$ ssh root@OpenWrt
(In the future, commands starting with `gemini - kennedy.gemi.dev are on the host computer, and commands starting with `#` are on the router.) I now had a root shell on the router! So far so good. I then `scp`ed the OpenWRT sysupgrade[1] onto the router:
$ scp ~/tmp/openwrt/stable.bin root@OpenWrt:/tmp/sysupgrade.bin
and proceeded to `sysupgrade` the router:
Image metadata not found
Cannot save config while running from ramdisk.
Commencing upgrade. Closing all shell sessions.
At this point, the router closed the SSH connection and entered a boot loop. Huh. That's interesting. I tried repeating the previous steps, replacing stable (18.06.4) OpenWRT with the snapshot. (The RB2011U v2 is listed as only supported by OpenWRT snapshot.) No luck. In vain, I tried pinging the router as it boot looped. It never responded. This meant that it was crashing and burning *before* networking was initialized. (This also meant that OpenWRT failsafe mode wouldn't help.) So, I tried to read the kernel logs from flash memory:
mount: mounting /dev/mtdblock6 on /mnt/ failed: Invalid argument
Maybe I need to specify the filesystem type? JFFS2 seems likely:
mount: mounting /dev/mtdblock6 on /mnt/ failed: Invalid argument
That last case was interesting, so I pulled up another SSH connection and:
[ 703.468505] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not
found at 0x0244003c: 0xa94c instead
[ 855.211369] jffs2: Cowardly refusing to erase blocks on filesystem
with no valid JFFS2 nodes
[ 855.220100] jffs2: empty_blocks 0, bad_blocks 3, c->nr_blocks 992
It appears that there's no JFFS2 filesystem on /dev/mtdblock6. That makes sense, given:
mtd0: 0000c000 00001000 "routerboot"
mtd1: 00001000 00001000 "hard_config"
mtd2: 00001000 00001000 "bios"
mtd3: 00001000 00001000 "soft_config"
mtd4: 00040000 00020000 "booter"
mtd5: 003c0000 00020000 "kernel"
mtd6: 07c00000 00020000 "ubi"
It would appear that `mtd6` has UBIFS on it, but:
mount: mounting /dev/mtdblock6 on /mnt/ failed: Invalid argument
At this point, I decided to dump `/dev/mtd6` to my laptop, and do some forensics:
ecs@192.168.1.10's password:
253952+0 records in
253952+0 records out
253944+10 records in
253952+0 records out
130023424 bytes (130 MB, 124 MiB) copied, 313.463 s, 415 kB/s
Wait! UBI is `ubi`, not `ubifs`:
mount: mounting /dev/mtdblock6 on /mnt/ failed: No such device
What?!?!
brw------- 1 root root 31, 6 Jan 1 1970 /dev/mtdblock6
By this point, I've installed `ubi_reader` on my laptop and I go back there to do some diagnostics:
$ ubireader_list_files mtd6
UBI Fatal: Less than 2 layout blocks found.
$ less mtd6
Interesting. It appeared that OpenWRT did not successfully flash, but it failed consistently. (By this time, I had re-flashed OpenWRT quite a few times.) At this point, it was 5:00 in the morning, so I decided to go to sleep. Update: I returned that router and bought another one. Same problem. I decided to give up. [1]: OpenWRT has a `sysupgrade` command which takes a firmware image and installs it. The install procedure for MikroTik RouterBOARDs is to run OpenWRT from RAM using TFTS, then use `sysupgrade` to flash a firmware upgrade.</description> <pubDate>18 Oct 2019 00:00:00 +0000</pubDate> <link>https://ecs.d2evs.net/posts/2019-10-18-Installing-OpenWRT.gmi</link> <guid isPermaLink="true">gemini://ecs.d2evs.net/posts/2019-10-18-Installing-OpenWRT.gmi</guid> </item> </channel> </rss>