raring: work around https://bugs.launchpad.net/bugs/1161912 by patching linux-version

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/22/head
Robert Nelson 12 years ago
parent c1b41260f8
commit dd489ed3e2

@ -121,6 +121,14 @@ apt-get remove -y x-loader-omap* || true
apt-get remove -y flash-kernel || true apt-get remove -y flash-kernel || true
apt-get -y autoremove || 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 if [ "x${serial_tty}" != "x" ] ; then
cat > /etc/init/${serial_tty}.conf <<-__EOF__ cat > /etc/init/${serial_tty}.conf <<-__EOF__
start on stopped rc RUNLEVEL=[2345] start on stopped rc RUNLEVEL=[2345]

@ -834,12 +834,24 @@ flash_kernel_base_installer () {
mount -o bind /sys /target/sys mount -o bind /sys /target/sys
cat /proc/mounts > /target/mounts 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) chroot /target update-initramfs -c -k \$(uname -r)
rm -f /target/mounts || true rm -f /target/mounts || true
umount /target/sys umount /target/sys
cp /target/boot/uboot/${fki_vmlinuz} /target/boot/${fki_vmlinuz} cp /target/boot/uboot/${fki_vmlinuz} /target/boot/${fki_vmlinuz}
cp /target/boot/initrd.img-\$(uname -r) /target/boot/${fki_initrd} 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 sync
umount /target/boot/uboot umount /target/boot/uboot
@ -867,6 +879,20 @@ flash_kernel_broken () {
chmod a+x ${TEMPDIR}/initrd-tree/fixes/fix_flash-kernel.sh 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 () { finish_installing_device () {
cat > ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device <<-__EOF__ cat > ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device <<-__EOF__
#!/bin/sh -e #!/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 cp -v "${DIR}/lib/flash_kernel/flash-kernel.conf" ${TEMPDIR}/initrd-tree/etc/flash-kernel.conf
flash_kernel_base_installer flash_kernel_base_installer
flash_kernel_broken flash_kernel_broken
patch_linux_version
;; ;;
wheezy) wheezy)
cp -v "${DIR}/lib/debian-finish.sh" ${TEMPDIR}/initrd-tree/usr/bin/finish-install.sh cp -v "${DIR}/lib/debian-finish.sh" ${TEMPDIR}/initrd-tree/usr/bin/finish-install.sh
@ -1726,21 +1753,6 @@ check_distro () {
;; ;;
raring|raring-armhf) raring|raring-armhf)
DIST="raring" 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) wheezy-armel)
DIST="wheezy" DIST="wheezy"

Loading…
Cancel
Save