summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BSDmakefile1
-rw-r--r--mk/kernel-build.mk1
-rw-r--r--mk/rootfs.mk6
-rwxr-xr-xscripts/install.sh100
-rwxr-xr-x[-rw-r--r--]scripts/md5sum0
-rw-r--r--target/Config.in71
-rw-r--r--target/alix1c/Makefile4
-rw-r--r--target/linux/patches/2.6.30/cygwin-compat.patch (renamed from target/linux/patches/cygwin-compat.patch)0
-rw-r--r--target/linux/patches/2.6.30/freebsd-compat.patch (renamed from target/linux/patches/freebsd-compat.patch)0
-rw-r--r--target/linux/patches/2.6.30/mips-delay-fix.patch11
-rw-r--r--target/linux/patches/2.6.30/ocf.patch (renamed from target/linux/patches/ocf.patch)0
-rw-r--r--target/linux/patches/2.6.30/swconfig.patch (renamed from target/linux/patches/swconfig.patch)0
-rw-r--r--target/linux/patches/2.6.30/yaffs2.patch (renamed from target/linux/patches/yaffs2.patch)0
13 files changed, 126 insertions, 68 deletions
diff --git a/BSDmakefile b/BSDmakefile
index 64050b550..477fc6d94 100644
--- a/BSDmakefile
+++ b/BSDmakefile
@@ -26,6 +26,5 @@ _subdir: ${_subdir_dep}
. include "${.CURDIR}/prereq.mk"
. include "${.CURDIR}/mk/split-cfg.mk"
.else
-. include "${.CURDIR}/prereq.mk"
. include "${.CURDIR}/Makefile"
.endif
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
index 69e271d55..04657d906 100644
--- a/mk/kernel-build.mk
+++ b/mk/kernel-build.mk
@@ -9,7 +9,6 @@ KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
$(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION)/.patched:
$(TRACE) target/$(DEVICE)-kernel-patch
- $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../linux/patches *.patch $(MAKE_TRACE)
$(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
$(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../$(DEVICE)/patches *.patch $(MAKE_TRACE)
touch $@
diff --git a/mk/rootfs.mk b/mk/rootfs.mk
index 455b6a979..67f2ec80c 100644
--- a/mk/rootfs.mk
+++ b/mk/rootfs.mk
@@ -8,7 +8,11 @@ FS_CMDLINE:=$(3)
endif
endef
-$(eval $(call rootfs_template,ext2-cf,EXT2_CF))
+ifeq ($(ADK_LINUX_MIPS_RB532),y)
+ROOTFS:= root=/dev/sda2
+endif
+
+$(eval $(call rootfs_template,ext2-cf,EXT2_CF,$(ROOTFS)))
$(eval $(call rootfs_template,ext2-mmc,EXT2_MMC))
$(eval $(call rootfs_template,ext2,EXT2))
$(eval $(call rootfs_template,initramfs,INITRAMFS))
diff --git a/scripts/install.sh b/scripts/install.sh
index 9baf4f428..eadb61869 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
if [ $(id -u) -ne 0 ];then
printf "Installation is only possible as root\n"
exit 1
@@ -55,16 +55,20 @@ else
fi
cfgfs=1
-while getopts "n" option
+rb532=0
+while getopts "nr" option
do
case $option in
n)
- cfgfs=0
- ;;
+ cfgfs=0
+ ;;
+ r)
+ rb532=1
+ ;;
*)
- printf "Option not recognized\n"
- exit 1
- ;;
+ printf "Option not recognized\n"
+ exit 1
+ ;;
esac
done
shift $(($OPTIND - 1))
@@ -84,6 +88,18 @@ else
printf "$2 is not a file, Exiting\n"
exit 1
fi
+ if [ $rb532 -eq 1 ];then
+ if [ -z $3 ];then
+ printf "Please give the kernel as third parameter\n"
+ exit 2
+ fi
+ if [ -f $3 ];then
+ printf "Installing $3 on $1\n"
+ else
+ printf "$3 is not a file, Exiting\n"
+ exit 1
+ fi
+ fi
if [ -b $1 ];then
printf "Using $1 as CF/USB disk for installation\n"
printf "This will destroy all data on $1, are you sure?\n"
@@ -127,7 +143,23 @@ if [ $($sfdisk -l $1 2>/dev/null|grep Empty|wc -l) -ne 4 ];then
fi
printf "Create partition and filesystem\n"
-if [ $cfgfs -eq 0 ];then
+if [ $rb532 -ne 0 ];then
+ rootpart=${1}2
+ $parted -s $1 mklabel msdos
+ sleep 2
+ maxsize=$(parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
+ rootsize=$(($maxsize-2))
+
+ $parted -s $1 unit cyl mkpart primary ext2 0 1
+ $parted -s $1 unit cyl mkpartfs primary ext2 1 $rootsize
+ $parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
+ $parted -s $1 set 1 boot on
+ $sfdisk --change-id $1 1 27
+ $sfdisk --change-id $1 3 88
+ dd if=$3 of=${1}1
+else
+ rootpart=${1}1
+ if [ $cfgfs -eq 0 ];then
$sfdisk $1 << EOF
,,L
;
@@ -135,51 +167,50 @@ $sfdisk $1 << EOF
;
y
EOF
-
-$mke2fs ${1}1
-
-else
-$parted -s $1 mklabel msdos
-sleep 2
-declare -i maxsize
-maxsize=$(parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
-let rootsize=$maxsize-1
-
-$parted -s $1 unit cyl mkpartfs primary ext2 0 $rootsize
-$parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
-$parted -s $1 set 1 boot on
-$sfdisk --change-id $1 2 88
+ $mke2fs ${rootpart}
+ else
+ $parted -s $1 mklabel msdos
+ sleep 2
+ maxsize=$(parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
+ rootsize=$(($maxsize-1))
+
+ $parted -s $1 unit cyl mkpartfs primary ext2 0 $rootsize
+ $parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
+ $parted -s $1 set 1 boot on
+ $sfdisk --change-id $1 2 88
+ fi
fi
if [ $? -eq 0 ];then
- printf "Successfully created partition ${1}1\n"
+ printf "Successfully created partition ${rootpart}\n"
else
printf "Partition creation failed, Exiting.\n"
exit 1
fi
-sleep 4
-$tune2fs -c 0 -i 0 ${1}1 >/dev/null
-
+sleep 2
+$tune2fs -c 0 -i 0 ${rootpart} >/dev/null
if [ $? -eq 0 ];then
- printf "Successfully disabled filesystem checks on ${1}1\n"
+ printf "Successfully disabled filesystem checks on ${rootpart}\n"
else
printf "Disabling filesystem checks failed, Exiting.\n"
+ exit 1
fi
tmp=$(mktemp -d)
-mount -t ext2 ${1}1 $tmp
+mount -t ext2 ${rootpart} $tmp
printf "Extracting install archive\n"
tar -C $tmp -xzpf $2
printf "Fixing permissions\n"
chmod 1777 $tmp/tmp
chmod 4755 $tmp/bin/busybox
-printf "Copying grub files\n"
-mkdir $tmp/boot/grub
-cp /boot/grub/stage1 $tmp/boot/grub
-cp /boot/grub/stage2 $tmp/boot/grub
-cp /boot/grub/e2fs_stage1_5 $tmp/boot/grub
+if [ $rb532 -ne 0 ];then
+ printf "Copying grub files\n"
+ mkdir $tmp/boot/grub
+ cp /boot/grub/stage1 $tmp/boot/grub
+ cp /boot/grub/stage2 $tmp/boot/grub
+ cp /boot/grub/e2fs_stage1_5 $tmp/boot/grub
cat << EOF > $tmp/boot/grub/menu.lst
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
@@ -192,13 +223,14 @@ root (hd0,0)
kernel /boot/kernel root=/dev/sda1 init=/init console=ttyS0,115200 console=tty0 panic=10 rw
EOF
-printf "Installing Grub bootloader\n"
+ printf "Installing Grub bootloader\n"
$grub --batch --no-curses --no-floppy --device-map=/dev/null >/dev/null << EOF
device (hd0) $1
root (hd0,0)
setup (hd0)
quit
EOF
+fi
printf "Creating device nodes\n"
mknod -m 666 $tmp/dev/null c 1 3
diff --git a/scripts/md5sum b/scripts/md5sum
index 6a95a4707..6a95a4707 100644..100755
--- a/scripts/md5sum
+++ b/scripts/md5sum
diff --git a/target/Config.in b/target/Config.in
index b005bae1f..318b70121 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -128,6 +128,11 @@ config ADK_LINUX_MIPS64_LEMOTE
help
Lemote Subnotebook
+config ADK_LINUX_MIKROTIK
+ bool "Mikrotik Routerboards"
+ help
+ Support for Mikrotik Routerboards
+
config ADK_LINUX_MIPS_WAG54G
bool "Linksys WAG54G"
select ADK_KERNEL_NETDEVICES
@@ -139,38 +144,10 @@ config ADK_LINUX_MIPS_WAG54G
Linksys WAG54G DSL router with Wireless
TI AR7 platform
-config ADK_LINUX_MIPS_RB411
- bool "Mikrotik Routerboard 411"
- select ADK_rb411
- select ADK_KERNEL_NETDEVICES
- select ADK_KERNEL_NET_PCI
- select ADK_KERNEL_NETDEV_1000
- select ADK_KERNEL_NET_ETHERNET
- help
- Support for Mikrotik RB411.
-
-config ADK_LINUX_MIPS_RB433
- bool "Mikrotik Routerboard 433"
- select ADK_rb433
- select ADK_KERNEL_NETDEVICES
- select ADK_KERNEL_NET_PCI
- select ADK_KERNEL_NETDEV_1000
- select ADK_KERNEL_NET_ETHERNET
- help
- Support for Mikrotik RB433.
-
-config ADK_LINUX_MIPS_RB532
- bool "Mikrotik Routerboard 532"
- select ADK_rb532
- select ADK_KERNEL_NETDEVICES
- select ADK_KERNEL_NET_PCI
- select ADK_KERNEL_NET_ETHERNET
- select ADK_KERNEL_MII
- help
- Support for Mikrotik RB532.
config ADK_LINUX_XSCALE_ZAURUS
bool "Zaurus SL-C3200"
+ depends on ADK_BROKEN
select ADK_zaurus
select ADK_DEVICE_NO_FPU
help
@@ -264,6 +241,42 @@ config ADK_LINUX_CRIS_QEMU
endchoice
choice
+prompt "Routerboard model"
+default ADK_LINUX_MIPS_RB433
+depends on ADK_LINUX_MIKROTIK
+
+config ADK_LINUX_MIPS_RB411
+ bool "Mikrotik Routerboard 411"
+ select ADK_rb411
+ select ADK_KERNEL_NETDEVICES
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_NETDEV_1000
+ select ADK_KERNEL_NET_ETHERNET
+ help
+ Support for Mikrotik RB411.
+
+config ADK_LINUX_MIPS_RB433
+ bool "Mikrotik Routerboard 433"
+ select ADK_rb433
+ select ADK_KERNEL_NETDEVICES
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_NETDEV_1000
+ select ADK_KERNEL_NET_ETHERNET
+ help
+ Support for Mikrotik RB433.
+
+config ADK_LINUX_MIPS_RB532
+ bool "Mikrotik Routerboard 532"
+ select ADK_rb532
+ select ADK_KERNEL_NETDEVICES
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_NET_ETHERNET
+ select ADK_KERNEL_MII
+ help
+ Support for Mikrotik RB532.
+endchoice
+
+choice
prompt "Device model"
default ADK_LINUX_CRIS_FOXBOARD_CLASSIC
depends on ADK_LINUX_CRIS_FOXBOARD
diff --git a/target/alix1c/Makefile b/target/alix1c/Makefile
index f71ab293d..4df5b14a6 100644
--- a/target/alix1c/Makefile
+++ b/target/alix1c/Makefile
@@ -14,11 +14,11 @@ ifeq ($(FS),ext2-cf)
imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
@echo
@echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
- @echo "To install everything to CompactFlash use scripts/install.sh."
+ @echo "To install everything to CompactFlash use scripts/install.sh"
endif
ifeq ($(FS),nfsroot)
imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
@echo
@echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
- @echo "To install everything to CompactFlash use scripts/install.sh."
+ @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
endif
diff --git a/target/linux/patches/cygwin-compat.patch b/target/linux/patches/2.6.30/cygwin-compat.patch
index 8d087dddf..8d087dddf 100644
--- a/target/linux/patches/cygwin-compat.patch
+++ b/target/linux/patches/2.6.30/cygwin-compat.patch
diff --git a/target/linux/patches/freebsd-compat.patch b/target/linux/patches/2.6.30/freebsd-compat.patch
index 051fdc63e..051fdc63e 100644
--- a/target/linux/patches/freebsd-compat.patch
+++ b/target/linux/patches/2.6.30/freebsd-compat.patch
diff --git a/target/linux/patches/2.6.30/mips-delay-fix.patch b/target/linux/patches/2.6.30/mips-delay-fix.patch
new file mode 100644
index 000000000..bb99f1df6
--- /dev/null
+++ b/target/linux/patches/2.6.30/mips-delay-fix.patch
@@ -0,0 +1,11 @@
+diff -Nur linux-2.6.30.orig/arch/mips/lib/delay.c linux-2.6.30/arch/mips/lib/delay.c
+--- linux-2.6.30.orig/arch/mips/lib/delay.c 2009-06-10 05:05:27.000000000 +0200
++++ linux-2.6.30/arch/mips/lib/delay.c 2009-06-12 19:11:07.000000000 +0200
+@@ -51,6 +51,6 @@
+ {
+ unsigned int lpj = current_cpu_data.udelay_val;
+
+- __delay((us * 0x00000005 * HZ * lpj) >> 32);
++ __delay((ns * 0x00000005 * HZ * lpj) >> 32);
+ }
+ EXPORT_SYMBOL(__ndelay);
diff --git a/target/linux/patches/ocf.patch b/target/linux/patches/2.6.30/ocf.patch
index 64c5eeb0f..64c5eeb0f 100644
--- a/target/linux/patches/ocf.patch
+++ b/target/linux/patches/2.6.30/ocf.patch
diff --git a/target/linux/patches/swconfig.patch b/target/linux/patches/2.6.30/swconfig.patch
index 3297bb116..3297bb116 100644
--- a/target/linux/patches/swconfig.patch
+++ b/target/linux/patches/2.6.30/swconfig.patch
diff --git a/target/linux/patches/yaffs2.patch b/target/linux/patches/2.6.30/yaffs2.patch
index a19ab9c84..a19ab9c84 100644
--- a/target/linux/patches/yaffs2.patch
+++ b/target/linux/patches/2.6.30/yaffs2.patch