- #!/bin/sh
- # FIXME: Rewrite all config_MANDATED options as functions
- # Resolve bootloaders and install targets
- syslinuxdev_host=''
- isolinuxdev_host=''
- grubdev_host=''
- lilodev_host=''
- partno=0
- for bootloader in $bootloaders; do
- let partno=$partno+1
- if [ $partno -gt 4 ]; then
- echo 'ERROR: No more than 4 bootloaders supported!' >&2
- exit 1
- fi
- case $bootloader in
- SYSLINUX)
- [ -n "$syslinuxdev_host" ] && continue
- syslinuxdev_host="$usbdev_host$partno"
- thisfs=''
- for fs in $selectable_filesystems; do
- case $fs in
- vfat|msdos)
- thisfs=$fs
- continue 2
- ;;
- esac
- done
- if [ -z "$thisfs" ]; then
- echo "ERROR: None of the selectable filesystems suitable for $bootloader"'!' >&2
- exit 1
- fi
- eval fs$partno=$thisfs
- ;;
- GRUB)
- [ -n "$grubdev_host" ] && continue
- grubdev_host="$usbdev_host$partno"
- let partno_grub=$partno-1 || partno_grub=0
- grubdev_grub="$usbdev_grub,$partno_grub"
- thisfs=''
- for fs in $selectable_filesystems; do
- case $fs in
- ext2|ext3|e2fs|e3fs|ext2fs|ext3fs)
- thisfs=e2fs
- continue 2
- ;;
- fat|vfat|dos)
- thisfs=fat
- continue 2
- ;;
- isofs)
- # FIXME: Do we need a specific 1st stage bootloader defined here as well?
- thisfs=$fs
- continue 2
- ;;
- jfs|reiserfs|xfs|minix)
- thisfs=$fs
- continue 2
- ;;
- esac
- done
- if [ -z "$thisfs" ]; then
- echo "ERROR: None of the selectable filesystems suitable for $bootloader"'!' >&2
- exit 1
- fi
- eval fs$partno=$thisfs
- ;;
- LILO|ISOLINUX)
- echo "ERROR: bootloader \"$bootloader\" not yet implemented"'!' >&2
- exit 1
- ;;
- *)
- echo "ERROR: Unknown bootloader \"$bootloader\""'!' >&2
- exit 1
- ;;
- esac
- done
- # TODO: Loop through all possible bootloaders instead of checking only these two
- if [ -n "$grubdev_host" ] && [ -n "$syslinuxdev_host" ]; then
- MULTIPLE_BOOTLOADERS="yes"
- fi
- if [ "$MULTIPLE_BOOTLOADERS" = "yes" ]; then
- MBR="yes"
- fi
- if [ -z "$grubdev_host$syslinuxdev_host$isolinuxdev_host$lilodev_host" ]; then
- echo 'ERROR: No bootloader defined!' >&2
- exit 1
- fi
- if [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" != "isofs" ]; then
- INCOMPATIBLE_FS="yes"
- fi
- bootdev_host="${usbdev_host}1"
- # FIXME: Set rootdev to dev of highest priority bootloader matching ROOTFS
- if [ "$MULTIPLE_BOOTLOADERS" = "yes" ] || [ "$INCOMPATIBLE_FS" = "yes" ]; then
- rootdev_host="${usbdev_host}2"
- rootdev_target="${usbdev_target}2"
- else
- rootdev_host="${usbdev_host}1"
- rootdev_target="${usbdev_target}1"
- fi
- if [ "$FLASHYBRID" = "yes" ] && [ "$ROOTFS" = "isofs" ]; then
- echo 'ERROR: FLASHYBRID requires a writable root filesystem!' >&2
- exit 1
- fi
- # FIXME: Support rolling the prepared system into a read-only ISO
- # filesystem instead of using flashybrid
- if [ "$ROOTFS" = "isofs" ]; then
- echo 'ERROR: isofs root filesystem is not yet supported!' >&2
- exit 1
- fi
- debootstrap_excludes="lilo,ipchains,pcmcia-cs,ppp,pppoe,pppoeconf,pppconfig,syslinux,logrotate,mailx,at,makedev,wget"
- debootstrap_excludes="$debootstrap_excludes,nvi,base-config,cron,ed,fdutils,gettext-base,groff-base,info,iptables,man-db,manpages,nano,tasksel,telnet,apt-utils"
- debootstrap_excludes="$debootstrap_excludes,bsdmainutils"
- #debootstrap_excludes="$debootstrap_excludes,klogd,sysklogd"
- debootstrap_excludes="$debootstrap_excludes,libpcap0.7"
- debootstrap_excludes="$debootstrap_excludes,libtextwrap1,libdb4.2,console-common"
- debootstrap_excludes="$debootstrap_excludes,console-data,console-tools,libconsole"
- # Save space by dropping MTA
- debootstrap_excludes="$debootstrap_excludes,exim,exim4-base,exim4,exim4-config,exim4-daemon-light,libopencdk8,libpcre3,libtasn1-2,libgcrypt11,libgcrypt7,libgdbm3,libgnutls10,libgnutls11,libgpg-error0,liblockfile1,liblzo1"
- # Save space by dropping debconf i18n support
- # (also allows to avoid logrotate - nasty to configure for r/o systems!)
- #debootstrap_excludes="$debootstrap_excludes,debconf-i18n,liblocale-gettext-perl,libtext-charwidth-perl,libtext-iconv-perl,libtext-wrapi18n-perl"
- #debootstrap_includes="debconf-english"
- ## FIXME: debootstrap currently broken and cannot include debconf-english,
- ## so do that as regular aptitude run within 1_makerootfs.sh.
- debootstrap_excludes="$debootstrap_excludes,liblocale-gettext-perl,libtext-charwidth-perl,libtext-iconv-perl,libtext-wrapi18n-perl"
- #debootstrap_excludes="$debootstrap_excludes,debconf-i18n"
- #debootstrap_includes="debconf-english"
- # Alternative DHCP client implementations
- debootstrap_excludes="$debootstrap_excludes,dhcp-client"
- case $DHCPCLIENT in
- dhcp3)
- aptitude_dhcpclient_install="dhcp3-client"
- ;;
- udhcpc)
- aptitude_dhcpclient_install="udhcpc"
- ;;
- *)
- echo "ERROR: Unknown dhcp client \"$DHCPCLIENT\""'!' >&2
- exit 1
- ;;
- esac
- [ -n "$grubdev_host" ] && aptitude_install="$aptitude_install grub"
- [ "$FLASHYBRID" = "yes" ] && aptitude_install="$aptitude_install flashybrid"
- if [ "$diskfs" = "nfs" ] || [ "$pubfs" = "nfs" ]; then
- aptitude_install="$aptitude_install nfs-common"
- fi
- # Kernel modules to install into the initrd
- modules_install="usb-storage sd_mod scsi_mod uhci uhci-hcd ehci-hcd usbcore"
- #modules_install="$modules_install vfat nls_cp437 msdos fat"
|