NanoBSD update scripts are broken when using disk labels
Ilya Bakulin
webmaster at kibab.com
Sun Dec 8 11:21:06 UTC 2013
On 28.11.13, 11:00, Nick Hibma wrote:
> On 28 Nov 2013, at 09:49, Nick Hibma <nick at van-laarhoven.org> wrote:
>
>> On 24 Nov 2013, at 22:13, Ilya Bakulin <webmaster at kibab.com> wrote:
>>
>>> After looking in the /root/updatep2 script I realized that it cannot
>>> work when NANO_LABEL parameter
>>> is set when building the NanoBSD image.
>>
>> The problem is that you need the device, not the UFS label to update the active partition. Attached the fixed updatep1 and updatep2 scripts. I’ve fixed exactly this problem yesterday to make booting from a USB thumb drive, and embedded CF card using the same image work.
>>
>> If you could test them, I’d be more than happy to commit them.
>
> The dev= line was incorrect in the scripts I provided. Try the attached files instead.
Hi Nick,
sorry for keeping silence. I was going to try your scripts when I have
found another bug...
But I suspect that you have made some modifications to nanobsd.sh as well.
You check if the variable NANO_LABEL has some value after sourcing
/etc/nanobsd.conf,
but FreeBSD-standard nanobsd.sh doesn't write NANO_LABEL in the config file.
Additionally, there is a problem that after dd'ing the image manually
onto the correct partition,
you won't have the required disk label on it. See:
# glabel status -s
ufs/FBSDFLTs3 N/A ada0s3
ufs/FBSDFLTs1a N/A ada0s1a
ufsid/52a44002fa6458ff N/A ada0s2a
The last entry is automatically generated UFSID label, because the
_.disk.image that is generated from NanoBSD
build doesn't have any label on it -- it is also logical, because the
build system doesn't know which partition you
will be upgrading.
--
Ilya
More information about the freebsd-embedded
mailing list