From dd489ed3e21cbc1e5543544062c48429a0d6cb6e Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Wed, 26 Jun 2013 15:07:57 -0500 Subject: [PATCH] raring: work around https://bugs.launchpad.net/bugs/1161912 by patching linux-version Signed-off-by: Robert Nelson --- lib/ubuntu-finish.sh | 8 ++++++++ mk_mmc.sh | 42 +++++++++++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/lib/ubuntu-finish.sh b/lib/ubuntu-finish.sh index 88b7754..df11026 100644 --- a/lib/ubuntu-finish.sh +++ b/lib/ubuntu-finish.sh @@ -121,6 +121,14 @@ apt-get remove -y x-loader-omap* || true apt-get remove -y flash-kernel || true apt-get -y autoremove || true + +#linux-version was patched.. +if [ -f /usr/bin/linux-version.broken ] ; then + rm -rf /usr/bin/linux-version || true + mv /usr/bin/linux-version.broken /usr/bin/linux-version + echo "INFO: [/usr/bin/linux-version] was patched..." >> /var/log/netinstall.log +fi + if [ "x${serial_tty}" != "x" ] ; then cat > /etc/init/${serial_tty}.conf <<-__EOF__ start on stopped rc RUNLEVEL=[2345] diff --git a/mk_mmc.sh b/mk_mmc.sh index a1e823d..61810ba 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -834,12 +834,24 @@ flash_kernel_base_installer () { mount -o bind /sys /target/sys cat /proc/mounts > /target/mounts + + #patch ubuntu's linux-version: + if [ -f /fixes/linux-version ] ; then + chroot /target apt-get -y --force-yes install linux-base + mv /target/usr/bin/linux-version /target/usr/bin/linux-version.broken + cp /fixes/linux-version /target/usr/bin/linux-version + fi + chroot /target update-initramfs -c -k \$(uname -r) rm -f /target/mounts || true umount /target/sys cp /target/boot/uboot/${fki_vmlinuz} /target/boot/${fki_vmlinuz} cp /target/boot/initrd.img-\$(uname -r) /target/boot/${fki_initrd} + + #needed with patched linux-version + cp /target/boot/uboot/${fki_vmlinuz} /target/boot/vmlinuz-\$(uname -r) + sync umount /target/boot/uboot @@ -867,6 +879,20 @@ flash_kernel_broken () { chmod a+x ${TEMPDIR}/initrd-tree/fixes/fix_flash-kernel.sh } +patch_linux_version () { + cat > ${TEMPDIR}/initrd-tree/fixes/linux-version <<-__EOF__ + #!/bin/sh -e + + /usr/bin/linux-version.broken "\$@" + + #fixme: we could check if [/usr/bin/linux-version.broken list] works: + echo \$(uname -r) + + __EOF__ + + chmod a+x ${TEMPDIR}/initrd-tree/fixes/linux-version +} + finish_installing_device () { cat > ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device <<-__EOF__ #!/bin/sh -e @@ -970,6 +996,7 @@ initrd_preseed_settings () { cp -v "${DIR}/lib/flash_kernel/flash-kernel.conf" ${TEMPDIR}/initrd-tree/etc/flash-kernel.conf flash_kernel_base_installer flash_kernel_broken + patch_linux_version ;; wheezy) cp -v "${DIR}/lib/debian-finish.sh" ${TEMPDIR}/initrd-tree/usr/bin/finish-install.sh @@ -1726,21 +1753,6 @@ check_distro () { ;; raring|raring-armhf) DIST="raring" - cat <<-__EOF__ - ----------------------------- - WARNING: Ubuntu Raring (13.04) is BROKEN for SOME boards (Beagle/Panda) - SEE: https://bugs.launchpad.net/bugs/1161912 - WORKAROUND: (after error) switch to either: shell/(ctrl-alt-f2) - and run: /bin/sh /fixes/fix_flash-kernel.sh - switch back to menu/(ctrl-alt-f1) and rerun failed option. - ----------------------------- - __EOF__ - unset response - echo -n "Are you 100% sure on still trying to install [${DIST}] (y/n)? " - read response - if [ "x${response}" != "xy" ] ; then - exit - fi ;; wheezy-armel) DIST="wheezy"