summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/rootfs.mk2
-rwxr-xr-xscripts/install-rb532.sh152
-rwxr-xr-xscripts/install.sh200
-rw-r--r--target/Config.in4
-rw-r--r--target/Makefile2
-rw-r--r--target/ibmx40/Makefile8
-rw-r--r--target/ibmx40/kernel.config150
-rw-r--r--target/tools/grub/Makefile24
-rw-r--r--tools/adk/Makefile6
-rw-r--r--tools/adk/pt.c256
10 files changed, 584 insertions, 220 deletions
diff --git a/mk/rootfs.mk b/mk/rootfs.mk
index d41cb682e..3093f532f 100644
--- a/mk/rootfs.mk
+++ b/mk/rootfs.mk
@@ -22,7 +22,7 @@ ROOTFS:= root=/dev/mmcblk0p2 rootwait
endif
$(eval $(call rootfs_template,ext2-block,EXT2_BLOCK,$(ROOTFS)))
-$(eval $(call rootfs_template,usb,USB,root=/dev/sdb1 rootdelay=5))
+$(eval $(call rootfs_template,usb,USB,root=/dev/sdb1 rootdelay=3))
$(eval $(call rootfs_template,archive,ARCHIVE))
$(eval $(call rootfs_template,initramfs,INITRAMFS))
$(eval $(call rootfs_template,initramfs-piggyback,INITRAMFS_PIGGYBACK))
diff --git a/scripts/install-rb532.sh b/scripts/install-rb532.sh
new file mode 100755
index 000000000..9011388c7
--- /dev/null
+++ b/scripts/install-rb532.sh
@@ -0,0 +1,152 @@
+#!/usr/bin/env bash
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+if [ $(id -u) -ne 0 ];then
+ printf "Installation is only possible as root\n"
+ exit 1
+fi
+
+printf "Checking if sfdisk is installed"
+sfdisk=$(which sfdisk)
+
+if [ ! -z $sfdisk -a -x $sfdisk ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if parted is installed"
+parted=$(which parted)
+
+if [ ! -z $parted -a -x $parted ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if mke2fs is installed"
+mke2fs=$(which mke2fs)
+
+if [ ! -z $mke2fs -a -x $mke2fs ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if tune2fs is installed"
+tune2fs=$(which tune2fs)
+
+if [ ! -z $tune2fs -a -x $tune2fs ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+if [ -z $1 ];then
+ printf "Please give your compact flash or USB device as first parameter\n"
+ exit 1
+else
+ if [ -z $2 ];then
+ printf "Please give your install tar archive as second parameter\n"
+ exit 2
+ fi
+ if [ -f $2 ];then
+ printf "Installing $2 on $1\n"
+ else
+ printf "$2 is not a file, Exiting\n"
+ exit 1
+ fi
+ 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
+ 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"
+ printf "Type "y" to continue\n"
+ read y
+ if [ "$y" = "y" ];then
+ $sfdisk -l $1 2>&1 |grep 'No medium'
+ if [ $? -eq 0 ];then
+ exit 1
+ else
+ printf "Starting with installation\n"
+ fi
+ else
+ printf "Exiting.\n"
+ exit 1
+ fi
+ else
+ printf "Sorry $1 is not a block device\n"
+ exit 1
+ fi
+fi
+
+
+if [ $(mount | grep $1| wc -l) -ne 0 ];then
+ printf "Block device $1 is in use, please umount first.\n"
+ exit 1
+fi
+
+
+if [ $($sfdisk -l $1 2>/dev/null|grep Empty|wc -l) -ne 4 ];then
+ printf "Partitions already exist, should I wipe them?\n"
+ printf "Type y to continue\n"
+ read y
+ if [ $y = "y" ];then
+ printf "Wiping existing partitions\n"
+ dd if=/dev/zero of=$1 bs=512 count=1 >/dev/null 2>&1
+ else
+ printf "Exiting.\n"
+ exit 1
+ fi
+fi
+
+printf "Create partition and filesystem for rb532\n"
+rootpart=${1}2
+$parted -s $1 mklabel msdos
+sleep 2
+maxsize=$(env LC_ALL=C $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 mkpart 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
+sleep 2
+$mke2fs ${1}2
+sync
+dd if=$3 of=${1}1 bs=2048
+sync
+sleep 2
+$tune2fs -c 0 -i 0 -m 1 ${rootpart} >/dev/null
+if [ $? -eq 0 ];then
+ 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 ${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
+umount $tmp
+printf "Successfully installed.\n"
+exit 0
diff --git a/scripts/install.sh b/scripts/install.sh
index b436767a5..3e07a7181 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -1,26 +1,11 @@
#!/usr/bin/env bash
-if [ $(id -u) -ne 0 ];then
- printf "Installation is only possible as root\n"
- exit 1
-fi
-
-printf "Checking if sfdisk is installed"
-sfdisk=$(which sfdisk)
-
-if [ ! -z $sfdisk -a -x $sfdisk ];then
- printf "...okay\n"
-else
- printf "...failed\n"
- exit 1
-fi
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
-printf "Checking if parted is installed"
-parted=$(which parted)
+TOPDIR=$(pwd)
-if [ ! -z $parted -a -x $parted ];then
- printf "...okay\n"
-else
- printf "...failed\n"
+if [ $(id -u) -ne 0 ];then
+ printf "Installation is only possible as root\n"
exit 1
fi
@@ -34,27 +19,17 @@ else
exit 1
fi
-printf "Checking if tune2fs is installed"
-tune2fs=$(which tune2fs)
-
-if [ ! -z $tune2fs -a -x $tune2fs ];then
- printf "...okay\n"
-else
- printf "...failed\n"
- exit 1
-fi
-
cfgfs=1
-rb532=0
-while getopts "nr" option
+quiet=0
+while getopts "nq" option
do
case $option in
+ q)
+ quiet=1
+ ;;
n)
cfgfs=0
;;
- r)
- rb532=1
- ;;
*)
printf "Option not recognized\n"
exit 1
@@ -78,33 +53,12 @@ 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"
- printf "Type "y" to continue\n"
- read y
- if [ "$y" = "y" ];then
- $sfdisk -l $1 2>&1 |grep 'No medium'
- if [ $? -eq 0 ];then
- exit 1
- else
- printf "Starting with installation\n"
- fi
- else
- printf "Exiting.\n"
- exit 1
+ if [ $quiet -eq 0 ];then
+ printf "This will destroy all data on $1, are you sure?\n"
+ printf "Type "y" to continue\n"
+ read y
fi
else
printf "Sorry $1 is not a block device\n"
@@ -112,26 +66,11 @@ else
fi
fi
-
if [ $(mount | grep $1| wc -l) -ne 0 ];then
printf "Block device $1 is in use, please umount first.\n"
exit 1
fi
-
-if [ $($sfdisk -l $1 2>/dev/null|grep Empty|wc -l) -ne 4 ];then
- printf "Partitions already exist, should I wipe them?\n"
- printf "Type y to continue\n"
- read y
- if [ $y = "y" ];then
- printf "Wiping existing partitions\n"
- dd if=/dev/zero of=$1 bs=512 count=1 >/dev/null 2>&1
- else
- printf "Exiting.\n"
- exit 1
- fi
-fi
-
case $2 in
wrap*)
speed=38400
@@ -141,102 +80,51 @@ case $2 in
;;
esac
-if [ $rb532 -ne 0 ];then
- printf "Create partition and filesystem for rb532\n"
- rootpart=${1}2
- $parted -s $1 mklabel msdos
- sleep 2
- maxsize=$(env LC_ALL=C $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 mkpart 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
- sleep 2
- $mke2fs ${1}2
- sync
- dd if=$3 of=${1}1 bs=2048
- sync
-else
- rootpart=${1}1
- if [ $cfgfs -eq 0 ];then
- printf "Create partition and filesystem without cfgfs\n"
-$sfdisk $1 << EOF
-,,L
-;
-;
-;
-y
-EOF
- $mke2fs ${rootpart}
- else
- printf "Create partition and filesystem with cfgfs\n"
- $parted -s $1 mklabel msdos
- sleep 2
- maxsize=$(env LC_ALL=C $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 $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 ${1}1
- fi
-fi
-
-if [ $? -eq 0 ];then
- printf "Successfully created partition ${rootpart}\n"
-else
- printf "Partition creation failed, Exiting.\n"
- exit 1
-fi
-
-sleep 2
-$tune2fs -c 0 -i 0 -m 1 ${rootpart} >/dev/null
-if [ $? -eq 0 ];then
- printf "Successfully disabled filesystem checks on ${rootpart}\n"
-else
- printf "Disabling filesystem checks failed, Exiting.\n"
- exit 1
-fi
-
+rootpart=${1}1
+pt=$TOPDIR/bin/tools/pt
+# get sector size from block device
+maxsector=$(sudo $pt -g $1)
+head=16
+sect=63
+rsize=$(($maxsector / 2))
+
+printf "Creating partition table ...\n"
+table=$(mktemp)
+# generate partition table
+$pt -o $table -s $sect -h $head -p ${rsize}K
+# write partition table to block device
+dd if=$table of=$1 bs=512 count=1 2> /dev/null
+printf "Creating ext2 filesystem ...\n"
+$mke2fs -q ${1}1
+
+printf "Extracting install archive ...\n"
tmp=$(mktemp -d)
mount -t ext2 ${rootpart} $tmp
-printf "Extracting install archive\n"
tar -C $tmp -xzpf $2
-printf "Fixing permissions\n"
+printf "Fixing permissions ...\n"
chmod 1777 $tmp/tmp
chmod 4755 $tmp/bin/busybox
-if [ $rb532 -eq 0 ];then
- printf "Installing GRUB bootloader\n"
- mkdir -p $tmp/boot/grub
- mount -o bind /dev $tmp/dev
- chroot $tmp mount -t proc /proc /proc
- chroot $tmp mount -t sysfs /sys /sys
+printf "Installing GRUB bootloader ...\n"
+mkdir -p $tmp/boot/grub
cat << EOF > $tmp/boot/grub/grub.cfg
set default=0
set timeout=1
-serial --unit=0 --speed=$speed
-terminal_output serial
-terminal_input serial
+terminal_output console
+terminal_input console
menuentry "GNU/Linux (OpenADK)" {
insmod ext2
set root=(hd0,1)
- linux /boot/vmlinuz-adk root=/dev/sda1 ro init=/init console=ttyS0,$speed console=tty0 panic=10
+ linux /boot/vmlinuz-adk init=/init
}
EOF
- chroot $tmp grub-install $1
- umount $tmp/proc
- umount $tmp/sys
- umount $tmp/dev
-fi
-
+./bin/tools/sbin/grub-install \
+ --grub-setup=./bin/tools/sbin/grub-setup \
+ --grub-mkimage=./bin/tools/bin/grub-mkimage \
+ --grub-mkdevicemap=./bin/tools/sbin/grub-mkdevicemap \
+ --no-floppy --root-directory=$tmp $1
umount $tmp
-
printf "Successfully installed.\n"
+rm -rf $tmp
exit 0
diff --git a/target/Config.in b/target/Config.in
index 92d1fdc4b..07733b06b 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -908,7 +908,7 @@ config ADK_TARGET_ROOTFS_NFSROOT
Root filesystem mounted via NFS. (DHCP)
config ADK_TARGET_ROOTFS_USB
- bool "root on USB stick"
+ bool "Boot from USB stick"
select ADK_KERNEL_SCSI
select ADK_KERNEL_ATA
select ADK_KERNEL_BLK_DEV_SD
@@ -919,7 +919,7 @@ config ADK_TARGET_ROOTFS_USB
select ADK_KERNEL_EXT2_FS
depends on ADK_LINUX_X86_IBMX40
help
- Boot target from USB stick.
+ Boot system from USB stick.
config ADK_TARGET_ROOTFS_EXT2_BLOCK
bool "read-write filesystem for block devices with ext2"
diff --git a/target/Makefile b/target/Makefile
index dc2d3dd5a..83c8ff900 100644
--- a/target/Makefile
+++ b/target/Makefile
@@ -93,4 +93,4 @@ clean: $(ADK_TARGET)-clean $(ADK_TARGET)-imageclean
%-imageinstall: %-imageprepare
$(TRACE) target/$(patsubst %-imageinstall,%,$@)-imageinstall
$(MAKE) -C $(patsubst %-imageinstall,%,$@) imageinstall
- @echo 'Login as user root with password ${ADK_RUNTIME_PASSWORD} via ssh or console'
+ @echo 'Login as user root with password ${ADK_RUNTIME_PASSWORD} via ssh or console.'
diff --git a/target/ibmx40/Makefile b/target/ibmx40/Makefile
index 3c95fc2d1..b50a864fc 100644
--- a/target/ibmx40/Makefile
+++ b/target/ibmx40/Makefile
@@ -7,6 +7,12 @@ include $(TOPDIR)/mk/modules.mk
include $(TOPDIR)/mk/kernel-build.mk
include $(TOPDIR)/mk/image.mk
+$(TOOLS_BUILD_DIR):
+ mkdir -p $(TOOLS_BUILD_DIR)
+
+tools-compile: $(TOOLS_BUILD_DIR)
+ $(MAKE) -C ../tools/grub prepare compile install
+
KERNEL:=$(LINUX_DIR)/arch/x86/boot/bzImage
createinitcrypt:
@@ -26,7 +32,7 @@ imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
@echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
endif
ifeq ($(FS),usb)
-imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+imageinstall: tools-compile $(BIN_DIR)/$(ROOTFSTARBALL)
@echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)"
@echo "To install everything to USB use scripts/install.sh"
endif
diff --git a/target/ibmx40/kernel.config b/target/ibmx40/kernel.config
index d40b3bdc8..9c337f483 100644
--- a/target/ibmx40/kernel.config
+++ b/target/ibmx40/kernel.config
@@ -1,12 +1,13 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.34
-# Wed Jul 28 23:45:42 2010
+# Linux kernel version: 2.6.35.7
+# Fri Oct 22 18:07:55 2010
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
+CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf32-i386"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
CONFIG_GENERIC_TIME=y
@@ -20,6 +21,7 @@ CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
# CONFIG_NEED_DMA_MAP_STATE is not set
+CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
@@ -49,6 +51,7 @@ CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_X86_32_LAZY_GS=y
+CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx"
CONFIG_KTIME_SCALAR=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y
@@ -60,6 +63,7 @@ CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
@@ -110,7 +114,7 @@ CONFIG_PRINTK=y
CONFIG_BUG=y
# CONFIG_ELF_CORE is not set
# CONFIG_PCSPKR_PLATFORM is not set
-CONFIG_BASE_FULL=y
+# CONFIG_BASE_FULL is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
@@ -126,7 +130,7 @@ CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_EVENTS=y
# CONFIG_PERF_COUNTERS is not set
# CONFIG_VM_EVENT_COUNTERS is not set
-CONFIG_PCI_QUIRKS=y
+# CONFIG_PCI_QUIRKS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
@@ -143,6 +147,7 @@ CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
+CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
#
@@ -152,7 +157,7 @@ CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
-CONFIG_BASE_SMALL=0
+CONFIG_BASE_SMALL=1
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
@@ -218,7 +223,7 @@ CONFIG_X86_MPPARSE=y
# CONFIG_X86_EXTENDED_PLATFORM is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_PARAVIRT_GUEST is not set
-CONFIG_NO_BOOTMEM=y
+# CONFIG_NO_BOOTMEM is not set
# CONFIG_MEMTEST is not set
# CONFIG_M386 is not set
# CONFIG_M486 is not set
@@ -270,7 +275,6 @@ CONFIG_CPU_SUP_INTEL=y
# CONFIG_CPU_SUP_CENTAUR is not set
# CONFIG_CPU_SUP_TRANSMETA_32 is not set
# CONFIG_CPU_SUP_UMC_32 is not set
-# CONFIG_X86_DS is not set
# CONFIG_HPET_TIMER is not set
# CONFIG_DMI is not set
# CONFIG_IOMMU_HELPER is not set
@@ -290,8 +294,8 @@ CONFIG_VM86=y
# CONFIG_I8K is not set
# CONFIG_X86_REBOOTFIXUPS is not set
# CONFIG_MICROCODE is not set
-CONFIG_X86_MSR=y
-CONFIG_X86_CPUID=y
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
# CONFIG_NOHIGHMEM is not set
CONFIG_HIGHMEM4G=y
# CONFIG_HIGHMEM64G is not set
@@ -325,12 +329,13 @@ CONFIG_VIRT_TO_BUS=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
# CONFIG_HIGHPTE is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
-CONFIG_X86_RESERVE_LOW_64K=y
+# CONFIG_X86_RESERVE_LOW_64K is not set
# CONFIG_MATH_EMULATION is not set
CONFIG_MTRR=y
-# CONFIG_MTRR_SANITIZER is not set
-CONFIG_X86_PAT=y
-CONFIG_ARCH_USES_PG_UNCACHED=y
+CONFIG_MTRR_SANITIZER=y
+CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
+CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
+# CONFIG_X86_PAT is not set
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_HZ_100 is not set
@@ -346,14 +351,18 @@ CONFIG_PHYSICAL_START=0x200000
CONFIG_PHYSICAL_ALIGN=0x200000
# CONFIG_COMPAT_VDSO is not set
CONFIG_CMDLINE_BOOL=y
-CONFIG_CMDLINE="console=ttyS0,115200 console=tty0"
+CONFIG_CMDLINE="console=tty0"
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
#
# Power management and ACPI options
#
-# CONFIG_PM is not set
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_SUSPEND is not set
+# CONFIG_PM_RUNTIME is not set
+# CONFIG_ACPI is not set
# CONFIG_SFI is not set
#
@@ -374,11 +383,12 @@ CONFIG_PCI_GOANY=y
CONFIG_PCI_BIOS=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_CNB20LE_QUIRK is not set
# CONFIG_PCIEPORTBUS is not set
CONFIG_ARCH_SUPPORTS_MSI=y
-CONFIG_PCI_MSI=y
+# CONFIG_PCI_MSI is not set
# CONFIG_PCI_STUB is not set
-# CONFIG_HT_IRQ is not set
+CONFIG_HT_IRQ=y
# CONFIG_PCI_IOV is not set
CONFIG_ISA_DMA_API=y
# CONFIG_ISA is not set
@@ -435,8 +445,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
-# CONFIG_NET_DSA is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
@@ -467,9 +477,14 @@ CONFIG_WIRELESS=y
#
# CFG80211 needs to be enabled for MAC80211
#
+
+#
+# Some wireless drivers require a rate control algorithm
+#
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
#
# Device Drivers
@@ -551,29 +566,46 @@ CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
# CONFIG_ATA_VERBOSE_ERROR is not set
# CONFIG_SATA_PMP is not set
+
+#
+# Controllers with non-SFF native interface
+#
# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_AHCI_PLATFORM is not set
+# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y
-# CONFIG_SATA_SVW is not set
+
+#
+# SFF controllers with custom DMA interface
+#
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_SX4 is not set
+CONFIG_ATA_BMDMA=y
+
+#
+# SATA SFF controllers with BMDMA
+#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
-# CONFIG_PDC_ADMA is not set
-# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_PROMISE is not set
-# CONFIG_SATA_SX4 is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set
-# CONFIG_SATA_INIC162X is not set
+
+#
+# PATA SFF controllers with BMDMA
+#
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARTOP is not set
-# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_ATIIXP is not set
-# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
@@ -581,39 +613,48 @@ CONFIG_ATA_PIIX=y
# CONFIG_PATA_CS5536 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
-# CONFIG_ATA_GENERIC is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
-# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
-# CONFIG_PATA_LEGACY is not set
-# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_MARVELL is not set
-# CONFIG_PATA_MPIIX is not set
-# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
-# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_NS87415 is not set
-# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
-# CONFIG_PATA_RZ1000 is not set
# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SCH is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
+# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
+
+#
+# PIO-only SFF controllers
+#
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PLATFORM is not set
-# CONFIG_PATA_SCH is not set
+# CONFIG_PATA_RZ1000 is not set
+
+#
+# Generic fallback / legacy drivers
+#
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
# CONFIG_BLK_DEV_MD is not set
# CONFIG_BLK_DEV_DM is not set
@@ -754,11 +795,12 @@ CONFIG_SERIO_LIBPS2=y
#
CONFIG_VT=y
# CONFIG_CONSOLE_TRANSLATIONS is not set
-# CONFIG_VT_CONSOLE is not set
+CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
# CONFIG_DEVKMEM is not set
# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
# CONFIG_NOZOMI is not set
#
@@ -778,6 +820,8 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_CORE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
@@ -796,6 +840,7 @@ CONFIG_UNIX98_PTYS=y
# CONFIG_TCG_TPM is not set
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
+# CONFIG_RAMOOPS is not set
# CONFIG_I2C is not set
# CONFIG_SPI is not set
@@ -816,33 +861,23 @@ CONFIG_SSB_POSSIBLE=y
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
-
-#
-# Multifunction device drivers
-#
+CONFIG_MFD_SUPPORT=y
# CONFIG_MFD_CORE is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_MFD_TMIO is not set
+# CONFIG_ABX500_CORE is not set
# CONFIG_LPC_SCH is not set
+# CONFIG_MFD_RDC321X is not set
+# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_REGULATOR is not set
# CONFIG_MEDIA_SUPPORT is not set
#
# Graphics support
#
-CONFIG_AGP=y
-# CONFIG_AGP_ALI is not set
-# CONFIG_AGP_ATI is not set
-# CONFIG_AGP_AMD is not set
-# CONFIG_AGP_INTEL is not set
-# CONFIG_AGP_NVIDIA is not set
-# CONFIG_AGP_SIS is not set
-# CONFIG_AGP_SWORKS is not set
-# CONFIG_AGP_VIA is not set
-# CONFIG_AGP_EFFICEON is not set
-CONFIG_VGA_ARB=y
-CONFIG_VGA_ARB_MAX_GPUS=16
+# CONFIG_AGP is not set
+# CONFIG_VGA_ARB is not set
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -934,10 +969,6 @@ CONFIG_RTC_DRV_CMOS=y
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
-
-#
-# TI VLYNQ
-#
# CONFIG_STAGING is not set
# CONFIG_X86_PLATFORM_DEVICES is not set
@@ -1075,12 +1106,14 @@ CONFIG_TRACING_SUPPORT=y
# CONFIG_FTRACE is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_STRICT_DEVMEM is not set
# CONFIG_X86_VERBOSE_BOOTUP is not set
-# CONFIG_EARLY_PRINTK is not set
+CONFIG_EARLY_PRINTK=y
+# CONFIG_EARLY_PRINTK_DBGP is not set
# CONFIG_4KSTACKS is not set
# CONFIG_DOUBLEFAULT is not set
# CONFIG_IOMMU_STRESS is not set
@@ -1210,6 +1243,7 @@ CONFIG_HAVE_KVM=y
#
# Library routines
#
+CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_FIND_LAST_BIT=y
@@ -1217,7 +1251,7 @@ CONFIG_GENERIC_FIND_LAST_BIT=y
# CONFIG_CRC16 is not set
# CONFIG_CRC_T10DIF is not set
# CONFIG_CRC_ITU_T is not set
-# CONFIG_CRC32 is not set
+CONFIG_CRC32=y
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
CONFIG_HAS_IOMEM=y
diff --git a/target/tools/grub/Makefile b/target/tools/grub/Makefile
new file mode 100644
index 000000000..95d7b2397
--- /dev/null
+++ b/target/tools/grub/Makefile
@@ -0,0 +1,24 @@
+# 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:= grub
+PKG_VERSION:= 1.98
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c0bcf60e524739bb64e3a2d4e3732a59
+PKG_SITES:= ftp://alpha.gnu.org/gnu/grub/
+
+include ../rules.mk
+
+$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
+ cd $(WRKBUILD) && ./configure --prefix=$(TOPDIR)/bin/tools
+ $(MAKE) -C $(WRKBUILD)
+ touch $@
+
+$(TOPDIR)/bin/tools/bin/grub-install: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+
+install: $(TOPDIR)/bin/tools/bin/grub-install
+
+include $(TOPDIR)/mk/tools.mk
diff --git a/tools/adk/Makefile b/tools/adk/Makefile
index 3f2048e68..fd1d0e2c0 100644
--- a/tools/adk/Makefile
+++ b/tools/adk/Makefile
@@ -9,6 +9,10 @@ ${TOPDIR}/bin/tools/depmaker:
${TOPDIR}/bin/tools/pkgrebuild:
$(HOSTCC) -o $(TOPDIR)/bin/tools/pkgrebuild pkgrebuild.c strmap.c
-install: ${TOPDIR}/bin/tools/depmaker ${TOPDIR}/bin/tools/pkgrebuild
+${TOPDIR}/bin/tools/pt:
+ $(HOSTCC) -o $(TOPDIR)/bin/tools/pt pt.c
+
+install: ${TOPDIR}/bin/tools/depmaker ${TOPDIR}/bin/tools/pkgrebuild \
+ $(TOPDIR)/bin/tools/pt
include $(TOPDIR)/mk/tools.mk
diff --git a/tools/adk/pt.c b/tools/adk/pt.c
new file mode 100644
index 000000000..e98550b31
--- /dev/null
+++ b/tools/adk/pt.c
@@ -0,0 +1,256 @@
+/*
+ * pt - partition table utility
+ * Copyright (C) 2010 by Waldemar Brodkorb <wbx@openadk.org>
+ *
+ * just adds some required code to ptgen - partition table generator
+ * Copyright (C) 2006 by Felix Fietkau <nbd@openwrt.org>
+ *
+ * uses parts of afdisk
+ * Copyright (C) 2002 by David Roetzel <david@roetzel.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#if defined(__linux__)
+#include <linux/fs.h>
+#endif
+
+#if defined(__APPLE__)
+#include <sys/disk.h>
+#define BLKGETSIZE DKIOCGETBLOCKCOUNT
+#endif
+
+#define bswap16(x) ( \
+ ((((x) )&(unsigned int)0xff)<< 8) \
+ |((((x)>> 8)&(unsigned int)0xff) ) \
+)
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define cpu_to_le16(x) bswap16(x)
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+#define cpu_to_le16(x) (x)
+#else
+#error unknown endianness!
+#endif
+
+/* Partition table entry */
+struct pte {
+ unsigned char active;
+ unsigned char chs_start[3];
+ unsigned char type;
+ unsigned char chs_end[3];
+ unsigned int start;
+ unsigned int length;
+};
+
+struct partinfo {
+ unsigned long size;
+ int type;
+};
+
+int verbose = 0;
+int active = 1;
+int heads = -1;
+int sectors = -1;
+struct partinfo parts[4];
+char *filename = NULL;
+
+/*
+ * get the sector size of the block device
+ *
+ * print the sector size
+ */
+
+static void getmaxsize(char *device) {
+ int fd;
+ unsigned long maxsectors=0;
+
+ fd = open(device, O_RDONLY);
+ ioctl(fd, BLKGETSIZE, &maxsectors);
+ printf("%lu\n", maxsectors);
+ close(fd);
+}
+
+/*
+ * parse the size argument, which is either
+ * a simple number (K assumed) or
+ * K, M or G
+ *
+ * returns the size in KByte
+ */
+static long to_kbytes(const char *string) {
+ int exp = 0;
+ long result;
+ char *end;
+
+ result = strtoul(string, &end, 0);
+ switch (tolower(*end)) {
+ case 'k' :
+ case '\0' : exp = 0; break;
+ case 'm' : exp = 1; break;
+ case 'g' : exp = 2; break;
+ default: return 0;
+ }
+
+ if (*end)
+ end++;
+
+ if (*end) {
+ fprintf(stderr, "garbage after end of number\n");
+ return 0;
+ }
+
+ /* result: number + 1024^(exp) */
+ return result * ((2 << ((10 * exp) - 1)) ?: 1);
+}
+
+/* convert the sector number into a CHS value for the partition table */
+static void to_chs(long sect, unsigned char chs[3]) {
+ int c,h,s;
+
+ s = (sect % sectors) + 1;
+ sect = sect / sectors;
+ h = sect % heads;
+ sect = sect / heads;
+ c = sect;
+
+ chs[0] = h;
+ chs[1] = s | ((c >> 2) & 0xC0);
+ chs[2] = c & 0xFF;
+
+ return;
+}
+
+/* round the sector number up to the next cylinder */
+static inline unsigned long round_to_cyl(long sect) {
+ int cyl_size = heads * sectors;
+
+ return sect + cyl_size - (sect % cyl_size);
+}
+
+/* check the partition sizes and write the partition table */
+static int gen_ptable(int nr)
+{
+ struct pte pte[4];
+ unsigned long sect = 0;
+ unsigned int start, len;
+ int i, fd, ret = -1;
+
+ memset(pte, 0, sizeof(struct pte) * 4);
+ for (i = 0; i < nr; i++) {
+ if (!parts[i].size) {
+ fprintf(stderr, "Invalid size in partition %d!\n", i);
+ return -1;
+ }
+ pte[i].active = ((i + 1) == active) ? 0x80 : 0;
+ pte[i].type = parts[i].type;
+ pte[i].start = cpu_to_le16(start = sect + sectors);
+ sect = round_to_cyl(start + parts[i].size * 2);
+ pte[i].length = cpu_to_le16(len = sect - start);
+ to_chs(start, pte[i].chs_start);
+ to_chs(start + len - 1, pte[i].chs_end);
+ if (verbose)
+ fprintf(stderr, "Partition %d: start=%u, end=%u, size=%u\n", i, start * 512, (start + len) * 512, len * 512);
+ }
+
+ if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) {
+ fprintf(stderr, "Can't open output file '%s'\n",filename);
+ return -1;
+ }
+
+ lseek(fd, 446, SEEK_SET);
+ if (write(fd, pte, sizeof(struct pte) * 4) != sizeof(struct pte) * 4) {
+ fprintf(stderr, "write failed.\n");
+ goto fail;
+ }
+ lseek(fd, 510, SEEK_SET);
+ if (write(fd, "\x55\xaa", 2) != 2) {
+ fprintf(stderr, "write failed.\n");
+ goto fail;
+ }
+
+ ret = 0;
+fail:
+ close(fd);
+ return ret;
+}
+
+static void usage(char *prog)
+{
+ fprintf(stderr, "Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [[-t <type>] -p <size>...] \n", prog);
+ fprintf(stderr, "Usage: %s -g <device>\n", prog);
+ exit(1);
+}
+
+int main (int argc, char **argv)
+{
+ char type = 0x83;
+ int ch;
+ int part = 0;
+
+ while ((ch = getopt(argc, argv, "h:s:p:a:t:o:vg:")) != -1) {
+ switch (ch) {
+ case 'o':
+ filename = optarg;
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'h':
+ heads = (int) strtoul(optarg, NULL, 0);
+ break;
+ case 's':
+ sectors = (int) strtoul(optarg, NULL, 0);
+ break;
+ case 'p':
+ if (part > 3) {
+ fprintf(stderr, "Too many partitions\n");
+ exit(1);
+ }
+ parts[part].size = to_kbytes(optarg);
+ parts[part++].type = type;
+ break;
+ case 't':
+ type = (char) strtoul(optarg, NULL, 16);
+ break;
+ case 'a':
+ active = (int) strtoul(optarg, NULL, 0);
+ if ((active < 0) || (active > 4))
+ active = 0;
+ break;
+ case 'g':
+ getmaxsize(optarg);
+ exit(0);
+ case '?':
+ default:
+ usage(argv[0]);
+ }
+ }
+ argc -= optind;
+ if (argc || (heads <= 0) || (sectors <= 0) || !filename)
+ usage(argv[0]);
+
+ return gen_ptable(part);
+}