From a486d3e1ad9401dfff9c0f0a98784bf8dfce1da7 Mon Sep 17 00:00:00 2001 From: "Cody A.W. Somerville" Date: Wed, 15 Apr 2009 22:07:26 +0200 Subject: Adding Ubuntu mode. --- functions/defaults.sh | 214 ++++++++++++++++++++++++++++++++++++++++------ functions/releases.sh | 10 +++ helpers/lh_binary_disk | 16 ++-- helpers/lh_chroot_sources | 58 +++++++++---- helpers/lh_source_disk | 22 +++-- 5 files changed, 263 insertions(+), 57 deletions(-) diff --git a/functions/defaults.sh b/functions/defaults.sh index 2b2e3f7..06e1478 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -28,6 +28,10 @@ Set_defaults () emdebian) LH_DISTRIBUTION="sid" ;; + + ubuntu) + LH_DISTRIBUTION="jaunty" + ;; esac fi @@ -72,7 +76,7 @@ Set_defaults () # Setting apt recommends case "${LH_MODE}" in - debian|debian-release) + debian|debian-release|ubuntu) LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS:-enabled}" ;; @@ -137,6 +141,10 @@ Set_defaults () fi ;; + ubuntu) + LH_INITRAMFS="casper" + ;; + *) LH_INITRAMFS="live-initramfs" ;; @@ -203,6 +211,10 @@ Set_defaults () emdebian) LH_ROOT="emdebian-live" ;; + + ubuntu) + LH_ROOT="ubuntu-live" + ;; esac fi @@ -288,6 +300,18 @@ Set_defaults () emdebian) LH_MIRROR_BOOTSTRAP="http://buildd.emdebian.org/grip/" ;; + + ubuntu) + case "${LH_ARCHITECTURE}" in + amd64|i386) + LH_MIRROR_BOOTSTRAP="http://archive.ubuntu.com/ubuntu/" + ;; + + *) + LH_MIRROR_BOOTSTRAP="http://ports.ubuntu.com/" + ;; + esac + ;; esac fi @@ -304,6 +328,18 @@ Set_defaults () emdebian) LH_MIRROR_CHROOT_SECURITY="none" ;; + + ubuntu) + case "${LH_ARCHITECTURE}" in + amd64|i386) + LH_MIRROR_CHROOT_SECURITY="http://archive.ubuntu.com/ubuntu/" + ;; + + *) + LH_MIRROR_CHROOT_SECURITY="http://ports.ubuntu.com/" + ;; + esac + ;; esac fi @@ -326,6 +362,18 @@ Set_defaults () emdebian) LH_MIRROR_BINARY="http://buildd.emdebian.org/grip/" ;; + + ubuntu) + case "${LH_ARCHITECTURE}" in + amd64|i386) + LH_MIRROR_BINARY="http://archive.ubuntu.com/ubuntu/" + ;; + + *) + LH_MIRROR_BINARY="http://ports.ubuntu.com/" + ;; + esac + ;; esac fi @@ -340,6 +388,18 @@ Set_defaults () emdebian) LH_MIRROR_BINARY_SECURITY="none" ;; + + ubuntu) + case "${LH_ARCHITECTURE}" in + amd64|i386) + LH_MIRROR_BINARY_SECURITY="http://archive.ubuntu.com/ubuntu/" + ;; + + *) + LH_MIRROR_BINARY_SECURITY="http://ports.ubuntu.com/" + ;; + esac + ;; esac fi @@ -385,6 +445,10 @@ Set_defaults () emdebian) LH_KEYRING_PACKAGES="${LH_kEYRING_PACKAGES:-debian-archive-keyring}" ;; + + ubuntu) + LH_KEYRING_PACKAGES="${LH_KEYRING_PACKAGES:-ubuntu-keyring}" + ;; esac # Setting language string @@ -395,25 +459,57 @@ Set_defaults () then case "${LH_ARCHITECTURE}" in alpha) - LH_LINUX_FLAVOURS="alpha-generic" + case "${LH_MODE}" in + ubuntu) + Echo_error "Architecture ${LH_ARCHITECTURE} not supported on Ubuntu." + ;; + + *) + LH_LINUX_FLAVOURS="alpha-generic" + ;; + esac ;; amd64) - LH_LINUX_FLAVOURS="amd64" + case "${LH_MODE}" in + ubuntu) + LH_LINUX_FLAVOURS="generic" + ;; + + *) + LH_LINUX_FLAVOURS="amd64" + ;; + esac ;; hppa) - LH_LINUX_FLAVOURS="parisc" + case "${LH_MODE}" in + ubuntu) + LH_LINUX_FLAVOURS="hppa32 hppa64" + ;; + + *) + LH_LINUX_FLAVOURS="parisc" + ;; + esac ;; i386) - case "${LIST}" in - stripped|minimal) - LH_LINUX_FLAVOURS="486" + case "${LH_MODE}" in + ubuntu) + LH_LINUX_FLAVOURS="generic" ;; *) - LH_LINUX_FLAVOURS="486 686" + case "${LIST}" in + stripped|minimal) + LH_LINUX_FLAVOURS="486" + ;; + + *) + LH_LINUX_FLAVOURS="486 686" + ;; + esac ;; esac ;; @@ -435,7 +531,15 @@ Set_defaults () ;; s390) - LH_LINUX_FLAVOURS="s390" + case "${LH_MODE}" in + ubuntu) + Echo_error "Architecture ${LH_ARCHITECTURE} not supported on Ubuntu." + ;; + + *) + LH_LINUX_FLAVOURS="s390" + ;; + esac ;; sparc) @@ -453,7 +557,7 @@ Set_defaults () ;; *) - Echo_error "Architecture not yet supported (FIXME)" + Echo_error "Architecture ${LH_ARCHITECTURE} not yet supported (FIXME)" ;; esac fi @@ -461,26 +565,46 @@ Set_defaults () # Set linux packages if [ -z "${LH_LINUX_PACKAGES}" ] then - LH_LINUX_PACKAGES="linux-image-2.6 \${LH_UNION_FILESYSTEM}-modules-2.6" + case "${LH_MODE}" in + debian|debian-release|embedian) + LH_LINUX_PACKAGES="linux-image-2.6 \${LH_UNION_FILESYSTEM}-modules-2.6" - if [ "${LH_CHROOT_FILESYSTEM}" = "squashfs" ] - then - LH_LINUX_PACKAGES="${LH_LINUX_PACKAGES} squashfs-modules-2.6" - fi + if [ "${LH_CHROOT_FILESYSTEM}" = "squashfs" ] + then + LH_LINUX_PACKAGES="${LH_LINUX_PACKAGES} squashfs-modules-2.6" + fi - case "${LH_ENCRYPTION}" in - ""|disabled) + case "${LH_ENCRYPTION}" in + ""|disabled) + + ;; + + *) + LH_LINUX_PACKAGES="${LH_LINUX_PACKAGES} loop-aes-modules-2.6" + ;; + esac ;; - *) - LH_LINUX_PACKAGES="${LH_LINUX_PACKAGES} loop-aes-modules-2.6" + + ubuntu) + LH_LINUX_PACKAGES="linux" ;; esac fi # Setting packages string - # LH_PACKAGES + case "${LH_MODE}" in + ubuntu) + LH_PACKAGES="${LH_PACKAGES:-ubuntu-standard}" + ;; + + *) + LH_PACKAGES_LISTS="${LH_PACKAGES_LISTS:-standard}" + ;; + esac + case "${LH_ENCRYPTION}" in ""|disabled) + ;; *) @@ -491,9 +615,6 @@ Set_defaults () ;; esac - # Setting packages list string - LH_PACKAGES_LISTS="${LH_PACKAGES_LISTS:-standard}" - # Setting tasks string for LIST in ${LH_PACKAGES_LISTS} do @@ -527,9 +648,6 @@ Set_defaults () LH_PACKAGES_LISTS="$(echo ${LH_PACKAGES_LISTS} | sed -e 's| ||g')" LH_TASKS="$(echo ${LH_TASKS} | sed -e 's| ||g')" - # Setting tasks - # LH_TASKS - # Setting security updates option if [ "${LH_MIRROR_CHROOT_SECURITY}" = "none" ] || [ "${LH_MIRROR_BINARY_SECURITY}" = "none" ] then @@ -551,6 +669,7 @@ Set_defaults () sparc) LH_BINARY_FILESYSTEM="${LH_BINARY_FILESYSTEM:-ext2}" ;; + *) LH_BINARY_FILESYSTEM="${LH_BINARY_FILESYSTEM:-fat16}" ;; @@ -648,6 +767,13 @@ Set_defaults () fi fi + # Ubuntu's d-i is patched to be able to use usb-hdd block devices for + # install media if enabled by preseeding cdrom-detect/try-usb to true. + if [ "${LH_MODE}" = "ubuntu" ] && [ "${LH_BINARY_IMAGES}" = "usb-hdd" ] + then + LH_BOOTAPPEND_INSTALL="cdrom-detect/try-usb=true -- \${LH_BOOTAPPEND_LIVE}" + fi + # Setting encryption LH_ENCRYPTION="${LH_ENCRYPTION:-disabled}" @@ -657,7 +783,19 @@ Set_defaults () # Setting hostname if [ -z "${LH_HOSTNAME}" ] then - LH_HOSTNAME="debian" + case "${LH_MODE}" in + embedian) + LH_HOSTNAME="embedian" + ;; + + ubuntu) + LH_HOSTNAME="ubuntu" + ;; + + *) + LH_HOSTNAME="debian" + ;; + esac fi # Setting iso author @@ -671,6 +809,10 @@ Set_defaults () emdebian) LH_ISO_APPLICATION="Emdebian Live" ;; + + ubuntu) + LH_ISO_APPLICATION="Ubuntu Live" + ;; esac fi @@ -696,6 +838,10 @@ Set_defaults () emdebian) LH_ISO_VOLUME="Emdebian ${LH_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)" ;; + + ubuntu) + LH_ISO_VOLUME="Ubuntu ${LH_DISTRIBUTION} \$(date +%Y%m%d-%H:%M)" + ;; esac fi @@ -732,6 +878,10 @@ Set_defaults () emdebian) LH_NET_ROOT_PATH="/srv/emdebian-live" ;; + + ubuntu) + LH_NET_ROOT_PATH="/srv/ubuntu-live" + ;; esac fi @@ -780,7 +930,15 @@ Set_defaults () LH_SYSLINUX_MENU_MEMTEST_ENTRY="${LH_SYSLINUX_MENU_MEMTEST_ENTRY:-Memory test}" # Setting username - LH_USERNAME="${LH_USERNAME:-user}" + case "${LH_MODE}" in + ubuntu) + LH_USERNAME="${LH_USERNAME:-ubuntu}" + ;; + + *) + LH_USERNAME="${LH_USERNAME:-user}" + ;; + esac ## config/source diff --git a/functions/releases.sh b/functions/releases.sh index 5d703d7..c7c16f9 100755 --- a/functions/releases.sh +++ b/functions/releases.sh @@ -12,3 +12,13 @@ RELEASE_etch="4.0 r8" RELEASE_lenny="5.0.1" RELEASE_squeeze="testing" RELEASE_sid="unstable" + +# Ubuntu releases +RELEASE_dapper="6.06" +RELEASE_edgy="6.10" +RELEASE_feisty="7.04" +RELEASE_gutsy="7.10" +RELEASE_hardy="8.04" +RELEASE_intrepid="8.10" +RELEASE_jaunty="9.04" +RELEASE_karmic="9.10" diff --git a/helpers/lh_binary_disk b/helpers/lh_binary_disk index 279da75..a7674e7 100755 --- a/helpers/lh_binary_disk +++ b/helpers/lh_binary_disk @@ -52,6 +52,7 @@ DISTRIBUTION="$(echo ${LH_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')" DISTRIBUTION="${DISTRIBUTION}$(echo ${LH_DISTRIBUTION} | cut -b 2-)" eval VERSION="$`echo RELEASE_${LH_DISTRIBUTION}`" +TITLE="Debian GNU/Linux" case "${LH_MODE}" in debian) STRING="Official Snapshot ${ARCHITECTURE}" @@ -61,6 +62,11 @@ case "${LH_MODE}" in STRING="Official ${ARCHITECTURE}" ;; + ubuntu) + TITLE="Ubuntu GNU/Linux" + STRING="Build ${ARCHITECTURE}" + ;; + *) STRING="Snapshot ${ARCHITECTURE}" ;; @@ -74,7 +80,7 @@ case "${LH_DEBIAN_INSTALLER}" in echo "full_cd" > binary/.disk/cd_type - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_udeb_include binary/.disk/udeb_include ;; @@ -88,9 +94,9 @@ case "${LH_DEBIAN_INSTALLER}" in if [ "${LH_DEBIAN_INSTALLER}" = "live" ] then - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info else - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info fi @@ -107,13 +113,13 @@ case "${LH_DEBIAN_INSTALLER}" in echo "not_complete" > binary/.disk/cd_type - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_businesscard_udeb_include binary/.disk/udeb_include ;; disabled) - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info ;; esac diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources index d5e640c..2c9e219 100755 --- a/helpers/lh_chroot_sources +++ b/helpers/lh_chroot_sources @@ -51,15 +51,28 @@ case "${1}" in if [ "${LH_SECURITY}" = "enabled" ] then - if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ] - then - echo "deb ${LH_MIRROR_CHROOT_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + case "${LH_MODE}" in + ubuntu) + echo "deb ${LH_MIRROR_CHROOT_SECURITY} ${LH_DISTRIBUTION}-security ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list - if [ "${LH_SOURCE}" = "enabled" ] - then - echo "deb-src ${LH_MIRROR_CHROOT_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list - fi - fi + if [ "${LH_SOURCE}" = "enabled" ] + then + echo "deb-src ${LH_MIRROR_CHROOT_SECURITY} ${LH_DISTRIBUTION}-security ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + fi + ;; + + *) + if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ] + then + echo "deb ${LH_MIRROR_CHROOT_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + + if [ "${LH_SOURCE}" = "enabled" ] + then + echo "deb-src ${LH_MIRROR_CHROOT_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + fi + fi + ;; + esac fi # Check local sources.list @@ -361,15 +374,28 @@ case "${1}" in if [ "${LH_SECURITY}" = "enabled" ] then - if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ] - then - echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + case "${LH_MODE}" in + ubuntu) + echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + + if [ "${LH_SOURCE}" = "enabled" ] + then + echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + fi + ;; - if [ "${LH_SOURCE}" = "enabled" ] - then - echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list - fi - fi + *) + if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ] + then + echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + + if [ "${LH_SOURCE}" = "enabled" ] + then + echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_CATEGORIES}" >> chroot/etc/apt/sources.list + fi + fi + ;; + esac fi # Check local sources.list diff --git a/helpers/lh_source_disk b/helpers/lh_source_disk index f7e4129..105fd63 100755 --- a/helpers/lh_source_disk +++ b/helpers/lh_source_disk @@ -44,43 +44,49 @@ Create_lockfile .lock mkdir -p source/.disk +TITLE="Debian GNU/Linux" DISTRIBUTION="$(echo ${LH_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')" DISTRIBUTION="${DISTRIBUTION}$(echo ${LH_DISTRIBUTION} | cut -b 2-)" eval VERSION="$`echo RELEASE_${LH_DISTRIBUTION}`" case "${LH_MODE}" in debian) - STRING="Official Snapshot" + STRING="Official Snapshot ${ARCHITECTURE}" ;; debian-release) - STRING="Official" + STRING="Official ${ARCHITECTURE}" + ;; + + ubuntu) + TITLE="Ubuntu GNU/Linux" + STRING="Build ${ARCHITECTURE}" ;; *) - STRING="Snapshot" + STRING="Snapshot ${ARCHITECTURE}" ;; esac case "${LH_DEBIAN_INSTALLER}" in cdrom) - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Source $(date +%Y%m%d-%H:%M)" > source/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/CD Source $(date +%Y%m%d-%H:%M)" > source/.disk/info ;; enabled|netinst) - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Source $(date +%Y%m%d-%H:%M)" > source/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/NETINST Source $(date +%Y%m%d-%H:%M)" > source/.disk/info ;; live) - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Source $(date +%Y%m%d-%H:%M)" > source/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/INSTALL Source $(date +%Y%m%d-%H:%M)" > source/.disk/info ;; businesscard) - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Source $(date +%Y%m%d-%H:%M)" > source/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE/BC Source $(date +%Y%m%d-%H:%M)" > source/.disk/info ;; disabled) - echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Source $(date +%Y%m%d-%H:%M)" > source/.disk/info + echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} LIVE Source $(date +%Y%m%d-%H:%M)" > source/.disk/info ;; esac -- cgit v1.0