Russ Allbery: Review: Stoneskin
| Series: | Deep Witches #0 |
| Publisher: | A Girl and Her Fed Books |
| Copyright: | September 2017 |
| ASIN: | B075PHK498 |
| Format: | Kindle |
| Pages: | 226 |
| Series: | Deep Witches #0 |
| Publisher: | A Girl and Her Fed Books |
| Copyright: | September 2017 |
| ASIN: | B075PHK498 |
| Format: | Kindle |
| Pages: | 226 |
$ git clone https://github.com/dimhoff/radio_stuff $ cd radio_stuff $ make -C converters am_to_ook $ make -C decoders decode_somfy $ rtl_fm -M am -f 433.42M -s 270K ./am_to_ook -d 10 -t 2000 - ./decode_somfy <press some buttons on the remote>The output contains the buttons I pressed, but also the id of the remote and the command counter (which is supposed to prevent replay attacks). At this point I could just use the id and the counter to send own commands, but if I'd do that too often, the real remote would stop working, as its counter won't increase and the receiver will drop the commands when the counters differ too much. But that's good enough for now. I know I'm looking for the right protocol at the right frequency. As the end result should be an ESP32, let's move on! Acquiring the right hardware Contrary to an RTL-SDR, one usually does not have a spare ESP32 with 433MHz radio at home, so I went shopping: a NodeMCU-32S clone and a CC1101. The CC1101 is important as most 433MHz chips for Arduino/ESP only work at 433.92MHz, but Somfy uses 433.42MHz and using the wrong frequency would result in really bad reception. The CC1101 is essentially an SDR, as you can tune it to a huge spectrum of frequencies. Oh and we need some cables, a bread board, the usual stuff ;) The wiring is rather simple:
And the end result isn't too beautiful either, but it works:
Acquiring the right software
In my initial research I found an Arduino sketch and was totally prepared to port it to ESP32, but luckily somebody already did that for me! Even better, it's explicitly using the CC1101. Okay, okay, I cheated, I actually ordered the hardware after I found this port and the reference to CC1101. ;)
As I am using ESPHome for my ESPs, the idea was to add a "Cover" that's controlling the shutters to it. Writing some C++, how hard can it be?
Turns out, not that hard. You can see the code in my GitHub repo. It consists of two (relevant) files: somfy_cover.h and somfy.yaml.
somfy_cover.h essentially wraps the communication with the Somfy_Remote_Lib library into an almost boilerplate Custom Cover for ESPHome. There is nothing too fancy in there. The only real difference to the "Custom Cover" example from the documentation is the split into SomfyESPRemote (which inherits from Component) and SomfyESPCover (which inherits from Cover) -- this is taken from the Custom Sensor documentation and allows me to define one "remote" that controls multiple "covers" using the add_cover function. The first two params of the function are the NVS name and key (think database table and row), and the third is the rolling code of the remote (stored in somfy_secrets.h, which is not in Git).
In ESPHome a Cover shall define its properties as CoverTraits. Here we call set_is_assumed_state(true), as we don't know the state of the shutters - they could have been controlled using the other (real) remote - and setting this to true allows issuing open/close commands at all times. We also call set_supports_position(false) as we can't tell the shutters to move to a specific position.
The one additional feature compared to a normal Cover interface is the program function, which allows to call the "program" command so that the shutters can learn a new remote.
somfy.yaml is the ESPHome "configuration", which contains information about the used hardware, WiFi credentials etc. Again, mostly boilerplate. The interesting parts are the loading of the additional libraries and attaching the custom component with multiple covers and the additional PROG switches:
esphome: name: somfy platform: ESP32 board: nodemcu-32s libraries: - SmartRC-CC1101-Driver-Lib@2.5.6 - Somfy_Remote_Lib@0.4.0 - EEPROM includes: - somfy_secrets.h - somfy_cover.h cover: - platform: custom lambda: - auto somfy_remote = new SomfyESPRemote(); somfy_remote->add_cover("somfy", "badezimmer", SOMFY_REMOTE_BADEZIMMER); somfy_remote->add_cover("somfy", "kinderzimmer", SOMFY_REMOTE_KINDERZIMMER); App.register_component(somfy_remote); return somfy_remote->covers; covers: - id: "somfy" name: "Somfy Cover" - id: "somfy2" name: "Somfy Cover2" switch: - platform: template name: "PROG" turn_on_action: - lambda: - ((SomfyESPCover*)id(somfy))->program(); - platform: template name: "PROG2" turn_on_action: - lambda: - ((SomfyESPCover*)id(somfy2))->program();The switch to trigger the program mode took me a bit. As the Cover interface of ESPHome does not offer any additional functions besides movement control, I first wrote code to trigger "program" when "stop" was pressed three times in a row, but that felt really cumbersome and also had the side effect that the remote would send more than needed, sometimes confusing the shutters. I then decided to have a separate button (well, switch) for that, but the compiler yelled at me I can't call
program on a Cover as it does not have such a function. Turns out, you need to explicitly cast to SomfyESPCover and then it works, even if the code becomes really readable, NOT. Oh and as the switch does not have any code to actually change/report state, it effectively acts as a button that can be pressed.
At this point we can just take an existing remote, press PROG for 5 seconds, see the blinds move shortly up and down a bit and press PROG on our new ESP32 remote and the shutters will learn the new remote.
And thanks to the awesome integration of ESPHome into HomeAssistant, this instantly shows up as a new controllable cover there too.
std::vector to make the code dynamically accept new shutters.
Using ESP32's NVS
The ESP32 has a non-volatile key-value storage which is much nicer than throwing bits at an emulated EEPROM. The first library I used for that explicitly used EEPROM storage and it would have required quite some hacking to make it work with NVS. Thankfully the library I am using now has a plugable storage interface, and I could just write the NVS backend myself and upstream now supports that. Yay open-source!
Remaining issues
Real state is unknown
As noted above, the ESP does not know the real state of the shutters: a command could have been lost in transmission (the Somfy protocol is send-only, there is no feedback) or the shutters might have been controlled by another remote. At least the second part could be solved by listening all the time and trying to decode commands heard over the air, but I don't think this is worth the time -- worst that can happen is that a closed (opened) shutter receives another close (open) command and that is harmless as they have integrated endstops and know that they should not move further.
Can't program new remotes with ESP only
To program new remotes, one has to press the "PROG" button for 5 seconds. This was not exposed in the old library, but the new one does support "long press", I just would need to add another ugly switch to the config and I currently don't plan to do so, as I do have working remotes for the case I need to learn a new one.
Let's say you're building some form of appliance on top of general purpose x86 hardware. You want to be able to verify the software it's running hasn't been tampered with. What's the best approach with existing technology?
Back in my last post on this topic, I'd got shell on my doorbell but hadn't figured out why the HTTP callbacks weren't always firing. I still haven't, but I have learned some more things.
I ve mostly had the preference of controlling my data rather than depend on someone else. That s one reason why I still believe email to be my most reliable medium for data storage, one that is not plagued/locked by a single entity. If I had the resources, I d prefer all digital data to be broken down to its simplest form for storage, like email format, and empower the user with it i.e. their data.
Yes, there are free services that are indirectly forced upon common users, and many of us get attracted to it. Many of us do not think that the information, which is shared for the free service in return, is of much importance. Which may be fair, depending on the individual, given that they get certain services without paying any direct dime.
It all started with the big bang! We nearly lost 33 of 36 disks on a Proxmox/Ceph Cluster; this is the story of how we recovered them.
At the end of 2020, we eventually had a long outstanding maintenance window for taking care of system upgrades at a customer. During this maintenance window, which involved reboots of server systems, the involved Ceph cluster unexpectedly went into a critical state. What was planned to be a few hours of checklist work in the early evening turned out to be an emergency case; let s call it a nightmare (not only because it included a big part of the night). Since we have learned a few things from our post mortem and RCA, it s worth sharing those with others. But first things first, let s step back and clarify what we had to deal with.
The system and its upgrade
One part of the upgrade included 3 Debian servers (we re calling them server1, server2 and server3 here), running on Proxmox v5 + Debian/stretch with 12 Ceph OSDs each (65.45TB in total), a so-called Proxmox Hyper-Converged Ceph Cluster.
First, we went for upgrading the Proxmox v5/stretch system to Proxmox v6/buster, before updating Ceph Luminous v12.2.13 to the latest v14.2 release, supported by Proxmox v6/buster. The Proxmox upgrade included updating corosync from v2 to v3. As part of this upgrade, we had to apply some configuration changes, like adjust ring0 + ring1 address settings and add a mon_host configuration to the Ceph configuration.
During the first two servers reboots, we noticed configuration glitches. After fixing those, we went for a reboot of the third server as well. Then we noticed that several Ceph OSDs were unexpectedly down. The NTP service wasn t working as expected after the upgrade. The underlying issue is a race condition of ntp with systemd-timesyncd (see #889290). As a result, we had clock skew problems with Ceph, indicating that the Ceph monitors clocks aren t running in sync (which is essential for proper Ceph operation). We initially assumed that our Ceph OSD failure derived from this clock skew problem, so we took care of it. After yet another round of reboots, to ensure the systems are running all with identical and sane configurations and services, we noticed lots of failing OSDs. This time all but three OSDs (19, 21 and 22) were down:
% sudo ceph osd tree ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF -1 65.44138 root default -2 21.81310 host server1 0 hdd 1.08989 osd.0 down 1.00000 1.00000 1 hdd 1.08989 osd.1 down 1.00000 1.00000 2 hdd 1.63539 osd.2 down 1.00000 1.00000 3 hdd 1.63539 osd.3 down 1.00000 1.00000 4 hdd 1.63539 osd.4 down 1.00000 1.00000 5 hdd 1.63539 osd.5 down 1.00000 1.00000 18 hdd 2.18279 osd.18 down 1.00000 1.00000 20 hdd 2.18179 osd.20 down 1.00000 1.00000 28 hdd 2.18179 osd.28 down 1.00000 1.00000 29 hdd 2.18179 osd.29 down 1.00000 1.00000 30 hdd 2.18179 osd.30 down 1.00000 1.00000 31 hdd 2.18179 osd.31 down 1.00000 1.00000 -4 21.81409 host server2 6 hdd 1.08989 osd.6 down 1.00000 1.00000 7 hdd 1.08989 osd.7 down 1.00000 1.00000 8 hdd 1.63539 osd.8 down 1.00000 1.00000 9 hdd 1.63539 osd.9 down 1.00000 1.00000 10 hdd 1.63539 osd.10 down 1.00000 1.00000 11 hdd 1.63539 osd.11 down 1.00000 1.00000 19 hdd 2.18179 osd.19 up 1.00000 1.00000 21 hdd 2.18279 osd.21 up 1.00000 1.00000 22 hdd 2.18279 osd.22 up 1.00000 1.00000 32 hdd 2.18179 osd.32 down 1.00000 1.00000 33 hdd 2.18179 osd.33 down 1.00000 1.00000 34 hdd 2.18179 osd.34 down 1.00000 1.00000 -3 21.81419 host server3 12 hdd 1.08989 osd.12 down 1.00000 1.00000 13 hdd 1.08989 osd.13 down 1.00000 1.00000 14 hdd 1.63539 osd.14 down 1.00000 1.00000 15 hdd 1.63539 osd.15 down 1.00000 1.00000 16 hdd 1.63539 osd.16 down 1.00000 1.00000 17 hdd 1.63539 osd.17 down 1.00000 1.00000 23 hdd 2.18190 osd.23 down 1.00000 1.00000 24 hdd 2.18279 osd.24 down 1.00000 1.00000 25 hdd 2.18279 osd.25 down 1.00000 1.00000 35 hdd 2.18179 osd.35 down 1.00000 1.00000 36 hdd 2.18179 osd.36 down 1.00000 1.00000 37 hdd 2.18179 osd.37 down 1.00000 1.00000Our blood pressure increased slightly! Did we just lose all of our cluster? What happened, and how can we get all the other OSDs back? We stumbled upon this beauty in our logs:
kernel: [ 73.697957] XFS (sdl1): SB stripe unit sanity check failed kernel: [ 73.698002] XFS (sdl1): Metadata corruption detected at xfs_sb_read_verify+0x10e/0x180 [xfs], xfs_sb block 0xffffffffffffffff kernel: [ 73.698799] XFS (sdl1): Unmount and run xfs_repair kernel: [ 73.699199] XFS (sdl1): First 128 bytes of corrupted metadata buffer: kernel: [ 73.699677] 00000000: 58 46 53 42 00 00 10 00 00 00 00 00 00 00 62 00 XFSB..........b. kernel: [ 73.700205] 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ kernel: [ 73.700836] 00000020: 62 44 2b c0 e6 22 40 d7 84 3d e1 cc 65 88 e9 d8 bD+.."@..=..e... kernel: [ 73.701347] 00000030: 00 00 00 00 00 00 40 08 00 00 00 00 00 00 01 00 ......@......... kernel: [ 73.701770] 00000040: 00 00 00 00 00 00 01 01 00 00 00 00 00 00 01 02 ................ ceph-disk[4240]: mount: /var/lib/ceph/tmp/mnt.jw367Y: mount(2) system call failed: Structure needs cleaning. ceph-disk[4240]: ceph-disk: Mounting filesystem failed: Command '['/bin/mount', '-t', u'xfs', '-o', 'noatime,inode64', '--', '/dev/disk/by-parttypeuuid/4fbd7e29-9d25-41b8-afd0-062c0ceff05d.cdda39ed-5 ceph/tmp/mnt.jw367Y']' returned non-zero exit status 32 kernel: [ 73.702162] 00000050: 00 00 00 01 00 00 18 80 00 00 00 04 00 00 00 00 ................ kernel: [ 73.702550] 00000060: 00 00 06 48 bd a5 10 00 08 00 00 02 00 00 00 00 ...H............ kernel: [ 73.702975] 00000070: 00 00 00 00 00 00 00 00 0c 0c 0b 01 0d 00 00 19 ................ kernel: [ 73.703373] XFS (sdl1): SB validate failed with error -117.The same issue was present for the other failing OSDs. We hoped, that the data itself was still there, and only the mounting of the XFS partitions failed. The Ceph cluster was initially installed in 2017 with Ceph jewel/10.2 with the OSDs on filestore (nowadays being a legacy approach to storing objects in Ceph). However, we migrated the disks to bluestore since then (with ceph-disk and not yet via ceph-volume what s being used nowadays). Using ceph-disk introduces these 100MB XFS partitions containing basic metadata for the OSD. Given that we had three working OSDs left, we decided to investigate how to rebuild the failing ones. Some folks on #ceph (thanks T1, ormandj + peetaur!) were kind enough to share how working XFS partitions looked like for them. After creating a backup (via dd), we tried to re-create such an XFS partition on server1. We noticed that even mounting a freshly created XFS partition failed:
synpromika@server1 ~ % sudo mkfs.xfs -f -i size=2048 -m uuid="4568c300-ad83-4288-963e-badcd99bf54f" /dev/sdc1
meta-data=/dev/sdc1 isize=2048 agcount=4, agsize=6272 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=0
data = bsize=4096 blocks=25088, imaxpct=25
= sunit=128 swidth=64 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=1608, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
synpromika@server1 ~ % sudo mount /dev/sdc1 /mnt/ceph-recovery
SB stripe unit sanity check failed
Metadata corruption detected at 0x433840, xfs_sb block 0x0/0x1000
libxfs_writebufr: write verifer failed on xfs_sb bno 0x0/0x1000
cache_node_purge: refcount was 1, not zero (node=0x1d3c400)
SB stripe unit sanity check failed
Metadata corruption detected at 0x433840, xfs_sb block 0x18800/0x1000
libxfs_writebufr: write verifer failed on xfs_sb bno 0x18800/0x1000
SB stripe unit sanity check failed
Metadata corruption detected at 0x433840, xfs_sb block 0x0/0x1000
libxfs_writebufr: write verifer failed on xfs_sb bno 0x0/0x1000
SB stripe unit sanity check failed
Metadata corruption detected at 0x433840, xfs_sb block 0x24c00/0x1000
libxfs_writebufr: write verifer failed on xfs_sb bno 0x24c00/0x1000
SB stripe unit sanity check failed
Metadata corruption detected at 0x433840, xfs_sb block 0xc400/0x1000
libxfs_writebufr: write verifer failed on xfs_sb bno 0xc400/0x1000
releasing dirty buffer (bulk) to free list!releasing dirty buffer (bulk) to free list!releasing dirty buffer (bulk) to free list!releasing dirty buffer (bulk) to free list!found dirty buffer (bulk) on free list!bad magic number
bad magic number
Metadata corruption detected at 0x433840, xfs_sb block 0x0/0x1000
libxfs_writebufr: write verifer failed on xfs_sb bno 0x0/0x1000
releasing dirty buffer (bulk) to free list!mount: /mnt/ceph-recovery: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.
Ouch. This very much looked related to the actual issue we re seeing. So we tried to execute mkfs.xfs with a bunch of different sunit/swidth settings. Using -d sunit=512 -d swidth=512 at least worked then, so we decided to force its usage in the creation of our OSD XFS partition. This brought us a working XFS partition. Please note, sunit must not be larger than swidth (more on that later!).
Then we reconstructed how to restore all the metadata for the OSD (activate.monmap, active, block_uuid, bluefs, ceph_fsid, fsid, keyring, kv_backend, magic, mkfs_done, ready, require_osd_release, systemd, type, whoami). To identify the UUID, we can read the data from ceph --format json osd dump , like this for all our OSDs (Zsh syntax ftw!):
synpromika@server1 ~ % for f in 0..37 ; printf "osd-$f: %s\n" "$(sudo ceph --format json osd dump jq -r ".osds[] select(.osd==$f) .uuid")" osd-0: 4568c300-ad83-4288-963e-badcd99bf54f osd-1: e573a17a-ccde-4719-bdf8-eef66903ca4f osd-2: 0e1b2626-f248-4e7d-9950-f1a46644754e osd-3: 1ac6a0a2-20ee-4ed8-9f76-d24e900c800c [...]Identifying the corresponding raw device for each OSD UUID is possible via:
synpromika@server1 ~ % UUID="4568c300-ad83-4288-963e-badcd99bf54f" synpromika@server1 ~ % readlink -f /dev/disk/by-partuuid/"$ UUID " /dev/sdc1The OSD s key ID can be retrieved via:
synpromika@server1 ~ % OSD_ID=0 synpromika@server1 ~ % sudo ceph auth get osd."$ OSD_ID " -f json 2>/dev/null jq -r '.[] .key' AQCKFpZdm0We[...]Now we also need to identify the underlying block device:
synpromika@server1 ~ % OSD_ID=0 synpromika@server1 ~ % sudo ceph osd metadata osd."$ OSD_ID " -f json jq -r '.bluestore_bdev_partition_path' /dev/sdc2With all of this, we reconstructed the
keyring, fsid, whoami, block + block_uuid files. All the other files inside the XFS metadata partition are identical on each OSD. So after placing and adjusting the corresponding metadata on the XFS partition for Ceph usage, we got a working OSD hurray! Since we had to fix yet another 32 OSDs, we decided to automate this XFS partitioning and metadata recovery procedure.
We had a network share available on /srv/backup for storing backups of existing partition data. On each server, we tested the procedure with one single OSD before iterating over the list of remaining failing OSDs. We started with a shell script on server1, then adjusted the script for server2 and server3. This is the script, as we executed it on the 3rd server.
Thanks to this, we managed to get the Ceph cluster up and running again. We didn t want to continue with the Ceph upgrade itself during the night though, as we wanted to know exactly what was going on and why the system behaved like that. Time for RCA!
Root Cause Analysis
So all but three OSDs on server2 failed, and the problem seems to be related to XFS. Therefore, our starting point for the RCA was, to identify what was different on server2, as compared to server1 + server3. My initial assumption was that this was related to some firmware issues with the involved controller (and as it turned out later, I was right!). The disks were attached as JBOD devices to a ServeRAID M5210 controller (with a stripe size of 512). Firmware state:
synpromika@server1 ~ % sudo storcli64 /c0 show all grep '^Firmware' Firmware Package Build = 24.16.0-0092 Firmware Version = 4.660.00-8156 synpromika@server2 ~ % sudo storcli64 /c0 show all grep '^Firmware' Firmware Package Build = 24.21.0-0112 Firmware Version = 4.680.00-8489 synpromika@server3 ~ % sudo storcli64 /c0 show all grep '^Firmware' Firmware Package Build = 24.16.0-0092 Firmware Version = 4.660.00-8156This looked very promising, as server2 indeed runs with a different firmware version on the controller. But how so? Well, the motherboard of server2 got replaced by a Lenovo/IBM technician in January 2020, as we had a failing memory slot during a memory upgrade. As part of this procedure, the Lenovo/IBM technician installed the latest firmware versions. According to our documentation, some OSDs were rebuilt (due to the filestore->bluestore migration) in March and April 2020. It turned out that precisely those OSDs were the ones that survived the upgrade. So the surviving drives were created with a different firmware version running on the involved controller. All the other OSDs were created with an older controller firmware. But what difference does this make? Now let s check firmware changelogs. For the 24.21.0-0097 release we found this:
- Cannot create or mount xfs filesystem using xfsprogs 4.19.x kernel 4.20(SCGCQ02027889) - xfs_info command run on an XFS file system created on a VD of strip size 1M shows sunit and swidth as 0(SCGCQ02056038)Our XFS problem certainly was related to the controller s firmware. We also recalled that our monitoring system reported different sunit settings for the OSDs that were rebuilt in March and April. For example, OSD 21 was recreated and got different sunit settings:
WARN server2.example.org Mount options of /var/lib/ceph/osd/ceph-21 WARN - Missing: sunit=1024, Exceeding: sunit=512We compared the new OSD 21 with an existing one (OSD 25 on server3):
synpromika@server2 ~ % systemctl show var-lib-ceph-osd-ceph\\x2d21.mount grep sunit Options=rw,noatime,attr2,inode64,sunit=512,swidth=512,noquota synpromika@server3 ~ % systemctl show var-lib-ceph-osd-ceph\\x2d25.mount grep sunit Options=rw,noatime,attr2,inode64,sunit=1024,swidth=512,noquotaThanks to our documentation, we could compare execution logs of their creation:
% diff -u ceph-disk-osd-25.log ceph-disk-osd-21.log
-synpromika@server2 ~ % sudo ceph-disk -v prepare --bluestore /dev/sdj --osd-id 25
+synpromika@server3 ~ % sudo ceph-disk -v prepare --bluestore /dev/sdi --osd-id 21
[...]
-command_check_call: Running command: /sbin/mkfs -t xfs -f -i size=2048 -- /dev/sdj1
-meta-data=/dev/sdj1 isize=2048 agcount=4, agsize=6272 blks
[...]
+command_check_call: Running command: /sbin/mkfs -t xfs -f -i size=2048 -- /dev/sdi1
+meta-data=/dev/sdi1 isize=2048 agcount=4, agsize=6336 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0, rmapbt=0, reflink=0
-data = bsize=4096 blocks=25088, imaxpct=25
- = sunit=128 swidth=64 blks
+data = bsize=4096 blocks=25344, imaxpct=25
+ = sunit=64 swidth=64 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=1608, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[...]
So back then, we even tried to track this down but couldn t make sense of it yet. But now this sounds very much like it is related to the problem we saw with this Ceph/XFS failure. We follow Occam s razor, assuming the simplest explanation is usually the right one, so let s check the disk properties and see what differs:
synpromika@server1 ~ % sudo blockdev --getsz --getsize64 --getss --getpbsz --getiomin --getioopt /dev/sdk 4685545472 2398999281664 512 4096 524288 262144 synpromika@server2 ~ % sudo blockdev --getsz --getsize64 --getss --getpbsz --getiomin --getioopt /dev/sdk 4685545472 2398999281664 512 4096 262144 262144See the difference between server1 and server2 for identical disks? The
getiomin option now reports something different for them:
synpromika@server1 ~ % sudo blockdev --getiomin /dev/sdk 524288 synpromika@server1 ~ % cat /sys/block/sdk/queue/minimum_io_size 524288 synpromika@server2 ~ % sudo blockdev --getiomin /dev/sdk 262144 synpromika@server2 ~ % cat /sys/block/sdk/queue/minimum_io_size 262144It doesn t make sense that the minimum I/O size (iomin, AKA
BLKIOMIN) is bigger than the optimal I/O size (ioopt, AKA BLKIOOPT). This leads us to Bug 202127 cannot mount or create xfs on a 597T device, which matches our findings here. But why did this XFS partition work in the past and fails now with the newer kernel version?
The XFS behaviour change
Now given that we have backups of all the XFS partition, we wanted to track down, a) when this XFS behaviour was introduced, and b) whether, and if so how it would be possible to reuse the XFS partition without having to rebuild it from scratch (e.g. if you would have no working Ceph OSD or backups left).
Let s look at such a failing XFS partition with the Grml live system:
root@grml ~ # grml-version grml64-full 2020.06 Release Codename Ausgehfuahangl [2020-06-24] root@grml ~ # uname -a Linux grml 5.6.0-2-amd64 #1 SMP Debian 5.6.14-2 (2020-06-09) x86_64 GNU/Linux root@grml ~ # grml-hostname grml-2020-06 Setting hostname to grml-2020-06: done root@grml ~ # exec zsh root@grml-2020-06 ~ # dpkg -l xfsprogs util-linux Desired=Unknown/Install/Remove/Purge/Hold Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend / Err?=(none)/Reinst-required (Status,Err: uppercase=bad) / Name Version Architecture Description +++-==============-============-============-========================================= ii util-linux 2.35.2-4 amd64 miscellaneous system utilities ii xfsprogs 5.6.0-1+b2 amd64 Utilities for managing the XFS filesystemThere it s failing, no matter which mount option we try:
root@grml-2020-06 ~ # mount ./sdd1.dd /mnt mount: /mnt: mount(2) system call failed: Structure needs cleaning. root@grml-2020-06 ~ # dmesg tail -30 [...] [ 64.788640] XFS (loop1): SB stripe unit sanity check failed [ 64.788671] XFS (loop1): Metadata corruption detected at xfs_sb_read_verify+0x102/0x170 [xfs], xfs_sb block 0xffffffffffffffff [ 64.788671] XFS (loop1): Unmount and run xfs_repair [ 64.788672] XFS (loop1): First 128 bytes of corrupted metadata buffer: [ 64.788673] 00000000: 58 46 53 42 00 00 10 00 00 00 00 00 00 00 62 00 XFSB..........b. [ 64.788674] 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 64.788675] 00000020: 32 b6 dc 35 53 b7 44 96 9d 63 30 ab b3 2b 68 36 2..5S.D..c0..+h6 [ 64.788675] 00000030: 00 00 00 00 00 00 40 08 00 00 00 00 00 00 01 00 ......@......... [ 64.788675] 00000040: 00 00 00 00 00 00 01 01 00 00 00 00 00 00 01 02 ................ [ 64.788676] 00000050: 00 00 00 01 00 00 18 80 00 00 00 04 00 00 00 00 ................ [ 64.788677] 00000060: 00 00 06 48 bd a5 10 00 08 00 00 02 00 00 00 00 ...H............ [ 64.788677] 00000070: 00 00 00 00 00 00 00 00 0c 0c 0b 01 0d 00 00 19 ................ [ 64.788679] XFS (loop1): SB validate failed with error -117. root@grml-2020-06 ~ # mount -t xfs -o rw,relatime,attr2,inode64,sunit=1024,swidth=512,noquota ./sdd1.dd /mnt/ mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop1, missing codepage or helper program, or other error. 32 root@grml-2020-06 ~ # dmesg tail -1 [ 66.342976] XFS (loop1): stripe width (512) must be a multiple of the stripe unit (1024) root@grml-2020-06 ~ # mount -t xfs -o rw,relatime,attr2,inode64,sunit=512,swidth=512,noquota ./sdd1.dd /mnt/ mount: /mnt: mount(2) system call failed: Structure needs cleaning. 32 root@grml-2020-06 ~ # dmesg tail -14 [ 66.342976] XFS (loop1): stripe width (512) must be a multiple of the stripe unit (1024) [ 80.751277] XFS (loop1): SB stripe unit sanity check failed [ 80.751323] XFS (loop1): Metadata corruption detected at xfs_sb_read_verify+0x102/0x170 [xfs], xfs_sb block 0xffffffffffffffff [ 80.751324] XFS (loop1): Unmount and run xfs_repair [ 80.751325] XFS (loop1): First 128 bytes of corrupted metadata buffer: [ 80.751327] 00000000: 58 46 53 42 00 00 10 00 00 00 00 00 00 00 62 00 XFSB..........b. [ 80.751328] 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [ 80.751330] 00000020: 32 b6 dc 35 53 b7 44 96 9d 63 30 ab b3 2b 68 36 2..5S.D..c0..+h6 [ 80.751331] 00000030: 00 00 00 00 00 00 40 08 00 00 00 00 00 00 01 00 ......@......... [ 80.751331] 00000040: 00 00 00 00 00 00 01 01 00 00 00 00 00 00 01 02 ................ [ 80.751332] 00000050: 00 00 00 01 00 00 18 80 00 00 00 04 00 00 00 00 ................ [ 80.751333] 00000060: 00 00 06 48 bd a5 10 00 08 00 00 02 00 00 00 00 ...H............ [ 80.751334] 00000070: 00 00 00 00 00 00 00 00 0c 0c 0b 01 0d 00 00 19 ................ [ 80.751338] XFS (loop1): SB validate failed with error -117.Also xfs_repair doesn t help either:
root@grml-2020-06 ~ # xfs_info ./sdd1.dd
meta-data=./sdd1.dd isize=2048 agcount=4, agsize=6272 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0, rmapbt=0
= reflink=0
data = bsize=4096 blocks=25088, imaxpct=25
= sunit=128 swidth=64 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=1608, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
root@grml-2020-06 ~ # xfs_repair ./sdd1.dd
Phase 1 - find and verify superblock...
bad primary superblock - bad stripe width in superblock !!!
attempting to find secondary superblock...
..............................................................................................Sorry, could not find valid secondary superblock
Exiting now.
With the SB stripe unit sanity check failed message, we could easily track this down to the following commit fa4ca9c:
% git show fa4ca9c5574605d1e48b7e617705230a0640b6da cat
commit fa4ca9c5574605d1e48b7e617705230a0640b6da
Author: Dave Chinner <dchinner@redhat.com>
Date: Tue Jun 5 10:06:16 2018 -0700
xfs: catch bad stripe alignment configurations
When stripe alignments are invalid, data alignment algorithms in the
allocator may not work correctly. Ensure we catch superblocks with
invalid stripe alignment setups at mount time. These data alignment
mismatches are now detected at mount time like this:
XFS (loop0): SB stripe unit sanity check failed
XFS (loop0): Metadata corruption detected at xfs_sb_read_verify+0xab/0x110, xfs_sb block 0xffffffffffffffff
XFS (loop0): Unmount and run xfs_repair
XFS (loop0): First 128 bytes of corrupted metadata buffer:
0000000091c2de02: 58 46 53 42 00 00 10 00 00 00 00 00 00 00 10 00 XFSB............
0000000023bff869: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000000cdd8c893: 17 32 37 15 ff ca 46 3d 9a 17 d3 33 04 b5 f1 a2 .27...F=...3....
000000009fd2844f: 00 00 00 00 00 00 00 04 00 00 00 00 00 00 06 d0 ................
0000000088e9b0bb: 00 00 00 00 00 00 06 d1 00 00 00 00 00 00 06 d2 ................
00000000ff233a20: 00 00 00 01 00 00 10 00 00 00 00 01 00 00 00 00 ................
000000009db0ac8b: 00 00 03 60 e1 34 02 00 08 00 00 02 00 00 00 00 ... .4..........
00000000f7022460: 00 00 00 00 00 00 00 00 0c 09 0b 01 0c 00 00 19 ................
XFS (loop0): SB validate failed with error -117.
And the mount fails.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
diff --git fs/xfs/libxfs/xfs_sb.c fs/xfs/libxfs/xfs_sb.c
index b5dca3c8c84d..c06b6fc92966 100644
--- fs/xfs/libxfs/xfs_sb.c
+++ fs/xfs/libxfs/xfs_sb.c
@@ -278,6 +278,22 @@ xfs_mount_validate_sb(
return -EFSCORRUPTED;
+ if (sbp->sb_unit)
+ if (!xfs_sb_version_hasdalign(sbp)
+ sbp->sb_unit > sbp->sb_width
+ (sbp->sb_width % sbp->sb_unit) != 0)
+ xfs_notice(mp, "SB stripe unit sanity check failed");
+ return -EFSCORRUPTED;
+
+ else if (xfs_sb_version_hasdalign(sbp))
+ xfs_notice(mp, "SB stripe alignment sanity check failed");
+ return -EFSCORRUPTED;
+ else if (sbp->sb_width)
+ xfs_notice(mp, "SB stripe width sanity check failed");
+ return -EFSCORRUPTED;
+
+
+
if (xfs_sb_version_hascrc(&mp->m_sb) &&
sbp->sb_blocksize < XFS_MIN_CRC_BLOCKSIZE)
xfs_notice(mp, "v5 SB sanity check failed");
This change is included in kernel versions 4.18-rc1 and newer:
% git describe --contains fa4ca9c5574605d1e48 v4.18-rc1~37^2~14Now let s try with an older kernel version (4.9.0), using old Grml 2017.05 release:
root@grml ~ # grml-version
grml64-small 2017.05 Release Codename Freedatensuppe [2017-05-31]
root@grml ~ # uname -a
Linux grml 4.9.0-1-grml-amd64 #1 SMP Debian 4.9.29-1+grml.1 (2017-05-24) x86_64 GNU/Linux
root@grml ~ # lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.0 (stretch)
Release: 9.0
Codename: stretch
root@grml ~ # grml-hostname grml-2017-05
Setting hostname to grml-2017-05: done
root@grml ~ # exec zsh
root@grml-2017-05 ~ #
root@grml-2017-05 ~ # xfs_info ./sdd1.dd
xfs_info: ./sdd1.dd is not a mounted XFS filesystem
1 root@grml-2017-05 ~ # xfs_repair ./sdd1.dd
Phase 1 - find and verify superblock...
bad primary superblock - bad stripe width in superblock !!!
attempting to find secondary superblock...
..............................................................................................Sorry, could not find valid secondary superblock
Exiting now.
1 root@grml-2017-05 ~ # mount ./sdd1.dd /mnt
root@grml-2017-05 ~ # mount -t xfs
/root/sdd1.dd on /mnt type xfs (rw,relatime,attr2,inode64,sunit=1024,swidth=512,noquota)
root@grml-2017-05 ~ # ls /mnt
activate.monmap active block block_uuid bluefs ceph_fsid fsid keyring kv_backend magic mkfs_done ready require_osd_release systemd type whoami
root@grml-2017-05 ~ # xfs_info /mnt
meta-data=/dev/loop1 isize=2048 agcount=4, agsize=6272 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1 spinodes=0 rmapbt=0
= reflink=0
data = bsize=4096 blocks=25088, imaxpct=25
= sunit=128 swidth=64 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=1608, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
Mounting there indeed works! Now, if we mount the filesystem with new and proper sunit/swidth settings using the older kernel, it should rewrite them on disk:
root@grml-2017-05 ~ # mount -t xfs -o sunit=512,swidth=512 ./sdd1.dd /mnt/ root@grml-2017-05 ~ # umount /mnt/And indeed, mounting this rewritten filesystem then also works with newer kernels:
root@grml-2020-06 ~ # mount ./sdd1.rewritten /mnt/
root@grml-2020-06 ~ # xfs_info /root/sdd1.rewritten
meta-data=/dev/loop1 isize=2048 agcount=4, agsize=6272 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0, rmapbt=0
= reflink=0
data = bsize=4096 blocks=25088, imaxpct=25
= sunit=64 swidth=64 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=1608, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
root@grml-2020-06 ~ # mount -t xfs
/root/sdd1.rewritten on /mnt type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,sunit=512,swidth=512,noquota)
FTR: The sunit=512,swidth=512 from the xfs mount option is identical to xfs_info s output sunit=64,swidth=64 (because mount.xfs s sunit value is given in 512-byte block units, see man 5 xfs, and the xfs_info output reported here is in blocks with a block size (bsize) of 4096, so sunit = 512*512 := 64*4096 ).
mkfs uses minimum and optimal sizes for stripe unit and stripe width; you can check this e.g. via (note that server2 with fixed firmware version reports proper values, whereas server3 with broken controller firmware reports non-sense):
synpromika@server2 ~ % for i in /sys/block/sd*/queue/ ; do printf "%s: %s %s\n" "$i" "$(cat "$i"/minimum_io_size)" "$(cat "$i"/optimal_io_size)" ; done [...] /sys/block/sdc/queue/: 262144 262144 /sys/block/sdd/queue/: 262144 262144 /sys/block/sde/queue/: 262144 262144 /sys/block/sdf/queue/: 262144 262144 /sys/block/sdg/queue/: 262144 262144 /sys/block/sdh/queue/: 262144 262144 /sys/block/sdi/queue/: 262144 262144 /sys/block/sdj/queue/: 262144 262144 /sys/block/sdk/queue/: 262144 262144 /sys/block/sdl/queue/: 262144 262144 /sys/block/sdm/queue/: 262144 262144 /sys/block/sdn/queue/: 262144 262144 [...] synpromika@server3 ~ % for i in /sys/block/sd*/queue/ ; do printf "%s: %s %s\n" "$i" "$(cat "$i"/minimum_io_size)" "$(cat "$i"/optimal_io_size)" ; done [...] /sys/block/sdc/queue/: 524288 262144 /sys/block/sdd/queue/: 524288 262144 /sys/block/sde/queue/: 524288 262144 /sys/block/sdf/queue/: 524288 262144 /sys/block/sdg/queue/: 524288 262144 /sys/block/sdh/queue/: 524288 262144 /sys/block/sdi/queue/: 524288 262144 /sys/block/sdj/queue/: 524288 262144 /sys/block/sdk/queue/: 524288 262144 /sys/block/sdl/queue/: 524288 262144 /sys/block/sdm/queue/: 524288 262144 /sys/block/sdn/queue/: 524288 262144 [...]This is the underlying reason why the initially created XFS partitions were created with incorrect sunit/swidth settings. The broken firmware of server1 and server3 was the cause of the incorrect settings they were ignored by old(er) xfs/kernel versions, but treated as an error by new ones. Make sure to also read the XFS FAQ regarding How to calculate the correct sunit,swidth values for optimal performance . We also stumbled upon two interesting reads in RedHat s knowledge base: 5075561 + 2150101 (requires an active subscription, though) and #1835947. Am I affected? How to work around it? To check whether your XFS mount points are affected by this issue, the following command line should be useful:
awk '$3 == "xfs" print $2 ' /proc/self/mounts while read mount ; do echo -n "$mount " ; xfs_info $mount awk '$0 ~ "swidth" gsub(/.*=/,"",$2); gsub(/.*=/,"",$3); print $2,$3 ' awk ' if ($1 > $2) print "impacted"; else print "OK" ' ; doneIf you run into the above situation, the only known solution to get your original XFS partition working again, is to boot into an older kernel version again (4.17 or older), mount the XFS partition with correct sunit/swidth settings and then boot back into your new system (kernel version wise). Lessons learned
cat vote.txt gpg --clearsign mail leader2021@vote.debian.org
cat vote.txt gpg --clearsign mail gr_rms@vote.debian.org
gpg --import public_key.asc
cat vote.txt gpg --encrypt --armor -s -r leader2021@vote.debian.org mail leader2021@vote.debian.org
cat vote.txt gpg --encrypt --armor -s -r gr_rms@vote.debian.org mail gr_rms@vote.debian.org
... mail gr_rms@vote.debian.org -a "From: Max Mustermann <max.mustermann@debian.org>" -r max.mustermann@debian.org
Google Pixel phones support what they call Motion Photo which is essentially a photo with a short video clip attached to it. They are quite nice since they bring the moment alive, especially as the capturing of the video starts a small moment before the shutter button is pressed. For most viewing programs they simply show as static JPEG photos, but there is more to the files. Xmp.GCamera.MicroVideo XmpText 1 1
Xmp.GCamera.MicroVideoVersion XmpText 1 1
Xmp.GCamera.MicroVideoOffset XmpText 7 4022143
Xmp.GCamera.MicroVideoPresentationTimestampUs XmpText 7 1331607
The offset is actually from the end of the file, so one needs to calculate accordingly. But it is exact otherwise, so one simply extract a file with that meta-data information:#!/bin/bash
#
# Extracts the microvideo from a MVIMG_*.jpg file
# The offset is from the ending of the file, so calculate accordingly
offset=$(exiv2 -p X "$1" grep MicroVideoOffset sed 's/.*\"\(.*\)"/\1/')
filesize=$(du --apparent-size --block=1 "$1" sed 's/^\([0-9]*\).*/\1/')
extractposition=$(expr $filesize - $offset)
echo offset: $offset
echo filesize: $filesize
echo extractposition=$extractposition
dd if="$1" skip=1 bs=$extractposition of="$(basename -s .jpg $1).mp4"
Xmp.GCamera.MotionPhoto XmpText 1 1
Xmp.GCamera.MotionPhotoVersion XmpText 1 1
Xmp.GCamera.MotionPhotoPresentationTimestampUs XmpText 6 233320
Xmp.xmpNote.HasExtendedXMP XmpText 32 E1F7505D2DD64EA6948D2047449F0FFA
Xmp.Container.Directory XmpText 0 type="Seq"
Xmp.Container.Directory[1] XmpText 0 type="Struct"
Xmp.Container.Directory[1]/Container:Item XmpText 0 type="Struct"
Xmp.Container.Directory[1]/Container:Item/Item:Mime XmpText 10 image/jpeg
Xmp.Container.Directory[1]/Container:Item/Item:Semantic XmpText 7 Primary
Xmp.Container.Directory[1]/Container:Item/Item:Length XmpText 1 0
Xmp.Container.Directory[1]/Container:Item/Item:Padding XmpText 1 0
Xmp.Container.Directory[2] XmpText 0 type="Struct"
Xmp.Container.Directory[2]/Container:Item XmpText 0 type="Struct"
Xmp.Container.Directory[2]/Container:Item/Item:Mime XmpText 9 video/mp4
Xmp.Container.Directory[2]/Container:Item/Item:Semantic XmpText 11 MotionPhoto
Xmp.Container.Directory[2]/Container:Item/Item:Length XmpText 7 1679555
Xmp.Container.Directory[2]/Container:Item/Item:Padding XmpText 1 0
Sounds like fun and lots of information. However I didn t see why the length in first item is 0 and I didn t see how to use the latter Length info. But I can use the mp4 headers to extract it:#!/bin/bash
#
# Extracts the motion part of a MotionPhoto file PXL_*.MP.mp4
extractposition=$(grep --binary --byte-offset --only-matching --text \
-P "\x00\x00\x00\x18\x66\x74\x79\x70\x6d\x70\x34\x32" $1 sed 's/^\([0-9]*\).*/\1/')
dd if="$1" skip=1 bs=$extractposition of="$(basename -s .jpg $1).mp4"
I wrote this blog post with Kaylea Champion and a version of this post was originally posted on the Community Data Science Collective blog. Critical software we all rely on can silently crumble away beneath us. Unfortunately, we often don t find out software infrastructure is in poor condition until it is too late. Over the last year or so, I have been supporting Kaylea Champion on a project my group announced earlier to measure software underproduction a term we use to describe software that is low in quality but high in importance. Underproduction reflects an important type of risk in widely used free/libre open source software (FLOSS) because participants often choose their own projects and tasks. Because FLOSS contributors work as volunteers and choose what they work on, important projects aren t always the ones to which FLOSS developers devote the most attention. Even when developers want to work on important projects, relative neglect among important projects is often difficult for FLOSS contributors to see. Given all this, what can we do to detect problems in FLOSS infrastructure before major failures occur? Kaylea Champion and I recently published a paper laying out our new method for measuring underproduction at the IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) 2021 that we believe provides one important answer to this question.
Conceptual diagram showing how our conception of underproduction relates to quality and importance of software.
These 30 packages have the highest level of underproduction in Debian according to our analysis.For more details, check out the full paper which is available as a freely accessible preprint.
This project was supported by the Ford/Sloan Digital Infrastructure Initiative. Wm Salt Hale of the Community Data Science Collective and Debian Developers Paul Wise and Don Armstrong provided valuable assistance in accessing and interpreting Debian bug data. Ren Just generously provided insight and feedback on the manuscript.
Paper Citation: Kaylea Champion and Benjamin Mako Hill. 2021. Underproduction: An Approach for Measuring Risk in Open Source Software. In Proceedings of the IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER 2021). IEEE.
Contact Kaylea Champion (kaylea@uw.edu) with any questions or if you are interested in following up.
screen that it
doesn't exist in tmux (or your favorite terminal emulator, for that
matter, a much scarier thought).
tmux like many did, but to dtach. I figured
that I didn't actually need multiplexing to run my long-running IRC
session: I just needed to be able to reattach to the terminal. That's
what dtach does. No windows, no panes, and, especially, no way to
start a new shell, which is exactly the kind of hardening I need.
So I came up with this, to start irssi:
dtach -N /run/$USER/dtach-irssi.socket irssi
To attach:
dtach -a /run/$USER/dtach-irssi.socket
Fairly simple no? Already one attack vector gone: evil attacker can't
get a new shell through my terminal multiplexer, yay.
irssi as my main user anyways!
Let's take the lessons from good UNIX security, and run this as a
separate user altogether. This requires me to create another user, say
foo-irc:
adduser foo-irc
... and run it as a systemd service, because how else are you going
to start this thing anyways, cron? I came up with something
like this unit file:
[Unit]
Description=IRC screen session
After=network.target
[Service]
Type=simple
Environment="TERM=screen.xterm-256color"
User=%i
RuntimeDirectory=%i
ExecStart=-/usr/bin/dtach -N /run/%i/dtach-irssi.socket irssi
ExecStop=-/bin/sh -c 'echo /quit stopping service... exec /usr/bin/dtach -p /run/%i/dtach-irssi.socket'
ExecReload=-/bin/sh -c 'echo /restart exec /usr/bin/dtach -p /run/%i/dtach-irssi.socket'
Notice this is a service template, because of the %i stuff. I don't
actually remember how to enable this thing, but let's say you drop
this in /etc/systemd/system/irssi@.service, then you run:
systemctl daemon-reload
And then, not sure about this bit, instantiate that template:
systemctl enable irssi@foo-irc.service
And then this should start the irssi session:
systemctl start irssi@foo-irc.service
To access the session:
sudo -u foo-irc dtach -a /run/foo-irc/dtach-irssi.socket
Obviously, you will probably need to migrate your irssi
configuration over, otherwise you'll end up with a blank, old-school
irssi. Take a moment to savor the view though. Nostalgia. Ah.
foo-irc user can still
launch arbitrary commands, thanks to irssi /exec (and a generous
Perl scripting environment). Let's throw the entire kitchen sink at it
and see what sticks. At this point, the unit file becomes too long to
just maintain in a blog post (which would be silly, but not unheard
of), so just look at this git repository instead.
irssi
session. So yay, no password to jump on chat. Like a real client or
something.
Just make sure to secure the SSH key you'll deploy in
authorized_keys with:
restrict,pty,command="dtach -a /run/foo-irc/dtach-irssi.socket" [...]
Obviously, make sure the keys are not writable by the user, by placing
it somewhere outside their home, which might require hacking at your
server's SSH configuration. Because otherwise a compromised user will
be able to change his own authorized_keys, which could be bad.
mosh still works.
It also includes instructions on how to setup your SSH keys.
Enjoy, and let me know if (or rather, how) I messed up.
irssi noticed only when I
re-attached the session:
09:39:51 -!- Irssi: warning Broken pipe
09:39:51 -!- Irssi: warning SSL write error: Broken pipe
09:39:51 -!- Irssi: warning SSL write error: Broken pipe
09:39:51 -!- Irssi: warning SSL write error: Broken pipe
09:39:51 -!- Irssi: warning SSL write error: Broken pipe
09:39:51 [bitlbee] -!- Irssi: Connection lost to localhost
09:39:51 -!- Irssi: warning SSL write error: Broken pipe
09:39:51 [gitter] -!- Irssi: Connection lost to irc.gitter.im
09:39:51 [OFTC] -!- Irssi: Connection lost to irc.oftc.net
09:42:34 [IMC] -!- Irssi: Connection lost to irc.indymedia.org
09:42:34 -!- Irssi: Connection lost to irc.hackint.org
09:42:34 -!- Irssi: Connection lost to chat.freenode.net
09:42:34 -!- dtach_away: Set away
from the outside I actually timed out a few minutes after I
detached, which also makes for a weird asymmetry:
22:31:00 -!- anarcat [~anarcat@ocean] has quit [Ping timeout: 250 seconds]
that is eleven hours before the error I get.mosh $server hangs with a blank
screen instead of instantly rejoining the session. I'm not sure it
is related to the timeout problem but I did rewrite the wrapper
before publication. this is the old version:
#!/bin/sh
# inspired by https://serverfault.com/questions/749474/ssh-authorized-keys-command-option-multiple-commands
command="dtach -a /run/anarcat-irc/dtach-irssi.socket"
case "$SSH_ORIGINAL_COMMAND" in
mosh-server*)
exec mosh-server -- $command
;;
*)
exec $command
;;
esac
I'm thinking of trying that one out for a while to see if it's
related. The weirdest thing is that mosh "un-hangs" if i reattach
with plain ssh, so there's definitely something fishy going on
here./content/blog/2021-03-12-static-comments-in-hugo/index.md instead of /content/blog/2021-03-12-static-comments-in-hugo.md.
This lets you store the comments as page resources in the subdirectory /content/blog/2021-03-12-static-comments-in-hugo/comments/.
comments.html partial and include it in the layout for the pages which should get comments:
<div class="post-comments">
<p class="comment-notice"><b>Comments</b>: To comment on this post,
send me an email following the template below. Your email address
will not be posted, unless you choose to include it in
the <span style="font-family: monospace;">link:</span> field.</p>
<pre class="comment-notice">
To: Your Name <your.email<span>@</span>example.org>
Subject: [blog-comment] .Page.RelPermalink
post_id: .Page.RelPermalink
author: [How should you be identified? Usually your name or "Anonymous"]
link: [optional link to your website]
Your comments here. Markdown syntax accepted.</pre>
$scratch := newScratch
$scratch.Set "comments" (.Resources.Match "comments/*yml")
if eq 1 (len ($scratch.Get "comments"))
<h2>1 Comment</h2>
else
<h2> len ($scratch.Get "comments") Comments</h2>
end
range ($scratch.Get "comments")
<div class="post-comment % cycle 'odd', 'even' % ">
$comment := (.Content transform.Unmarshal)
<span class="post-meta">
- $comment.date dateFormat "Jan 2, 2006 at 15:04" -
</span>
<h3 class="comment-header">
if $comment.link
<a href=" $comment.link "> $comment.author </a>
else
$comment.author
end
<br />
</h3>
$comment.comment markdownify
</div>
end
</div>
keybinding) to the following (admittedly janky) shell script.
It takes the comment, reformats it appropriately, and puts it in the post s comments subdirectory.
Note that it determines which filename to use based on the email s contents, so make sure to check that the email doesn t contain anything nefarious before you pipe it into the script!
#!/bin/sh
# Copyright (C) 2016-2021 Ryan Kavanagh <rak@rak.ac>
# Distributed under the ISC license
BLOG_BASE="/media/t/work/blog"
MESSAGE=$(cat)
EMAIL=$(echo "$ MESSAGE " grep "From:" sed -e 's/From[^<]*<\?\([^>]*\)>\?.*/\1/g;s/@/-at-/g')
DATE=$(echo "$ MESSAGE " grep "Date:" sed -e 's/Date:\s*//g' xargs -0 date -Iseconds -u -d)
POST_ID=$(echo "$ MESSAGE " grep "post_id:" sed -e 's/post_id: //g')
COMMENTS_DIR="$ BLOG_BASE /content/$ POST_ID /comments/"
COMMENT_FILE="$ COMMENTS_DIR /$ DATE _$ EMAIL .yml"
# Strip out the email headers and whitespace until the start of the comment
COMMENT_WHOLE=$(echo "$ MESSAGE " sed -e '/^\s*$/,$!d;/^[^\s]/,$!d')
# Indent everything after the comment header
COMMENT_INDENTED=$(echo "$ COMMENT_WHOLE " sed -e '/^\s*$/,$ s/.*/ &/g ')
# And add the comment header
COMMENT_PREFIXED=$(echo "$ COMMENT_INDENTED " sed -e '0,/^\s*$/ s/^\s*$/comment: / ')
[ -d "$ COMMENTS_DIR " ] mkdir -p "$ COMMENTS_DIR "
echo "Saving the comment to $ COMMENT_FILE "
echo "date: $ DATE " tee "$ COMMENT_FILE "
echo "$ COMMENT_PREFIXED " tee -a "$ COMMENT_FILE "
post_id: /blog/2021-03-12-static-comments-in-hugo/
author: Ryan Kavanagh
link: https://rak.ac/
Dear self,
Here is a test comment for your blog post.
It supports *markdown* **syntax** and stuff .
Best,
Yourself
content/blog/2021-03-12-static-comments-in-hugo/comments/2021-03-12T18:47:25+00:00_rak-at-example.org.yml containing:
date: 2021-03-12T18:47:25+00:00
post_id: /blog/2021-03-12-static-comments-in-hugo/
author: Ryan Kavanagh
link: https://rak.ac/
comment:
Dear self,
Here is a test comment for your blog post.
It supports *markdown* **syntax** and stuff .
Best,
Yourself
I d like to briefly introduce my new project, Consfigurator:
Consfigurator is a system for declarative configuration management using Common Lisp. You can use it to configure hosts as root, deploy services as unprivileged users, build and deploy containers, and produce disc images. [not all of these are implemented yet, but the design permits them to be] Consfigurator s design gives you a great deal of flexibility about how to control the hosts you want to configure. If there is a command you can run which will obtain input and output streams attached to an interactive POSIX sh running on the target host/container, then with a little glue code, you can use much of Consfigurator s functionality to configure that host/container. But if it is possible to get an implementation of Common Lisp started up on the host, then Configurator can transparently execute your deployment code over on the remote side, rather than exchanging information via POSIX sh. This lets you use the full power of Common Lisp to deploy your configuration. Configurator has convenient abstractions for combining these different ways to execute your configuration on hosts with different ways of connecting to them. Connections can be arbitrarily nested. For example, to combine SSHing to a Debian machine as an unprivileged user, using sudo to become root, and then starting up a Lisp image to execute your deployment code, you would evaluate
(deploy ((:ssh (:sudo :as "spwhitton@athena.example.com") :debian-sbcl)) athena.example.com)
Declarative configuration management systems like Consfigurator and Propellor share a number of goals with projects like the GNU Guix System and NixOS. However, tools like Consfigurator and Propellor try to layer the power of declarative and reproducible configuration on top of traditional, battle-tested unix system administration infrastructure like apt, dpkg, yum, and distro package archives, rather than seeking to replace any of those. Let s get as much as we can out of all that existing distro policy-compliant work!Please check out the user s manual, which includes a tutorial/quick start guide, and come join us in
#consfigurator on
irc.oftc.net. It s early days but you can already do a fair few things
with Consfigurator. It s a good time to come help get all the basic
properties defined!
(Edit: this is CVE-2021-1000002)
I ve mentioned in the past my twisted EE network setup from when I moved in to my current house. The 4GEE WiFi Mini (also known as the EE Osprey 2 Mini or the EE40VB, and actually a rebadged Alcatel Y853VB) has been sitting unused since then, so I figured I d see about trying to get a shell on it.
TL;DR: Of course it s running Linux, there s a couple of test points internally which bring out the serial console, but after finding those and logging in I discovered it s running ADB on port 5555 quite happily available without authentication both via wifi and the USB port. So if you have physical or local network access, instant root shell. Well done, folks. And then I bricked it before I could do anything more interesting.
There s a lack of information about this device out there - most of the links I can find are around removing the SIM lock - so I thought I d document the pieces I found just in case anyone else is trying to figure it out. It s based around a Qualcomm MDM9607 SoC, paired with 64M RAM and 256M NAND flash. Wifi is via an RTL8192ES. Kernel is 3.18.20. Busybox is v1.23.1. It s running dnsmasq but I didn t grab the version. Of course there s no source or offer of source provided.
Taking it apart is fairly easy. There s a single screw to remove, just beside the SIM slot. The coloured rim can then be carefully pried away from the back, revealing the battery. There are then 4 screws in the corners which need removed in order to be able to lift out the actual PCB and gain access to the serial console test points.
My mistake was going poking around trying to figure out where the updates are downloaded from - I know I m running a slightly older release than what s current, and the device can do an automatic download + update. Top tip; don t run Jrdrecovery. It ll error on finding /cache/update.zip and wipe the main partition anyway. That ll leave you in a boot loop where the device boots the recovery partition which tries to install /cache/update.zip which of course still doesn t exist.
So. Where next? First, I need to get the device into a state where I can actually do something other than watch it boot into recovery, fail to flash and reboot. Best guess at present is to try and get it to enter the Qualcomm EDL (Emergency Download) mode. That might be possible with a custom USB cable that grounds D+ on boot. Alternatively I need to probe some of the other test points on the PCB and see if grounding any of those helps enter EDL mode. I then need a suitable firehose OEM-signed programmer image. And then I need to actually get hold of a proper EE40VB firmware image, either via one of the OTA update files or possibly via an Alcatel ADSU image (though no idea how to get hold of one, other than by posting to a random GSM device forum and hoping for the kindness of strangers). More updates if/when I make progress
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.2-00053
S - IMAGE_VARIANT_STRING=LAATANAZA
S - OEM_IMAGE_VERSION_STRING=linux3
S - Boot Config, 0x000002e1
B - 105194 - SBL1, Start
D - 61885 - QSEE Image Loaded, Delta - (451964 Bytes)
D - 30286 - RPM Image Loaded, Delta - (151152 Bytes)
B - 459330 - Roger:boot_jrd_oem_main
B - 461526 - Welcome to key_check_poweron!!!
B - 466436 - REG0x00, rc=47
B - 469120 - REG0x01, rc=1f
B - 472018 - REG0x02, rc=1c
B - 474885 - REG0x03, rc=47
B - 477782 - REG0x04, rc=b2
B - 480558 - REG0x05, rc=
B - 483272 - REG0x06, rc=9e
B - 486139 - REG0x07, rc=
B - 488854 - REG0x08, rc=a4
B - 491721 - REG0x09, rc=80
B - 494130 - bq24295_probe: vflt/vsys/vprechg=0mV/0mV/0mV, tprechg/tfastchg=0Min/0Min, [0C, 0C]
B - 511546 - come to calculate vol and temperature!!
B - 511637 - ##############battery_core_convert_vntc: NTC_voltage=1785690
B - 517280 - battery_core_convert_vntc: <-44C, 1785690uV>, present=0
B - 529358 - bq24295_set_current_limit: setting=0mA, mode=-1, input/fastchg/prechg/termchg=-1mA/0mA/0mA/0mA
B - 534360 - bq24295_set_charge_current, rc=0,reg_val=0,i=0
B - 539636 - bq24295_enable_charge: setting=0, chg_enable=-1, otg_enable=0
B - 546072 - bq24295_enable_charging: enable_charging=0
B - 552172 - bq24295_set_current_limit: setting=0mA, mode=-1, input/fastchg/prechg/termchg=-1mA/0mA/0mA/0mA
B - 561566 - bq24295_set_charge_current, rc=0,reg_val=0,i=0
B - 567056 - bq24295_enable_charge: setting=0, chg_enable=0, otg_enable=0
B - 579286 - come to calculate vol and temperature!!
B - 579378 - ##############battery_core_convert_vntc: NTC_voltage=1785777
B - 585539 - battery_core_convert_vntc: <-44C, 1785777uV>, present=0
B - 597617 - charge_main: battery is plugout!!
B - 597678 - Welcome to pca955x_probe!!!
B - 601063 - pca955x_probe: PCA955X probed successfully!
D - 27511 - APPSBL Image Loaded, Delta - (179348 Bytes)
B - 633271 - QSEE Execution, Start
D - 213 - QSEE Execution, Delta
B - 638944 - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Start writting JRD RECOVERY BOOT
B - 650107 - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Start writting RECOVERY BOOT
B - 653218 - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>read_buf[0] == 0
B - 659044 - SBL1, End
D - 556137 - SBL1, Delta
S - Throughput, 2000 KB/s (782884 Bytes, 278155 us)
S - DDR Frequency, 240 MHz
Android Bootloader - UART_DM Initialized!!!
[0] welcome to lk
[0] SCM call: 0x2000601 failed with :fffffffc
[0] Failed to initialize SCM
[10] platform_init()
[10] target_init()
[10] smem ptable found: ver: 4 len: 17
[10] ERROR: No devinfo partition found
[10] Neither 'config' nor 'frp' partition found
[30] voltage of NTC is 1789872!
[30] voltage of BAT is 3179553!
[30] usb present is 1!
[30] Loading (boot) image (4171776): start
[530] Loading (boot) image (4171776): done
[540] DTB Total entry: 25, DTB version: 3
[540] Using DTB entry 0x00000129/00010000/0x00000008/0 for device 0x00000129/00010000/0x00010008/0
[560] JRD_CHG_OFF_FEATURE!
[560] come to jrd_target_pause_for_battery_charge!
[570] power_on_status.hard_reset = 0x0
[570] power_on_status.smpl = 0x0
[570] power_on_status.rtc = 0x0
[580] power_on_status.dc_chg = 0x0
[580] power_on_status.usb_chg = 0x0
[580] power_on_status.pon1 = 0x1
[590] power_on_status.cblpwr = 0x0
[590] power_on_status.kpdpwr = 0x0
[590] power_on_status.bugflag = 0x0
[590] cmdline: noinitrd rw console=ttyHSL0,115200,n8 androidboot.hardware=qcom ehci-hcd.park=3 msm_rtb.filter=0x37 lpm_levels.sleep_disabled=1 earlycon=msm_hsl_uart,0x78b3000 androidboot.serialno=7e6ba58c androidboot.baseband=msm rootfstype=ubifs rootflags=b
[620] Updating device tree: start
[720] Updating device tree: done
[720] booting linux @ 0x80008000, ramdisk @ 0x80008000 (0), tags/device tree @ 0x81e00000
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.18.20 (linux3@linux3) (gcc version 4.9.2 (GCC) ) #1 PREEMPT Thu Aug 10 11:57:07 CST 2017
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Qualcomm Technologies, Inc. MDM 9607 MTP
[ 0.000000] Early serial console at I/O port 0x0 (options '')
[ 0.000000] bootconsole [uart0] enabled
[ 0.000000] Reserved memory: reserved region for node 'modem_adsp_region@0': base 0x82a00000, size 56 MiB
[ 0.000000] Reserved memory: reserved region for node 'external_image_region@0': base 0x87c00000, size 4 MiB
[ 0.000000] Removed memory: created DMA memory pool at 0x82a00000, size 56 MiB
[ 0.000000] Reserved memory: initialized node modem_adsp_region@0, compatible id removed-dma-pool
[ 0.000000] Removed memory: created DMA memory pool at 0x87c00000, size 4 MiB
[ 0.000000] Reserved memory: initialized node external_image_region@0, compatible id removed-dma-pool
[ 0.000000] cma: Reserved 4 MiB at 0x87800000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 17152
[ 0.000000] Kernel command line: noinitrd rw console=ttyHSL0,115200,n8 androidboot.hardware=qcom ehci-hcd.park=3 msm_rtb.filter=0x37 lpm_levels.sleep_disabled=1 earlycon=msm_hsl_uart,0x78b3000 androidboot.serialno=7e6ba58c androidboot.baseband=msm rootfstype=ubifs rootflags=bulk_read root=ubi0:rootfs ubi.mtd=16
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Memory: 54792K/69632K available (5830K kernel code, 399K rwdata, 2228K rodata, 276K init, 830K bss, 14840K reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc8800000 - 0xff000000 ( 872 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc07e6c38 (8060 kB)
[ 0.000000] .init : 0xc07e7000 - 0xc082c000 ( 276 kB)
[ 0.000000] .data : 0xc082c000 - 0xc088fdc0 ( 400 kB)
[ 0.000000] .bss : 0xc088fe84 - 0xc095f798 ( 831 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] GIC CPU mask not found - kernel will fail to boot.
[ 0.000000] GIC CPU mask not found - kernel will fail to boot.
[ 0.000000] mpm_init_irq_domain(): Cannot find irq controller for qcom,gpio-parent
[ 0.000000] MPM 1 irq mapping errored -517
[ 0.000000] Architected mmio timer(s) running at 19.20MHz (virt).
[ 0.000011] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 3579139424256ns
[ 0.007975] Switching to timer-based delay loop, resolution 52ns
[ 0.013969] Switched to clocksource arch_mem_counter
[ 0.019687] Console: colour dummy device 80x30
[ 0.023344] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[ 0.033666] pid_max: default: 32768 minimum: 301
[ 0.038411] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.044902] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.052445] CPU: Testing write buffer coherency: ok
[ 0.057057] Setting up static identity map for 0x8058aac8 - 0x8058ab20
[ 0.064242]
[ 0.064242] **********************************************************
[ 0.071251] ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **
[ 0.077817] ** **
[ 0.084302] ** trace_printk() being used. Allocating extra memory. **
[ 0.090781] ** **
[ 0.097320] ** This means that this is a DEBUG kernel and it is **
[ 0.103802] ** unsafe for produciton use. **
[ 0.110339] ** **
[ 0.116850] ** If you see this message and you are not debugging **
[ 0.123333] ** the kernel, report this immediately to your vendor! **
[ 0.129870] ** **
[ 0.136380] ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **
[ 0.142865] **********************************************************
[ 0.150225] MSM Memory Dump base table set up
[ 0.153739] MSM Memory Dump apps data table set up
[ 0.168125] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.176332] pinctrl core: initialized pinctrl subsystem
[ 0.180930] regulator-dummy: no parameters
[ 0.215338] NET: Registered protocol family 16
[ 0.220475] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.284034] cpuidle: using governor ladder
[ 0.314026] cpuidle: using governor menu
[ 0.344024] cpuidle: using governor qcom
[ 0.355452] msm_watchdog b017000.qcom,wdt: wdog absent resource not present
[ 0.361656] msm_watchdog b017000.qcom,wdt: MSM Watchdog Initialized
[ 0.371373] irq: no irq domain found for /soc/pinctrl@1000000 !
[ 0.381268] spmi_pmic_arb 200f000.qcom,spmi: PMIC Arb Version-2 0x20010000
[ 0.389733] platform 4080000.qcom,mss: assigned reserved memory node modem_adsp_region@0
[ 0.397409] mem_acc_corner: 0 <--> 0 mV
[ 0.401937] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.408966] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.416287] __of_mpm_init(): MPM driver mapping exists
[ 0.420940] msm_rpm_glink_dt_parse: qcom,rpm-glink compatible not matches
[ 0.427235] msm_rpm_dev_probe: APSS-RPM communication over SMD
[ 0.432977] smd_open() before smd_init()
[ 0.437544] msm_mpm_dev_probe(): Cannot get clk resource for XO: -517
[ 0.445730] smd_channel_probe_now: allocation table not initialized
[ 0.453100] mdm9607_s1: 1050 <--> 1350 mV at 1225 mV normal idle
[ 0.458566] spm_regulator_probe: name=mdm9607_s1, range=LV, voltage=1225000 uV, mode=AUTO, step rate=4800 uV/us
[ 0.468817] cpr_efuse_init: apc_corner: efuse_addr = 0x000a4000 (len=0x1000)
[ 0.475353] cpr_read_fuse_revision: apc_corner: fuse revision = 2
[ 0.481345] cpr_parse_speed_bin_fuse: apc_corner: [row: 37]: 0x79e8bd327e6ba58c, speed_bits = 4
[ 0.490124] cpr_pvs_init: apc_corner: pvs voltage: [1050000 1100000 1275000] uV
[ 0.497342] cpr_pvs_init: apc_corner: ceiling voltage: [1050000 1225000 1350000] uV
[ 0.504979] cpr_pvs_init: apc_corner: floor voltage: [1050000 1050000 1150000] uV
[ 0.513125] i2c-msm-v2 78b8000.i2c: probing driver i2c-msm-v2
[ 0.518335] i2c-msm-v2 78b8000.i2c: error on clk_get(core_clk):-517
[ 0.524478] i2c-msm-v2 78b8000.i2c: error probe() failed with err:-517
[ 0.531111] i2c-msm-v2 78b7000.i2c: probing driver i2c-msm-v2
[ 0.536788] i2c-msm-v2 78b7000.i2c: error on clk_get(core_clk):-517
[ 0.542886] i2c-msm-v2 78b7000.i2c: error probe() failed with err:-517
[ 0.549618] i2c-msm-v2 78b9000.i2c: probing driver i2c-msm-v2
[ 0.555202] i2c-msm-v2 78b9000.i2c: error on clk_get(core_clk):-517
[ 0.561374] i2c-msm-v2 78b9000.i2c: error probe() failed with err:-517
[ 0.570613] msm-thermal soc:qcom,msm-thermal: msm_thermal:Failed reading node=/soc/qcom,msm-thermal, key=qcom,core-limit-temp. err=-22. KTM continues
[ 0.583049] msm-thermal soc:qcom,msm-thermal: probe_therm_reset:Failed reading node=/soc/qcom,msm-thermal, key=qcom,therm-reset-temp err=-22. KTM continues
[ 0.596926] msm_thermal:msm_thermal_dev_probe Failed reading node=/soc/qcom,msm-thermal, key=qcom,online-hotplug-core. err:-517
[ 0.609370] sps:sps is ready.
[ 0.613137] msm_rpm_glink_dt_parse: qcom,rpm-glink compatible not matches
[ 0.619020] msm_rpm_dev_probe: APSS-RPM communication over SMD
[ 0.625773] mdm9607_s2: 750 <--> 1275 mV at 750 mV normal idle
[ 0.631584] mdm9607_s3_level: 0 <--> 0 mV at 0 mV normal idle
[ 0.637085] mdm9607_s3_level_ao: 0 <--> 0 mV at 0 mV normal idle
[ 0.643092] mdm9607_s3_floor_level: 0 <--> 0 mV at 0 mV normal idle
[ 0.649512] mdm9607_s3_level_so: 0 <--> 0 mV at 0 mV normal idle
[ 0.655750] mdm9607_s4: 1800 <--> 1950 mV at 1800 mV normal idle
[ 0.661791] mdm9607_l1: 1250 mV normal idle
[ 0.666090] mdm9607_l2: 1800 mV normal idle
[ 0.670276] mdm9607_l3: 1800 mV normal idle
[ 0.674541] mdm9607_l4: 3075 mV normal idle
[ 0.678743] mdm9607_l5: 1700 <--> 3050 mV at 1700 mV normal idle
[ 0.684904] mdm9607_l6: 1700 <--> 3050 mV at 1700 mV normal idle
[ 0.690892] mdm9607_l7: 1700 <--> 1900 mV at 1700 mV normal idle
[ 0.697036] mdm9607_l8: 1800 mV normal idle
[ 0.701238] mdm9607_l9: 1200 <--> 1250 mV at 1200 mV normal idle
[ 0.707367] mdm9607_l10: 1050 mV normal idle
[ 0.711662] mdm9607_l11: 1800 mV normal idle
[ 0.716089] mdm9607_l12_level: 0 <--> 0 mV at 0 mV normal idle
[ 0.721717] mdm9607_l12_level_ao: 0 <--> 0 mV at 0 mV normal idle
[ 0.727946] mdm9607_l12_level_so: 0 <--> 0 mV at 0 mV normal idle
[ 0.734099] mdm9607_l12_floor_lebel: 0 <--> 0 mV at 0 mV normal idle
[ 0.740706] mdm9607_l13: 1800 <--> 2850 mV at 2850 mV normal idle
[ 0.746883] mdm9607_l14: 2650 <--> 3000 mV at 2650 mV normal idle
[ 0.752515] msm_mpm_dev_probe(): Cannot get clk resource for XO: -517
[ 0.759036] cpr_efuse_init: apc_corner: efuse_addr = 0x000a4000 (len=0x1000)
[ 0.765807] cpr_read_fuse_revision: apc_corner: fuse revision = 2
[ 0.771809] cpr_parse_speed_bin_fuse: apc_corner: [row: 37]: 0x79e8bd327e6ba58c, speed_bits = 4
[ 0.780586] cpr_pvs_init: apc_corner: pvs voltage: [1050000 1100000 1275000] uV
[ 0.787808] cpr_pvs_init: apc_corner: ceiling voltage: [1050000 1225000 1350000] uV
[ 0.795443] cpr_pvs_init: apc_corner: floor voltage: [1050000 1050000 1150000] uV
[ 0.803094] cpr_init_cpr_parameters: apc_corner: up threshold = 2, down threshold = 3
[ 0.810752] cpr_init_cpr_parameters: apc_corner: CPR is enabled by default.
[ 0.817687] cpr_init_cpr_efuse: apc_corner: [row:65] = 0x15000277277383
[ 0.824272] cpr_init_cpr_efuse: apc_corner: CPR disable fuse = 0
[ 0.830225] cpr_init_cpr_efuse: apc_corner: Corner[1]: ro_sel = 0, target quot = 631
[ 0.837976] cpr_init_cpr_efuse: apc_corner: Corner[2]: ro_sel = 0, target quot = 631
[ 0.845703] cpr_init_cpr_efuse: apc_corner: Corner[3]: ro_sel = 0, target quot = 899
[ 0.853592] cpr_config: apc_corner: Timer count: 0x17700 (for 5000 us)
[ 0.860426] apc_corner: 0 <--> 0 mV
[ 0.864044] i2c-msm-v2 78b8000.i2c: probing driver i2c-msm-v2
[ 0.869261] i2c-msm-v2 78b8000.i2c: error on clk_get(core_clk):-517
[ 0.875492] i2c-msm-v2 78b8000.i2c: error probe() failed with err:-517
[ 0.882225] i2c-msm-v2 78b7000.i2c: probing driver i2c-msm-v2
[ 0.887775] i2c-msm-v2 78b7000.i2c: error on clk_get(core_clk):-517
[ 0.893941] i2c-msm-v2 78b7000.i2c: error probe() failed with err:-517
[ 0.900719] i2c-msm-v2 78b9000.i2c: probing driver i2c-msm-v2
[ 0.906256] i2c-msm-v2 78b9000.i2c: error on clk_get(core_clk):-517
[ 0.912430] i2c-msm-v2 78b9000.i2c: error probe() failed with err:-517
[ 0.919472] msm-thermal soc:qcom,msm-thermal: msm_thermal:Failed reading node=/soc/qcom,msm-thermal, key=qcom,core-limit-temp. err=-22. KTM continues
[ 0.932372] msm-thermal soc:qcom,msm-thermal: probe_therm_reset:Failed reading node=/soc/qcom,msm-thermal,
key=qcom,therm-reset-temp err=-22. KTM continues
[ 0.946361] msm_thermal:get_kernel_cluster_info CPU0 topology not initialized.
[ 0.953824] cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
[ 0.960300] msm_thermal:get_cpu_freq_plan_len Error reading CPU0 freq table len. error:-19
[ 0.968533] msm_thermal:vdd_restriction_reg_init Defer vdd rstr freq init.
[ 0.975846] cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
[ 0.982219] msm_thermal:get_cpu_freq_plan_len Error reading CPU0 freq table len. error:-19
[ 0.991378] cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
[ 0.997544] msm_thermal:get_cpu_freq_plan_len Error reading CPU0 freq table len. error:-19
[ 1.013642] qcom,gcc-mdm9607 1800000.qcom,gcc: Registered GCC clocks
[ 1.019451] clock-a7 b010008.qcom,clock-a7: Speed bin: 4 PVS Version: 0
[ 1.025693] a7ssmux: set OPP pair(400000000 Hz: 1 uV) on cpu0
[ 1.031314] a7ssmux: set OPP pair(1305600000 Hz: 7 uV) on cpu0
[ 1.038805] i2c-msm-v2 78b8000.i2c: probing driver i2c-msm-v2
[ 1.043587] AXI: msm_bus_scale_register_client(): msm_bus_scale_register_client: Bus driver not ready.
[ 1.052935] i2c-msm-v2 78b8000.i2c: msm_bus_scale_register_client(mstr-id:86):0 (not a problem)
[ 1.062006] irq: no irq domain found for /soc/wcd9xxx-irq !
[ 1.069884] i2c-msm-v2 78b7000.i2c: probing driver i2c-msm-v2
[ 1.074814] AXI: msm_bus_scale_register_client(): msm_bus_scale_register_client: Bus driver not ready.
[ 1.083716] i2c-msm-v2 78b7000.i2c: msm_bus_scale_register_client(mstr-id:86):0 (not a problem)
[ 1.093850] i2c-msm-v2 78b9000.i2c: probing driver i2c-msm-v2
[ 1.098889] AXI: msm_bus_scale_register_client(): msm_bus_scale_register_client: Bus driver not ready.
[ 1.107779] i2c-msm-v2 78b9000.i2c: msm_bus_scale_register_client(mstr-id:86):0 (not a problem)
[ 1.167871] KPI: Bootloader start count = 24097
[ 1.171364] KPI: Bootloader end count = 48481
[ 1.175855] KPI: Bootloader display count = 3884474147
[ 1.180825] KPI: Bootloader load kernel count = 16420
[ 1.185905] KPI: Kernel MPM timestamp = 105728
[ 1.190286] KPI: Kernel MPM Clock frequency = 32768
[ 1.195209] socinfo_print: v0.10, id=297, ver=1.0, raw_id=72, raw_ver=0, hw_plat=8, hw_plat_ver=65536
[ 1.195209] accessory_chip=0, hw_plat_subtype=0, pmic_model=65539, pmic_die_revision=131074 foundry_id=0 serial_number=2120983948
[ 1.216731] sdcard_ext_vreg: no parameters
[ 1.220555] rome_vreg: no parameters
[ 1.224133] emac_lan_vreg: no parameters
[ 1.228177] usbcore: registered new interface driver usbfs
[ 1.233156] usbcore: registered new interface driver hub
[ 1.238578] usbcore: registered new device driver usb
[ 1.244507] cpufreq: driver msm up and running
[ 1.248425] ION heap system created
[ 1.251895] msm_bus_fabric_init_driver
[ 1.262563] qcom,qpnp-power-on qpnp-power-on-c7303800: PMIC@SID0 Power-on reason: Triggered from PON1 (secondary PMIC) and 'cold' boot
[ 1.273747] qcom,qpnp-power-on qpnp-power-on-c7303800: PMIC@SID0: Power-off reason: Triggered from UVLO (Under Voltage Lock Out)
[ 1.285430] input: qpnp_pon as /devices/virtual/input/input0
[ 1.291246] PMIC@SID0: PM8019 v2.2 options: 3, 2, 2, 2
[ 1.296706] Advanced Linux Sound Architecture Driver Initialized.
[ 1.302493] Add group failed
[ 1.305291] cfg80211: Calling CRDA to update world regulatory domain
[ 1.311216] cfg80211: World regulatory domain updated:
[ 1.317109] Switched to clocksource arch_mem_counter
[ 1.334091] cfg80211: DFS Master region: unset
[ 1.337418] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 1.354087] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.361055] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.370545] NET: Registered protocol family 2
[ 1.374082] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.381851] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.389876] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.397857] cfg80211: (5490000 KHz - 5710000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.405841] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.413795] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 1.422355] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 1.428921] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 1.435192] TCP: Hash tables configured (established 1024 bind 1024)
[ 1.441528] TCP: reno registered
[ 1.444738] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.450521] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.456950] NET: Registered protocol family 1
[ 1.462779] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 1.474555] msgmni has been set to 115
[ 1.478551] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 1.485041] io scheduler noop registered
[ 1.488818] io scheduler deadline registered
[ 1.493200] io scheduler cfq registered (default)
[ 1.502142] msm_rpm_log_probe: OK
[ 1.506717] msm_serial_hs module loaded
[ 1.509803] msm_serial_hsl_probe: detected port #0 (ttyHSL0)
[ 1.515324] AXI: get_pdata(): Error: Client name not found
[ 1.520626] AXI: msm_bus_cl_get_pdata(): client has to provide missing entry for successful registration
[ 1.530171] msm_serial_hsl_probe: Bus scaling is disabled [ 1.074814] AXI: msm_bus_scale_register_client(): msm_bus_scale_register_client: Bus driver not ready.
[ 1.083716] i2c-msm-v2 78b7000.i2c: msm_bus_scale_register_client(mstr-id:86):0 (not a problem)
[ 1.093850] i2c-msm-v2 78b9000.i2c: probing driver i2c-msm-v2
[ 1.098889] AXI: msm_bus_scale_register_client(): msm_bus_scale_register_client: Bus driver not ready.
[ 1.107779] i2c-msm-v2 78b9000.i2c: msm_bus_scale_register_client(mstr-id:86):0 (not a problem)
[ 1.167871] KPI: Bootloader start count = 24097
[ 1.171364] KPI: Bootloader end count = 48481
[ 1.175855] KPI: Bootloader display count = 3884474147
[ 1.180825] KPI: Bootloader load kernel count = 16420
[ 1.185905] KPI: Kernel MPM timestamp = 105728
[ 1.190286] KPI: Kernel MPM Clock frequency = 32768
[ 1.195209] socinfo_print: v0.10, id=297, ver=1.0, raw_id=72, raw_ver=0, hw_plat=8, hw_plat_ver=65536
[ 1.195209] accessory_chip=0, hw_plat_subtype=0, pmic_model=65539, pmic_die_revision=131074 foundry_id=0 serial_number=2120983948
[ 1.216731] sdcard_ext_vreg: no parameters
[ 1.220555] rome_vreg: no parameters
[ 1.224133] emac_lan_vreg: no parameters
[ 1.228177] usbcore: registered new interface driver usbfs
[ 1.233156] usbcore: registered new interface driver hub
[ 1.238578] usbcore: registered new device driver usb
[ 1.244507] cpufreq: driver msm up and running
[ 1.248425] ION heap system created
[ 1.251895] msm_bus_fabric_init_driver
[ 1.262563] qcom,qpnp-power-on qpnp-power-on-c7303800: PMIC@SID0 Power-on reason: Triggered from PON1 (secondary PMIC) and 'cold' boot
[ 1.273747] qcom,qpnp-power-on qpnp-power-on-c7303800: PMIC@SID0: Power-off reason: Triggered from UVLO (Under Voltage Lock Out)
[ 1.285430] input: qpnp_pon as /devices/virtual/input/input0
[ 1.291246] PMIC@SID0: PM8019 v2.2 options: 3, 2, 2, 2
[ 1.296706] Advanced Linux Sound Architecture Driver Initialized.
[ 1.302493] Add group failed
[ 1.305291] cfg80211: Calling CRDA to update world regulatory domain
[ 1.311216] cfg80211: World regulatory domain updated:
[ 1.317109] Switched to clocksource arch_mem_counter
[ 1.334091] cfg80211: DFS Master region: unset
[ 1.337418] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 1.354087] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.361055] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.370545] NET: Registered protocol family 2
[ 1.374082] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.381851] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.389876] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.397857] cfg80211: (5490000 KHz - 5710000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.405841] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 1.413795] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 1.422355] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 1.428921] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 1.435192] TCP: Hash tables configured (established 1024 bind 1024)
[ 1.441528] TCP: reno registered
[ 1.444738] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.450521] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.456950] NET: Registered protocol family 1
[ 1.462779] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 1.474555] msgmni has been set to 115
[ 1.478551] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 1.485041] io scheduler noop registered
[ 1.488818] io scheduler deadline registered
[ 1.493200] io scheduler cfq registered (default)
[ 1.502142] msm_rpm_log_probe: OK
[ 1.506717] msm_serial_hs module loaded
[ 1.509803] msm_serial_hsl_probe: detected port #0 (ttyHSL0)
[ 1.515324] AXI: get_pdata(): Error: Client name not found
[ 1.520626] AXI: msm_bus_cl_get_pdata(): client has to provide missing entry for successful registration
[ 1.530171] msm_serial_hsl_probe: Bus scaling is disabled
[ 1.535696] 78b3000.serial: ttyHSL0 at MMIO 0x78b3000 (irq = 153, base_baud = 460800 [ 1.544155] msm_hsl_console_setup: console setup on port #0
[ 1.548727] console [ttyHSL0] enabled
[ 1.548727] console [ttyHSL0] enabled
[ 1.556014] bootconsole [uart0] disabled
[ 1.556014] bootconsole [uart0] disabled
[ 1.564212] msm_serial_hsl_init: driver initialized
[ 1.578450] brd: module loaded
[ 1.582920] loop: module loaded
[ 1.589183] sps: BAM device 0x07984000 is not registered yet.
[ 1.594234] sps:BAM 0x07984000 is registered.
[ 1.598072] msm_nand_bam_init: msm_nand_bam_init: BAM device registered: bam_handle 0xc69f6400
[ 1.607103] sps:BAM 0x07984000 (va:0xc89a0000) enabled: ver:0x18, number of pipes:7
[ 1.616588] msm_nand_parse_smem_ptable: Parsing partition table info from SMEM
[ 1.622805] msm_nand_parse_smem_ptable: SMEM partition table found: ver: 4 len: 17
[ 1.630391] msm_nand_version_check: nand_major:1, nand_minor:5, qpic_major:1, qpic_minor:5
[ 1.638642] msm_nand_scan: NAND Id: 0x1590aa98 Buswidth: 8Bits Density: 256 MByte
[ 1.646069] msm_nand_scan: pagesize: 2048 Erasesize: 131072 oobsize: 128 (in Bytes)
[ 1.653676] msm_nand_scan: BCH ECC: 8 Bit
[ 1.657710] msm_nand_scan: CFG0: 0x290408c0, CFG1: 0x0804715c
[ 1.657710] RAWCFG0: 0x2b8400c0, RAWCFG1: 0x0005055d
[ 1.657710] ECCBUFCFG: 0x00000203, ECCBCHCFG: 0x42040d10
[ 1.657710] RAWECCCFG: 0x42000d11, BAD BLOCK BYTE: 0x000001c5
[ 1.684101] Creating 17 MTD partitions on "7980000.nand":
[ 1.689447] 0x000000000000-0x000000140000 : "sbl"
[ 1.694867] 0x000000140000-0x000000280000 : "mibib"
[ 1.699560] 0x000000280000-0x000000e80000 : "efs2"
[ 1.704408] 0x000000e80000-0x000000f40000 : "tz"
[ 1.708934] 0x000000f40000-0x000000fa0000 : "rpm"
[ 1.713625] 0x000000fa0000-0x000001000000 : "aboot"
[ 1.718582] 0x000001000000-0x0000017e0000 : "boot"
[ 1.723281] 0x0000017e0000-0x000002820000 : "scrub"
[ 1.728174] 0x000002820000-0x000005020000 : "modem"
[ 1.732968] 0x000005020000-0x000005420000 : "rfbackup"
[ 1.738156] 0x000005420000-0x000005820000 : "oem"
[ 1.742770] 0x000005820000-0x000005f00000 : "recovery"
[ 1.747972] 0x000005f00000-0x000009100000 : "cache"
[ 1.752787] 0x000009100000-0x000009a40000 : "recoveryfs"
[ 1.758389] 0x000009a40000-0x00000aa40000 : "cdrom"
[ 1.762967] 0x00000aa40000-0x00000ba40000 : "jrdresource"
[ 1.768407] 0x00000ba40000-0x000010000000 : "system"
[ 1.773239] msm_nand_probe: NANDc phys addr 0x7980000, BAM phys addr 0x7984000, BAM IRQ 164
[ 1.781074] msm_nand_probe: Allocated DMA buffer at virt_addr 0xc7840000, phys_addr 0x87840000
[ 1.791872] PPP generic driver version 2.4.2
[ 1.801126] cnss_sdio 87a00000.qcom,cnss-sdio: CNSS SDIO Driver registered
[ 1.807554] msm_otg 78d9000.usb: msm_otg probe
[ 1.813333] msm_otg 78d9000.usb: OTG regs = c88f8000
[ 1.820702] gbridge_init: gbridge_init successs.
[ 1.826344] msm_otg 78d9000.usb: phy_reset: success
[ 1.830294] qcom,qpnp-rtc qpnp-rtc-c7307000: rtc core: registered qpnp_rtc as rtc0
[ 1.838474] i2c /dev entries driver
[ 1.842459] unable to find DT imem DLOAD mode node
[ 1.846588] unable to find DT imem EDLOAD mode node
[ 1.851332] unable to find DT imem dload-type node
[ 1.856921] bq24295-charger 4-006b: bq24295 probe enter
[ 1.861161] qcom,iterm-ma = 128
[ 1.864476] bq24295_otg_vreg: no parameters
[ 1.868502] charger_core_register: Charger Core Version 5.0.0(Built at 20151202-21:36)!
[ 1.877007] i2c-msm-v2 78b8000.i2c: msm_bus_scale_register_client(mstr-id:86):0x3 (ok)
[ 1.885559] bq24295-charger 4-006b: bq24295_set_bhot_mode 3
[ 1.890150] bq24295-charger 4-006b: power_good is 1,vbus_stat is 2
[ 1.896588] bq24295-charger 4-006b: bq24295_set_thermal_threshold 100
[ 1.902952] bq24295-charger 4-006b: bq24295_set_sys_min 3700
[ 1.908639] bq24295-charger 4-006b: bq24295_set_max_target_voltage 4150
[ 1.915223] bq24295-charger 4-006b: bq24295_set_recharge_threshold 300
[ 1.922119] bq24295-charger 4-006b: bq24295_set_terminal_current_limit iterm_disabled=0, iterm_ma=128
[ 1.930917] bq24295-charger 4-006b: bq24295_set_precharge_current_limit bdi->prech_cur=128
[ 1.940038] bq24295-charger 4-006b: bq24295_set_safty_timer 0
[ 1.945088] bq24295-charger 4-006b: bq24295_set_input_voltage_limit 4520
[ 1.972949] sdhci: Secure Digital Host Controller Interface driver
[ 1.978151] sdhci: Copyright(c) Pierre Ossman
[ 1.982441] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.989092] sdhci_msm 7824900.sdhci: sdhci_msm_probe: ICE device is not enabled
[ 1.995473] sdhci_msm 7824900.sdhci: No vreg data found for vdd
[ 2.001530] sdhci_msm 7824900.sdhci: sdhci_msm_pm_qos_parse_irq: error -22 reading irq cpu
[ 2.009809] sdhci_msm 7824900.sdhci: sdhci_msm_pm_qos_parse: PM QoS voting for IRQ will be disabled
[ 2.018600] sdhci_msm 7824900.sdhci: sdhci_msm_pm_qos_parse: PM QoS voting for cpu group will be disabled
[ 2.030541] sdhci_msm 7824900.sdhci: sdhci_msm_probe: sdiowakeup_irq = 353
[ 2.036867] sdhci_msm 7824900.sdhci: No vmmc regulator found
[ 2.042027] sdhci_msm 7824900.sdhci: No vqmmc regulator found
[ 2.048266] mmc0: SDHCI controller on 7824900.sdhci [7824900.sdhci] using 32-bit ADMA in legacy mode
[ 2.080401] Welcome to pca955x_probe!!
[ 2.084362] leds-pca955x 3-0020: leds-pca955x: Using pca9555 16-bit LED driver at slave address 0x20
[ 2.095400] sdhci_msm 7824900.sdhci: card claims to support voltages below defined range
[ 2.103125] i2c-msm-v2 78b7000.i2c: msm_bus_scale_register_client(mstr-id:86):0x5 (ok)
[ 2.114183] msm_otg 78d9000.usb: Avail curr from USB = 1500
[ 2.120251] come to USB_SDP_CHARGER!
[ 2.123215] Welcome to sn3199_probe!
[ 2.126718] leds-sn3199 5-0064: leds-sn3199: Using sn3199 9-bit LED driver at slave address 0x64
[ 2.136511] sn3199->led_en_gpio=21
[ 2.139143] i2c-msm-v2 78b9000.i2c: msm_bus_scale_register_client(mstr-id:86):0x6 (ok)
[ 2.150207] usbcore: registered new interface driver usbhid
[ 2.154864] usbhid: USB HID core driver
[ 2.159825] sps:BAM 0x078c4000 is registered.
[ 2.163573] bimc-bwmon 408000.qcom,cpu-bwmon: BW HWmon governor registered.
[ 2.171080] devfreq soc:qcom,cpubw: Couldn't update frequency transition information.
[ 2.178513] coresight-fuse a601c.fuse: QPDI fuse not specified
[ 2.184242] coresight-fuse a601c.fuse: Fuse initialized
[ 2.192407] coresight-csr 6001000.csr: CSR initialized
[ 2.197263] coresight-tmc 6026000.tmc: Byte Counter feature enabled
[ 2.203204] sps:BAM 0x06084000 is registered.
[ 2.207301] coresight-tmc 6026000.tmc: TMC initialized
[ 2.212681] coresight-tmc 6025000.tmc: TMC initialized
[ 2.220071] nidnt boot config: 0
[ 2.224563] mmc0: new ultra high speed SDR50 SDIO card at address 0001
[ 2.231120] coresight-tpiu 6020000.tpiu: NIDnT on SDCARD only mode
[ 2.236440] coresight-tpiu 6020000.tpiu: TPIU initialized
[ 2.242808] coresight-replicator 6024000.replicator: REPLICATOR initialized
[ 2.249372] coresight-stm 6002000.stm: STM initialized
[ 2.255034] coresight-hwevent 606c000.hwevent: Hardware Event driver initialized
[ 2.262312] Netfilter messages via NETLINK v0.30.
[ 2.266306] nf_conntrack version 0.5.0 (920 buckets, 3680 max)
[ 2.272312] ctnetlink v0.93: registering with nfnetlink.
[ 2.277565] ip_set: protocol 6
[ 2.280568] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 2.285723] arp_tables: (C) 2002 David S. Miller
[ 2.290146] TCP: cubic registered
[ 2.293915] NET: Registered protocol family 10
[ 2.298740] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 2.303407] sit: IPv6 over IPv4 tunneling driver
[ 2.308481] NET: Registered protocol family 17
[ 2.312340] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 2.325094] Bridge firewalling registered
[ 2.328930] Ebtables v2.0 registered
[ 2.333260] NET: Registered protocol family 27
[ 2.341362] battery_core_register: Battery Core Version 5.0.0(Built at 20151202-21:36)!
[ 2.348466] pmu_battery_probe: vbat_channel=21, tbat_channel=17
[ 2.420236] ubi0: attaching mtd16
[ 2.723941] ubi0: scanning is finished
[ 2.732997] ubi0: attached mtd16 (name "system", size 69 MiB)
[ 2.737783] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 2.744601] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 2.751333] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 2.758540] ubi0: good PEBs: 556, bad PEBs: 2, corrupted PEBs: 0
[ 2.764305] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[ 2.771476] ubi0: max/mean erase counter: 192/64, WL threshold: 4096, image sequence number: 35657280
[ 2.780708] ubi0: available PEBs: 0, total reserved PEBs: 556, PEBs reserved for bad PEB handling: 38
[ 2.789921] ubi0: background thread "ubi_bgt0d" started, PID 96
[ 2.796395] android_bind cdev: 0xC6583E80, name: ci13xxx_msm
[ 2.801508] file system registered
[ 2.804974] mbim_init: initialize 1 instances
[ 2.809228] mbim_init: Initialized 1 ports
[ 2.815074] rndis_qc_init: initialize rndis QC instance
[ 2.819713] jrd device_desc.bcdDevice: [0x0242]
[ 2.823779] android_bind scheduled usb start work: name: ci13xxx_msm
[ 2.830230] android_usb gadget: android_usb ready
[ 2.834845] msm_hsusb msm_hsusb: [ci13xxx_start] hw_ep_max = 32
[ 2.840741] msm_hsusb msm_hsusb: CI13XXX_CONTROLLER_RESET_EVENT received
[ 2.847433] msm_hsusb msm_hsusb: CI13XXX_CONTROLLER_UDC_STARTED_EVENT received
[ 2.855851] input: gpio-keys as /devices/soc:gpio_keys/input/input1
[ 2.861452] qcom,qpnp-rtc qpnp-rtc-c7307000: setting system clock to 1970-01-01 06:36:41 UTC (23801)
[ 2.870315] open file error /usb_conf/usb_config.ini
[ 2.876412] jrd_usb_start_work open file erro /usb_conf/usb_config.ini, retry_count:0
[ 2.884324] parse_legacy_cluster_params(): Ignoring cluster params
[ 2.889468] ------------[ cut here ]------------
[ 2.894186] WARNING: CPU: 0 PID: 1 at /home/linux3/jrd/yanping.an/ee40/0810/MDM9607.LE.1.0-00130/apps_proc/oe-core/build/tmp-glibc/work-shared/mdm9607/kernel-source/drivers/cpuidle/lpm-levels-of.c:739 parse_cluster+0xb50/0xcb4()
[ 2.914366] Modules linked in:
[ 2.917339] CPU: 0 PID: 1 Comm: swapper Not tainted 3.18.20 #1
[ 2.923171] [<c00132ac>] (unwind_backtrace) from [<c0011460>] (show_stack+0x10/0x14)
[ 2.931092] [<c0011460>] (show_stack) from [<c001c6ac>] (warn_slowpath_common+0x68/0x88)
[ 2.939175] [<c001c6ac>] (warn_slowpath_common) from [<c001c75c>] (warn_slowpath_null+0x18/0x20)
[ 2.947895] [<c001c75c>] (warn_slowpath_null) from [<c034e180>] (parse_cluster+0xb50/0xcb4)
[ 2.956189] [<c034e180>] (parse_cluster) from [<c034b6b4>] (lpm_probe+0xc/0x1d4)
[ 2.963527] [<c034b6b4>] (lpm_probe) from [<c024857c>] (platform_drv_probe+0x30/0x7c)
[ 2.971380] [<c024857c>] (platform_drv_probe) from [<c0246d54>] (driver_probe_device+0xb8/0x1e8)
[ 2.980118] [<c0246d54>] (driver_probe_device) from [<c0246f30>] (__driver_attach+0x68/0x8c)
[ 2.988467] [<c0246f30>] (__driver_attach) from [<c02455d0>] (bus_for_each_dev+0x6c/0x90)
[ 2.996626] [<c02455d0>] (bus_for_each_dev) from [<c02465a4>] (bus_add_driver+0xe0/0x1c8)
[ 3.004786] [<c02465a4>] (bus_add_driver) from [<c02477bc>] (driver_register+0x9c/0xe0)
[ 3.012739] [<c02477bc>] (driver_register) from [<c080c3d8>] (lpm_levels_module_init+0x14/0x38)
[ 3.021459] [<c080c3d8>] (lpm_levels_module_init) from [<c0008980>] (do_one_initcall+0xf8/0x1a0)
[ 3.030217] [<c0008980>] (do_one_initcall) from [<c07e7d4c>] (kernel_init_freeable+0xf0/0x1b0)
[ 3.038818] [<c07e7d4c>] (kernel_init_freeable) from [<c0582d48>] (kernel_init+0x8/0xe4)
[ 3.046888] [<c0582d48>] (kernel_init) from [<c000dda0>] (ret_from_fork+0x14/0x34)
[ 3.054432] ---[ end trace e9ec50b1ec4c8f73 ]---
[ 3.059012] ------------[ cut here ]------------
[ 3.063604] WARNING: CPU: 0 PID: 1 at /home/linux3/jrd/yanping.an/ee40/0810/MDM9607.LE.1.0-00130/apps_proc/oe-core/build/tmp-glibc/work-shared/mdm9607/kernel-source/drivers/cpuidle/lpm-levels-of.c:739 parse_cluster+0xb50/0xcb4()
[ 3.083858] Modules linked in:
[ 3.086870] CPU: 0 PID: 1 Comm: swapper Tainted: G W 3.18.20 #1
[ 3.093814] [<c00132ac>] (unwind_backtrace) from [<c0011460>] (show_stack+0x10/0x14)
[ 3.101575] [<c0011460>] (show_stack) from [<c001c6ac>] (warn_slowpath_common+0x68/0x88)
[ 3.109641] [<c001c6ac>] (warn_slowpath_common) from [<c001c75c>] (warn_slowpath_null+0x18/0x20)
[ 3.118412] [<c001c75c>] (warn_slowpath_null) from [<c034e180>] (parse_cluster+0xb50/0xcb4)
[ 3.126745] [<c034e180>] (parse_cluster) from [<c034b6b4>] (lpm_probe+0xc/0x1d4)
[ 3.134126] [<c034b6b4>] (lpm_probe) from [<c024857c>] (platform_drv_probe+0x30/0x7c)
[ 3.141906] [<c024857c>] (platform_drv_probe) from [<c0246d54>] (driver_probe_device+0xb8/0x1e8)
[ 3.150702] [<c0246d54>] (driver_probe_device) from [<c0246f30>] (__driver_attach+0x68/0x8c)
[ 3.159120] [<c0246f30>] (__driver_attach) from [<c02455d0>] (bus_for_each_dev+0x6c/0x90)
[ 3.167285] [<c02455d0>] (bus_for_each_dev) from [<c02465a4>] (bus_add_driver+0xe0/0x1c8)
[ 3.175444] [<c02465a4>] (bus_add_driver) from [<c02477bc>] (driver_register+0x9c/0xe0)
[ 3.183398] [<c02477bc>] (driver_register) from [<c080c3d8>] (lpm_levels_module_init+0x14/0x38)
[ 3.192107] [<c080c3d8>] (lpm_levels_module_init) from [<c0008980>] (do_one_initcall+0xf8/0x1a0)
[ 3.200877] [<c0008980>] (do_one_initcall) from [<c07e7d4c>] (kernel_init_freeable+0xf0/0x1b0)
[ 3.209475] [<c07e7d4c>] (kernel_init_freeable) from [<c0582d48>] (kernel_init+0x8/0xe4)
[ 3.217542] [<c0582d48>] (kernel_init) from [<c000dda0>] (ret_from_fork+0x14/0x34)
[ 3.225090] ---[ end trace e9ec50b1ec4c8f74 ]---
[ 3.229667] /soc/qcom,lpm-levels/qcom,pm-cluster@0: No CPU phandle, assuming single cluster
[ 3.239954] qcom,cc-debug-mdm9607 1800000.qcom,debug: Registered Debug Mux successfully
[ 3.247619] emac_lan_vreg: disabling
[ 3.250507] mem_acc_corner: disabling
[ 3.254196] clock_late_init: Removing enables held for handed-off clocks
[ 3.262690] ALSA device list:
[ 3.264732] No soundcard [ 3.274083] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 102
[ 3.305224] UBIFS (ubi0:0): recovery needed
[ 3.466156] UBIFS (ubi0:0): recovery completed
[ 3.469627] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[ 3.476987] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 3.486876] UBIFS (ubi0:0): FS size: 45838336 bytes (43 MiB, 361 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[ 3.497417] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[ 3.503078] UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 4DBB2F12-34EB-43B6-839B-3BA930765BAE, small LPT model
[ 3.515582] VFS: Mounted root (ubifs filesystem) on device 0:12.
[ 3.520940] Freeing unused kernel memory: 276K (c07e7000 - c082c000)
INIT: version 2.88 booting
Thrilled to announce that a new package of mine just made it to CRAN: the td package accesses the twelvedata API for financial data.
Currently only the time_series REST access point is supported, but it is already supported with all meaningful options (we skipped only JSON or CSV which makes no sense here) so for example any resolution between 1 minute and 1 month can be requested for any stock, etf or currency symbol for a wide array of exchanges. Historical access is available too via (optional) start and end dates. We return either raw JSON or a data.frame or an xts object making it trivial to call high-end plotting functions on the data the project and repo pages show several examples.
As just one example, here is GME during the follies. We simply request via
> gme <- time_series("GME", "1min",
+ start_date="2021-01-25 09:30:00",
+ end_date="2021-02-04 16:00:00", as="xts")tools::R_user_dir("td") pointing at this package s directory, or via an environment variable; either is accessed at package load or attachment) from which we can then plot via quantmod
> quantmod::chart_Series(gme, name=paste0(attr(gme, "symbol"), "/", attr(gme, "exchange")))
which shows how we also helpfully store metadata returned by twelvedata as extra attributes of the object. The chart is
You will need an API key to have up to 800 daily accesses for free, higher-performance plans (including websocket access) are available for paying customers too. I have only used the free API so far myself.
I plan to add quote and price support this weekend, and generalize the time series access to returning lists of objects as the API does in fact support multi-security access. As always, feedback is welcomed. Please post comments and suggestions at the GitHub repo.
If you like this or other open-source work I do, you can now sponsor me at GitHub.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Here is my monthly update covering what I have been doing in the free software world during January 2021 (previous month):
node-tap-parser's manual pages contained errors instead of documentation (#980293).
stat(2) repeatedly. [...]
2020 12' when generating commit listings [...].
sys.argv in our top-level temporary directory, in case it helps debug why temporary directories might not get cleaned up. [...]--acl and --xattr arguments into --extended-filesystem-attributes to cover all of these extended attributes, defaulting the new option to false (ie. to not check these expensive external calls). [...][...]--exclude-directory-metadata argument. [...]cmp(1) with a missing profiling point. [...]jsondiff differences at 512 bytes, in case they consume the entire page. [...]__del__ is not always called in Python, so temporary directories are not necessarily removed the moment they go out of scope. [...]diffoscope.main. [...]diffoscope.comparators.utils.fuzzy module. [...]test_all_tools_are_listed within that module. [...]python-django:
3.1.5-1 New upstream bugfix release.3.2~alpha1-1 New upstream 3.2 alpha release & misc packaging updates.redis:
6.0.9-2 (to unstable) Enable systemd Type=notify support. (#977852lllllllllll)6.0.9-3 (to unstable) Allow /etc/redis to be rewritten and also removed upon purge. (#981000)6.0.9-4 (to unstable) Send systemd readiness notification when we are ready to accept connections in order to fix replicaof support. Thanks to Guillem Jover for the report and patch. (#981226)6.2~rc2-1 (to experimental) New upstream release.6.2~rc2-2 (to experimental) Allow /etc/redis to be rewritten and also removed upon purge. (#981000)cairo (CVE-2020-35492), firefox-esr (CVE-2020-16044), jackson-databind (CVE-2020-36179 CVE-2020-36189), nvidia-graphics-drivers (CVE-2021-1052, CVE-2021-1053 & CVE-2021-1056)), opensmtpd (CVE-2020-35680 & CVE-2020-35679), php7.0 (CVE-2020-7071)), python-autobahn (CVE-2020-35678) & tlslite-ng (CVE-2020-26263.
csync2. The cluster synchronization tool did not correctly check for the return value from GnuTLS security routines; it neglected to repeatedly call this function as required by the design of the API.
gssproxy to fix a privilege separation issue that arose from failing to unlock a shared resource.
CVE-2020-24386). The second was an issue where a malicious sender could crash Dovecot by sending messages with more than 10,000 (!) attachments (CVE-2020-25275).
crm history command-line tool, potentially allowing escalation of privileges. DLA 2533-1 was issued to address this.

