| author | Bdale Garbee <bdale@gag.com> | |
| Sat, 17 Sep 2011 06:46:17 +0000 (00:46 -0600) | ||
| committer | Bdale Garbee <bdale@gag.com> | |
| Sat, 17 Sep 2011 06:46:17 +0000 (00:46 -0600) |
| Makefile | patch | blob | history | |
| README | patch | blob | history | |
| bin/copy2dream.sh | patch | blob | history | |
| bin/partition-stick | [new file with mode: 0755] | patch | blob |
| fbx-base.conf | patch | blob | history | |
| kernel/uImage | [new file with mode: 0755] | patch | blob |
| mk_dreamplug_rootfs | patch | blob | history |
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
-# 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
--- a/README
+++ b/README
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
--- a/bin/copy2dream.sh
+++ b/bin/copy2dream.sh
#!/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"
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
--- /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
--- a/fbx-base.conf
+++ b/fbx-base.conf
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 (executable)
index 0000000..124a6ff
Binary files /dev/null and b/kernel/uImage differ
index 0000000..124a6ff
Binary files /dev/null and b/kernel/uImage differ
diff --git a/mk_dreamplug_rootfs b/mk_dreamplug_rootfs
--- a/mk_dreamplug_rootfs
+++ b/mk_dreamplug_rootfs
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/
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
# 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
