Write directly to $initdir

Simplify install() by removing the need for a temp file.

Signed-off-by: Soeren Tempel <soeren+git@soeren-tempel.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #3093
This commit is contained in:
Sören Tempel 2015-02-10 21:12:27 +01:00 committed by Brian Behlendorf
parent cfbaa3c830
commit cbedd7b034

View File

@ -46,12 +46,9 @@ install() {
fi
# Synchronize initramfs and system hostid
TMP=`mktemp`
AA=`hostid | cut -b 1,2`
BB=`hostid | cut -b 3,4`
CC=`hostid | cut -b 5,6`
DD=`hostid | cut -b 7,8`
printf "\x$DD\x$CC\x$BB\x$AA" >$TMP
inst_simple "$TMP" /etc/hostid
rm "$TMP"
printf "\x$DD\x$CC\x$BB\x$AA" > "$initdir/etc/hostid"
}