summaryrefslogtreecommitdiff
path: root/package/installer
diff options
context:
space:
mode:
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>2012-03-20 18:54:07 +0100
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>2012-03-20 18:54:07 +0100
commita9eb63c94f02dea45167719da7ea75f1ef539191 (patch)
treedde5807e64dff86d58d1e43d273f280a3d4685b4 /package/installer
parent28bfc5688a1a016bef4a001a5bc2a7f7703b1f85 (diff)
add simple lemote disk installer
Diffstat (limited to 'package/installer')
-rw-r--r--package/installer/Makefile26
-rwxr-xr-xpackage/installer/src/installer61
2 files changed, 87 insertions, 0 deletions
diff --git a/package/installer/Makefile b/package/installer/Makefile
new file mode 100644
index 000000000..5866a9629
--- /dev/null
+++ b/package/installer/Makefile
@@ -0,0 +1,26 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= installer
+PKG_VERSION:= 1.0
+PKG_RELEASE:= 1
+PKG_DESCR:= OpenADK disk installer
+PKG_SECTION:= base
+
+WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,INSTALLER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:= manual
+BUILD_STYLE:= manual
+INSTALL_STYLE:= manual
+
+do-install:
+ $(INSTALL_BIN) ./src/installer $(IDIR_INSTALLER)/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/installer/src/installer b/package/installer/src/installer
new file mode 100755
index 000000000..fd45c443c
--- /dev/null
+++ b/package/installer/src/installer
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+create_bootcfg() {
+ cat << FOO > /mnt/boot/boot.cfg
+default 0
+timeout 2
+showmenu 1
+title OpenADK
+ kernel (wd0,0)/boot/kernel
+ args root=/dev/sda1
+
+title USB
+ kernel (usb0,0)/boot/kernel
+ args root=/dev/sdc1
+FOO
+
+}
+
+disk_install() {
+ mke2fs -q -j /dev/sda1
+ sync
+ sleep 2
+ mount -t ext4 /dev/sda1 /mnt
+ tar xzvf /lemote-yeelong-eglibc-archive+kernel.tar.gz -C /mnt
+ test -x /mnt/usr/bin/sudo && chmod u+s /mnt/usr/bin/sudo
+ test -x /mnt/usr/bin/Xorg && chmod u+s /mnt/usr/bin/Xorg
+ create_bootcfg
+ umount /mnt
+
+}
+
+. /etc/functions.sh
+echo 0 > /proc/sys/kernel/printk
+
+load_modules /etc/modules
+for f in /etc/modules.d/*; do
+ [[ -e $f ]] && load_modules /etc/modules.d/*
+ break
+done
+
+echo " ___ _ ____ _ __ "
+echo " / _ \ _ __ ___ _ __ / \ | _ \| |/ / "
+echo "| | | | '_ \ / _ \ '_ \ / _ \ | | | | ' / "
+echo "| |_| | |_) | __/ | | |/ ___ \| |_| | . \ "
+echo " \___/| .__/ \___|_| |_/_/ \_\____/|_|\_\ "
+echo " |_| "
+echo ""
+# settle down, after module load
+sleep 2
+echo "Should I install OpenADK to disk (y/n)"
+read answer
+if [ "$answer" = "y" ];then
+ disk_install
+fi
+echo "Should I reboot now (y/n)"
+read answer
+if [ "$answer" = "y" ];then
+ reboot
+else
+ exit
+fi