summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--README7
-rw-r--r--bin/copy2dream.sh27
-rwxr-xr-xbin/partition-stick9
-rw-r--r--fbx-base.conf4
-rwxr-xr-xkernel/uImagebin0 -> 2733212 bytes
-rwxr-xr-xmk_dreamplug_rootfs42
7 files changed, 66 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index e8fc80a..b4f7128 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,11 @@
-# copy DreamPlug root filesystem to a usb stick with an ext3 partition
+# copy DreamPlug root filesystem to a usb stick
+# stick assumed to have 2 partitions, 128meg FAT and the rest ext3 partition
dreamstick: stamp-dreamplug-rootfs
mount /media/freedom
- sudo rsync -atvz --progress --delete build/dreamplug/ /media/freedom/
+ mount /media/freedom/boot
+ sudo rsync -atvz --progress --delete --exclude=boot build/dreamplug/ /media/freedom/
+ cp build/dreamplug/boot/* /media/freedom/boot/
+ umount /media/freedom/boot
umount /media/freedom
# populate a tree with DreamPlug root filesystem
diff --git a/README b/README
index 215f56e..1affca6 100644
--- a/README
+++ b/README
@@ -36,3 +36,10 @@ you're logged into the system booted from root on USB stick you can use:
Be aware that this is an imcomplete solution for now .. you will want to at
least do things like create unique ssh host keys for your device!
+
+- - - - -
+hacking with zumbi's kernel
+
+ setenv x_bootcmd_kernel fatload usb 2 0x6400000 uImage
+ setenv x_bootargs_root root=/dev/sdc2 rootdelay=10
+ boot
diff --git a/bin/copy2dream.sh b/bin/copy2dream.sh
index cc800e9..b6823c5 100644
--- a/bin/copy2dream.sh
+++ b/bin/copy2dream.sh
@@ -1,19 +1,27 @@
#!/bin/sh
#
# this script assumes the current root filesystem is the source, and the
-# internal microSD on a DreamPlug is the target .. copy the kernel uImage to
-# the FAT partition on sda1, and the root contents to the ext3 on sda2
+# internal microSD on a DreamPlug is the target .. all existing content on
+# the microSD card will be lost.
#
-mount /dev/sda1 /media
-mv /media/uImage /media/uImage.old
-cp /boot/uImage /media/uImage
-umount /media
+# partition microSD card inside DreamPlug
+parted -s /dev/sda mklabel msdos
+parted -s /dev/sda mkpart primary fat16 0 128
+parted -s /dev/sda mkpart primary ext2 128 100%
+
+# create filesystems on new partitions
+mkdosfs /dev/sda1
mke2fs -j /dev/sda2
+
mount /dev/sda2 /media
-(cd / ; tar cf - `/bin/ls | grep -v proc | grep -v sys | grep -v media | grep -v dev`) | \
- (cd /media ; tar xvf -)
+mkdir -p /media/boot
+mount /dev/sda1 /media/boot
+
+sudo rsync -atvz --progress --exclude=boot --exclude proc --exclude sys \
+ --exclude media --exclude dev build/dreamplug/ /media/freedom/
+cp /boot/* /media/boot/
mkdir /media/proc /media/sys /media/media
echo "Creating basic device nodes"
@@ -24,7 +32,8 @@ mknod /media/dev/urandom c 1 9
mknod /media/dev/null c 1 3
mknod /media/dev/ptmx c 5 2
+umount /dev/sda1
umount /dev/sda2
-echo "interrupt the next boot and change the root path to /dev/sda2"
+echo "installation complete .. see docs for how to boot from internal microSD"
diff --git a/bin/partition-stick b/bin/partition-stick
new file mode 100755
index 0000000..9017e54
--- /dev/null
+++ b/bin/partition-stick
@@ -0,0 +1,9 @@
+#!/bin/sh
+# create required partitions on a USB stick
+
+parted -s /dev/sdb mklabel msdos
+parted -s /dev/sdb mkpart primary fat16 0 128
+parted -s /dev/sdb mkpart primary ext2 128 100%
+
+mkdosfs /dev/sdb1
+mke2fs -j /dev/sdb2
diff --git a/fbx-base.conf b/fbx-base.conf
index 0096f1a..8729fd2 100644
--- a/fbx-base.conf
+++ b/fbx-base.conf
@@ -6,8 +6,8 @@ aptsources=Debian
debootstrap=Debian
[Debian]
-packages=base-files netbase openssh-server zile wget iproute net-tools hostname module-init-tools wget resolvconf udev isc-dhcp-client ifupdown rsyslog libertas-firmware
-source=http://ftp.ba.debian.org/debian
+packages=base-files netbase openssh-server zile wget iproute net-tools hostname module-init-tools wget resolvconf udev isc-dhcp-client ifupdown rsyslog libertas-firmware devio initramfs-tools uboot-mkimage parted dosfstools
+source=http://www.gag.com:9999/debian
keyring=debian-archive-keyring
suite=squeeze
components=main contrib non-free
diff --git a/kernel/uImage b/kernel/uImage
new file mode 100755
index 0000000..124a6ff
--- /dev/null
+++ b/kernel/uImage
Binary files differ
diff --git a/mk_dreamplug_rootfs b/mk_dreamplug_rootfs
index c69cc53..ba3fb79 100755
--- a/mk_dreamplug_rootfs
+++ b/mk_dreamplug_rootfs
@@ -43,18 +43,6 @@ mkdir -p $pkgcache
hostname='freedombox'
rootpassword='freedom'
-kernelimage=http://www.newit.co.uk/kernels/Dreamplug/Dreamplug-prerelease/uImage
-kernelmodules=http://www.newit.co.uk/kernels/Dreamplug/Dreamplug-prerelease/Modules.tar.gz
-
-if [ ! -f $tmpdir/uImage ]
-then
- wget -c $kernelimage --output-document="$tmpdir/uImage"
-fi
-if [ ! -f $tmpdir/linux.tar.gz ]
-then
- wget -c $kernelmodules --output-document="$tmpdir/linux.tar.gz"
-fi
-
rm -rf $target/*
mkdir -p $target/var/cache/apt/ && mount -o bind $pkgcache $target/var/cache/apt/
@@ -65,13 +53,15 @@ multistrap -f fbx-armel.conf --no-auth -d $target
umount $target/var/cache/apt/
mkdir $target/var/cache/apt/archives
-echo "Unpacking kernel modules..."
-mkdir -p $target/lib/modules/
-tar -C $target/lib/ -zxvf $tmpdir/linux.tar.gz | tail
+echo `pwd`
+
+# kludge around Dreamplug kernel support not being available in Debian main yet
+mkdir -p $target/tmp/kernel
+cp kernel/*.deb $target/tmp/kernel/
+cp kernel/uImage $target/tmp/kernel/
+
+echo `pwd`
-echo "copy uImage to target filesystem"
-mkdir -p $target/boot
-cp build/tmp/uImage $target/boot/uImage
echo "copy copy2dream.sh script to target filesystem"
cp bin/copy2dream.sh $target/boot/copy2dream.sh
@@ -139,6 +129,22 @@ dpkg --configure -a
# sshd may be left running by the postinst, clean that up
/etc/init.d/ssh stop
+# post-install operations for kernel packages
+echo \"Installing kernel content\"
+dpkg --install /tmp/kernel/*.deb
+
+# rename deliverables so that flash-kernel is happy using them
+mv /boot/config-3.0.0 /boot/config-3.0.0-kirkwood
+mv /boot/initrd.img-3.0.0 /boot/initrd.img-3.0.0-kirkwood
+mv /boot/System.map-3.0.0 /boot/System.map-3.0.0-kirkwood
+mv /boot/vmlinuz-3.0.0 /boot/vmlinuz-3.0.0-kirkwood
+
+# pre-processed bootable kernel image crafted from above using flash-kernel
+cp /tmp/kernel/uImage /boot/uImage
+
+# update-initramfs -c -k 3.0.0-4
+# flash-kernel 3.0.0-4
+
# Establish an initial root password
echo \"Set root password to \"$rootpassword
echo root:$rootpassword | /usr/sbin/chpasswd