[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: late_command not late enough? (also: partman-nfs)



Hello Brian,

Anything of use at

    https://lists.debian.org/debian-user/2013/05/msg01167.html ?

Thanks for the link.

Basically: yes and no. The core issue is that late_command is run early (07) in the long line of finish.d scripts. partman (20s I believe), netcfg (50's I think), and baseinstaller all run afterwards, forcing me (and others) to resort to unseemly workarounds.

I did solve my problems though, via two hacky methods (that I am /not/ proud of).

For networking, I do the following:
 apt-install curl ; \
 in-target mkdir -p /etc/network ; \
in-target curl -o /etc/network/interfaces tftp://10.0.0.254/install_interfaces ; \
 in-target chmod 644 /etc/network/interfaces ; \
 cp /target/etc/network/interfaces /etc/network/interfaces ; \

Here I download (from the tftp server I am netbooting from) a copy of the interfaces file I'd like to use. Since curl is not available in the installer environment, I download the file in the target environment.

I don't need to worry about 55netcfg-copy-config since it exits early in its script (since I am not using NM). However, baseinstaller will copy the installer's /e/n/i file into the install environment, so I preemptively copy the newly downloaded interfaces file over the installer's /e/n/i file. Thus overwriting the installer's /e/n/i file before it overwrites mine.

Yes, this is ass-backwards.

The NFS mount, I'm afraid, is even worse:
 rm /usr/lib/finish-install.d/55netcfg-copy-config ; \
 echo "#! /bin/sh" > /usr/lib/finish-install.d/55netcfg-copy-config ; \
 echo "set -e" >> /usr/lib/finish-install.d/55netcfg-copy-config ; \
echo "echo '10.0.0.254:/home /home nfs _netdev 0 0' >> /target/etc/fstab" >> /usr/lib/finish-install.d/55netcfg-copy-config ; \
 chmod 755 /usr/lib/finish-install.d/55netcfg-copy-config ;

Since I know that I don't need 55netcfg-copy-config (and it runs after partman), I choose to overwrite it. I cannot make my own sanely-named script to go into the finish.d folder (without creating a udeb) because the list of files in that folder is created before late_command is run. Thus I must reuse an existing script's name. 55netcfg-copy-config is that script.

My generated script simply appends the target's fstab.

So... doing things this way has caused a small part of my soul to die. I don't have a good idea of how to solve the networking situation more elegantly (any suggestions?), but I do know that writing a partman-nfs was discussed long ago. If it's still needed, I'm inspired to have a go at writing it -- even if it is only used for preseeding. Unfortunately, I won't have time for this for at least a few weeks (hence the pressure to resort to these hacks -- for the meantime).

I am mostly interesting in creating partman-nfs if it has a chance to be used by others and accepted into Debian. If it is the wise wisdom of the Debian boot team that a partman-nfs is not wanted, then I may just go for a custom, internal udeb that just plops a script into finish.d.

I'm new to the installer environment, so any pointers or tips for developing and debugging a udeb will also be very helpful.

---Alex


Reply to: