diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:04:20 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:04:20 +0200 |
commit | eeaafbe5c0d5f2ffd87bf7d9f12c13df1bd0adf5 (patch) | |
tree | 18151396add367542887fe7f017025538e3318d6 /scripts | |
download | live-build-eeaafbe5c0d5f2ffd87bf7d9f12c13df1bd0adf5.zip live-build-eeaafbe5c0d5f2ffd87bf7d9f12c13df1bd0adf5.tar.gz |
Adding live-package 0.99-1.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/00-defaults.sh | 125 | ||||
-rw-r--r-- | scripts/00-init.sh | 18 | ||||
-rw-r--r-- | scripts/01-bootstrap.sh | 43 | ||||
-rw-r--r-- | scripts/01-chroot.sh | 169 | ||||
-rw-r--r-- | scripts/01-patch.sh | 91 | ||||
-rw-r--r-- | scripts/02-image.sh | 145 | ||||
-rw-r--r-- | scripts/02-iso.sh | 46 | ||||
-rw-r--r-- | scripts/02-net.sh | 38 |
8 files changed, 675 insertions, 0 deletions
diff --git a/scripts/00-defaults.sh b/scripts/00-defaults.sh new file mode 100644 index 0000000..32e5e13 --- /dev/null +++ b/scripts/00-defaults.sh @@ -0,0 +1,125 @@ +# scripts/00-defaults.sh + +Defaults () +{ + # Set architecture name + if [ -z "${LIVE_ARCHITECTURE}" ] + then + LIVE_ARCHITECTURE="`dpkg-architecture -qDEB_BUILD_ARCH`" + fi + + # Set build directory + if [ -z "${LIVE_ROOT}" ] + then + LIVE_ROOT="`pwd`/live" + fi + + # Set rootfs directory + if [ -d "${LIVE_ROOTFS}" ] + then + LIVE_CHROOT="${LIVE_ROOTFS}" + else + LIVE_CHROOT="${LIVE_ROOT}/chroot" + fi + + # Set distribution name + if [ -z "${LIVE_DISTRIBUTION}" ] + then + LIVE_DISTRIBUTION="unstable" + fi + + # Set bootstrap flavour + if [ -z "${LIVE_FLAVOUR}" ] + then + LIVE_FLAVOUR="standard" + fi + + # Set linux-image flavour + if [ -z "${LIVE_LINUX}" ] + then + case "${LIVE_ARCHITECTURE}" in + alpha) + LIVE_LINUX="alpha-generic" + ;; + + amd64) + LIVE_LINUX="amd64-generic" + ;; + + arm) + echo "E: You need to specify the linux flavour." + exit 1 + ;; + + hppa) + LIVE_LINUX="parisc" + ;; + + i386) + LIVE_LINUX="486" + ;; + + ia64) + LIVE_LINUX="itanium" + ;; + + m68k) + echo "E: You need to specify the linux flavour." + exit 1 + ;; + + powerpc) + LIVE_LINUX="powerpc" + ;; + + s390) + LIVE_LINUX="s390" + ;; + + sparc) + LIVE_LINUX="sparc32" + ;; + + *) + echo "FIXME: Architecture not yet supported." + exit 1 + ;; + esac + fi + + # Set logfile + if [ -z "${LIVE_LOGFILE}" ] + then + LIVE_LOGFILE="${LIVE_ROOT}/make-live.log" + fi + + # Set mirror server + if [ -z "${LIVE_MIRROR}" ] + then + LIVE_MIRROR="http://ftp.debian.org/debian" + fi + + # Set package list + if [ -z "${LIVE_PACKAGE_LIST}" ] && [ ! -z "${LIVE_LIST}" ] + then + LIVE_PACKAGE_LIST="/usr/share/make-live/lists/${LIVE_LIST}" + fi + + # Set sections names + if [ -z "${LIVE_SECTIONS}" ] + then + LIVE_SECTIONS="main" + fi + + # Set templates directory + if [ ! -z "${LIVE_TEMPLATES}" ] + then + if [ ! -d "${LIVE_TEMPLATES}" ] + then + echo "E: ${LIVE_TEMPLATES} is not a directory." + exit 1 + fi + else + LIVE_TEMPLATES="/usr/share/make-live/templates" + fi +} diff --git a/scripts/00-init.sh b/scripts/00-init.sh new file mode 100644 index 0000000..43aa251 --- /dev/null +++ b/scripts/00-init.sh @@ -0,0 +1,18 @@ +# scripts/00-init.sh + +Init () +{ + # Check if user is root + if [ "`id -u`" -ne "0" ] + then + echo "E: ${PROGRAM} requires superuser privilege." + exit 1 + fi + + # Check if build directory already exists + if [ -d "${LIVE_ROOT}" ] && [ ! -d "${LIVE_ROOTFS}" ] + then + echo "E: found an (unfinished) system, remove it and re-run ${PROGRAM}." + exit 1 + fi +} diff --git a/scripts/01-bootstrap.sh b/scripts/01-bootstrap.sh new file mode 100644 index 0000000..934737c --- /dev/null +++ b/scripts/01-bootstrap.sh @@ -0,0 +1,43 @@ +# scripts/01-bootstrap.sh + +Bootstrap () +{ + if [ -z "${LIVE_ROOTFS}" ] + then + # Create chroot directory + mkdir -p "${LIVE_CHROOT}" + + if [ -z "${LIVE_VERBOSE}" ] + then + if [ -x /usr/bin/cdebootstrap ] + then + # Bootstrap with cdebootstrap + cdebootstrap --arch="${LIVE_ARCHITECTURE}" \ + --flavour="${LIVE_FLAVOUR}" \ + "${LIVE_DISTRIBUTION}" \ + "${LIVE_CHROOT}" "${LIVE_MIRROR}" + elif [ -x /usr/sbin/debootstrap ] + then + # Bootstrap with debootstrap + debootstrap --arch="${LIVE_ARCHITECTURE}" \ + "${LIVE_DISTRIBUTION}" \ + "${LIVE_CHROOT}" "${LIVE_MIRROR}" + fi + else + if [ -x /usr/bin/cdebootstrap ] + then + # Bootstrap with cdebootstrap (debug) + cdebootstrap --arch="${LIVE_ARCHITECTURE}" \ + --debug --flavour="${LIVE_FLAVOUR}" \ + "${LIVE_DISTRIBUTION}" \ + "${LIVE_CHROOT}" "${LIVE_MIRROR}" + elif [ -x /usr/sbin/debootstrap ] + then + # Bootstrap with debootstrap (debug) + debootstrap --arch="${LIVE_ARCHITECTURE}" \ + --verbose "${LIVE_DISTRIBUTION}" \ + "${LIVE_CHROOT}" "${LIVE_MIRROR}" + fi + fi + fi +} diff --git a/scripts/01-chroot.sh b/scripts/01-chroot.sh new file mode 100644 index 0000000..ba5d526 --- /dev/null +++ b/scripts/01-chroot.sh @@ -0,0 +1,169 @@ +# scripts/01-chroot.sh + +chroots () +{ + # Execute commands chrooted + chroot "${LIVE_CHROOT}" /usr/bin/env -i HOME="/root" \ + PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" \ + ftp_proxy="${LIVE_FTPPROXY}" http_proxy="${LIVE_HTTPPROXY}" \ + DEBIAN_PRIORITY="critical" ${1} + #DEBIAN_FRONTEND=non-interactive DEBIAN_PRIORITY=critical + # FIXME: setting DEBIAN_FRONTEND to non-interactive seems not to work. +} + +Chroot () +{ + # Configure chroot + Patch_chroot apply + + # Configure network + Patch_network apply + + # Configure /etc/apt/sources.list + echo "deb ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > \ + "${LIVE_CHROOT}"/etc/apt/sources.list + chroots "apt-get update" + + # Install gnupg + chroots "apt-get install --yes --force-yes gnupg wget" + + # Import archive signing key + if [ ! -z "${LIVE_MIRROR_KEY}" ] + then + chroots "wget ${LIVE_MIRROR_KEY}" + chroots "apt-key add `basename ${LIVE_MIRROR_KEY}`" + chroots "rm -f `basename ${LIVE_MIRROR_KEY}`" + fi + + # Add other repository + if [ ! -z "${LIVE_REPOSITORY}" ] + then + # Configure /etc/apt/sources.list + echo "deb ${LIVE_REPOSITORY}" >> \ + "${LIVE_CHROOT}"/etc/apt/sources.list + + # Import archive signing key + if [ ! -z "${LIVE_REPOSITORY_KEY}" ] + then + chroots "wget ${LIVE_REPOSITORY_KEY}" + chroots "apt-key add `basename ${LIVE_REPOSITORY_KEY}`" + chroots "rm -f `basename ${LIVE_REPOSITORY_KEY}`" + fi + fi + + # Update indices + chroots "apt-get update" + + # Configure linux-image + Patch_linuximage apply + + # Install linux-image + chroots "apt-get install --yes linux-image-2.6-${LIVE_LINUX}" + chroots "apt-get install --yes --force-yes casper \ + squashfs-modules-2.6-${LIVE_LINUX} \ + unionfs-modules-2.6-${LIVE_LINUX}" + + # Rebuild initial ramdisk + chroots "dpkg-reconfigure `basename ${LIVE_CHROOT}/var/lib/dpkg/info/linux-image-2.6.*-${LIVE_LINUX}.postinst .postinst`" + + # Deconfigure linux-image + Patch_linuximage deapply + + # --- Begin FIXME --- + if [ -d "${LIVE_CLONE}" ] + then + # swapping chroots + LIVE_TMP="${LIVE_CHROOT}" + LIVE_CHROOT="${LIVE_CLONE}" + + # get info + chroots "apt-get install --yes debconf-utils" + chroots "debconf-get-selections" > "${LIVE_ROOT}"/preseed.cloned + chroots "dpkg --get-selections" | grep -v deinstall | cut -f1 > "${LIVE_ROOT}"/package-list.cloned + + # swapping out + LIVE_CHROOT="${LIVE_TMP}" + + LIVE_PRESEED="${LIVE_ROOT}"/preseed.cloned + LIVE_PACKAGE_LIST="${LIVE_ROOT}"/package-list.cloned + fi + + if [ -f "${LIVE_PRESEED}" ] + then + chroots "apt-get install --yes debconf-utils" + cp ${LIVE_PRESEED} ${LIVE_CHROOT}/tmp/preseed + chroots "debconf-set-selections /tmp/preseed" + rm ${LIVE_CHROOT}/tmp/preseed + fi + + if [ -z "${LIVE_ROOTFS}" ] + then + # Install packages list + if [ ! -z "${LIVE_PACKAGE_LIST}" ] + then + chroots "apt-get install --yes `cat ${LIVE_PACKAGE_LIST}`" + fi + + # Install extra packages + if [ ! -z "${LIVE_PACKAGES}" ] + then + chroots "apt-get install --yes ${LIVE_PACKAGES}" + fi + fi + + # Copy external path into the chroot + if [ -d "${LIVE_INCLUDE_ROOTFS}" ] + then + cd "${LIVE_INCLUDE_ROOTFS}" + find . | cpio -pumd "${LIVE_CHROOT}"/ + cd "${OLDPWD}" + fi + + # Execute extra command in the chroot + if [ ! -z "${LIVE_HOOK}" ] + then + chroots "${LIVE_HOOK}" + fi + + # Add splashy and conditionally a theme + if [ ! -z "${LIVE_SPLASHY}" ] + then + chroots "apt-get install --yes splashy splashy-themes" + + if [ ! -z "${LIVE_SPLASHY_THEME}" ] + then + # not already installed ? Then its a new theme to install! + if [ ! -d "${LIVE_CHROOT}"/etc/splashy/themes/"${LIVE_SPLASHY_THEME}" ] + then + if [ -f "${LIVE_SPLASHY_THEME}".tar.gz ] + then + cp "${LIVE_SPLASHY_THEME}".tar.gz "${LIVE_CHROOT}"/tmp/"${LIVE_SPLASHY_THEME}".tar.gz # this permits simlink to theme + chroots "splashy_config -i /tmp/${LIVE_SPLASHY_THEME}.tar.gz" + rm "${LIVE_CHROOT}"/tmp/"${LIVE_SPLASHY_THEME}".tar.gz + chroots "splashy_config -s ${LIVE_SPLASHY_THEME}" + else + echo "Specify the local splashy theme without extension, it also must be in the cwd" + fi + else + chroots "splashy_config -s ${LIVE_SPLASHY_THEME}" + fi + fi + fi + # --- End FIXME --- + + # Clean apt packages cache + rm -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb + rm -f "${LIVE_CHROOT}"/var/cache/apt/archives/partial/*.deb + + # Clean apt indices cache + rm -f "${LIVE_CHROOT}"/var/cache/apt/*pkgcache.bin + + # Remove cdebootstrap packages cache + rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap + + # Deconfigure network + Patch_network deapply + + # Deconfigure chroot + Patch_chroot deapply +} diff --git a/scripts/01-patch.sh b/scripts/01-patch.sh new file mode 100644 index 0000000..5b81bf5 --- /dev/null +++ b/scripts/01-patch.sh @@ -0,0 +1,91 @@ +# scripts/01-patches.sh + +Patch_chroot () +{ + # Some maintainer scripts can detect if they are in a chrooted system. + # Therefore, we create the corresponding file. + + case "${1}" in + apply) + # Create chroot file + echo "live" > "${LIFE_CHROOT}"/etc/debian_chroot + ;; + + deapply) + # Remove chroot file + rm -f "${LIVE_CHROOT}"/etc/debian_chroot + ;; + esac +} + +Patch_network () +{ + # Packages which are manually installed inside the chroot are installed + # from the network. Therefore, we need to be able to resolv hosts. + + case "${1}" in + apply) + # Save host lookup table + if [ -f "${LIVE_CHROOT}"/etc/hosts ] + then + cp "${LIVE_CHROOT}"/etc/hosts \ + "${LIVE_CHROOT}"/etc/hosts.orig + fi + + # Save resolver configuration + if [ -f "${LIVE_CHROOT}"/etc/resolv.conf ] + then + cp "${LIVE_CHROOT}"/etc/resolv.conf \ + "${LIVE_CHROOT}"/etc/resolv.conf.orig + fi + + # Copy host lookup table + if [ -f /etc/hosts ] + then + cp /etc/hosts "${LIVE_CHROOT}"/etc/hosts + fi + + # Copy resolver configuration + if [ -f /etc/resolv.conf ] + then + cp /etc/resolv.conf \ + "${LIVE_CHROOT}"/etc/resolv.conf + fi + ;; + + deapply) + # Restore host lookup table + if [ -f "${LIVE_CHROOT}"/etc/hosts.orig ] + then + mv "${LIVE_CHROOT}"/etc/hosts.orig \ + "${LIVE_CHROOT}"/etc/hosts + fi + + # Restore resolver configuration + if [ -f "${LIVE_CHROOT}"/etc/resolv.conf.orig ] + then + mv "${LIVE_CHROOT}"/etc/resolv.conf.orig \ + "${LIVE_CHROOT}"/etc/resolv.conf + fi + ;; + esac +} + +Patch_linuximage () +{ + # The linux-image package asks interactively for initial ramdisk + # creation. Therefore, we preconfigure /etc/kernel-img.conf. + + case "${1}" in + apply) + # Write configuration option + echo "do_initrd = Yes" >> \ + "${LIVE_CHROOT}"/etc/kernel-img.conf + ;; + + deapply) + # Remove configuration file + rm -f "${LIVE_CHROOT}"/etc/kernel-img.conf + ;; + esac +} diff --git a/scripts/02-image.sh b/scripts/02-image.sh new file mode 100644 index 0000000..85b7cc6 --- /dev/null +++ b/scripts/02-image.sh @@ -0,0 +1,145 @@ +# scripts/02-image.sh + +md5sums () +{ + # Calculating md5sums + cd "${LIVE_ROOT}"/image + find . -type f -print0 | xargs -0 md5sum > "${LIVE_ROOT}"/md5sum.txt + cd "${OLDPWD}" + + if [ -d "${LIVE_INCLUDE_IMAGE}" ] + then + cd "${LIVE_INCLUDE_IMAGE}" + find . -type f -print0 | xargs -0 md5sum >> \ + "${LIVE_ROOT}"/md5sum.txt + cd "${OLDPWD}" + fi + + mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/image +} + +mkisofss () +{ + if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] + then + # Create image + if [ -z "${LIVE_VERBOSE}" ] + then + mkisofs -quiet -A "Debian Live" -p "Debian Live; http://live.debian.net/; live@lists.debian-unofficial.org" -publisher "Debian Live; http://live.debian.net/; live@lists.debian-unofficial.org" -o "${LIVE_ROOT}"/image.iso -r -J -l -V "Debian Live `date +%Y%m%d`" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/image ${LIVE_INCLUDE_IMAGE} + else + mkisofs -A "Debian Live" -p "Debian Live; http://live.debian.net/; live@lists.debian-unofficial.org" -publisher "Debian Live; http://live.debian.net/; live@lists.debian-unofficial.org" -o "${LIVE_ROOT}"/image.iso -r -J -l -V "Debian Live `date +%Y%m%d`" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/image ${LIVE_INCLUDE_IMAGE} + fi + else + echo "FIXME: Bootloader on your architecture not yet supported (Continuing in 5 seconds)." + sleep 5 + + if [ -z "${LIVE_VERBOSE}" ] + then + # Create image + mkisofs -quiet -o "${LIVE_ROOT}"/image.iso -r -J -l -V "Debian Live `date +%Y%m%d`" "${LIVE_ROOT}"/image ${LIVE_INCLUDE_IMAGE} + else + # Create image (debug) + mkisofs -o "${LIVE_ROOT}"/image.iso -r -J -l -V "Debian Live `date +%Y%m%d`" "${LIVE_ROOT}"/image ${LIVE_INCLUDE_IMAGE} + fi + fi +} + + +Linuximage () +{ + case "${1}" in + iso) + # Copy linux-image + cp "${LIVE_CHROOT}"/boot/vmlinuz-* \ + "${LIVE_ROOT}"/image/isolinux/vmlinuz + cp "${LIVE_CHROOT}"/boot/initrd.img-* \ + "${LIVE_ROOT}"/image/isolinux/initrd.gz + ;; + + net) + # Copy linux-image + cp "${LIVE_ROOT}"/chroot/boot/vmlinuz-* \ + "${LIVE_ROOT}"/tftpboot/vmlinuz + cp "${LIVE_ROOT}"/chroot/boot/initrd.img-* \ + "${LIVE_ROOT}"/tftpboot/initrd.gz + ;; + esac +} + +Memtest () +{ + if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] + then + # Install memtest + Patch_network apply + chroots "apt-get install --yes memtest86+" + + case "$1" in + iso) + # Copy memtest + cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin \ + "${LIVE_ROOT}"/image/isolinux/memtest + ;; + + net) + # Copy memtest + cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin \ + "${LIVE_ROOT}"/tftpboot/memtest + ;; + esac + + # Remove memtest + chroots "apt-get remove --purge --yes memtest86+" + Patch_network deapply + fi +} + +Syslinux () +{ + if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] + then + # Install syslinux + Patch_network apply + chroots "apt-get install --yes syslinux" + + case "${1}" in + iso) + # Copy syslinux + mkdir -p "${LIVE_ROOT}"/image/isolinux + cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/image/isolinux + + # Install syslinux templates + cp -a "${LIVE_TEMPLATES}"/syslinux/* \ + "${LIVE_ROOT}"/image/isolinux + rm -f "${LIVE_ROOT}"/image/isolinux/pxelinux.cfg + + # Configure syslinux templates + sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/image/isolinux/isolinux.cfg + sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/image/isolinux/f1.txt + sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/image/isolinux/f10.txt + ;; + + net) + # Copy syslinux + mkdir -p "${LIVE_ROOT}"/tftpboot + cp "${LIVE_ROOT}"/chroot/usr/lib/syslinux/pxelinux.0 "${LIVE_ROOT}"/tftpboot + + # Install syslinux templates + mkdir -p "${LIVE_ROOT}"/tftpboot/pxelinux.cfg + cp -a "${LIVE_TEMPLATES}"/syslinux/* \ + "${LIVE_ROOT}"/tftpboot/pxelinux.cfg + mv "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/pxelinux.cfg "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default + rm -f "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.* + + # Configure syslinux templates + sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default + sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f1.txt + sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f10.txt + ;; + esac + + # Remove syslinux + chroots "apt-get remove --purge --yes syslinux" + Patch_network deapply + fi +} diff --git a/scripts/02-iso.sh b/scripts/02-iso.sh new file mode 100644 index 0000000..838b219 --- /dev/null +++ b/scripts/02-iso.sh @@ -0,0 +1,46 @@ +# scripts/02-iso.sh + +Iso () +{ + mkdir -p "${LIVE_ROOT}"/image/casper + + if [ "${LIVE_FILESYSTEM}" = "ext2" ] + then + DU_DIM="`du -ks ${LIVE_CHROOT} | cut -f1`" + REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here... + + genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 \ + \--root="${LIVE_CHROOT}" \ + "${LIVE_ROOT}"/image/casper/filesystem.ext2 + else + if [ -f "${LIVE_ROOT}"/image/casper/filesystem.squashfs ] + then + rm "${LIVE_ROOT}"/image/casper/filesystem.squashfs + fi + + if [ -z "${LIVE_VERBOSE}" ] + then + mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/image/casper/filesystem.squashfs + else + mksquashfs -info "${LIVE_CHROOT}" "${LIVE_ROOT}"/image/casper/filesystem.squashfs + fi + fi + + # Installing syslinux + Syslinux iso + + # Installing linux-image + Linuximage iso + + # Installing memtest + Memtest iso + + # Installing templates + cp -a "${LIVE_TEMPLATES}"/iso/* "${LIVE_ROOT}"/image + + # Calculating md5sums + md5sums + + # Creating image + mkisofss +} diff --git a/scripts/02-net.sh b/scripts/02-net.sh new file mode 100644 index 0000000..743d8b2 --- /dev/null +++ b/scripts/02-net.sh @@ -0,0 +1,38 @@ +# scripts/02-net.sh + +Net () +{ + # Installing smbfs + chroots "apt-get install --yes smbfs" + + if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] + then + # Configuring initramfs for NFS +cat >> "${LIVE_ROOT}"/chroot/etc/mkinitramfs/initramfs.conf << EOF +MODULES=netboot +BOOT=nfs +EOF + fi + + # Installing syslinux + Syslinux net + + # Installing linux-image + Linuximage net + + # Installing memtest + Memtest net + + if [ -z "${LIVE_VERBOSE}" ] + then + # Creating tarball + cd "${LIVE_ROOT}" && cd .. && \ + tar cfz netboot.tar.gz "${LIVE_ROOT}" && \ + mv netboot.tar.gz "${LIVE_ROOT}" + else + # Creating tarball (debug) + cd "${LIVE_ROOT}" && cd .. && \ + tar cfvz netboot.tar.gz "${LIVE_ROOT}" && \ + mv netboot.tar.gz "${LIVE_ROOT}" + fi +} |