Installing Home Assistant Supervised on a Raspberry Pi using Debian 12

It seems that my problems were not related to Debian upgrade but to Home Assistant core upgrade and the database schema change. An index creation on statistics table was failing because of duplicates. It turned out that I had around 50million records for 2021-10-31. Wasn’t easy, but I managed to remove those records (losing 2021-10-31 statistics I suppose) and the database schema change seems now successful.

Likely there was a bug handling DST change that caused the problem I didn’t noticed until upgrading HA core. Likely the database schema changing was repsonsible of making at some point my system unresponsive.

At least, I hope so.

Installation of home-assistant / supervised-installer Release 1.1.1 will partially fail:

grep: /etc/default/grub: No such file or directory
[info] Switching to cgroup v1
cp: cannot stat '/etc/default/grub': No such file or directory
dpkg: error processing package homeassistant-supervised (--install):
 installed homeassistant-supervised package post-installation script subprocess returned error exit status 1

The solution as described by fcastilloec is:

If you need to enable cgroups v1, the values cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory must be added to /boot/cmdline.txt.

The above didn’t fix the issue on my clean debian 11 build as the install script still wanted to access grub files. Here’s what I did.

I guess one way to fix the problem is to do the following

touch /etc/default/grub

Then put a script named update-grub in /bin that doesn’t do anything

#!/bin/bash
echo $@ > /tmp/update-grub.out 

Not a good solution but the install will complete and it appears HA is up and working.

1 Like

As I pointed out on github supervised-installer PR #201:

fcastilloec’s recommendation helped me!
But as stated before: Installing the HA supervisor on Raspberry Pi OS is not supported. Doing so has the following consequence:

[...]
1 not fully installed or removed. <--

And each invocation of apt install / remove/ ... leads to these few lines repeated over and over:

[info] Switching to cgroup v1
cp: cannot stat '/etc/default/grub': No such file or directory
dpkg: error processing package homeassistant-supervised (--configure):
 installed homeassistant-supervised package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 homeassistant-supervised
E: Sub-process /usr/bin/dpkg returned an error code (1)

To solve this issue comment the lines concerning grub + cgroup in /var/lib/dpkg/info/homeassistant-supervised.postinst.
Then just run apt autoremove and the installation will successfully conclude and stop nagging.

1 Like

I like your solution. But to be clear I’ve installed on a clean debian bullseye system, not on raspberry os. Looking for grub shouldn’t be something this package does on an arm system. There is no grub on any arm based system I’m aware of. Seems a few lines of code in the package could fix this. My kernel parameters are in /boot/extlinux/extlinux.conf, which I believe is standard on most debian arm installs. When the package see it’s an arm install, or grub file isn’t present, it could just post a message about the need to fix. Thanks for the response.

Where did you get the image from? This?

This site has scripts that builds for a few different boards. I’m using the N2+ builld.

https://github.com/pyavitz/debian-image-builder

You have to build the image on a debian bullseye system and it’ll cross compile anything special required for the specific image you’re building. The guy that runs the site is very responsive and its only a couple commands to get a full image. He has an image build for PI4, but I haven’t used it.

So if I understand you correctly you are installing HA Supervised on an Odroid N2+ but not on a Raspberry Pi?

Yes, I think the N2+ is the best option for HA. If you use a raspberry pi that same guy has a site specifically for Raspberry pi image builds

https://github.com/pyavitz/rpi-img-builder

The guy recommends this builder if you’re going to run on a pi.

He actually has some full images posted here

https://github.com/pyavitz/binary/releases/tag/images

Exclusively for running HA Supervised on a RPI you really should use an image specially cooked for the RPI but not for Odroid.

Note Section 1 – Install Debian 11

1.1) Start by downloading the correct xz-compressed image for your Pi from HERE . For a Pi 4, you will need the image listed as 4 under Family

Then you are posting into the wrong thread. This thread is for Installing Home Assistant Supervised on a Raspberry Pi with Debian 11.

As for installing HA on Odroid there are plenty of instructions on the web like here or here or here and many more.

1 Like

The images I’ve posted are 100% Debian with minimal items installed. Ideally I’d want a bullseye image from the raspberry pi people. I did tried the straight bullseye image for PI4 but it ended up crashing. It seemed to have some issues when I tried it. Anyway the guy that runs that site I mentioned seems pretty committed to getting clean images that work. As you’ve indicated you can’t really find a good image for odroid N2+. There is one available on the hardkernel forum but it had reboot issues. Since HA had a specific release with odroid it would be nice if the HA team has made their debian release available for people that need to do a little more than the basic HA stuff.

While I can understand you frustration you are clogging up a forum thread (Community Guide) for installing and running HA Supervised on the Rasspberry Pi and probably confusing people who don’t read thoughtfully.

I would open a new thread specially about installing HA Supervised on Odroid N2(+). That way you might get more focused support and things here are not getting mixed up.

2 Likes

dist-upgrading from rpi os buster to bullseye worked flawlessly for me. Maybe you should give it a try.

I posted here because I had the same bullseye issue and then I respond to your questions. Seems we don’t agree on who’s clogging who. Have a good day.

I believe this thread is very specific on RPI right? and you are asking for N2+ which is totally a different HW?

1 Like

You guys should read the thread. Someone posted an issue. I gave a solution. Someone gave an alternative solution. I said that was a good solution, but I also pointed out that the issue was arm specific, as arm boards don’t use grub. Then I was asked about the distro I used and pointed to it and pointed out it was N2+, and also indicate the guy that made the N2+ distro also makes distros for the PI. No question just information that could be useful for someone trying to install the latest release on an arm board, which includes all of the PIs. Along with an alternative distro build for PIs that could also be useful for people using PIs. Sorry I’ll make sure not to post a solution next time.

1 Like

Anyway this is a public forum and you should keep on helping others. I’m sorry if I offended you. But that is not my intentions. Its just this is already a very long thread and the informations might lost in the tangle.

Thank You, i almost despaired because I couldn´t get it running!