2

My question is like this one: How do I force the Raspberry Pi to turn on HDMI? , except for OpenELEC and not Raspbmc.

Basically I have a homemade media center Raspberry PI 3 with OpenELEC/KODI connected via HDMI to a dumb TV. If the TV is turned on when I power the Raspberry PI, everything works fine. However, if the Raspberry PI is powered first and then I turn on the TV, the screen stays blank; for anything on the screen to appear I need to power cycle the Raspberry PI.

So basically I need to find a way to force OpenELEC to keep HDMI turned on.

According to this post, all one has to do is to add a line

hdmi_force_hotplug=1

to the file /boot/config.txt.

However, this file doesn't exist on my system, and the filesystem is read-only.

How do I write to the filesystem? Or, alternatively, is there another way to solve my issue?

dr_
  • 123
  • 5

1 Answers1

3

I just installed OpenElec on a Pi 3, and it puts the partition that is normally mounted as /boot on other distributions as /flash.

OpenELEC:~ # df | grep p1
/dev/mmcblk0p1          524008    151736    372272  29% /flash

As you say, it is mounted by default as read-only.

OpenELEC:~ # mount | grep flash
/dev/mmcblk0p1 on /flash type vfat (ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)

To modify the file /flash/config.txt, you have two general ways to do it.

  • Use another computer

The filesystem is just a normal FAT filesystem. Stop OpenElec, take the SD card out and put it in another system (Windows, Linux, whatever). You should see the file config.txt at the top of the filesystem. Edit it. Then cleanly eject the drive and put it back into the Raspberry Pi and boot. You should be able to see your changes by typing cat /flash/config.txt.

  • Temporarily make the filesystem read-write

Use df to see how your filesystem is mounted

OpenELEC:~ # df | grep p1
/dev/mmcblk0p1          524008    151736    372272  29% /flash

Run mount with the device given and the remount options to make it writable

OpenELEC:~ # touch /flash/foo
touch: /flash/foo: Read-only file system
OpenELEC:~ # mount -o remount,rw /dev/mmcblk0p1 /flash
OpenELEC:~ # touch /flash/foo
OpenELEC:~ #

At this point you should be able to use an editor to modify /flash/config.txt. Reboot the system and it will go back to being read-only (which makes it more resilient in case of power loss.

BowlOfRed
  • 410
  • 2
  • 9
  • Ah, so /boot on Raspbmc = /flash on OpenELEC. Good to know. I should have run (lazy me...) a find on the fs for the file config.txt. Anyway it works perfectly. Thanks. – dr_ Oct 29 '17 at 15:42