Skip to content

Copying of one-time-script.sh is broken in Rasberry PI OS

I appreciate these scripts and have used them for a while now, however, they no longer work with the new Raspberry PI OS (Buster) release January 11, 2021.

After a bunch of debugging I finally traced it down to an apparent difference between the old Raspbian distro and the new Raspberry PI OS. In Raspbian /lib was a directory and in the new Raspberry PI OS /lib is a symlink to /usr/lib. This causes an error when the 'cp -r /boot/payload/* /' is executed. It says /lib is not a directory so it refuses to do the copy.

My solution to fix the RPI OS issue was to move /boot/payload/lib to /boot/payload/usr/lib and the copy works again. A more general solution which I'd have to spend time testing would be to check for [[ -L /lib ]] and do appropriate things differently. But to test it I'll have to track down some Raspbian sources to ensure it is backwards compatible.

Any thoughts about which path (or another possibility) to take?

Edited by Bob Grant
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information