Actually it is a bit more complex. I use the late_command to download and then 
run a PERL script which is chrooted in /target as you can see here:

d-i preseed/late_command string \
    in-target wget http://x.x.x.x/d-i/wheezy/postinst.pl -O /tmp/postinst.pl; \
    in-target /bin/chmod 755 /tmp/postinst.pl; \
    in-target /tmp/postinst.pl;


Maybe I could add an extra command to late_command after running my PERL script 
such as:

cp /target/etc/network/interfaces /etc/network/interfaces

but I am not sure if it is possible to mix "in-target" commands with no 
"in-target" commands in one single late_command config param. Did you maybe 
already try that and know?  else I will simply give it a try later on.



----- Original Message -----
From: Brian <a...@cityscape.co.uk>
To: debian-user@lists.debian.org
Cc: 
Sent: Monday, May 20, 2013 5:14 PM
Subject: Re: Wheezy preseed overwritting interfaces file

On Mon 20 May 2013 at 03:40:41 -0700, ML mail wrote:

> Thanks for taking the time and testing this issue. I will definitely
> open a bug for that one on the netcfg package as you recommend. This
> has for sure been changed between squeeze and wheezy as with squeeze I
> was using exactly the same procedure and it worked just fine.

It was remiss not to ask what your late_command is. I'd assumed it is
along the lines of

   /bin/echo <something> >> /target/e/n/i

When you set up the network at the start of the installation an
interfaces file is written to /etc/network. This file is copied to
/target/etc/network during the install of the base system. On Squeeze
it is this interfaces file in /target which ends up as the one on the
installed system. If you alter it with the late_command then this
altered file is the one put on the installed system. All nice and
straightforward.

On Wheezy you still have an interfaces file in /e/n/; it is still
copied to /target/e/n and it still gets altered by late_command at the
'Finish the installation' stage.

However, netcfg on Wheezy has a script (not present on Squeeze) which
is run when the install finishes. With a wired network it copies the
existing /e/n/i to /target/e/n/i. This copied file is the one you get.

In your situation you could work round the problem with

   /bin/echo <something> >> /e/n/i

But don't decide to switch to using a wireless network for installing
because a different procedure is used. Before being copied to /target
/e/n/i is rewritten to contain only a loopback interface. Not only
will you lose any changes made by late_command but you won't even have
any connectivity when you boot into the new system!



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130520151424.GH23758@desktop


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1369065261.55752.yahoomail...@web164606.mail.gq1.yahoo.com

Reply via email to