How does one make an i2c ssd1306 a framebuffer?
A device tree overlay which allows the use of an ssd1306 via i2c was merged into the Raspberry Pi OS (Raspbian) kernel in early 2019 (https://github.com/raspberrypi/firmware/issues/1098).
To use this, you could add
If you want to use the ssd1306 as your primary console, then you can prevent the Pi GPU being used as the console by adding
fbcon=map:1 to the kernel commandline in
If you do this, you might want to recompile the kernel to include the
MINI_4x6 font (the default 8x8 font will only give you an 8 row, 16 column character display on a 128x64 screen, whereas the 4x6 font should give you a spacious 10 row, 32 column character display).
There is already built-in support for the SSD1306 OLED module in the Linux Kernel CONFIG_FB_SSD1307. For the Raspberry PI for example with the Yocto build setup you could use the meta-rpi-ssd1306 available here https://github.com/mickey-happygolucky/meta-rpi-ssd1306