]> spindle.queued.net Git - xodist/commitdiff
initial installer support (no, it doesn't do anything interesting yet)
authorAndres Salomon <dilinger@collabora.co.uk>
Tue, 2 Jun 2009 23:02:17 +0000 (19:02 -0400)
committerAndres Salomon <dilinger@collabora.co.uk>
Tue, 2 Jun 2009 23:02:17 +0000 (19:02 -0400)
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
installer [new file with mode: 0755]
mkchroot.sh
mkext3.sh

diff --git a/installer b/installer
new file mode 100755 (executable)
index 0000000..f9d6d91
--- /dev/null
+++ b/installer
@@ -0,0 +1,40 @@
+#!/bin/sh -e
+
+PREREQS=""
+
+prereqs()
+{
+       echo "$PREREQS"
+}
+
+case "$1" in
+       prereqs)
+               prereqs
+               exit 0
+       ;;
+esac
+
+do_install()
+{
+       echo
+       echo
+       echo "Triggering installer!"
+       ROOT_SRC=$(grep ' /root ' /proc/mounts | cut -d' ' -f1)
+       ROOT_SRC=$(readlink -f $ROOT_SRC)
+
+       echo "root src: $ROOT_SRC"
+       [ -d /root/etc ] || {
+               echo "Error: /root doesn't appear to have a valid filesystem mounted!"
+               exit 1
+       }
+
+}
+
+for x in $(cat /proc/cmdline); do
+       case $x in
+       installer)
+               do_install
+               ;;
+       esac
+done
+
index df9d8e7e2a414630f2df89c520da31fe71518dd6..e1cb6bb2b8356c09981a2277d97cd8277c424e3a 100755 (executable)
@@ -140,6 +140,10 @@ EOF
 # set the default locale
 echo "${IMG_LOCALE}" >${ROOT_DIR}/etc/locale.gen
 
+# add support for installation onto a block device
+mkdir -p ${ROOT_DIR}/etc/initramfs-tools/scripts/local-bottom
+cp installer ${ROOT_DIR}/etc/initramfs-tools/scripts/local-bottom/
+
 # run any customizations necessary pre-package install
 customize_chroot_hook "$ROOT_DIR"
 
index 677391c35685da3f8bde25643b9782e8e280e783..8d8532477cf0b5a09ec512b9f9e3f45bcafb398a 100755 (executable)
--- a/mkext3.sh
+++ b/mkext3.sh
@@ -94,6 +94,7 @@ default 0
 timeout 5
 color cyan/blue white/blue
 EOF
+       installer_added=0
        label=`sed -ne 's/^LABEL=\(.\+\)[[:space:]]\+\/[[:space:]]\+.*/\1/p' configs/${CONFIG_TYPE}/fstab-ext3`
        prefix=
        grep -q ' ${mntpt}/boot ' /proc/mounts && prefix=/boot
@@ -111,6 +112,18 @@ kernel             ${prefix}/vmlinuz-${v} root=LABEL=${label} ro
 initrd         ${prefix}/initrd.img-${v}
 boot
 EOF
+               if [ "$installer_added" = "0" ]; then
+                       installer_added=1
+                       cat >>${mntpt}/boot/grub/menu.lst<<EOF
+
+title           Debian GNU/Linux Installer
+root            (hd0,0)
+kernel          ${prefix}/vmlinuz-${v} root=LABEL=${label} ro installer
+initrd          ${prefix}/initrd.img-${v}
+boot
+EOF
+               fi
+
        done
 
        # grub-install is pretty broken, so we do this manually