/dev/null not a device in Linux boot image / initrd

Johannes Singer <[email protected]>
Newsgroups gmane.comp.windows.unattended.devel
Message-ID <[email protected]>
Hello everyone!

First of all, thank you for this great project!


I stumbled over what I believe is a bug in the Linux boot image: /dev/null is not created as 
a device, and so everything that is put into it is returned when reading it.

As I see it, /dev/null is first written to in /etc/master, in the function check_z(), which 
cats /z/dosbin/install.pl to /dev/null to check its existence. But this creates a file 
named /dev/null with the contents of install.pl.

It is then read by the function write_ini_entry() in usr/lib/unatt-functions.sh on line 44, 
but unintentionally, as it is meant to truncate the temporary file: cat /dev/null > $tmp.
It then appends the original file, which usually is the unattend.txt.

This creates a very interesting unattend.txt, because this function is called five times
in usr/bin/nt5x-install (lines 184++), that means the contents of unattend.txt are the 
alternating contents of five times install.pl and unattended.txt. :)

Then on line 208 in nt5xinstall, "parse_ini_file" returns a wrong string of the value of 
"scan_windrivers_dest_map" and the copying of the drivers fails.

Strangely, this does not seem to create any problems for "normal" use, only when using
the autodetecting drivers.

A quick fix would be changing the "cat /dev/null > $tmp" in unatt-functions.sh line 44
to "echo "" > $tmp", but I think this really should be corrected by creating a working 
/dev/null.

Could someone please cross-check this?

I am not entirely sure it is a general problem and could be just be an issue with my setup. 
I use PXE booting, the Linux boot image and the nt5install script.

Sincerely,
    Johannes Singer


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.