2007-09-23 08:04:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# lh_binary_debian-installer(1) - install debian-installer into binary
|
2008-03-06 14:43:00 -01:00
|
|
|
# Copyright (C) 2006-2008 Daniel Baumann <daniel@debian.org>
|
2007-09-23 08:04:52 +00:00
|
|
|
#
|
|
|
|
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
# This is free software, and you are welcome to redistribute it
|
|
|
|
# under certain conditions; see COPYING for details.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
|
|
|
LH_BASE="${LH_BASE:-/usr/share/live-helper}"
|
|
|
|
|
|
|
|
for FUNCTION in "${LH_BASE}"/functions/*.sh
|
2007-09-23 08:04:52 +00:00
|
|
|
do
|
2007-09-23 08:05:11 +00:00
|
|
|
. "${FUNCTION}"
|
2007-09-23 08:04:52 +00:00
|
|
|
done
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2007-09-23 08:04:52 +00:00
|
|
|
DESCRIPTION="install debian-installer into binary"
|
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
|
|
|
# Reading configuration files
|
2008-04-07 10:10:21 +00:00
|
|
|
Read_conffile config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:04:52 +00:00
|
|
|
Set_defaults
|
|
|
|
|
2007-09-23 12:05:14 +00:00
|
|
|
if [ "${LH_QUIET}" = "enabled" ]
|
|
|
|
then
|
|
|
|
WGET_OPTIONS="${WGET_OPTIONS} --quiet"
|
|
|
|
fi
|
|
|
|
|
2008-03-22 00:30:55 -01:00
|
|
|
# Check d-i configuration
|
2007-09-23 08:05:17 +00:00
|
|
|
case "${LH_DEBIAN_INSTALLER}" in
|
2008-06-15 01:45:50 +00:00
|
|
|
enabled|cdrom|netinst|netboot|businesscard)
|
2007-09-23 08:05:15 +00:00
|
|
|
;;
|
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
disabled)
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
2008-06-15 01:45:50 +00:00
|
|
|
live)
|
|
|
|
case "${LH_PACKAGES_LISTS}" in
|
|
|
|
stripped|minimal)
|
|
|
|
Echo_error "live d-i installation is incompatbile with stripped and minimal"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2007-09-23 08:05:13 +00:00
|
|
|
*)
|
2008-06-14 23:36:20 +00:00
|
|
|
Echo_error "debian-installer flavour ${LH_DEBIAN_INSTALLER} not supported."
|
2007-09-23 08:05:13 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
Echo_message "Begin installing debian-installer..."
|
2007-09-23 08:04:52 +00:00
|
|
|
|
|
|
|
# Requiring stage file
|
|
|
|
Require_stagefile .stage/bootstrap
|
|
|
|
|
|
|
|
# Checking stage file
|
|
|
|
Check_stagefile .stage/binary_debian-installer
|
|
|
|
|
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
|
|
|
|
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
|
|
|
|
2008-04-16 05:19:10 +00:00
|
|
|
# Checking depends
|
|
|
|
Check_package chroot/usr/bin/wget wget
|
2008-06-15 01:55:33 +00:00
|
|
|
Check_package chroot/usr/bin/apt-ftparchive apt-utils
|
2008-04-16 05:19:10 +00:00
|
|
|
|
|
|
|
# Restoring cache
|
|
|
|
Restore_cache cache/packages_binary
|
|
|
|
|
|
|
|
# Installing depends
|
|
|
|
Install_package
|
|
|
|
|
2007-09-23 08:04:52 +00:00
|
|
|
# Setting destination directory
|
2007-09-23 08:05:17 +00:00
|
|
|
case "${LH_BINARY_IMAGES}" in
|
2007-09-23 08:04:52 +00:00
|
|
|
iso)
|
|
|
|
DESTDIR="binary/install"
|
|
|
|
;;
|
|
|
|
|
|
|
|
net)
|
2008-03-22 00:30:55 -01:00
|
|
|
DESTDIR="tftpboot/debian-install/${LH_ARCHITECTURE}"
|
2007-09-23 08:04:52 +00:00
|
|
|
;;
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
tar|usb-hdd)
|
2007-09-23 08:05:12 +00:00
|
|
|
DESTDIR="binary/install"
|
|
|
|
|
2007-09-23 08:05:09 +00:00
|
|
|
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
|
2007-09-23 08:05:17 +00:00
|
|
|
if [ "${LH_DISTRIBUTION}" = "etch" ] && [ "${LH_BOOTLOADER}" = "syslinux" ]
|
2007-09-23 08:05:09 +00:00
|
|
|
then
|
2007-09-23 08:05:12 +00:00
|
|
|
DESTDIR="binary"
|
2007-09-23 08:05:09 +00:00
|
|
|
fi
|
2007-09-23 08:04:52 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-06-14 16:22:57 +00:00
|
|
|
# Set d-i image type
|
|
|
|
case "${LH_DEBIAN_INSTALLER}" in
|
|
|
|
businesscard|netboot|netinst)
|
2008-06-14 15:41:58 +00:00
|
|
|
DI_IMAGE_TYPE="netboot"
|
2008-03-22 17:09:46 -01:00
|
|
|
;;
|
|
|
|
*)
|
2008-06-14 16:22:57 +00:00
|
|
|
case "${LH_BINARY_IMAGES}" in
|
|
|
|
iso)
|
|
|
|
DI_IMAGE_TYPE="cdrom"
|
2008-03-22 17:09:46 -01:00
|
|
|
;;
|
2008-06-14 16:22:57 +00:00
|
|
|
|
2008-03-22 17:09:46 -01:00
|
|
|
*)
|
2008-06-14 16:22:57 +00:00
|
|
|
DI_IMAGE_TYPE="netboot"
|
2008-03-22 17:09:46 -01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-06-14 15:41:58 +00:00
|
|
|
case "${DI_IMAGE_TYPE}" in
|
|
|
|
netboot)
|
2008-03-22 00:30:55 -01:00
|
|
|
DI_REMOTE_BASE="netboot/debian-installer/${LH_ARCHITECTURE}"
|
|
|
|
DI_REMOTE_BASE_GTK="netboot/gtk/debian-installer/${LH_ARCHITECTURE}"
|
|
|
|
DI_REMOTE_KERNEL="linux"
|
|
|
|
;;
|
2008-06-14 15:41:58 +00:00
|
|
|
cdrom)
|
2008-03-22 00:30:55 -01:00
|
|
|
DI_REMOTE_BASE="cdrom"
|
|
|
|
DI_REMOTE_BASE_GTK="cdrom/gtk"
|
|
|
|
DI_REMOTE_KERNEL="vmlinuz"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-06-15 03:47:23 +00:00
|
|
|
# Varous architecture-specific hacks
|
2008-06-14 16:27:42 +00:00
|
|
|
case "${LH_ARCHITECTURE}" in
|
|
|
|
powerpc)
|
|
|
|
DI_REMOTE_BASE="${LH_ARCHITECTURE}/${DI_REMOTE_BASE}"
|
|
|
|
;;
|
2008-06-15 03:47:23 +00:00
|
|
|
sparc)
|
|
|
|
DEFAULT_FLAVOUR="$(echo ${LH_LINUX_FLAVOURS} | awk '{ print $1 }')"
|
|
|
|
DI_REMOTE_KERNEL="$(basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR})"
|
|
|
|
DI_REMOTE_BASE_GTK="none"
|
|
|
|
|
|
|
|
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
|
|
|
then
|
|
|
|
DI_REMOTE_BASE="cdrom/2.6"
|
|
|
|
else
|
|
|
|
DI_REMOTE_BASE="cdrom"
|
|
|
|
fi
|
|
|
|
;;
|
2008-06-14 16:27:42 +00:00
|
|
|
esac
|
|
|
|
|
2007-09-23 08:05:14 +00:00
|
|
|
Check_multiarchitecture
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-01-15 01:43:42 -01:00
|
|
|
Install_file() {
|
2008-03-22 17:05:42 -01:00
|
|
|
local FILE
|
|
|
|
FILE="${1}"
|
|
|
|
|
|
|
|
local TARGET
|
|
|
|
TARGET="${2}"
|
2008-01-15 01:43:42 -01:00
|
|
|
|
|
|
|
SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')"
|
|
|
|
|
|
|
|
if [ -z "${SOURCE}" ]
|
|
|
|
then
|
|
|
|
SOURCE="$(basename ${FILE} | awk -F_ '{ print $1 }')"
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "${SOURCE}" in
|
|
|
|
lib?*)
|
2008-01-15 06:25:29 -01:00
|
|
|
LETTER="$(echo ${SOURCE} | sed 's|\(....\).*|\1|')"
|
2008-01-15 01:43:42 -01:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2008-01-15 06:25:29 -01:00
|
|
|
LETTER="$(echo ${SOURCE} | sed 's|\(.\).*|\1|')"
|
2008-01-15 01:43:42 -01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Install directory
|
2008-01-15 18:42:28 -01:00
|
|
|
mkdir -p "${TARGET}"/"${LETTER}"/"${SOURCE}"
|
2008-01-15 01:43:42 -01:00
|
|
|
|
|
|
|
# Move files
|
2008-01-15 18:42:28 -01:00
|
|
|
cp "${FILE}" "${TARGET}"/"${LETTER}"/"${SOURCE}"
|
2008-01-15 01:43:42 -01:00
|
|
|
}
|
|
|
|
|
2008-06-14 16:30:32 +00:00
|
|
|
VMLINUZ_DI="vmlinuz"
|
|
|
|
INITRD_DI="initrd.gz"
|
|
|
|
DESTDIR_DI="${DESTDIR}"
|
|
|
|
|
|
|
|
VMLINUZ_GI="gtk/vmlinuz"
|
|
|
|
INITRD_GI="gtk/initrd.gz"
|
|
|
|
DESTDIR_GI="${DESTDIR}/gtk"
|
|
|
|
|
2007-09-23 08:05:09 +00:00
|
|
|
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
|
2007-09-23 08:05:17 +00:00
|
|
|
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
2007-09-23 08:05:09 +00:00
|
|
|
then
|
2008-06-14 16:35:11 +00:00
|
|
|
case "${LH_BINARY_IMAGES}" in
|
|
|
|
usb-hdd|tar)
|
|
|
|
VMLINUZ_DI="vmlinuz.di"
|
|
|
|
INITRD_DI="initrddi.gz"
|
|
|
|
DESTDIR_DI="${DESTDIR}"
|
|
|
|
|
|
|
|
VMLINUZ_GI="vmlinuz.gi"
|
|
|
|
INITRD_GI="initrdgi.gz"
|
|
|
|
DESTDIR_GI="${DESTDIR}"
|
|
|
|
;;
|
|
|
|
esac
|
2007-09-23 08:05:09 +00:00
|
|
|
fi
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
if [ "${LH_DEBIAN_INSTALLER_DAILY}" = "enabled" ]
|
|
|
|
then
|
|
|
|
# Debian Installer daily builds
|
|
|
|
case "${LH_ARCHITECTURE}" in
|
|
|
|
alpha)
|
|
|
|
URL="http://people.debian.org/~vorlon/d-i/alpha/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
amd64)
|
|
|
|
URL="http://people.debian.org/~aba/d-i/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
arm)
|
|
|
|
URL="http://people.debian.org/~kmuto/d-i/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
hppa)
|
|
|
|
URL="http://people.debian.org/~kyle/d-i/hppa/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
i386)
|
|
|
|
URL="http://people.debian.org/~joeyh/d-i/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
ia64)
|
|
|
|
URL="http://people.debian.org/~dannf/d-i/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
m68k)
|
|
|
|
URL="http://people.debian.org/~smarenka/d-i/images-m68k/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
mips)
|
|
|
|
URL="http://people.debian.org/~ths/d-i/mips/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
mipsel)
|
|
|
|
URL="http://people.debian.org/~ths/d-i/mipsel/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
powerpc)
|
|
|
|
URL="http://people.debian.org/~wouter/d-i/powerpc/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
s390)
|
|
|
|
URL="http://lophos.multibuild.org/d-i/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
sparc)
|
|
|
|
URL="http://people.debian.org/~stappers/d-i/images/daily/"
|
|
|
|
;;
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:21 +00:00
|
|
|
*)
|
|
|
|
Echo_error "No daily-builds found for your architecture."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
2008-02-21 18:52:37 -01:00
|
|
|
URL="${LH_MIRROR_CHROOT}/dists/${LH_DISTRIBUTION}/main/installer-${LH_ARCHITECTURE}/current/images/"
|
2007-09-23 08:05:21 +00:00
|
|
|
fi
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2007-09-23 08:05:12 +00:00
|
|
|
mkdir -p "${DESTDIR_DI}"
|
|
|
|
|
2008-06-17 05:08:24 +00:00
|
|
|
if [ "${LH_ARCHITECTURE}" = "sparc" ] && [ "${DI_IMAGE_TYPE}" = "netboot" ]
|
2008-06-15 03:47:23 +00:00
|
|
|
then
|
|
|
|
# There are no prepared kernel/initrd pairs for sparc netboot so we
|
|
|
|
# must unpack them from a mini.iso
|
|
|
|
|
|
|
|
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
|
|
|
then
|
|
|
|
wget ${WGET_OPTIONS} -O mini.iso ${URL}/combined/2.6/mini.iso
|
|
|
|
else
|
|
|
|
wget ${WGET_OPTIONS} -O mini.iso ${URL}/mini.iso
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir mini.tmp
|
2008-06-15 15:07:05 +00:00
|
|
|
${LH_ROOT_COMMAND} mount -o loop -t iso9660 mini.iso mini.tmp
|
2008-06-15 03:47:23 +00:00
|
|
|
|
|
|
|
cp mini.tmp/boot/vmlinuz-${DEFAULT_FLAVOUR} "${DESTDIR}"/"${VMLINUZ_DI}"
|
|
|
|
cp mini.tmp/boot/initrd.gz "${DESTDIR}"/"${INITRD_DI}"
|
|
|
|
|
2008-06-15 15:07:05 +00:00
|
|
|
${LH_ROOT_COMMAND} umount mini.tmp
|
2008-06-15 03:47:23 +00:00
|
|
|
rm -rf mini.tmp mini.iso
|
|
|
|
else
|
|
|
|
# Downloading debian-installer
|
|
|
|
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${VMLINUZ_DI}" ${URL}/${DI_REMOTE_BASE}/${DI_REMOTE_KERNEL}
|
|
|
|
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${INITRD_DI}" ${URL}/${DI_REMOTE_BASE}/initrd.gz
|
|
|
|
|
|
|
|
# Downloading graphical-installer
|
|
|
|
case "${LH_ARCHITECTURE}" in
|
|
|
|
amd64|i386|powerpc)
|
|
|
|
mkdir -p "${DESTDIR_GI}"
|
|
|
|
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${VMLINUZ_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/${DI_REMOTE_KERNEL}
|
|
|
|
wget ${WGET_OPTIONS} -O "${DESTDIR}"/"${INITRD_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/initrd.gz
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Only download additional packages if appropriate
|
2008-06-14 15:41:58 +00:00
|
|
|
if [ "${DI_IMAGE_TYPE}" != "netboot" ]
|
2008-03-22 00:24:32 -01:00
|
|
|
then
|
2007-09-23 08:05:13 +00:00
|
|
|
# Downloading additional packages
|
|
|
|
mkdir -p chroot/binary.deb/archives/partial
|
|
|
|
mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
|
|
|
|
touch chroot/var/lib/dpkg/status
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2007-09-23 08:05:17 +00:00
|
|
|
case "${LH_ARCHITECTURE}" in
|
2007-09-23 08:05:13 +00:00
|
|
|
amd64)
|
|
|
|
DI_PACKAGES="linux-image-2.6-amd64 lilo grub"
|
|
|
|
;;
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2007-09-23 08:05:13 +00:00
|
|
|
i386)
|
|
|
|
DI_PACKAGES="linux-image-2.6-486 linux-image-2.6-686 elilo lilo grub"
|
|
|
|
;;
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-06-15 03:47:23 +00:00
|
|
|
sparc)
|
|
|
|
DI_PACKAGES="linux-image-2.6-sparc64 linux-image-2.6-sparc64-smp silo"
|
|
|
|
|
|
|
|
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
|
|
|
then
|
|
|
|
DI_PACKAGES="${DI_PACKAGES} linux-image-2.6-sparc32"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2007-09-23 08:05:13 +00:00
|
|
|
powerpc)
|
|
|
|
DI_PACKAGES="linux-image-2.6-powerpc linux-image-2.6-powerpc64 linux-image-2.6-powerpc-smp linux-image-2.6-prep yaboot" # FIXME bootloader?
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
DI_PACKAGES="${DI_PACKAGES} cryptsetup lvm2"
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-02-21 18:03:57 -01:00
|
|
|
Chroot "apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb --download-only install ${DI_PACKAGES}"
|
2007-09-23 08:05:13 +00:00
|
|
|
mv chroot/binary.deb ./
|
|
|
|
mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
|
2008-04-17 08:42:34 +00:00
|
|
|
|
2008-01-15 18:47:50 -01:00
|
|
|
if ls binary.deb/archives/*.deb > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
for FILE in binary.deb/archives/*.deb
|
|
|
|
do
|
|
|
|
Install_file "${FILE}" "binary/pool/main"
|
|
|
|
done
|
|
|
|
fi
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Including base debian packages
|
|
|
|
if [ -d cache/packages_bootstrap ]
|
|
|
|
then
|
|
|
|
for FILE in cache/packages_bootstrap/*.deb
|
|
|
|
do
|
|
|
|
Install_file "${FILE}" "binary/pool/main"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
Echo_error "E: Could not find cache/packages_bootstrap"
|
|
|
|
exit 1
|
|
|
|
fi
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Including local debs
|
2008-06-13 13:28:27 +00:00
|
|
|
if ls ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".deb > /dev/null 2>&1
|
2008-03-22 00:24:32 -01:00
|
|
|
then
|
|
|
|
for FILE in ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".deb
|
|
|
|
do
|
|
|
|
Install_file "${FILE}" "binary/pool/main"
|
|
|
|
done
|
|
|
|
fi
|
2008-01-15 01:41:10 -01:00
|
|
|
|
2008-06-13 13:28:27 +00:00
|
|
|
if ls ../config/binary_local-debs/*_all.deb > /dev/null 2>&1
|
2008-03-22 00:24:32 -01:00
|
|
|
then
|
|
|
|
for FILE in ../config/binary_local-debs/*_all.deb
|
|
|
|
do
|
|
|
|
Install_file "${FILE}" "binary/pool/main"
|
|
|
|
done
|
|
|
|
fi
|
2007-09-23 08:05:13 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Generating deb indices
|
|
|
|
mkdir -p binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
cd binary
|
|
|
|
apt-ftparchive packages pool/main > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages
|
|
|
|
gzip -9 -c dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages.gz
|
|
|
|
cd "${OLDPWD}"
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Fetching release
|
|
|
|
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/dists/"${LH_DISTRIBUTION}"/main/binary-"${LH_ARCHITECTURE}"/Release -O binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Release
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
mkdir binary.udeb
|
|
|
|
cd binary.udeb
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Downloading udeb indices
|
|
|
|
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages.gz
|
|
|
|
gunzip -c Packages.gz > Packages
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Sorting udebs
|
|
|
|
UDEBS="$(awk '/Filename: / { print $2 }' Packages)"
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Downloading udebs
|
|
|
|
for UDEB in ${UDEBS}
|
|
|
|
do
|
|
|
|
if [ -f ../cache/packages_debian-installer.udeb/"$(basename ${UDEB})" ]
|
|
|
|
then
|
|
|
|
# Copying cached udebs
|
|
|
|
cp ../cache/packages_debian-installer.udeb/"$(basename ${UDEB})" ./
|
|
|
|
else
|
|
|
|
# Downloading udebs
|
|
|
|
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/${UDEB}
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Caching udebs
|
|
|
|
rm -rf ../cache/packages_debian-installer.udeb
|
|
|
|
mkdir -p ../cache/packages_debian-installer.udeb
|
|
|
|
cp *.udeb ../cache/packages_debian-installer.udeb
|
|
|
|
|
|
|
|
# Including local udebs
|
|
|
|
if ls ../config/binary_local-udebs/*_"${LH_ARCHITECTURE}".udeb > /dev/null 2>&1
|
2007-09-23 08:05:13 +00:00
|
|
|
then
|
2008-03-22 00:24:32 -01:00
|
|
|
for FILE in ../config/binary_local-udebs/*_"${LH_ARCHITECTURE}".udeb
|
|
|
|
do
|
|
|
|
Install_file "${FILE}" "pool/main"
|
|
|
|
|
|
|
|
# Prefer local udebs over downloaded udebs
|
|
|
|
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
|
|
|
|
done
|
2007-09-23 08:05:13 +00:00
|
|
|
fi
|
2008-04-17 08:42:34 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
if ls ../config/binary_local-udebs/*_all.udeb > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
for FILE in ../config/binary_local-udebs/*_all.udeb
|
|
|
|
do
|
|
|
|
Install_file "${FILE}" "pool/main"
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Prefer local udebs over downloaded udebs
|
|
|
|
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
|
|
|
|
done
|
|
|
|
fi
|
2007-09-23 08:05:13 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Excluding udebs
|
|
|
|
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/udeb_exclude > exclude
|
|
|
|
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs >> exclude
|
|
|
|
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs-${LH_ARCHITECTURE} >> exclude
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Local exclude file
|
|
|
|
if [ -e ../config/binary_debian-installer/udeb_exclude ]
|
|
|
|
then
|
|
|
|
cat ../config/binary_debian-installer/udeb_exclude >> exclude
|
|
|
|
fi
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
for EXCLUDE in $(cat exclude)
|
|
|
|
do
|
2008-06-13 14:52:16 +00:00
|
|
|
if [ "${LH_DEBIAN_INSTALLER}" = "live" ] && [ "${EXCLUDE}" = "live-installer" ]
|
|
|
|
then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
rm -f "${EXCLUDE}"_*.udeb
|
2008-01-15 18:45:07 -01:00
|
|
|
done
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Enable live-installer
|
|
|
|
if [ "${LH_DEBIAN_INSTALLER}" = "live" ]
|
|
|
|
then
|
|
|
|
# Remove local udebs
|
|
|
|
rm -f pool/main/b/base-installer/bootstrap-base_*.udeb
|
2007-09-23 12:05:14 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Remove d-i udebs
|
|
|
|
rm -f bootstrap-base_*.udeb
|
|
|
|
fi
|
2007-09-23 08:05:12 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Moving udebs
|
|
|
|
for UDEB in ${UDEBS}
|
|
|
|
do
|
|
|
|
if [ -f "$(basename ${UDEB})" ]
|
|
|
|
then
|
|
|
|
mkdir -p $(dirname ${UDEB})
|
|
|
|
mv "$(basename ${UDEB})" "$(dirname ${UDEB})"
|
|
|
|
fi
|
|
|
|
done
|
2007-09-23 12:05:11 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Creating udeb indices
|
|
|
|
mkdir -p dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"
|
|
|
|
apt-ftparchive packages pool/main > dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages
|
|
|
|
gzip -9 -c dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages.gz
|
|
|
|
|
|
|
|
rm -f Packages* exclude
|
|
|
|
find . | cpio -dmpu "${OLDPWD}"/binary
|
|
|
|
cd "${OLDPWD}"
|
|
|
|
|
|
|
|
rm -rf binary.udeb
|
|
|
|
rm -rf binary.deb
|
|
|
|
|
|
|
|
# Generating release file
|
|
|
|
apt-ftparchive \
|
|
|
|
-o APT::FTPArchive::Release::Origin="Debian" \
|
|
|
|
-o APT::FTPArchive::Release::Label="Debian" \
|
|
|
|
-o APT::FTPArchive::Release::Suite="${LH_DISTRIBUTION}" \
|
|
|
|
-o APT::FTPArchive::Release::Version="4.0" \
|
|
|
|
-o APT::FTPArchive::Release::Codename="${LH_DISTRIBUTION}" \
|
|
|
|
-o APT::FTPArchive::Release::Date="$(date -R)" \
|
|
|
|
-o APT::FTPArchive::Release::Architectures="${LH_ARCHITECTURE}" \
|
|
|
|
-o APT::FTPArchive::Release::Components="main" \
|
|
|
|
-o APT::FTPArchive::Release::Description="Last updated: $(date -R)" \
|
|
|
|
release binary/dists/${LH_DISTRIBUTION} > binary/dists/${LH_DISTRIBUTION}/Release
|
|
|
|
|
|
|
|
# Creating dist symlinks
|
|
|
|
for DISTRIBUTION in frozen stable testing unstable
|
|
|
|
do
|
|
|
|
ln -s ${LH_DISTRIBUTION} binary/dists/${DISTRIBUTION}
|
|
|
|
done
|
2007-09-23 12:05:10 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
if [ "${LH_BINARY_IMAGES}" != "usb-hdd" ]
|
2007-09-23 08:05:12 +00:00
|
|
|
then
|
2008-03-22 00:24:32 -01:00
|
|
|
ln -s . binary/debian
|
2007-09-23 08:05:12 +00:00
|
|
|
fi
|
2007-09-23 08:04:52 +00:00
|
|
|
|
2008-03-22 00:24:32 -01:00
|
|
|
# Including preseeding files
|
2008-06-13 13:28:27 +00:00
|
|
|
if ls config/binary_debian_installer/preseed*.cfg > /dev/null 2>&1
|
2008-03-22 00:24:32 -01:00
|
|
|
then
|
|
|
|
cp config/binary_debian-installer/preseed*.cfg binary/install
|
|
|
|
fi
|
2008-02-29 11:27:56 -01:00
|
|
|
fi
|
|
|
|
|
2008-04-17 08:42:34 +00:00
|
|
|
Repack_initrd()
|
|
|
|
{
|
2008-03-22 17:13:03 -01:00
|
|
|
local TARGET_INITRD
|
|
|
|
TARGET_INITRD="${1}"
|
|
|
|
REPACK_TMPDIR="unpacked-initrd"
|
2008-04-17 08:42:34 +00:00
|
|
|
|
2008-03-22 17:13:03 -01:00
|
|
|
# cpio does not have a "extract to directory", so we must change directory
|
|
|
|
mkdir -p ${REPACK_TMPDIR}
|
|
|
|
cd ${REPACK_TMPDIR}
|
|
|
|
|
|
|
|
gzip -d < ../${TARGET_INITRD} | cpio -i --make-directories --no-absolute-filenames
|
|
|
|
cp ../config/binary_debian-installer/preseed.cfg .
|
2008-04-17 08:42:34 +00:00
|
|
|
find | cpio -H newc -o | gzip -9 > ../${TARGET_INITRD}
|
2008-03-22 17:13:03 -01:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
rm -rf ${REPACK_TMPDIR}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Preseed d-i by repacking the initrd in certain situations
|
2008-06-14 15:41:58 +00:00
|
|
|
if [ "${DI_IMAGE_TYPE}" = "netboot" ] && [ -e config/binary_debian-installer/preseed.cfg ]
|
2008-03-22 17:13:03 -01:00
|
|
|
then
|
2008-04-17 08:42:34 +00:00
|
|
|
Repack_initrd "${DESTDIR}"/"${INITRD_DI}"
|
2008-03-22 17:13:03 -01:00
|
|
|
|
|
|
|
if [ -e "${DESTDIR}"/"${INITRD_GI}" ]
|
|
|
|
then
|
2008-04-17 08:42:34 +00:00
|
|
|
Repack_initrd "${DESTDIR}"/"${INITRD_GI}"
|
2008-03-22 17:13:03 -01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2008-04-16 05:19:10 +00:00
|
|
|
# Saving cache
|
|
|
|
Save_cache cache/packages_binary
|
|
|
|
|
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
|
|
|
|
2007-09-23 08:04:52 +00:00
|
|
|
# Creating stage file
|
|
|
|
Create_stagefile .stage/binary_debian-installer
|