]> granicus.if.org Git - zfs/commitdiff
Write directly to $initdir
authorSören Tempel <soeren+git@soeren-tempel.net>
Tue, 10 Feb 2015 20:12:27 +0000 (21:12 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 13 Feb 2015 23:58:53 +0000 (15:58 -0800)
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

dracut/90zfs/module-setup.sh.in

index 2d0b335cf0e16feb0ebe4c02d3b3d04b01ba4eea..b7a6f1d4540f62fd102a72875259dfb29ed90767 100755 (executable)
@@ -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"
 }