summaryrefslogtreecommitdiff
path: root/3_configure.sh
blob: c88ca2a0338537c566738ec53bd5bc1f43a7f3dd (plain)
  1. #!/bin/sh
  2. set -e
  3. . ./common-settings || exit 1
  4. . ./common-functions || exit 1
  5. # Check if already installed
  6. #if ! ./chroot.sh grep -q 'root::' "/etc/shadow"; then
  7. # echo 'ERROR: rootfd already (halfway?) configured!' >&2
  8. # exit 1
  9. #fi
  10. # Install MBR, GRUB and SYSLINUX
  11. [ -n "$grubdev_host" ] && mkgrubdevmap "$usbdev_host" >"$baseworkdir/grub_host_device.map"
  12. if [ "$MBR" = "yes" ]; then
  13. [ "$MBR" = "yes" ] && install-mbr "$usbdev_host"
  14. # [ -n "$syslinuxdev_host" ] && syslinux "$bootdev_host"
  15. [ -n "$syslinuxdev_host" ] && makebootfat -o "$syslinuxdev_host" -Y -P -b /usr/lib/syslinux/ldlinux.bss -c /usr/lib/syslinux/ldlinux.sys "$targettemp_fat"
  16. [ -n "$grubdev_host" ] && echo -e "root ($grubdev_grub)\nsetup ($grubdev_grub)" | grub --batch --device-map="$baseworkdir/grub_host_device.map"
  17. elif [ -n "$grubdev_host" ]; then
  18. echo -e "root ($grubdev_grub)\nsetup ($usbdev_grub)" | grub --batch --device-map="$baseworkdir/grub_host_device.map"
  19. elif [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" = "ext2" ]; then
  20. makebootfat -o "$syslinuxdev_host" -X -P -b /usr/lib/syslinux/ldlinux.bss -c /usr/lib/syslinux/ldlinux.sys "$targettemp_fat"
  21. elif [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" = "dos" ]; then
  22. # This should make sticks be recognized as both USB-FDD and USB-HDD.
  23. # (VIA EPIA mobos will boot only as USB-ZIP, however :-( )
  24. makebootfat -o "$usbdev_host" -Y -Z -D -b /usr/lib/syslinux/ldlinux.bss -m /usr/lib/makebootfat/mbrfat.bin -F -c /usr/lib/syslinux/ldlinux.sys "$targettemp_isofs"
  25. elif [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" = "iso" ]; then
  26. # This should make sticks be recognized as both USB-FDD and USB-HDD.
  27. # (VIA EPIA mobos will boot only as USB-ZIP, however :-( )
  28. makebootfat -o "$usbdev_host" -Y -Z -D -b /usr/lib/syslinux/ldlinux.bss -m /usr/lib/makebootfat/mbrfat.bin -F -c /usr/lib/syslinux/ldlinux.sys "$targettemp_isofs"
  29. else
  30. echo "WARNING: Sorry: don't know how to handle this choice of bootloaders." >&2
  31. exit 1
  32. fi
  33. # Tweak /etc/passwd to sanity
  34. ./chroot.sh shadowconfig on
  35. ./chroot.sh passwd root
  36. # FIXME: move this to configure.d/net plugin
  37. echo "Creating SSH2 RSA/DSA keys; this may take some time ..."
  38. echo "NB! Please just hit enter to the following questions..."
  39. ./chroot.sh ssh-keygen -q -f "/etc/ssh/ssh_host_rsa_key" -t rsa #-N ""
  40. ./chroot.sh ssh-keygen -q -f "/etc/ssh/ssh_host_dsa_key" -t dsa #-N ""
  41. echo 'Done configuring rootfs!'