From 9a5955a79f907075d0cde61db6f7d2d605ab3b4a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Sep 2007 10:04:39 +0200 Subject: Adding live-package 0.99.19-1. --- src/scripts/02defaults.sh | 23 +++-- src/scripts/13chroot.sh | 222 ++++++++++++++++++++++++++++++++++++++++++++++ src/scripts/13hack.sh | 23 ----- src/scripts/14chroot.sh | 213 -------------------------------------------- 4 files changed, 238 insertions(+), 243 deletions(-) create mode 100644 src/scripts/13chroot.sh delete mode 100644 src/scripts/13hack.sh delete mode 100644 src/scripts/14chroot.sh (limited to 'src/scripts') diff --git a/src/scripts/02defaults.sh b/src/scripts/02defaults.sh index 83101fc48..e762145a8 100644 --- a/src/scripts/02defaults.sh +++ b/src/scripts/02defaults.sh @@ -86,13 +86,7 @@ Defaults () ;; amd64) - if [ "${LIVE_DISTRIBUTION}" = "unstable" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ] || \ - [ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ] - then - LIVE_KERNEL="amd64" - else - LIVE_KERNEL="amd64-generic" - fi + LIVE_KERNEL="amd64" ;; arm) @@ -166,6 +160,21 @@ Defaults () LIVE_MIRROR_SECURITY="http://security.debian.org/" fi + # Set default aptitude tasks + if [ "${LIVE_PACKAGE_LIST}" = "gnome-desktop" ] + then + LIVE_PACKAGE_LIST="gnome" + LIVE_TASKS="${LIVE_TASKS} gnome-desktop" + elif [ "${LIVE_PACKAGE_LIST}" = "kde-desktop" ] + then + LIVE_PACKAGE_LIST="kde" + LIVE_TASKS="${LIVE_TASKS} kde-desktop" + elif [ "${LIVE_PACKAGE_LIST}" = "xfce-desktop" ] + then + LIVE_PACKAGE_LIST="xfce" + LIVE_TASKS="${LIVE_TASKS} xfce-desktop" + fi + # Check for package lists if [ -z "${LIVE_PACKAGE_LIST}" ] then diff --git a/src/scripts/13chroot.sh b/src/scripts/13chroot.sh new file mode 100644 index 000000000..06df0b60e --- /dev/null +++ b/src/scripts/13chroot.sh @@ -0,0 +1,222 @@ +#!/bin/sh + +# make-live - utility to build Debian Live systems +# +# Copyright (C) 2006 Daniel Baumann +# Copyright (C) 2006 Marco Amadori +# +# make-live 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. + +Chroot_exec () +{ + # Execute commands chrooted + chroot "${LIVE_CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" ftp_proxy="${LIVE_PROXY_FTP}" http_proxy="${LIVE_PPROXY_HTTP}" DEBIAN_FRONTEND="${LIVE_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LIVE_DEBCONF_PRIORITY}" ${1} + return ${?} +} + +Chroot () +{ + if [ ! -f "${LIVE_ROOT}"/.stage/chroot ] + then + # Configure chroot + Patch_chroot apply + Patch_runlevel apply + + # Configure network + Patch_network apply + + # Mount proc + mount proc-live -t proc "${LIVE_CHROOT}"/proc + + # Avoid daemon starting + cat > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d < "${LIVE_ROOT}"/preseed.cloned + + # Extract package selection + Chroot_exec "dpkg --get-selections" | grep -v deinstall | cut -f1 > "${LIVE_ROOT}"/package-list.cloned + + # Restoring chroot directories + LIVE_CHROOT="${LIVE_CHROOT_TMP}" + LIVE_CHROOT_TMP="" + + LIVE_PRESEED="${LIVE_ROOT}/preseed.cloned" + LIVE_PACKAGE_LIST_CLONED="${LIVE_ROOT}/package-list.cloned" + fi + + # Restore preseed configuration + if [ -f "${LIVE_PRESEED}" ] + then + Chroot_exec "aptitude install --assume-yes debconf-utils" + cp "${LIVE_PRESEED}" "${LIVE_CHROOT}"/root/preseed + Chroot_exec "debconf-set-selections /root/preseed" + rm -f "${LIVE_CHROOT}"/root/preseed + else + if [ -n "${LIVE_PRESEED}" ]; then + echo "'${LIVE_PRESEED}' file doesn't exists. Exiting..." + exit 1 + fi + fi + + # Restore cloned package selection + if [ -f "${LIVE_PACKAGE_LIST_CLONED}" ] + then + Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST_CLONED}` aptitude install --assume-yes" + fi + + # Install packages list + if [ -n "${LIVE_PACKAGE_LIST}" ] + then + grep -v "^#" "${LIVE_PACKAGE_LIST}" > "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`" + Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST}` aptitude install --assume-yes" + rm -f "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`" + fi + + # Install extra packages + if [ -n "${LIVE_PACKAGES}" ] + then + Chroot_exec "aptitude install --assume-yes ${LIVE_PACKAGES}" + fi + + # Install aptitude tasks + if [ -n "${LIVE_TASKS}" ] + then + for TASK in ${LIVE_TASKS} + do + Chroot_exec "aptitude install --assume-yes ${TASK}" + done + fi + + # Copy external directory into the chroot + if [ -d "${LIVE_INCLUDE_CHROOT}" ] + then + cd "${LIVE_INCLUDE_CHROOT}" + find . | cpio -pumd "${LIVE_CHROOT}" + cd "${OLDPWD}" + fi + + # Process flavour specific hooks + if [ -r "${BASE}"/hooks/"${LIVE_FLAVOUR}" ] + then + grep -v "^#" "${BASE}"/hooks/"${LIVE_FLAVOUR}" > "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}" + LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "sh /root/${LIVE_FLAVOUR}" + rm -f "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}" + fi + + # Execute extra command in the chroot + if [ -r "${LIVE_HOOK}" ] + then + # FIXME + LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "`cat ${LIVE_HOOK}`" + elif [ -n "${LIVE_HOOK}" ] + then + LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "${LIVE_HOOK}" + fi + + # Save package list + Chroot_exec "dpkg --get-selections" > "${LIVE_ROOT}"/packages.txt + + # Add filesystem.manifest + Chroot_exec "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest + + if [ ! -z "${LIVE_MANIFEST}" ] + then + Chroot_exec "aptitude install --assume-yes ${LIVE_MANIFEST}" + Chroot_exec "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest-desktop + fi + + # Clean apt packages cache + rm -rf "${LIVE_CHROOT}"/var/cache/apt + mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial + + if [ "${LIVE_FLAVOUR}" = "minimal" ] + then + rm -f "${LIVE_CHROOT}"/var/lib/apt/lists/* + rm -f "${LIVE_CHROOT}"/var/lib/dpkg/available-old + rm -f "${LIVE_CHROOT}"/var/lib/dpkg/diversions-old + rm -f "${LIVE_CHROOT}"/var/lib/dpkg/statoverride-old + rm -f "${LIVE_CHROOT}"/var/lib/dpkg/status-old + fi + + # Workaround binfmt-support /proc locking + umount "${LIVE_CHROOT}"/proc/sys/fs/binfmt_misc > /dev/null || true + + # Unmount proc + umount "${LIVE_CHROOT}"/proc + + # Allow daemon starting + rm "${LIVE_CHROOT}"/usr/sbin/policy-rc.d + + # Deconfigure network + Patch_network deapply + + # Deconfigure chroot + Patch_runlevel deapply + Patch_chroot deapply + + # Touching stage file + touch "${LIVE_ROOT}"/.stage/chroot + fi +} diff --git a/src/scripts/13hack.sh b/src/scripts/13hack.sh deleted file mode 100644 index 1f7b57a58..000000000 --- a/src/scripts/13hack.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# make-live - utility to build Debian Live systems -# -# Copyright (C) 2006 Daniel Baumann -# Copyright (C) 2006 Marco Amadori -# -# make-live 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. - -Hack_xorg () -{ - # xserver-xorg << 7.1 - if [ -f "${LIVE_CHROOT}/etc/X11/xorg.conf" ] - then - if [ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ] - then - # Comment "BusID" line and set driver to "vesa" - sed -i -e 's/\(^.*BusID.*\)/#\1/g' -e '/Section "Device"/,/EndSection/ s/\(.*Driver.*"\).*\(".*\)/\1vesa\2/g' "${LIVE_CHROOT}"/etc/X11/xorg.conf - fi - fi -} diff --git a/src/scripts/14chroot.sh b/src/scripts/14chroot.sh deleted file mode 100644 index 125f08f9f..000000000 --- a/src/scripts/14chroot.sh +++ /dev/null @@ -1,213 +0,0 @@ -#!/bin/sh - -# make-live - utility to build Debian Live systems -# -# Copyright (C) 2006 Daniel Baumann -# Copyright (C) 2006 Marco Amadori -# -# make-live 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. - -Chroot_exec () -{ - # Execute commands chrooted - chroot "${LIVE_CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" ftp_proxy="${LIVE_PROXY_FTP}" http_proxy="${LIVE_PPROXY_HTTP}" DEBIAN_FRONTEND="${LIVE_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LIVE_DEBCONF_PRIORITY}" ${1} - return ${?} -} - -Chroot () -{ - if [ ! -f "${LIVE_ROOT}"/.stage/chroot ] - then - # Configure chroot - Patch_chroot apply - Patch_runlevel apply - - # Configure network - Patch_network apply - - # Mount proc - mount proc-live -t proc "${LIVE_CHROOT}"/proc - - # Avoid daemon starting - cat > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d < "${LIVE_ROOT}"/preseed.cloned - - # Extract package selection - Chroot_exec "dpkg --get-selections" | grep -v deinstall | cut -f1 > "${LIVE_ROOT}"/package-list.cloned - - # Restoring chroot directories - LIVE_CHROOT="${LIVE_CHROOT_TMP}" - LIVE_CHROOT_TMP="" - - LIVE_PRESEED="${LIVE_ROOT}/preseed.cloned" - LIVE_PACKAGE_LIST_CLONED="${LIVE_ROOT}/package-list.cloned" - fi - - # Restore preseed configuration - if [ -f "${LIVE_PRESEED}" ] - then - Chroot_exec "aptitude install --assume-yes debconf-utils" - cp "${LIVE_PRESEED}" "${LIVE_CHROOT}"/root/preseed - Chroot_exec "debconf-set-selections /root/preseed" - rm -f "${LIVE_CHROOT}"/root/preseed - else - if [ -n "${LIVE_PRESEED}" ]; then - echo "'${LIVE_PRESEED}' file doesn't exists. Exiting..." - exit 1 - fi - fi - - # Restore cloned package selection - if [ -f "${LIVE_PACAKGE_LIST_CLONED}" ] - then - Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST_CLONED}` aptitude install --assume-yes" - fi - - # Install packages list - if [ -n "${LIVE_PACKAGE_LIST}" ] - then - grep -v "^#" "${LIVE_PACKAGE_LIST}" > "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`" - Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST}` aptitude install --assume-yes" - rm -f "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`" - fi - - # Install extra packages - if [ -n "${LIVE_PACKAGES}" ] - then - Chroot_exec "aptitude install --assume-yes ${LIVE_PACKAGES}" - fi - - # Copy external directory into the chroot - if [ -d "${LIVE_INCLUDE_CHROOT}" ] - then - cd "${LIVE_INCLUDE_CHROOT}" - find . | cpio -pumd "${LIVE_CHROOT}" - cd "${OLDPWD}" - fi - - # Process flavour specific hooks - if [ -r "${BASE}"/hooks/"${LIVE_FLAVOUR}" ] - then - grep -v "^#" "${BASE}"/hooks/"${LIVE_FLAVOUR}" > "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}" - LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "sh /root/${LIVE_FLAVOUR}" - rm -f "${LIVE_CHROOT}"/root/"${LIVE_FLAVOUR}" - fi - - # Execute extra command in the chroot - if [ -r "${LIVE_HOOK}" ] - then - # FIXME - LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "`cat ${LIVE_HOOK}`" - elif [ -n "${LIVE_HOOK}" ] - then - LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" Chroot_exec "${LIVE_HOOK}" - fi - - # Temporary hacks for broken packages - Hack_xorg - - # Add filesystem.manifest - Chroot_exec "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest - - if [ ! -z "${LIVE_MANIFEST}" ] - then - Chroot_exec "aptitude install --assume-yes ${LIVE_MANIFEST}" - Chroot_exec "dpkg-query -W \*" | awk '$2 ~ /./ {print $1 " " $2 }' > "${LIVE_ROOT}"/filesystem.manifest-desktop - fi - - # Clean apt packages cache - rm -rf "${LIVE_CHROOT}"/var/cache/apt - mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial - - if [ "${LIVE_FLAVOUR}" = "minimal" ] - then - rm -f "${LIVE_CHROOT}"/var/lib/apt/lists/* - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/available-old - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/diversions-old - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/statoverride-old - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/status-old - fi - - # Workaround binfmt-support /proc locking - umount "${LIVE_CHROOT}"/proc/sys/fs/binfmt_misc > /dev/null || true - - # Unmount proc - umount "${LIVE_CHROOT}"/proc - - # Allow daemon starting - rm "${LIVE_CHROOT}"/usr/sbin/policy-rc.d - - # Deconfigure network - Patch_network deapply - - # Deconfigure chroot - Patch_runlevel deapply - Patch_chroot deapply - - # Touching stage file - touch "${LIVE_ROOT}"/.stage/chroot - fi -} -- cgit v1.2.3