summaryrefslogtreecommitdiff
path: root/config-MANDATED
blob: 8d78323310a0ca7a6a743a280356d888e985f69b (plain)
  1. #!/bin/sh
  2. # FIXME: Rewrite all config_MANDATED options as functions
  3. # Resolve bootloaders and install targets
  4. syslinuxdev_host=''
  5. isolinuxdev_host=''
  6. grubdev_host=''
  7. lilodev_host=''
  8. partno=0
  9. for bootloader in $bootloaders; do
  10. let partno=$partno+1
  11. if [ $partno -gt 4 ]; then
  12. echo 'ERROR: No more than 4 bootloaders supported!' >&2
  13. exit 1
  14. fi
  15. case $bootloader in
  16. SYSLINUX)
  17. [ -n "$syslinuxdev_host" ] && continue
  18. syslinuxdev_host="$usbdev_host$partno"
  19. thisfs=''
  20. for fs in $selectable_filesystems; do
  21. case $fs in
  22. vfat|msdos)
  23. thisfs=$fs
  24. continue 2
  25. ;;
  26. esac
  27. done
  28. if [ -z "$thisfs" ]; then
  29. echo "ERROR: None of the selectable filesystems suitable for $bootloader"'!' >&2
  30. exit 1
  31. fi
  32. eval fs$partno=$thisfs
  33. ;;
  34. GRUB)
  35. [ -n "$grubdev_host" ] && continue
  36. grubdev_host="$usbdev_host$partno"
  37. let partno_grub=$partno-1 || partno_grub=0
  38. grubdev_grub="$usbdev_grub,$partno_grub"
  39. thisfs=''
  40. for fs in $selectable_filesystems; do
  41. case $fs in
  42. ext2|ext3|e2fs|e3fs|ext2fs|ext3fs)
  43. thisfs=e2fs
  44. continue 2
  45. ;;
  46. fat|vfat|dos)
  47. thisfs=fat
  48. continue 2
  49. ;;
  50. isofs)
  51. # FIXME: Do we need a specific 1st stage bootloader defined here as well?
  52. thisfs=$fs
  53. continue 2
  54. ;;
  55. jfs|reiserfs|xfs|minix)
  56. thisfs=$fs
  57. continue 2
  58. ;;
  59. esac
  60. done
  61. if [ -z "$thisfs" ]; then
  62. echo "ERROR: None of the selectable filesystems suitable for $bootloader"'!' >&2
  63. exit 1
  64. fi
  65. eval fs$partno=$thisfs
  66. ;;
  67. LILO|ISOLINUX)
  68. echo "ERROR: bootloader \"$bootloader\" not yet implemented"'!' >&2
  69. exit 1
  70. ;;
  71. *)
  72. echo "ERROR: Unknown bootloader \"$bootloader\""'!' >&2
  73. exit 1
  74. ;;
  75. esac
  76. done
  77. # TODO: Loop through all possible bootloaders instead of checking only these two
  78. if [ -n "$grubdev_host" ] && [ -n "$syslinuxdev_host" ]; then
  79. MULTIPLE_BOOTLOADERS="yes"
  80. fi
  81. if [ "$MULTIPLE_BOOTLOADERS" = "yes" ]; then
  82. MBR="yes"
  83. fi
  84. if [ -z "$grubdev_host$syslinuxdev_host$isolinuxdev_host$lilodev_host" ]; then
  85. echo 'ERROR: No bootloader defined!' >&2
  86. exit 1
  87. fi
  88. if [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" != "isofs" ]; then
  89. INCOMPATIBLE_FS="yes"
  90. fi
  91. bootdev_host="${usbdev_host}1"
  92. # FIXME: Set rootdev to dev of highest priority bootloader matching ROOTFS
  93. if [ "$MULTIPLE_BOOTLOADERS" = "yes" ] || [ "$INCOMPATIBLE_FS" = "yes" ]; then
  94. rootdev_host="${usbdev_host}2"
  95. rootdev_target="${usbdev_target}2"
  96. else
  97. rootdev_host="${usbdev_host}1"
  98. rootdev_target="${usbdev_target}1"
  99. fi
  100. if [ "$FLASHYBRID" = "yes" ] && [ "$ROOTFS" = "isofs" ]; then
  101. echo 'ERROR: FLASHYBRID requires a writable root filesystem!' >&2
  102. exit 1
  103. fi
  104. # FIXME: Support rolling the prepared system into a read-only ISO
  105. # filesystem instead of using flashybrid
  106. if [ "$ROOTFS" = "isofs" ]; then
  107. echo 'ERROR: isofs root filesystem is not yet supported!' >&2
  108. exit 1
  109. fi
  110. debootstrap_excludes="lilo,ipchains,pcmcia-cs,ppp,pppoe,pppoeconf,pppconfig,syslinux,logrotate,mailx,at,makedev,wget"
  111. debootstrap_excludes="$debootstrap_excludes,nvi,base-config,cron,ed,fdutils,gettext-base,groff-base,info,iptables,man-db,manpages,nano,tasksel,telnet,apt-utils"
  112. debootstrap_excludes="$debootstrap_excludes,bsdmainutils"
  113. #debootstrap_excludes="$debootstrap_excludes,klogd,sysklogd"
  114. debootstrap_excludes="$debootstrap_excludes,libpcap0.7"
  115. debootstrap_excludes="$debootstrap_excludes,libtextwrap1,libdb4.2,console-common"
  116. debootstrap_excludes="$debootstrap_excludes,console-data,console-tools,libconsole"
  117. # Save space by dropping MTA
  118. 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"
  119. # Save space by dropping debconf i18n support
  120. # (also allows to avoid logrotate - nasty to configure for r/o systems!)
  121. #debootstrap_excludes="$debootstrap_excludes,debconf-i18n,liblocale-gettext-perl,libtext-charwidth-perl,libtext-iconv-perl,libtext-wrapi18n-perl"
  122. #debootstrap_includes="debconf-english"
  123. ## FIXME: debootstrap currently broken and cannot include debconf-english,
  124. ## so do that as regular aptitude run within 1_makerootfs.sh.
  125. debootstrap_excludes="$debootstrap_excludes,liblocale-gettext-perl,libtext-charwidth-perl,libtext-iconv-perl,libtext-wrapi18n-perl"
  126. #debootstrap_excludes="$debootstrap_excludes,debconf-i18n"
  127. #debootstrap_includes="debconf-english"
  128. # Alternative DHCP client implementations
  129. debootstrap_excludes="$debootstrap_excludes,dhcp-client"
  130. case $DHCPCLIENT in
  131. dhcp3)
  132. aptitude_dhcpclient_install="dhcp3-client"
  133. ;;
  134. udhcpc)
  135. aptitude_dhcpclient_install="udhcpc"
  136. ;;
  137. *)
  138. echo "ERROR: Unknown dhcp client \"$DHCPCLIENT\""'!' >&2
  139. exit 1
  140. ;;
  141. esac
  142. [ -n "$grubdev_host" ] && aptitude_install="$aptitude_install grub"
  143. [ "$FLASHYBRID" = "yes" ] && aptitude_install="$aptitude_install flashybrid"
  144. if [ "$diskfs" = "nfs" ] || [ "$pubfs" = "nfs" ]; then
  145. aptitude_install="$aptitude_install nfs-common"
  146. fi
  147. # Kernel modules to install into the initrd
  148. modules_install="usb-storage sd_mod scsi_mod uhci uhci-hcd ehci-hcd usbcore"
  149. #modules_install="$modules_install vfat nls_cp437 msdos fat"