'>summaryrefsloglogtree'>commit'>diffstats
diff options
context:
space:
mode:
authorFlorent Neveu (Captain) <captain@else-projects.org>2007-12-01 18:10:28 +0100
committerCaptain <captain@else-projects.org>2007-12-01 18:10:28 +0100
commit444ae82e7bb73a7340eb04309f02d2a8102be91f ( (patch)
tree'>295b70264c7a1d4a3234df0b9481e837aaa8081d
parent'>Elsinstall : format setup.sh script alias ('>diff)
downloadpfe-basile.tar.gz
Elsinstall : add boot_else_custom and is alias on setup.shbasile
l---------rimelse/elsinstall/boot_else_custom1
-rwxr-xr-xrimelse/elsinstall/script.sh103
2 files changed, 104 insertions, 0 deletions
diff --git a/rimelse/elsinstall/boot_else_custom b/rimelse/elsinstall/boot_else_custom
new file mode 120000
index 0000000..0231def
--- /dev/null
+++ b/rimelse/elsinstall/boot_else_custom
@@ -0,0 +1 @@
+script.sh \ No newline at end of file
diff --git a/rimelse/elsinstall/script.sh b/rimelse/elsinstall/script.sh
index c72c9a2..b227f78 100755
--- a/rimelse/elsinstall/script.sh
+++ b/rimelse/elsinstall/script.sh
@@ -46,6 +46,18 @@ TMP_MOUNT_POINT=""
#PATH_RIMELSE="/data/ELSE/else_compil/cross/current"
PATH_RIMELSE=""
+# ELSE TEMPORARY directory
+#ELSE_TMP_DIR="/tmp"
+ELSE_TMP_DIR="/tmp/rimelse_\$(date +%Y%m%d).gz"
+
+# Internet download commande
+#INTERNET_DL_CMD="wget"
+INTERNET_DL_CMD=""
+
+# *** boot else custom configuration ***
+#BOOT_CUSTOM_SRC_FILES_PATH="http://download.else-projects.org:/boot"
+BOOT_CUSTOM_SRC_FILES_PATH="http://download.else-projects.org:/boot"
+
# *** bootbase configuration ***
# Bootbase name (the initrd)
# change to match your /boot/grub/grub.conf
@@ -83,6 +95,97 @@ function out ()
{
sync
umount ${TMP_MOUNT_POINT} || die "umount failed"
+ [ -d "${ELSE_TMP_DIR}" ] && rm -rf ${ELSE_TMP_DIR}
+}
+
+function boot_else_custom ()
+{
+ [ -z "DEVICE_PATH" ] && missing_conf DEVICE_PATH
+ [ -z "DEVICE_BOOT_PART_NB" ] && missing_conf DEVICE_BOOT_PART_NB
+ [ -z "TMP_MOUNT_POINT" ] && missing_conf TMP_MOUNT_POINT
+ [ -z "BOOT_CUSTOM_SRC_FILES_PATH" ] && missing_conf BOOT_CUSTOM_SRC_FILES_PATH
+
+ # Some cheking before doing l'ankou (lélé)
+ check_exist ${DEVICE_PATH}
+ check_exist ${DEVICE_PATH}${DEVICE_BOOT_PART_NB}
+ check_exist ${TMP_MOUNT_POINT}
+
+ # Make temporary directory
+ BOOT_TMP_DIR=${ELSE_TMP_DIR}/boot
+ mkdir -p ${BOOT_TMP_DIR} || die "Unable to make temporary directory"
+
+ # change to temporary directory
+ cd ${BOOT_TMP_DIR} || \
+ die "Unable to change to temporary directory"
+
+ # if there is an argument copy or extract to temporary dir
+ if [ $# -eq 1 ]
+ then
+ : # extract if need
+ else
+ [ -z "INTERNET_DL_CMD" ] && missing_conf INTERNET_DL_CMD
+ # get datas for internet
+ ${INTERNET_DL_CMD} ${BOOT_CUSTOM_SRC_FILES_PATH}/kernel_else || \
+ die "download kernel_else from ${BOOT_CUSTOM_SRC_FILES_PATH} failed"
+
+ ${INTERNET_DL_CMD} ${BOOT_CUSTOM_SRC_FILES_PATH}/bootbase_else.gz || \
+ die "download kernel_else from ${BOOT_CUSTOM_SRC_FILES_PATH} failed"
+
+ ${INTERNET_DL_CMD} ${BOOT_CUSTOM_SRC_FILES_PATH}/grub.conf || \
+ die "download kernel_else from ${BOOT_CUSTOM_SRC_FILES_PATH} failed"
+
+ ${INTERNET_DL_CMD} ${BOOT_CUSTOM_SRC_FILES_PATH}/else.xpm.gz || \
+ die "download kernel_else from ${BOOT_CUSTOM_SRC_FILES_PATH} failed"
+
+ fi
+
+ # Mount device
+ mount ${DEVICE_PATH}${DEVICE_BOOT_PART_NB} ${TMP_MOUNT_POINT} || \
+ die "mount failed"
+
+ # change to boot
+ cd ${TMP_MOUNT_POINT}/boot/ || \
+ die "Unable to change to boot directory"
+
+ # install kernel
+ cp ${BOOT_TMP_DIR}/kernel_else ${TMP_MOUNT_POINT}/boot/ || \
+ die "Unable to copy kernel on RIM device "
+
+ ln -s kernel_else vmlinuz
+
+ # install bootbase
+ cp ${BOOT_TMP_DIR}/bootbase_else.gz ${TMP_MOUNT_POINT}/boot/ || \
+ die "Unable to copy bootbase on RIM device "
+
+ ln -s bootbase_else.gz bootbase
+
+ # install bootsplash
+ mkdir ${TMP_MOUNT_POINT}/boot/grub/splash || \
+ die "Unable to make grub splash directory"
+
+ cp ${BOOT_TMP_DIR}/else.xpm.gz ${TMP_MOUNT_POINT}/boot/grub/splash \
+ || die "Unable to copy grub splash on RIM device "
+
+ # install grub.conf
+ cd ${TMP_MOUNT_POINT}/boot/grub || \
+ die "Unable to change to grub directory"
+
+ cp ${BOOT_TMP_DIR}/grub.conf ${TMP_MOUNT_POINT}/boot/grub || \
+ die "Unable to copy grub configuration on RIM device "
+
+ ln -s grub.conf menu.lst
+
+ # set grub.conf
+ GRUB_BOOT_PART_NB=$((${DEVICE_BOOT_PART_NB}-1))
+ sed -i -e s/DEVICE_BOOT_PART_NB/${GRUB_BOOT_PART_NB}/g \
+ ${TMP_MOUNT_POINT}/boot/grub/grub.conf
+
+ # change to an other directory
+ cd
+
+ # end
+ out
+
}
function mk_bootbase ()