mirror of
https://git.proxmox.com/git/ifupdown2
synced 2025-10-06 17:00:53 +00:00
d/maintscripts: use postinst arguments to determine first install
Following https://www.debian.org/doc/debian-policy/ap-flowcharts.html postinst gets called as 'postinst configure' w/o second argument on first installation, use that information instead of creating a flag-file in preinst. Technically this changes the semantics and the first-install parts will not be run, in case ifupdown2 had been installed on the system, but was subsequently removed, but not purged ('rc' in dpkg-output). Since the functionality was added quite a while ago (released with PVE 6.2 to support ovs-setups with ifupdown2 - the potential for regression should be limited. Originally introduced in:849ae55de6
Fixes:8d5303c350
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
parent
8453de808d
commit
e10142c0fa
3
debian/ifupdown2.postinst
vendored
3
debian/ifupdown2.postinst
vendored
@ -111,11 +111,10 @@ case "$1" in
|
||||
process_udev
|
||||
chmod +x /usr/share/ifupdown2/__main__.py
|
||||
postinst_remove_diverts
|
||||
if [ -f "/tmp/.ifupdown2-first-install" ] && [ ! -e /proxmox_install_mode ]; then
|
||||
if [ -z "$2" ] && [ ! -e /proxmox_install_mode ]; then
|
||||
proxmox_compatibility
|
||||
echo "Reloading network config on first install"
|
||||
ifreload -a || report_warn "Reloading failed"
|
||||
rm /tmp/.ifupdown2-first-install
|
||||
fi
|
||||
;;
|
||||
|
||||
|
20
debian/ifupdown2.preinst
vendored
20
debian/ifupdown2.preinst
vendored
@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
touch /tmp/.ifupdown2-first-install
|
||||
;;
|
||||
|
||||
upgrade|abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user