summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/adkinstall/Makefile5
-rw-r--r--package/adkinstall/src/adkinstall.foxg203
-rw-r--r--package/adkinstall/src/adkinstall.yeelong59
3 files changed, 65 insertions, 2 deletions
diff --git a/package/adkinstall/Makefile b/package/adkinstall/Makefile
index cb2d8002c..6aae012f8 100644
--- a/package/adkinstall/Makefile
+++ b/package/adkinstall/Makefile
@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
PKG_NAME:= adkinstall
PKG_VERSION:= 1.0
-PKG_RELEASE:= 8
+PKG_RELEASE:= 9
PKG_DESCR:= openadk installer
PKG_SECTION:= base
PKG_DEPENDS:= parted sfdisk e2fsprogs
@@ -33,6 +33,9 @@ ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB532),y)
else ifeq ($(ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20),y)
${INSTALL_BIN} ./src/adkinstall.foxg20 \
$(IDIR_ADKINSTALL)/sbin/adkinstall
+else ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
+ ${INSTALL_BIN} ./src/adkinstall.yeelong \
+ $(IDIR_ADKINSTALL)/sbin/adkinstall
else ifeq ($(ADK_TARGET_SYSTEM_MIKROTIK_RB411),y)
${INSTALL_BIN} ./src/adkinstall.rb4xx \
$(IDIR_ADKINSTALL)/sbin/adkinstall
diff --git a/package/adkinstall/src/adkinstall.foxg20 b/package/adkinstall/src/adkinstall.foxg20
index 61ab65d9d..99cd899f4 100644
--- a/package/adkinstall/src/adkinstall.foxg20
+++ b/package/adkinstall/src/adkinstall.foxg20
@@ -24,8 +24,9 @@ parted -s /dev/mmcblk0 set 1 boot on
sfdisk --change-id /dev/mmcblk0 3 88 >/dev/null 2>&1
sleep 2
sync
-printf "Creating ext2 filesystem\n"
+printf "Creating vfat filesystem\n"
mkfs.vfat /dev/mmcblk0p1 >/dev/null 2>&1
+printf "Creating ext2 filesystem\n"
mke2fs /dev/mmcblk0p2 >/dev/null 2>&1
tune2fs -c0 -i0 /dev/mmcblk0p2 >/dev/null 2>&1
mount -t ext2 /dev/mmcblk0p2 /mnt
diff --git a/package/adkinstall/src/adkinstall.yeelong b/package/adkinstall/src/adkinstall.yeelong
new file mode 100644
index 000000000..b6735ec54
--- /dev/null
+++ b/package/adkinstall/src/adkinstall.yeelong
@@ -0,0 +1,59 @@
+#!/bin/sh
+# installs a rootfs tar archive from OpenADK onto a disk
+# lemote yeelong specific installer
+
+check_exit() {
+ if [ $? -ne 0 ];then
+ echo "Installation failed."
+ exit 1
+ fi
+}
+
+if [ -z $1 ];then
+ printf "Please give your root tar archive as parameter\n"
+ exit 1
+fi
+
+printf "Creating partitions ...\n"
+parted -s /dev/sda mklabel msdos
+check_exit
+sleep 2
+maxsize=$(env LC_ALL=C parted /dev/sda -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
+rootsize=$(($maxsize-2))
+start=0
+rootp=1
+cfgfsp=2
+
+parted -s /dev/sda unit cyl mkpart primary ext2 $start $rootsize
+check_exit
+mke2fs -q /dev/sda1
+check_exit
+parted -s /dev/sda unit cyl mkpart primary fat32 $rootsize $maxsize
+check_exit
+parted -s /dev/sda set $rootp boot on
+check_exit
+sfdisk --change-id /dev/sda $cfgfsp 88 >/dev/null 2>&1
+check_exit
+# settle down
+sleep 2
+mount -t ext2 /dev/sda$rootp /mnt
+check_exit
+printf "Extracting install archive ...\n"
+tar -C /mnt -xzpf $1
+check_exit
+chmod 1777 /mnt/tmp
+chmod 4755 /mnt/bin/busybox
+
+cat << EOF > /mnt/boot/boot.cfg
+default 0
+timeout 3
+showmenu 1
+title OpenADK
+ kernel (wd0,0)/boot/kernel
+ args root=/dev/sda1 ro panic=10
+}
+EOF
+
+umount /mnt
+printf "Successfully installed. You can reboot now.\n"
+exit 0