There are ton of articles out there to configure mutt and all related
things to it. But I find certain configs very hard to get. So I will
write down those.
set date_format="%d/%m/%y %I:%M %p"
set index_format="%3C %Z %?X?@& ? %-22.17L %-5.50s %> %-22.20D"
set editor="nano --syntax=email -r 70 -b"
new_mail_command can be used to execute
a custom script upon new
mail, such as running notify-send. There are many standalone
mail notifier such as mailnag,
mail notification
etc. It all just felt bulky for me. So I ended up making
these.
#!/bin/sh
accounts="$(awk '/^Channel/ print $2 ' "$MBSYNCRC")"
for account in $accounts; do
acc="$(echo "$account" sed "s/.*\///")"
new=$(find "$MAILBOX/$acc/Inbox/new/" -type f -newer "$MUTT/.mailsynclastrun" 2> /dev/null)
newcount=$(echo "$new" sed '/^\s*$/d' wc -l)
if [ "$newcount" -gt "0" ]; then
for file in $new; do
# Extract subject and sender from mail.
from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' awk ' $1=""; if (NF>=3)$NF=""; print $0 ' sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//')
subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" head -n 1 perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' sed 's/^Subject: //' sed 's/^ [[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' tr -d '\n')
displays="$(pgrep -a Xorg grep -wo "[0-9]*:[0-9]\+")"
for x in $displays; do
export DISPLAY=$x
notify-send -i $MUTT/mutt.png -t 5000 "$account received new message:" "$from: <i>$subject</i>"
done
done
fi
done
touch "$MUTT/.mailsynclastrun"
EOF and secret key not found error.apt-get install debootstrap qemu-user-static binfmt-support debian-ports-archive-keyring debootstrap --arch=riscv64 --keyring /usr/share/keyrings/debian-ports-archive-keyring.gpg --include=debian-ports-archive-keyring unstable /mnt/tmp http://deb.debian.org/debian-portsI first tried running RISC-V Qemu on Buster, but even ls didn t work properly and the installation failed.
chroot /mnt/tmp bin/bash # ls -ld . /usr/bin/ls: cannot access '.': Function not implementedWhen I ran it on Unstable ls works but strace doesn t work in a chroot, this gave enough functionality to complete the installation.
chroot /mnt/tmp bin/bash # strace ls -l /usr/bin/strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Function not implemented /usr/bin/strace: ptrace(PTRACE_TRACEME, ...): Function not implemented /usr/bin/strace: PTRACE_SETOPTIONS: Function not implemented /usr/bin/strace: detach: waitpid(1602629): No child processes /usr/bin/strace: Process 1602629 detachedWhen running the VM the operation was noticably slower than the emulation of PPC64 and S/390x which both ran at an apparently normal speed. When running on a server with equivalent speed CPU a ssh login was obviously slower due to the CPU time taken for encryption, a ssh connection from a system on the same LAN took 6 seconds to connect. I presume that because RISC-V is a newer architecture there hasn t been as much effort made on optimising the Qemu emulation and that a future version of Qemu will be faster. But I don t think that Debian/Bullseye will give good Qemu performance for RISC-V, probably more changes are needed than can happen before the freeze. Maybe a version of Qemu with better RISC-V performance can be uploaded to backports some time after Bullseye is released. Here s the Qemu command I use to run RISC-V emulation:
qemu-system-riscv64 -machine virt -device virtio-blk-device,drive=hd0 -drive file=/vmstore/riscv,format=raw,id=hd0 -device virtio-blk-device,drive=hd1 -drive file=/vmswap/riscv,format=raw,id=hd1 -m 1024 -kernel /boot/riscv/vmlinux-5.10.0-1-riscv64 -initrd /boot/riscv/initrd.img-5.10.0-1-riscv64 -nographic -append net.ifnames=0 noresume security=selinux root=/dev/vda ro -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0 -device virtio-net-device,netdev=net0,mac=02:02:00:00:01:03 -netdev tap,id=net0,helper=/usr/lib/qemu/qemu-bridge-helperCurrently the program /usr/sbin/sefcontext_compile from the selinux-utils package needs execmem access on RISC-V while it doesn t on any other architecture I have tested. I don t know why and support for debugging such things seems to be in early stages of development, for example the execstack program doesn t work on RISC-V now. RISC-V emulation in Unstable seems adequate for people who are serious about RISC-V development. But if you want to just try a different architecture then PPC64 and S/390 will work better.
Next.