Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wheezy preseed overwritting interfaces file

470 views
Skip to first unread message

John Ron

unread,
May 18, 2013, 9:50:02 AM5/18/13
to
Hello,

I am installing wheezy automatically by using preseed and am using its late_command feature to run a script at the end of the installation. This script is actually modifying the /etc/network/interfaces file to setup bonding and VLAN access. This all used to work fine on squeeze but now with wheezy it looks like the /etc/network/interfaces file gets rewritten after the late_command of preseed.

Does anyone know more about this or have any tips?

Regards.
John

Brian

unread,
May 19, 2013, 2:20:01 PM5/19/13
to
Over which type of network connection did you install Wheezy? Wired or
wireless?

What tasks did you choose to install? DE, basic system utilities etc?

Please post the contents of /e/n/i which you have after the install on
first boot.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130519181756.GC23758@desktop

ML mail

unread,
May 19, 2013, 4:00:02 PM5/19/13
to
Hi Brian,

I am preseeding a server so no wireless only standard ethernet. I am installing the bare minimum possible so the only task I preseed is the openssh server, then I add a few additional useful server packages such as lvm, ethtool, etc.

Here below is the content of /e/n/i as overwritten by the installer:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp


Regards
J.
Archive: http://lists.debian.org/1368993539.722...@web164604.mail.gq1.yahoo.com

Andrei POPESCU

unread,
May 19, 2013, 6:10:02 PM5/19/13
to
On Du, 19 mai 13, 12:58:59, ML mail wrote:
> Hi Brian,
>
> I am preseeding a server so no wireless only standard ethernet. I am
> installing the bare minimum possible so the only task I preseed is the
> openssh server, then I add a few additional useful server packages
> such as lvm, ethtool, etc.
>
> Here below is the content of /e/n/i as overwritten by the installer:

I'm guessing you have to preseed the network configuration (as opposed
to doing it with a separate script), because otherwise the installer has
no way of telling that you are changing /e/n/i so it does what it
usually does (write to it the configuration used during the install).

Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
signature.asc

Brian

unread,
May 19, 2013, 8:20:02 PM5/19/13
to
On Sun 19 May 2013 at 12:58:59 -0700, ML mail wrote:

> Hi Brian,
>
> I am preseeding a server so no wireless only standard ethernet. I am installing the bare minimum possible so the only task I preseed is the openssh server, then I add a few additional useful server packages such as lvm, ethtool, etc.
>
> Here below is the content of /e/n/i as overwritten by the installer:
>
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
>
> # The loopback network interface
> auto lo
> iface lo inet loopback
>
> # The primary network interface
> allow-hotplug eth0
> iface eth0 inet dhcp

Your assumption that /e/n/i is being rewritten has a high probability of
being correct. I have experienced something similar myself and have
confirmed today (by editing /target/e/n/i just before finishing the
installation) that what you experience does happen. There have been
changes in netcfg for Wheezy and they are, in my opinion, the cause of
what you experience.

There is little you can do about it apart from reporting it as a bug
against netcfg after reading the existing bug reports. If you do decide
to do this I would say its severity is at least 'important'.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130520001741.GG23758@desktop

ML mail

unread,
May 20, 2013, 6:40:02 AM5/20/13
to
Hi Andrei,

I would really like to use the preseed config file to configure my /e/n/i file but right now it's just not possible. I need to setup ethernet bonding with VLAN and bridging. All netcfg in the deban installer can do is simple wireless and ethernet so that's why I have to use a late_command script to "patch" my /e/n/i file.

Regards,
John



----- Original Message -----
From: Andrei POPESCU <andreim...@gmail.com>
To: debia...@lists.debian.org
Cc:
Sent: Monday, May 20, 2013 12:06 AM
Subject: Re: Wheezy preseed overwritting interfaces file

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1369045985.132...@web164606.mail.gq1.yahoo.com

ML mail

unread,
May 20, 2013, 6:50:01 AM5/20/13
to
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.

J.


----- Original Message -----
From: Brian <ad...@cityscape.co.uk>
To: debia...@lists.debian.org
Cc:
Sent: Monday, May 20, 2013 2:17 AM
Subject: Re: Wheezy preseed overwritting interfaces file

Archive: http://lists.debian.org/1369046441.539...@web164604.mail.gq1.yahoo.com

ML mail

unread,
May 20, 2013, 9:20:02 AM5/20/13
to
Just to let you know that I've now opened a bug on Debian with important prirority. Let's see what they say...

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=709017




----- Original Message -----
From: Brian <ad...@cityscape.co.uk>
To: debia...@lists.debian.org
Cc:
Sent: Monday, May 20, 2013 2:17 AM
Subject: Re: Wheezy preseed overwritting interfaces file

Archive: http://lists.debian.org/1369055441.608...@web164606.mail.gq1.yahoo.com

Brian

unread,
May 20, 2013, 11:20:02 AM5/20/13
to
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-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130520151424.GH23758@desktop

ML mail

unread,
May 20, 2013, 12:00:02 PM5/20/13
to
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 <ad...@cityscape.co.uk>
To: debia...@lists.debian.org
Cc:
Sent: Monday, May 20, 2013 5:14 PM
Subject: Re: Wheezy preseed overwritting interfaces file

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

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

Archive: http://lists.debian.org/1369065261.557...@web164606.mail.gq1.yahoo.com

Brian

unread,
May 20, 2013, 3:00:02 PM5/20/13
to
On Mon 20 May 2013 at 08:54:21 -0700, ML mail wrote:

> 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.

I've not tried it. Please let us know if it works.

A couple of ideas, neither tested:

1. Backup /target/e/n/i. At least it will be on the new system and give
you less work should you want to use it.

2. Delete /usr/lib//finish-install.d/55netcfg-copy-config at some stage
of the install. This will effectively give you a Squeeze situation.

55netcfg-copy-config is a pain anyway. It appears to focus on making
sure someone who installed GNOME and Network Manager has a connected
system.

If you go for a minimal install with ifupdown it seems you are
penalised. Installing over a wireless connection without a DE surely
epitomises that. No network connection on first boot and not a single
indication in the installer or in the documentation it might happen.
This removal of connectivity legitimately configured during the
install must be a first in Debian's history.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130520185508.GI23758@desktop

ML mail

unread,
May 20, 2013, 5:30:02 PM5/20/13
to
Thanks again for all your help and ideas. I went for the easiest way and tried to adapt my preseed late_command in order to invoke a copy of /target/e/n/i to /e/n/i once my post installation PERL script has finished running. So my late_command looks like that now:

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; \
    cp /target/etc/network/interfaces /etc/network/interfaces;


Just did a test preseed installation using that and it worked perfectly. Nice and easy workaround for a weird modification in netcfg as you say... I guess a few other people will get stuck too. I am still suprised that netcfg does not support the configuration of bonding, VLAN or bridging. But until it does people will have to find solutions like mine and modify /e/n/i afterwards.

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

Archive: http://lists.debian.org/1369085136.711...@web164601.mail.gq1.yahoo.com

0 new messages