summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-01-30 20:33:35 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2010-01-30 20:33:35 +0100
commit345795d6b5aeaad33091bbf34250b2ddbc9dcca2 (patch)
tree7f7709503758b43ec2859cea14c69d527dab71b9 /package
parent5df306b0c9d713021edd9d81ff8f37b5d7f01db5 (diff)
implement cfinstaller for rb532
Diffstat (limited to 'package')
-rw-r--r--package/cfinstall/Makefile7
-rw-r--r--package/cfinstall/src/cfinstall.rb53249
-rw-r--r--package/parted/Makefile2
3 files changed, 56 insertions, 2 deletions
diff --git a/package/cfinstall/Makefile b/package/cfinstall/Makefile
index 94b423d83..fb64446f3 100644
--- a/package/cfinstall/Makefile
+++ b/package/cfinstall/Makefile
@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
PKG_NAME:= cfinstall
PKG_VERSION:= 1.0
-PKG_RELEASE:= 2
+PKG_RELEASE:= 3
PKG_DESCR:= compact flash installer
PKG_SECTION:= base
PKG_DEPENDS:= parted sfdisk
@@ -27,6 +27,11 @@ pre-configure:
do-install:
${INSTALL_DIR} $(IDIR_CFINSTALL)/sbin
+ifeq ($(ADK_LINUX_MIPS_RB532),y)
+ ${INSTALL_BIN} ./src/cfinstall.rb532 \
+ $(IDIR_CFINSTALL)/sbin/cfinstall
+else
${INSTALL_BIN} ./src/cfinstall $(IDIR_CFINSTALL)/sbin
+endif
include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cfinstall/src/cfinstall.rb532 b/package/cfinstall/src/cfinstall.rb532
new file mode 100644
index 000000000..900d6dc18
--- /dev/null
+++ b/package/cfinstall/src/cfinstall.rb532
@@ -0,0 +1,49 @@
+#!/bin/sh
+# installs a rootfs tar archive from OpenADK onto a Compact Flash disk
+# special script for routerboard rb532
+
+if [ -z $1 ];then
+ printf "Please give your root tar archive as first parameter\n"
+ exit 1
+fi
+if [ -z $2 ];then
+ printf "Please give your kernel as second parameter\n"
+ exit 1
+fi
+# create empty partition table
+parted -s /dev/sda mklabel msdos
+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))
+
+parted -s /dev/sda unit cyl mkpart primary ext2 0 1
+parted -s /dev/sda unit cyl mkpartfs primary ext2 1 $rootsize
+parted -s /dev/sda unit cyl mkpart primary fat32 $rootsize $maxsize
+parted -s /dev/sda set 1 boot on
+sfdisk --change-id /dev/sda 1 27 >/dev/null 2>&1
+sfdisk --change-id /dev/sda 3 88 >/dev/null 2>&1
+if [ $? -eq 0 ];then
+ printf "Successfully created partition ${rootpart}\n"
+else
+ printf "Partition creation failed, Exiting.\n"
+ exit 1
+fi
+sleep 2
+sync
+printf "Installing kernel\n"
+dd if=$2 of=/dev/sda1 bs=2048 >/dev/null 2>&1
+sync
+mount -t ext2 /dev/sda2 /mnt
+printf "Extracting install archive\n"
+tar -C /mnt -xzpf $1
+chmod 1777 /mnt/tmp
+chmod 4755 /mnt/bin/busybox
+
+printf "Creating device nodes\n"
+mknod -m 666 /mnt/dev/null c 1 3
+mknod -m 622 /mnt/dev/console c 5 1
+mknod -m 666 /mnt/dev/tty c 5 0
+
+umount /mnt
+printf "Successfully installed.\n"
+exit 0
diff --git a/package/parted/Makefile b/package/parted/Makefile
index b51fefd90..6323c875c 100644
--- a/package/parted/Makefile
+++ b/package/parted/Makefile
@@ -9,7 +9,7 @@ PKG_RELEASE:= 1
PKG_MD5SUM:= 055305bc7bcf472ce38f9abf69a9d94d
PKG_DESCR:= GNU parted
PKG_SECTION:= admin
-PKG_DEPENDS:= libuuid libreadline device-mapper
+PKG_DEPENDS:= libuuid libreadline device-mapper libpthread
PKG_BUILDDEP+= e2fsprogs lvm readline
PKG_URL:= http://www.gnu.org/software/parted/index.shtml
PKG_SITES:= ${MASTER_SITE_GNU:=parted/}