diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:12 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:19:41 +0100 |
commit | 504c05c3a63de0af4fd0e876274afc039c5c0ed1 (patch) | |
tree | 5a29d0f82735a131c9319b5b825c57b740584d13 /helpers/lh_binary_debian-installer | |
parent | 37a5c53ddd2825bf6b0ce521908a63d419683981 (diff) | |
download | live-build-504c05c3a63de0af4fd0e876274afc039c5c0ed1.zip live-build-504c05c3a63de0af4fd0e876274afc039c5c0ed1.tar.gz |
Adding live-helper 1.0~a15-1.
Diffstat (limited to 'helpers/lh_binary_debian-installer')
-rwxr-xr-x | helpers/lh_binary_debian-installer | 288 |
1 files changed, 146 insertions, 142 deletions
diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer index d04ec31..de15f1c 100755 --- a/helpers/lh_binary_debian-installer +++ b/helpers/lh_binary_debian-installer @@ -55,32 +55,26 @@ Create_lockfile .lock case "${LIVE_BINARY_IMAGES}" in iso) DESTDIR="binary/install" - DESTDIR_INSTALLER="cdrom" + DI="cdrom" ;; net) DESTDIR="tftpboot" - DESTDIR_INSTALLER="netboot" + DI="netboot" Echo_error "Not supported yet (FIXME)" exit 1 ;; tar|usb-hdd) + DESTDIR="binary/install" + DI="hd-media" + # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ] + if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ] then - if [ "${LIVE_BOOTLOADER}" = "syslinux" ] - then - DESTDIR="binary" - else - DESTDIR="binary/install" - fi - else - DESTDIR="binary/install" + DESTDIR="binary" fi - - DESTDIR_INSTALLER="hd-media" ;; esac @@ -106,96 +100,71 @@ then fi fi -# Downloading debian-installer -mkdir -p "${DESTDIR}" +VMLINUZ_DI="vmlinuz" +INITRD_DI="initrd.gz" +DESTDIR_DI="${DESTDIR}" + +VMLINUZ_GI="gtk/vmlinuz" +INITRD_GI="gtk/initrd.gz" +DESTDIR_GI="${DESTDIR}/gtk" # Workaround for syslinux (<< 3.36) which doesn't support long file/path names -if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ] +if [ "${LIVE_DISTRIBUTION}" = "etch" ] then if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ] then - if [ "${LIVE_BOOTLOADER}" = "syslinux" ] - then - wget --no-clobber -O "${DESTDIR}"/vmlinuz.di "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz - wget --no-clobber -O "${DESTDIR}"/initrddi.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz - else - wget --no-clobber -O "${DESTDIR}"/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz - wget --no-clobber -O "${DESTDIR}"/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz - fi - else - wget --no-clobber -O "${DESTDIR}"/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz - wget --no-clobber -O "${DESTDIR}"/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz + VMLINUZ_DI="vmlinuz.di" + INITRD_DI="initrddi.gz" + DESTDIR_DI="${DESTDIR}" + + VMLINUZ_GI="vmlinuz.gi" + INITRD_GI="initrdgi.gz" + DESTDIR_GI="${DESTDIR}" fi -else - wget --no-clobber -O "${DESTDIR}"/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz - wget --no-clobber -O "${DESTDIR}"/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz fi +# Downloading debian-installer +mkdir -p "${DESTDIR_DI}" +wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/vmlinuz +wget --no-clobber -O "${DESTDIR}"/"${INITRD_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/initrd.gz + # Downloading graphical-installer if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ] then - # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ] - then - if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ] - then - if [ "${LIVE_BOOTLOADER}" = "syslinux" ] - then - wget --no-clobber -O "${DESTDIR}"/vmlinuz.gi "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz - wget --no-clobber -O "${DESTDIR}"/initrdgi.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz - else - mkdir -p "${DESTDIR}"/gtk - - wget --no-clobber -O "${DESTDIR}"/gtk/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz - wget --no-clobber -O "${DESTDIR}"/gtk/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz - fi - else - mkdir -p "${DESTDIR}"/gtk - - wget --no-clobber -O "${DESTDIR}"/gtk/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz - wget --no-clobber -O "${DESTDIR}"/gtk/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz - fi - else - mkdir -p "${DESTDIR}"/gtk - - wget --no-clobber -O "${DESTDIR}"/gtk/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz - wget --no-clobber -O "${DESTDIR}"/gtk/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz - fi + mkdir -p "${DESTDIR_GI}" + wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/gtk/vmlinuz + wget --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/gtk/initrd.gz fi -FIXME () -{ -# Downloading udebs -mkdir -p binary/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}" -cd binary/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}" -wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages.gz -gunzip -c Packages.gz > Packages -cd "${OLDPWD}" +# 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 -for DISTRIBUTION in frozen stable testing unstable -do - ln -s ${LIVE_DISTRIBUTION} binary/dists/${DISTRIBUTION} -done +case "${LIVE_ARCHITECTURE}" in + amd64) + DI_PACKAGES="linux-image-2.6-amd64 lilo grub" + ;; -DEBS="`awk '/Filename: / { print $2 }' binary/dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages`" -UDEBS="`echo ${DEBS} | grep '.*.udeb'`" + i386) + DI_PACKAGES="linux-image-2.6-486 linux-image-2.6-686 lilo grub" + ;; -rm -f packages.di + 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 -for UDEB in ${UDEBS} -do - mkdir -p binary/`dirname ${UDEB}` - cd binary/`dirname ${UDEB}` - wget "${LIVE_MIRROR_BOOTSTRAP}"/${UDEB} - cd "${OLDPWD}" -done +Chroot "apt-get -o Dir::Cache=/binary.deb --download-only install --yes ${DI_PACKAGES}" +mv chroot/binary.deb ./ +mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status -# Downloading debs +# Including base debian packages if [ -d cache/packages_bootstrap ] then - for FILE in cache/packages_bootstrap/*.deb + for FILE in cache/packages_bootstrap/*.deb binary.deb/archives/*.deb do - SOURCE="`dpkg -f ${FILE} Source`" + SOURCE="`dpkg -f ${FILE} Source | awk '{ print $1 }'`" if [ -z "${SOURCE}" ] then @@ -220,85 +189,120 @@ then done fi +# Generating deb indices mkdir -p binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE} +cd binary +apt-ftparchive packages pool/main > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages +gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages.gz +#apt-ftparchive sources pool/main > dists/${LIVE_DISTRIBUTION}/main/source/Sources +#gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/source/Sources > dists/${LIVE_DISTRIBUTION}/main/source/Sources +cd "${OLDPWD}" + +# Writing release cat > binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Release << EOF -Archive: ${LIVE_DISTRIBUTION} +Archive: stable +Version: 4.0r0 Component: main Origin: Debian Label: Debian Architecture: ${LIVE_ARCHITECTURE} EOF -mkdir -p cache/indices_debian-installer - -cat > cache/indices_debian-installer/archive << EOF -Dir -{ - ArchiveDir "binary"; - // OverrideDir ""; - // CacheDir ""; - FileListDir "cache/indices_debian-installer"; -}; - -Default -{ - Packages::Compress ". gzip"; - // Packages::Extension ".deb"; - // Sources::Extensions ".dsc"; - // Contents::Compress "gzip"; - // DeLinkLimit "0"; - // FileMode "0644"; -}; - -TreeDefault -{ - // MaxContentsChange - // ContentsAge - Directory "dists/\$(DIST)/\$(SECTION)/binary-\$(ARCH)/"; - Packages "dists/\$(DIST)/\$(SECTION)/binary-\$(ARCH)/Packages"; - InternalPrefix "dists/\$(DIST)/\$(SECTION)/"; - Contents "dists/\$(DIST)/Contents-\$(ARCH)"; - // Contents::Header - // BinCacheDB "cache.\$(DIST).\$(SECTION).\$(ARCH)"; - // FileList "filelist.\$(DIST).\$(SECTION).\$(ARCH)"; - FileList "filelist"; - // BinOverride "override.\$(DIST).\$(SECTION)"; -}; - -tree "${LIVE_DISTRIBUTION}" -{ - Sections "main"; - Architectures "${LIVE_ARCHITECTURE}"; -}; -EOF +#cat > binary/dists/${LIVE_DISTRIBUTION}/main/source/Release << EOF +#Archive: stable +#Version: 4.0r0 +#Component: main +#Origin: Debian +#Label: Debian +#Architecture: source +#EOF -cd binary -find pool -name "*.deb" | sort > ../cache/indices_debian-installer/filelist +mkdir binary.udeb +cd binary.udeb + +# Downloading udeb indices +wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages.gz +gunzip -c Packages.gz > Packages + +# Sorting udebs +UDEBS="`awk '/Filename: / { print $2 }' Packages`" + +# Downloading udebs +DOWNLOAD="" +for UDEB in ${UDEBS} +do + DOWNLOAD="$DOWNLOAD ${LIVE_MIRROR_BOOTSTRAP}/${UDEB}" +done +echo $DOWNLOAD | xargs wget + +# Excluding udebs +grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/udeb_exclude > exclude +grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs > exclude +grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs-${LIVE_ARCHITECTURE} >> exclude + +for EXCLUDE in `cat exclude` +do + rm -f "${EXCLUDE}"_*.udeb +done + +# Moving udebs +for UDEB in ${UDEBS} +do + if [ -f "`basename ${UDEB}`" ] + then + mkdir -p `dirname ${UDEB}` + mv "`basename ${UDEB}`" "`dirname ${UDEB}`" + fi +done + +# Creating udeb indices +mkdir -p dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}" +apt-ftparchive packages pool/main > dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages +gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages.gz + +rm -f Packages* exclude +find . | cpio -dmpu "${OLDPWD}"/binary cd "${OLDPWD}" -cat > cache/indices_debian-installer/release << EOF -APT::FTPArchive::Release::Origin "Debian"; -APT::FTPArchive::Release::Label "Debian"; -APT::FTPArchive::Release::Suite "${LIVE_DISTRIBUTION}"; -APT::FTPArchive::Release::Version "4.0"; -APT::FTPArchive::Release::Codename "${LIVE_DISTRIBUTION}"; -APT::FTPArchive::Release::Date "`date -R`"; -APT::FTPArchive::Release::Architectures "${LIVE_ARCHITECTURE}"; -APT::FTPArchive::Release::Components "main"; -EOF +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="${LIVE_DISTRIBUTION}" \ + -o APT::FTPArchive::Release::Version="4.0" \ + -o APT::FTPArchive::Release::Codename="${LIVE_DISTRIBUTION}" \ + -o APT::FTPArchive::Release::Date="`date -R`" \ + -o APT::FTPArchive::Release::Architectures="${LIVE_ARCHITECTURE}" \ + -o APT::FTPArchive::Release::Components="main" \ + -o APT::FTPArchive::Release::Description="Last updated: `date -R`" \ +release binary/dists/${LIVE_DISTRIBUTION} > binary/dists/${LIVE_DISTRIBUTION}/Release + +# Creating dist symlinks +for DISTRIBUTION in frozen stable testing unstable +do + ln -s ${LIVE_DISTRIBUTION} binary/dists/${DISTRIBUTION} +done -apt-ftparchive generate cache/indices_debian-installer/archive -apt-ftparchive -c cache/indices_debian-installer/release -o APT::FTPArchive::Release::Description="Last updated: `date -R`" release binary/dists/${LIVE_DISTRIBUTION} > binary/dists/${LIVE_DISTRIBUTION}/Release -} +ln -s . binary/debian +# Creating disk info mkdir binary/.disk echo "main" > binary/.disk/base_components touch binary/.disk/base_installable echo "not_complete" > binary/.disk/cd_type -#echo "Debian GNU/Linux 4.0 r0 \"Etch\" - Official i386 NETINST Binary-1 20070407-11:29" > binary/.disk/info -echo "Debian GNU/Linux ${LIVE_DISTRIBUTION} - Unofficial ${LIVE_ARCHITECTURE} NETINST Binary-1 `date +%Y%m%d-%H:%M`" > binary/.disk/info +echo "Debian GNU/Linux ${LIVE_DISTRIBUTION} - Unofficial ${LIVE_ARCHITECTURE} LIVE Binary `date +%Y%m%d-%H:%M`" > binary/.disk/info touch binary/.disk/mkisofs +cat > binary/.disk/udeb_include << EOF +netcfg +ethdetect +pcmcia-cs-udeb +pcmciautils-udeb +wireless-tools-udeb +EOF # Creating stage file Create_stagefile .stage/binary_debian-installer |