From 0062d7e0a479af61fd0b5759b7c2774a572d705b Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Sun, 2 May 2010 12:59:52 -0500 Subject: [PATCH] add mmc boot partition along with uinitrd update script --- mk_mmc.sh | 10 +--------- scripts/lucid-tweaks.diff | 21 +++++++++++++++++---- scripts/rebuild_uinitrd.sh | 7 +++++++ scripts/squeeze-tweaks.diff | 20 ++++++++++++++++---- 4 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 scripts/rebuild_uinitrd.sh diff --git a/mk_mmc.sh b/mk_mmc.sh index 82cf244..d99beb6 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -186,15 +186,7 @@ else sudo cp -v ${DIR}/scripts/dvi-normal-${DIST}.cmd ${DIR}/disk/boot.cmd fi -echo "#!/bin/sh" > /tmp/rebuild_uinitrd.sh -echo "" >> /tmp/rebuild_uinitrd.sh -echo "echo \"This script requires: uboot-mkimage and initramfs-tools installed\"" >> /tmp/rebuild_uinitrd.sh -echo "DIR=\$PWD" >> /tmp/rebuild_uinitrd.sh -echo "sudo update-initramfs -u -k \$(uname -r)" >> /tmp/rebuild_uinitrd.sh -echo "sudo mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-\$(uname -r) \${DIR}/uInitrd" >> /tmp/rebuild_uinitrd.sh -echo "" >> /tmp/rebuild_uinitrd.sh - -sudo cp -v /tmp/rebuild_uinitrd.sh ${DIR}/disk/rebuild_uinitrd.sh +sudo cp -v ${DIR}/scripts/rebuild_uinitrd.sh ${DIR}/disk/rebuild_uinitrd.sh sudo chmod +x ${DIR}/disk/rebuild_uinitrd.sh cd ${DIR}/disk diff --git a/scripts/lucid-tweaks.diff b/scripts/lucid-tweaks.diff index 8c4129b..a11464e 100644 --- a/scripts/lucid-tweaks.diff +++ b/scripts/lucid-tweaks.diff @@ -1,25 +1,32 @@ diff --git a/lib/chroot-setup.sh b/lib/chroot-setup.sh -index 61bc6ae..3406f4e 100644 +index 61bc6ae..fea0a1b 100644 --- a/lib/chroot-setup.sh +++ b/lib/chroot-setup.sh -@@ -110,6 +110,9 @@ EOF +@@ -110,6 +110,12 @@ EOF APT_LISTCHANGES_FRONTEND=none export APT_LISTCHANGES_FRONTEND + cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf + cp /etc/e2fsck.conf /target/etc/e2fsck.conf ++ ++ ++ + return 0 } -@@ -120,6 +123,23 @@ chroot_cleanup () { +@@ -120,6 +126,33 @@ chroot_cleanup () { mv /target/sbin/initctl.REAL /target/sbin/initctl fi + if [ -e /target/boot/initrd.img ]; then + /usr/sbin/flash_eraseall /dev/mtd2 ++ ++ + fi + ++ ++ + if [ -e /etc/rcn.conf ]; then + mkdir -p /tmp/mmc + mount /dev/mmcblk0p1 /tmp/mmc @@ -27,10 +34,16 @@ index 61bc6ae..3406f4e 100644 + cp /tmp/mmc/normal.scr /tmp/mmc/boot.scr + cp /tmp/mmc/uInitrd /tmp/mmc/uInitrd.net + cp /tmp/mmc/uInitrd.final /tmp/mmc/uInitrd ++ umount /tmp/mmc ++ ++ mkdir -p /target/boot/uboot ++ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab ++ + cp -r /lib/modules/`uname -r`/ /target/lib/modules/ + cp -r /lib/firmware/ /target/lib/ + rm -f /etc/rcn.conf -+ umount /tmp/mmc ++ ++ + fi + # Undo the mounts done by the packages during installation. diff --git a/scripts/rebuild_uinitrd.sh b/scripts/rebuild_uinitrd.sh new file mode 100644 index 0000000..1908647 --- /dev/null +++ b/scripts/rebuild_uinitrd.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "This script requires: uboot-mkimage and initramfs-tools installed" +DIR=$PWD +sudo update-initramfs -u -k $(uname -r) +sudo mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-$(uname -r) ${DIR}/uInitrd + diff --git a/scripts/squeeze-tweaks.diff b/scripts/squeeze-tweaks.diff index d569d95..5bd7d8a 100644 --- a/scripts/squeeze-tweaks.diff +++ b/scripts/squeeze-tweaks.diff @@ -1,20 +1,26 @@ diff --git a/lib/chroot-setup.sh b/lib/chroot-setup.sh -index 61bc6ae..bc67b04 100644 +index 61bc6ae..a889e23 100644 --- a/lib/chroot-setup.sh +++ b/lib/chroot-setup.sh -@@ -110,6 +110,8 @@ EOF +@@ -110,6 +110,12 @@ EOF APT_LISTCHANGES_FRONTEND=none export APT_LISTCHANGES_FRONTEND ++ + cp /etc/e2fsck.conf /target/etc/e2fsck.conf ++ ++ ++ + return 0 } -@@ -120,6 +122,19 @@ chroot_cleanup () { +@@ -120,6 +126,27 @@ chroot_cleanup () { mv /target/sbin/initctl.REAL /target/sbin/initctl fi ++ ++ + if [ -e /etc/rcn.conf ]; then + mkdir -p /tmp/mmc + mount /dev/mmcblk0p1 /tmp/mmc @@ -22,10 +28,16 @@ index 61bc6ae..bc67b04 100644 + cp /tmp/mmc/normal.scr /tmp/mmc/boot.scr + cp /tmp/mmc/uInitrd /tmp/mmc/uInitrd.net + cp /tmp/mmc/uInitrd.final /tmp/mmc/uInitrd ++ umount /tmp/mmc ++ ++ mkdir -p /target/boot/uboot ++ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab ++ + cp -r /lib/modules/`uname -r`/ /target/lib/modules/ + cp -r /lib/firmware/ /target/lib/ + rm -f /etc/rcn.conf -+ umount /tmp/mmc ++ ++ + fi + # Undo the mounts done by the packages during installation.