erase uboot env in nand

pull/8/head
Robert Nelson 15 years ago committed by Robert Nelson
parent f736315de7
commit fbb805acf9

@ -20,7 +20,6 @@ DIR=$PWD
function dl_xload_uboot {
rm -rfd ${DIR}/dl/ || true
mkdir -p ${DIR}/dl/
echo ""
@ -34,9 +33,12 @@ function dl_xload_uboot {
if test "-$DIST-" = "-lucid-"
then
KERNEL=${KERNEL_REL}-l${KERNEL_PATCH}
rm -f ${DIR}/dl/initrd.gz || true
wget -c --directory-prefix=${DIR}/dl/ http://ports.ubuntu.com/ubuntu-ports/dists/${DIST}/main/installer-armel/current/images/versatile/netboot/initrd.gz
wget -c --directory-prefix=${DIR}/dl/ http://ports.ubuntu.com/pool/universe/m/mtd-utils/mtd-utils_20090606-1_armel.deb
else
KERNEL=${KERNEL_REL}-x${KERNEL_PATCH}
rm -f ${DIR}/dl/initrd.gz || true
wget -c --directory-prefix=${DIR}/dl/ http://ftp.debian.org/debian/dists/${DIST}/main/installer-armel/current/images/versatile/netboot/initrd.gz
fi
@ -106,12 +108,16 @@ fi
sudo rm -rfd ${DIR}/initrd-tree/lib/modules/${KERNEL}/kernel/fs/
sudo rm -rfd ${DIR}/initrd-tree/lib/modules/${KERNEL}/kernel/sound/
sudo rm -rfd ${DIR}/initrd-tree/lib/modules/*-versatile/
sudo rm -rfd ${DIR}/initrd-tree/lib/firmware/*-versatile/
# if test "-$DIST-" = "-lucid-"
# then
# sudo patch -p1 -s < ${DIR}/scripts/beagle-lucid-override-flash-kernel.diff
# sudo patch -p1 -s < ${DIR}/scripts/beagle-use-normal.scr-for-boot.diff
# fi
if test "-$DIST-" = "-lucid-"
then
sudo cp -v ${DIR}/scripts/flash-kernel.conf ${DIR}/initrd-tree/etc/flash-kernel.conf
sudo patch -p1 -s < ${DIR}/scripts/beagle-copy-flash-kernel-override.diff
sudo patch -p1 -s < ${DIR}/scripts/beagle-erase-nand-and-copy-new-scr.diff
sudo dpkg -x ${DIR}/dl/mtd-utils_20090606-1_armel.deb ${DIR}/initrd-tree
fi
find . | cpio -o -H newc | gzip -9 > ${DIR}/initrd.mod.gz
cd ${DIR}/
@ -162,6 +168,8 @@ sudo cp -v ${DIR}/dl/${MLO} ${DIR}/disk/MLO
sudo cp -v ${DIR}/dl/${XLOAD} ${DIR}/disk/x-load.bin.ift
sudo cp -v ${DIR}/dl/${UBOOT} ${DIR}/disk/u-boot.bin
sudo touch ${DIR}/disk/limit.one
sudo mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ${DIR}/initrd.mod ${DIR}/disk/uInitrd
sudo mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n ${KERNEL} -d ${DIR}/kernel/boot/vmlinuz-* ${DIR}/disk/uImage

@ -0,0 +1,13 @@
diff --git a/lib/chroot-setup.sh b/lib/chroot-setup.sh
index 61bc6ae..629f541 100644
--- a/lib/chroot-setup.sh
+++ b/lib/chroot-setup.sh
@@ -110,6 +110,8 @@ EOF
APT_LISTCHANGES_FRONTEND=none
export APT_LISTCHANGES_FRONTEND
+ cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf
+
return 0
}

@ -1,15 +1,22 @@
diff --git a/lib/chroot-setup.sh b/lib/chroot-setup.sh
index f582297..c98a5d5 100644
index 629f541..783818a 100644
--- a/lib/chroot-setup.sh
+++ b/lib/chroot-setup.sh
@@ -129,6 +129,12 @@ chroot_cleanup () {
@@ -122,6 +122,19 @@ chroot_cleanup () {
mv /target/sbin/initctl.REAL /target/sbin/initctl
fi
+ /usr/sbin/flash_eraseall /dev/mtd2
+
+ mkdir -p /tmp/mmc
+ mount /dev/mmcblk0p1 /tmp/mmc
+ rm -f /tmp/mmc/boot.scr
+ mv /tmp/mmc/normal.scr /tmp/mmc/boot.scr
+
+ if [ -e /tmp/mmc/limit.one ]; then
+ cp /tmp/mmc/boot.scr /tmp/mmc/netinstall.scr
+ cp /tmp/mmc/normal.scr /tmp/mmc/boot.scr
+ rm -f /tmp/mmc/limit.one
+ fi
+
+ umount /tmp/mmc
+
# Undo the mounts done by the packages during installation.

@ -1,20 +0,0 @@
diff --git a/lib/chroot-setup.sh b/lib/chroot-setup.sh
index 4a92c4f..7663f3f 100644
--- a/lib/chroot-setup.sh
+++ b/lib/chroot-setup.sh
@@ -109,6 +109,15 @@ EOF
# Avoid apt-listchanges doing anything.
APT_LISTCHANGES_FRONTEND=none
export APT_LISTCHANGES_FRONTEND
+ cat > /target/etc/flash-kernel.conf <<FK
+#!/bin/sh
+
+echo "flash-kernel stopped:"
+echo "You are currently running the Community Kernel edition"
+echo "remove /etc/flash-kernel.conf to run Ubuntu's Kernel"
+exit
+
+FK
return 0
}
Loading…
Cancel
Save