Adjust UUID lower-case translation from straight-forward tr(1)

usage to an equivalent csh(1) usage as tr(1) stays in /usr/bin and
/etc/rc.d/hostid has just the root filesystem (and this way mainly the
tools in /bin) available.

I've chosen csh(1) here as the string manipulation tools available in
/bin is extremely limited and the (only) alternative ed(1) usage would
have been a lot more complicated or even might require a temporary file.
This commit is contained in:
Ralf S. Engelschall 2007-05-21 11:44:13 +00:00
parent b8fdb7f911
commit 3148ce8687
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169824

View File

@ -56,7 +56,8 @@ hostid_set()
hostid_hardware()
{
uuid=`kenv smbios.system.uuid 2>/dev/null | tr '[:upper:]' '[:lower:]'`
uuid=`kenv smbios.system.uuid 2>/dev/null`
uuid=`csh -c 'echo -n ${*:al}' "$uuid"`
x="[0-9a-f]"
y=$x$x$x$x
case "${uuid}" in