summaryrefslogtreecommitdiff
path: root/3_configure.sh
diff options
context:
space:
mode:
authorjonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e>2006-06-10 18:18:37 +0000
committerjonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e>2006-06-10 18:18:37 +0000
commitb6d85b04286d30498a11aaac36e75032b1e72801 (patch)
tree2fc597a2ae2cf69a5cc6b3e7162f02f89613b08d /3_configure.sh
parent369cb1e5a343ec9e7c6f05de64f0eb102488d77f (diff)
Added all work so far...
git-svn-id: svn+ssh://xayide/home/jonas/private_svn/fleshybrid/trunk@2 8f53b18a-e215-0410-8885-9f593d34873e
Diffstat (limited to '3_configure.sh')
-rwxr-xr-x3_configure.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/3_configure.sh b/3_configure.sh
new file mode 100755
index 0000000..af63fa2
--- /dev/null
+++ b/3_configure.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+. ./config-DEFAULTS || exit 1
+. ./config-HOST || exit 1
+. ./config-TARGET || exit 1
+. ./config-MANDATED || exit 1
+. ./functions || exit 1
+
+# Check if already installed
+if ! ./chroot.sh grep -q 'root::' "/etc/passwd"; then
+ echo 'ERROR: rootfd already (halfway?) configured!' >&2
+ exit 1
+fi
+
+# Install MBR, GRUB and SYSLINUX
+[ -n "$grubdev_host" ] && mkgrubdevmap "$usbdev_host" >>"$baseworkdir/grub_host_device.map"
+if [ "$MBR" = "yes" ]; then
+ [ "$MBR" = "yes" ] && install-mbr "$usbdev_host"
+# [ -n "$syslinuxdev_host" ] && syslinux "$bootdev_host"
+ [ -n "$syslinuxdev_host" ] && makebootfat -o "$syslinuxdev_host" -X -P -b /usr/lib/syslinux/ldlinux.bss -c /usr/lib/syslinux/ldlinux.sys "$targettemp_fat"
+ [ -n "$grubdev_host" ] && echo -e "root ($grubdev_grub)\nsetup ($grubdev_grub)" | grub --batch --device-map="$baseworkdir/grub_host_device.map"
+elif [ -n "$grubdev_host" ]; then
+ echo -e "root ($grubdev_grub)\nsetup ($usbdev_grub)" | grub --batch --device-map="$baseworkdir/grub_host_device.map"
+elif [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" = "ext2fs" ]; then
+ makebootfat -o "$syslinuxdev_host" -X -P -b /usr/lib/syslinux/ldlinux.bss -c /usr/lib/syslinux/ldlinux.sys "$targettemp_fat"
+elif [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" = "dosfs" ]; then
+ # This should make sticks be recognized as both USB-FDD and USB-HDD.
+ # (VIA EPIA mobos will boot only as USB-ZIP, however :-( )
+ makebootfat -o "$usbdev_host" -X -D -b /usr/lib/syslinux/ldlinux.bss -m /usr/lib/makebootfat/mbrfat.bin -F -c /usr/lib/syslinux/ldlinux.sys "$targettemp_isofs"
+elif [ -n "$syslinuxdev_host" ] && [ "$ROOTFS" = "isofs" ]; then
+ # This should make sticks be recognized as both USB-FDD and USB-HDD.
+ # (VIA EPIA mobos will boot only as USB-ZIP, however :-( )
+ makebootfat -o "$usbdev_host" -X -D -b /usr/lib/syslinux/ldlinux.bss -m /usr/lib/makebootfat/mbrfat.bin -F -c /usr/lib/syslinux/ldlinux.sys "$targettemp_isofs"
+else
+ echo "WARNING: Sorry: don't know how to handle this choice of bootloaders." >&2
+ exit 1
+fi
+
+# Tweak /etc/passwd to sanity
+./chroot.sh shadowconfig on
+./chroot.sh passwd root
+echo "Creating SSH2 RSA/DSA keys; this may take some time ..."
+./chroot.sh ssh-keygen -q -f "/etc/ssh/ssh_host_rsa_key" -t rsa #-N ""
+./chroot.sh ssh-keygen -q -f "/etc/ssh/ssh_host_dsa_key" -t dsa #-N ""
+
+echo 'Done configuring rootfs!'