summaryrefslogtreecommitdiff
path: root/scripts/build/binary_debian-installer
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2013-01-20 08:53:43 +0100
committerDaniel Baumann <daniel@debian.org>2013-01-20 08:55:05 +0100
commitcca9934da61b560f6d48bcd61743dbb0ba1de904 (patch)
treeb83a78d3f7745f938d2392d94552d823879dd5b6 /scripts/build/binary_debian-installer
parent715adcfc8eae4a212c723b3b38d4c0347eeeb954 (diff)
downloadvyos-live-build-cca9934da61b560f6d48bcd61743dbb0ba1de904.tar.gz
vyos-live-build-cca9934da61b560f6d48bcd61743dbb0ba1de904.zip
Applying slightly modified patch from Raphaël Hertzog <hertzog@debian.org> to fix automatic firmware inclusion when using debian-installer with live-installer and having firmware packages installed in the live system already.
Diffstat (limited to 'scripts/build/binary_debian-installer')
-rwxr-xr-xscripts/build/binary_debian-installer33
1 files changed, 12 insertions, 21 deletions
diff --git a/scripts/build/binary_debian-installer b/scripts/build/binary_debian-installer
index 78e7f5abf..624b42e5f 100755
--- a/scripts/build/binary_debian-installer
+++ b/scripts/build/binary_debian-installer
@@ -523,34 +523,25 @@ then
# d-i does not support (for example) re-installing grub from target/ - the grub
# .debs must actually exist.
- # Modify dpkg status to show the required packages are not installed.
- cp chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
- for PACKAGE in ${DI_REQ_PACKAGES}
- do
- awk -v f=0 '
- f == 1 { print "Status: purge ok not-installed"; f=0; next }
- /Package: '"${PACKAGE}"'/ { f=1; }
- { print }
- ' chroot/var/lib/dpkg/status > chroot/var/lib/dpkg/status.awk
- mv chroot/var/lib/dpkg/status.awk chroot/var/lib/dpkg/status
- done
-
- # Download .deb's that we just marked as "purged" which caused broken dependencies
- Chroot chroot ${_LB_APT_COMMAND} -f dist-upgrade
-
- # Revert dpkg status file
- mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
-
# Download .debs of the required packages
Chroot chroot ${_LB_APT_COMMAND} install ${DI_PACKAGES} ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES}
+
+ # Drop the packages already installed that d-i doesn't explicitely need
+ _REMAINING_PACKAGES="$(echo ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES} | sed -e 's# #|#g')"
+ _REMAINING_PACKAGES="$(sed -n -e 's|Package: ||p' chroot/var/lib/dpkg/status.tmp | grep -E -v "^${_REMAINING_PACKAGES}$")"
+
+ for _PACKAGE in ${_REMAINING_PACKAGES}
+ do
+ rm -f "chroot/binary.deb/archives/${_PACKAGE}_*.deb"
+ done
else
# Download .debs of the required packages
Chroot chroot ${_LB_APT_COMMAND} install ${DI_PACKAGES} ${DI_FIRMWARE_PACKAGES}
-
- # Revert dpkg status file
- mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
fi
+ # Revert dpkg status file
+ mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
+
mv chroot/binary.deb ./
for _ARCHIVE_AREA in $(echo ${LB_PARENT_ARCHIVE_AREAS} ${LB_ARCHIVE_AREAS})