From 604cf8f096a50effebd151dc5e52ec33cd31c54b Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Wed, 23 Nov 2011 11:39:42 -0600 Subject: [PATCH] bug fix: just run the fixer script in the end target Signed-off-by: Robert Nelson --- mk_mmc.sh | 21 +++++---- scripts/debian-finish.sh | 34 ++++++++++++++ scripts/debian-tweaks-uenv.diff | 63 ------------------------- scripts/debian-tweaks.diff | 37 +++++---------- scripts/maverick-preseed.cfg | 2 +- scripts/natty-preseed.cfg | 2 +- scripts/oneiric-preseed.cfg | 2 +- scripts/squeeze-preseed.cfg | 2 +- scripts/ubuntu-finish.sh | 64 +++++++++++++++++++++++++ scripts/ubuntu-tweaks-uenv.diff | 83 --------------------------------- scripts/ubuntu-tweaks.diff | 65 +++++--------------------- 11 files changed, 139 insertions(+), 236 deletions(-) create mode 100644 scripts/debian-finish.sh delete mode 100644 scripts/debian-tweaks-uenv.diff create mode 100644 scripts/ubuntu-finish.sh delete mode 100644 scripts/ubuntu-tweaks-uenv.diff diff --git a/mk_mmc.sh b/mk_mmc.sh index e54ecd3..71179cd 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -514,6 +514,8 @@ function setup_bootscripts { #Setup Kernel Boot Address sed -i -e 's:ZRELADD:'$ZRELADD':g' ${DIR}/scripts/*.diff + sed -i -e 's:ZRELADD:'$ZRELADD':g' ${DIR}/scripts/ubuntu-finish.sh + sed -i -e 's:ZRELADD:'$ZRELADD':g' ${DIR}/scripts/debian-finish.sh if [ "$SMSC95XX_MOREMEM" ];then sed -i 's/8192/16384/g' ${DIR}/scripts/*.diff @@ -631,23 +633,19 @@ function initrd_cleanup { function initrd_preseed_settings { echo "NetInstall: Adding Distro Tweaks and Preseed Configuration" - unset UENV - if [ "${USE_UENV}" ] ; then - UENV="-uenv" - fi cd ${TEMPDIR}/initrd-tree/ case "$DIST" in maverick) - patch -p1 < ${DIR}/scripts/ubuntu-tweaks${UENV}.diff + patch -p1 < ${DIR}/scripts/ubuntu-tweaks.diff ;; natty) - patch -p1 < ${DIR}/scripts/ubuntu-tweaks${UENV}.diff + patch -p1 < ${DIR}/scripts/ubuntu-tweaks.diff ;; oneiric) - patch -p1 < ${DIR}/scripts/ubuntu-tweaks${UENV}.diff + patch -p1 < ${DIR}/scripts/ubuntu-tweaks.diff ;; squeeze) - patch -p1 < ${DIR}/scripts/debian-tweaks${UENV}.diff + patch -p1 < ${DIR}/scripts/debian-tweaks.diff ;; esac cd ${DIR}/ @@ -658,23 +656,27 @@ case "$DIST" in cp -v ${DIR}/scripts/serial.conf ${TEMPDIR}/initrd-tree/etc/${SERIAL}.conf chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg + cp -v ${DIR}/scripts/ubuntu-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh ;; natty) cp -v ${DIR}/scripts/flash-kernel.conf ${TEMPDIR}/initrd-tree/etc/flash-kernel.conf cp -v ${DIR}/scripts/serial.conf ${TEMPDIR}/initrd-tree/etc/${SERIAL}.conf chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg + cp -v ${DIR}/scripts/ubuntu-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh ;; oneiric) cp -v ${DIR}/scripts/flash-kernel.conf ${TEMPDIR}/initrd-tree/etc/flash-kernel.conf cp -v ${DIR}/scripts/serial.conf ${TEMPDIR}/initrd-tree/etc/${SERIAL}.conf chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg + cp -v ${DIR}/scripts/ubuntu-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh ;; squeeze) cp -v ${DIR}/scripts/e2fsck.conf ${TEMPDIR}/initrd-tree/etc/e2fsck.conf chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg + cp -v ${DIR}/scripts/debian-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh ;; esac } @@ -858,6 +860,7 @@ if [ "${USE_UENV}" ] ; then echo "-----------------------------" cat ${TEMPDIR}/bootscripts/normal.cmd echo "-----------------------------" + touch ${TEMPDIR}/disk/use_uenv else echo "Copying boot.scr based boot scripts to Boot Partition" echo "-----------------------------" @@ -1023,6 +1026,8 @@ function reset_scripts { #Setup Kernel Boot Address sed -i -e 's:'$ZRELADD':ZRELADD:g' ${DIR}/scripts/*.diff + sed -i -e 's:'$ZRELADD':ZRELADD:g' ${DIR}/scripts/ubuntu-finish.sh + sed -i -e 's:'$ZRELADD':ZRELADD:g' ${DIR}/scripts/debian-finish.sh if [ "$SMSC95XX_MOREMEM" ];then sed -i 's/16384/8192/g' ${DIR}/scripts/*.diff diff --git a/scripts/debian-finish.sh b/scripts/debian-finish.sh new file mode 100644 index 0000000..f995af9 --- /dev/null +++ b/scripts/debian-finish.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#Find Target Partition and FileSystem +FINAL_PART=$(mount | grep /dev/ | grep -v devpts | awk '{print $1}') +FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | awk '{print $5}') + +#Cleanup: NetInstall Files +rm -f /boot/uboot/uInitrd.net || true +rm -f /boot/uboot/uImage || true + +#Next: are we using uEnv.txt or boot.scr boot files? +if [ -f "/boot/uboot/use_uenv" ]; then + rm -f /boot/uboot/boot.scr || true + + if [ -f "/boot/uboot/normal.txt" ]; then + sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/normal.txt + sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/normal.txt + + rm -f /boot/uboot/uEnv.txt || true + mv /boot/uboot/normal.txt /boot/uboot/uEnv.txt + fi +else + if [ -f "/boot/uboot/boot.scr" ]; then + rm -f /boot/uboot/boot.scr || true + mv /boot/uboot/normal.scr /boot/uboot/boot.scr + fi +fi + +#Process Correct Kernel Image: +update-initramfs -c -k `uname -r` +mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uboot/uInitrd +mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uboot/uImage + + diff --git a/scripts/debian-tweaks-uenv.diff b/scripts/debian-tweaks-uenv.diff deleted file mode 100644 index f4efec4..0000000 --- a/scripts/debian-tweaks-uenv.diff +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/usr/lib/finish-install.d/08rcn-omap b/usr/lib/finish-install.d/08rcn-omap -new file mode 100755 -index 0000000..6d06fc7 ---- /dev/null -+++ b/usr/lib/finish-install.d/08rcn-omap -@@ -0,0 +1,57 @@ -+#!/bin/sh -e -+cp /etc/e2fsck.conf /target/etc/e2fsck.conf -+ -+if [ -f /etc/rcn.conf ]; then -+ mkdir -p /tmp/mmc -+ mount /dev/mmcblk0p1 /tmp/mmc -+ -+ #Remove NetInstall bits -+ rm -f /tmp/mmc/uInitrd.net || true -+ -+ #Install kernel image deb -+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/ -+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true -+ -+ #Setup Final Boot Scripts -+ if [ -f "/tmp/mmc/boot.scr" ]; then -+ rm -f /tmp/mmc/boot.scr || true -+ mv /tmp/mmc/normal.scr /tmp/mmc/boot.scr -+ fi -+ -+ if [ -f "/tmp/mmc/normal.txt" ]; then -+ FINAL_PART=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's/ .*//') -+ FINAL_FSTYPE=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's:'$FINAL_PART' on /target/ type ::' | sed 's/ .*//') -+ sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /tmp/mmc/normal.txt -+ sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /tmp/mmc/normal.txt -+ -+ rm -f /tmp/mmc/uEnv.txt || true -+ mv /tmp/mmc/normal.txt /tmp/mmc/uEnv.txt -+ fi -+ -+ mkdir -p /target/boot/uboot -+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab -+ -+ #smsc95xx kevent workaround/hack -+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf -+ -+ if [ ! -f /etc/rcn-serial.conf ]; then -+ cat /target/etc/inittab | grep SERIAL || echo "S:2345:respawn:/sbin/getty 115200 SERIAL" >> /target/etc/inittab -+ fi -+ -+ cp -r /lib/firmware/ /target/lib/ || true -+ -+ rm -f /etc/rcn.conf -+ -+ #Generate new initrd.img-* -+ mount -o bind /sys /target/sys -+ chroot /target update-initramfs -c -k `uname -r` -+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd -+ cp /target/boot/uInitrd /tmp/mmc/uInitrd -+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage -+ cp /target/boot/uImage /tmp/mmc/uImage -+ umount /target/sys -+ -+ sync -+ umount /tmp/mmc -+fi -+ diff --git a/scripts/debian-tweaks.diff b/scripts/debian-tweaks.diff index 8234ad9..98aad75 100644 --- a/scripts/debian-tweaks.diff +++ b/scripts/debian-tweaks.diff @@ -3,29 +3,21 @@ new file mode 100755 index 0000000..6d06fc7 --- /dev/null +++ b/usr/lib/finish-install.d/08rcn-omap -@@ -0,0 +1,47 @@ +@@ -0,0 +1,34 @@ +#!/bin/sh -e +cp /etc/e2fsck.conf /target/etc/e2fsck.conf ++cp /etc/finish-install.sh /target/etc/finish-install.sh ++chmod a+x /target/etc/finish-install.sh + +if [ -f /etc/rcn.conf ]; then -+ mkdir -p /tmp/mmc -+ mount /dev/mmcblk0p1 /tmp/mmc ++ mkdir -p /target/boot/uboot ++ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab + -+ #Remove NetInstall bits -+ rm -f /tmp/mmc/uInitrd.net || true ++ mount /dev/mmcblk0p1 /target/boot/uboot + + #Install kernel image deb -+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/ -+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true -+ -+ #Setup Final Boot Scripts -+ if [ -f "/tmp/mmc/boot.scr" ]; then -+ rm -f /tmp/mmc/boot.scr || true -+ mv /tmp/mmc/normal.scr /tmp/mmc/boot.scr -+ fi -+ -+ mkdir -p /target/boot/uboot -+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab ++ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /target/boot/uboot/linux-image-*_1.0*_armel.deb /target/ ++ rm -f /target/boot/uboot/linux-image-*_1.0*_armel.deb || true + + #smsc95xx kevent workaround/hack + echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf @@ -38,16 +30,11 @@ index 0000000..6d06fc7 + + rm -f /etc/rcn.conf + -+ #Generate new initrd.img-* -+ mount -o bind /sys /target/sys -+ chroot /target update-initramfs -c -k `uname -r` -+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd -+ cp /target/boot/uInitrd /tmp/mmc/uInitrd -+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage -+ cp /target/boot/uImage /tmp/mmc/uImage -+ umount /target/sys ++ mount -o bind /sys /target/sys ++ chroot /target /bin/bash /etc/finish-install.sh ++ umount /target/sys + + sync -+ umount /tmp/mmc ++ umount /target/boot/uboot +fi + diff --git a/scripts/maverick-preseed.cfg b/scripts/maverick-preseed.cfg index f33e2b3..de694c9 100644 --- a/scripts/maverick-preseed.cfg +++ b/scripts/maverick-preseed.cfg @@ -4,7 +4,7 @@ #d-i apt-setup/contrib boolean true # Individual additional packages to install -d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate +d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate bash # Whether to upgrade packages after debootstrap. # Allowed values: none, safe-upgrade, full-upgrade diff --git a/scripts/natty-preseed.cfg b/scripts/natty-preseed.cfg index 78e8a45..1d5293f 100644 --- a/scripts/natty-preseed.cfg +++ b/scripts/natty-preseed.cfg @@ -10,7 +10,7 @@ d-i mirror/http/hostname string ports.ubuntu.com d-i mirror/http/directory string /ubuntu-ports # Individual additional packages to install -d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate +d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate bash # Whether to upgrade packages after debootstrap. # Allowed values: none, safe-upgrade, full-upgrade diff --git a/scripts/oneiric-preseed.cfg b/scripts/oneiric-preseed.cfg index 78e8a45..1d5293f 100644 --- a/scripts/oneiric-preseed.cfg +++ b/scripts/oneiric-preseed.cfg @@ -10,7 +10,7 @@ d-i mirror/http/hostname string ports.ubuntu.com d-i mirror/http/directory string /ubuntu-ports # Individual additional packages to install -d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate +d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate bash # Whether to upgrade packages after debootstrap. # Allowed values: none, safe-upgrade, full-upgrade diff --git a/scripts/squeeze-preseed.cfg b/scripts/squeeze-preseed.cfg index edb56ab..d31e2a8 100644 --- a/scripts/squeeze-preseed.cfg +++ b/scripts/squeeze-preseed.cfg @@ -4,7 +4,7 @@ d-i apt-setup/non-free boolean true d-i apt-setup/contrib boolean true # Individual additional packages to install -d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget firmware-linux ntpdate +d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget firmware-linux ntpdate bash # Whether to upgrade packages after debootstrap. # Allowed values: none, safe-upgrade, full-upgrade diff --git a/scripts/ubuntu-finish.sh b/scripts/ubuntu-finish.sh new file mode 100644 index 0000000..a10649e --- /dev/null +++ b/scripts/ubuntu-finish.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +#Find Target Partition and FileSystem +FINAL_PART=$(mount | grep /dev/ | grep -v devpts | awk '{print $1}') +FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | awk '{print $5}') + +#Cleanup: NetInstall Files +rm -f /boot/uboot/uInitrd.net || true + +#Cleanup: Ubuntu's mess of backup files +rm -f /boot/uboot/uInitrd || true +rm -f /boot/uboot/uInitrd.bak || true +rm -f /boot/uboot/uImage || true +rm -f /boot/uboot/uImage.bak || true + +#Did: Ubuntu touch and backup scr boot file? +if [ -f "/boot/uboot/boot.scr.bak" ]; then + rm -f /boot/uboot/boot.scr || true + mv /boot/uboot/boot.scr.bak /boot/uboot/boot.scr +fi + +#Did: Ubuntu touch and backup MLO Bootloader? +if [ -f "/boot/uboot/MLO.bak" ]; then + rm -f /boot/uboot/MLO || true + mv /boot/uboot/MLO.bak /boot/uboot/MLO +fi + +#Did: Ubuntu touch and backup u-boot.bin Bootloader? +if [ -f "/boot/uboot/u-boot.bin.bak" ]; then + rm -f /boot/uboot/u-boot.bin || true + mv /boot/uboot/u-boot.bin.bak /boot/uboot/u-boot.bin +fi + +#Next: are we using uEnv.txt or boot.scr boot files? +if [ -f "/boot/uboot/use_uenv" ]; then + rm -f /boot/uboot/boot.scr || true + + if [ -f "/boot/uboot/normal.txt" ]; then + sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/normal.txt + sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/normal.txt + + rm -f /boot/uboot/uEnv.txt || true + mv /boot/uboot/normal.txt /boot/uboot/uEnv.txt + fi +else + if [ -f "/boot/uboot/boot.scr" ]; then + rm -f /boot/uboot/boot.scr || true + mv /boot/uboot/normal.scr /boot/uboot/boot.scr + fi +fi + +#Cleanup: some of Ubuntu's packages: +apt-get remove -y linux-image-omap* || true +apt-get remove -y linux-headers-omap* || true +apt-get remove -y u-boot-linaro* || true +apt-get remove -y x-loader-omap* || true +apt-get remove -y flash-kernel || true + +#Process Correct Kernel Image: +update-initramfs -c -k `uname -r` +mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uboot/uInitrd +mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uboot/uImage + + diff --git a/scripts/ubuntu-tweaks-uenv.diff b/scripts/ubuntu-tweaks-uenv.diff deleted file mode 100644 index 303db4b..0000000 --- a/scripts/ubuntu-tweaks-uenv.diff +++ /dev/null @@ -1,83 +0,0 @@ -diff --git a/usr/lib/finish-install.d/08rcn-omap b/usr/lib/finish-install.d/08rcn-omap -new file mode 100755 -index 0000000..6d06fc7 ---- /dev/null -+++ b/usr/lib/finish-install.d/08rcn-omap -@@ -0,0 +1,76 @@ -+#!/bin/sh -e -+cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf -+cp /etc/SERIAL.conf /target/etc/init/SERIAL.conf -+ -+if [ -f /etc/rcn.conf ]; then -+ mkdir -p /tmp/mmc -+ mount /dev/mmcblk0p1 /tmp/mmc -+ -+ #Remove NetInstall bits -+ rm -f /tmp/mmc/uInitrd.net || true -+ -+ #Cleanup Ubuntu's mess -+ rm -f /tmp/mmc/uInitrd || true -+ rm -f /tmp/mmc/uInitrd.bak || true -+ rm -f /tmp/mmc/uImage || true -+ rm -f /tmp/mmc/uImage.bak || true -+ -+ if [ -f "/tmp/mmc/boot.scr.bak" ]; then -+ rm -f /tmp/mmc/boot.scr.bak || true -+ fi -+ -+ if [ -f "/tmp/mmc/MLO.bak" ]; then -+ rm -f /tmp/mmc/MLO || true -+ mv /tmp/mmc/MLO.bak /tmp/mmc/MLO -+ fi -+ -+ if [ -f "/tmp/mmc/u-boot.bin.bak" ]; then -+ rm -f /tmp/mmc/u-boot.bin || true -+ mv /tmp/mmc/u-boot.bin.bak /tmp/mmc/u-boot.bin -+ fi -+ -+ #Install kernel image deb -+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/ -+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true -+ -+ #With Oneiric Updates, these now seem to ignore /etc/flash-kernel.conf, so lets just remove them.. -+ chroot /target apt-get remove -y linux-image-omap* || true -+ chroot /target apt-get remove -y linux-headers-omap* || true -+ chroot /target apt-get remove -y u-boot-linaro* || true -+ chroot /target apt-get remove -y x-loader-omap* || true -+ -+ chroot /target apt-get remove -y flash-kernel || true -+ -+ #Setup Final Boot Scripts -+ if [ -f "/tmp/mmc/normal.txt" ]; then -+ FINAL_PART=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's/ .*//') -+ FINAL_FSTYPE=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's:'$FINAL_PART' on /target/ type ::' | sed 's/ .*//') -+ sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /tmp/mmc/normal.txt -+ sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /tmp/mmc/normal.txt -+ -+ rm -f /tmp/mmc/uEnv.txt || true -+ mv /tmp/mmc/normal.txt /tmp/mmc/uEnv.txt -+ fi -+ -+ mkdir -p /target/boot/uboot -+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab -+ -+ #smsc95xx kevent workaround/hack -+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf -+ -+ cp -r /lib/firmware/ /target/lib/ || true -+ -+ rm -f /etc/rcn.conf -+ -+ #Generate new initrd.img-* -+ mount -o bind /sys /target/sys -+ chroot /target update-initramfs -c -k `uname -r` -+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd -+ cp /target/boot/uInitrd /tmp/mmc/uInitrd -+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage -+ cp /target/boot/uImage /tmp/mmc/uImage -+ umount /target/sys -+ -+ sync -+ umount /tmp/mmc -+fi -+ diff --git a/scripts/ubuntu-tweaks.diff b/scripts/ubuntu-tweaks.diff index bd44bed..1ffdad3 100644 --- a/scripts/ubuntu-tweaks.diff +++ b/scripts/ubuntu-tweaks.diff @@ -3,58 +3,22 @@ new file mode 100755 index 0000000..6d06fc7 --- /dev/null +++ b/usr/lib/finish-install.d/08rcn-omap -@@ -0,0 +1,71 @@ +@@ -0,0 +1,31 @@ +#!/bin/sh -e +cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf +cp /etc/SERIAL.conf /target/etc/init/SERIAL.conf ++cp /etc/finish-install.sh /target/etc/finish-install.sh ++chmod a+x /target/etc/finish-install.sh + +if [ -f /etc/rcn.conf ]; then -+ mkdir -p /tmp/mmc -+ mount /dev/mmcblk0p1 /tmp/mmc -+ -+ #Remove NetInstall bits -+ rm -f /tmp/mmc/uInitrd.net || true -+ -+ #Cleanup Ubuntu's mess -+ rm -f /tmp/mmc/uInitrd || true -+ rm -f /tmp/mmc/uInitrd.bak || true -+ rm -f /tmp/mmc/uImage || true -+ rm -f /tmp/mmc/uImage.bak || true -+ -+ if [ -f "/tmp/mmc/boot.scr.bak" ]; then -+ rm -f /tmp/mmc/boot.scr.bak || true -+ fi -+ -+ if [ -f "/tmp/mmc/MLO.bak" ]; then -+ rm -f /tmp/mmc/MLO || true -+ mv /tmp/mmc/MLO.bak /tmp/mmc/MLO -+ fi ++ mkdir -p /target/boot/uboot ++ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab + -+ if [ -f "/tmp/mmc/u-boot.bin.bak" ]; then -+ rm -f /tmp/mmc/u-boot.bin || true -+ mv /tmp/mmc/u-boot.bin.bak /tmp/mmc/u-boot.bin -+ fi ++ mount /dev/mmcblk0p1 /target/boot/uboot + + #Install kernel image deb -+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/ -+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true -+ -+ #With Oneiric Updates, these now seem to ignore /etc/flash-kernel.conf, so lets just remove them.. -+ chroot /target apt-get remove -y linux-image-omap* || true -+ chroot /target apt-get remove -y linux-headers-omap* || true -+ chroot /target apt-get remove -y u-boot-linaro* || true -+ chroot /target apt-get remove -y x-loader-omap* || true -+ -+ chroot /target apt-get remove -y flash-kernel || true -+ -+ #Setup Final Boot Scripts -+ if [ -f "/tmp/mmc/boot.scr" ]; then -+ rm -f /tmp/mmc/boot.scr || true -+ mv /tmp/mmc/normal.scr /tmp/mmc/boot.scr -+ fi -+ -+ mkdir -p /target/boot/uboot -+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab ++ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /target/boot/uboot/linux-image-*_1.0*_armel.deb /target/ ++ rm -f /target/boot/uboot/linux-image-*_1.0*_armel.deb || true + + #smsc95xx kevent workaround/hack + echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf @@ -63,16 +27,11 @@ index 0000000..6d06fc7 + + rm -f /etc/rcn.conf + -+ #Generate new initrd.img-* -+ mount -o bind /sys /target/sys -+ chroot /target update-initramfs -c -k `uname -r` -+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd -+ cp /target/boot/uInitrd /tmp/mmc/uInitrd -+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage -+ cp /target/boot/uImage /tmp/mmc/uImage -+ umount /target/sys ++ mount -o bind /sys /target/sys ++ chroot /target /bin/bash /etc/finish-install.sh ++ umount /target/sys + + sync -+ umount /tmp/mmc ++ umount /target/boot/uboot +fi +