From: Andres Salomon Date: Tue, 2 Jun 2009 23:02:17 +0000 (-0400) Subject: initial installer support (no, it doesn't do anything interesting yet) X-Git-Tag: v0.6~48 X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c21aa494c7c8a12cc93c2f4314033be8ce7e03f5;p=xodist initial installer support (no, it doesn't do anything interesting yet) Signed-off-by: Andres Salomon --- diff --git a/installer b/installer new file mode 100755 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 + diff --git a/mkchroot.sh b/mkchroot.sh index df9d8e7..e1cb6bb 100755 --- a/mkchroot.sh +++ b/mkchroot.sh @@ -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" diff --git a/mkext3.sh b/mkext3.sh index 677391c..8d85324 100755 --- 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<