The Problem
I recently became interested in AllStarLink, and had a HamVoip image installed on a Raspberry Pi. (I was using “RPi2-3 includes 3B+ Image Version 1.5rc19”.)
The AllStarLink image booted to 1366x768, which was the screen’s default resolution. However, the screen itself was a 7 inch HDMI screen. That was hard to read.
Things that didn’t work
I decided to change the resolution by editing /boot/cmdline.txt. My first attempt was to add:
framebuffer_width=720
framebuffer_height=400
before the root= line at the beginning of the file. That resulted in a kernel panic:
Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
After a while, I realized that root= had to come first. Then I tried:
root=/dev/mmcblk0p2 rw rootwait bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=400
console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0
smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop
hdmi_safe=1
hdmi_group=1
hdmi_mode=1
but my cmdline.txt values seemed to be ignored.
Finally I wised up: apparently when the Pi reads the root line it starts booting, ignoring everything after it in cmdline.txt. So, I had to pass the video size as a kernel parameter instead.
I did:
cat /proc/cmdline
and saw:
8250.nr_uarts=0 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768
bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000
root=/dev/mmcblk0p2 rw rootwait console=ttyS0,115200 console=tty1 selinux=0
plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyS0,115200 elevator=noop
The Solution
(For Linux / AllStarLink newbies: in order to get to the terminal, I picked menu item 9 - open a bash shell.)
I went into /boot/cmdline.txt with a text editor:
nano /boot/cmdline.txt
and inserted the following two parameters on the existing line that begins with “root=”:
bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=400
I put these right after the rootwait parameter, so in /boot/cmdline.txt I now had:
root=/dev/mmcblk0p2 rw rootwait bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=400
console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0
smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop
(Note that root line is all one long line - not broken up with line separators!)
Once I did that and saved it, the Raspberry Pi booted up in glorious 80x25 text. Now we could read it!