[25996] in Source-Commits
Re: /svn/athena r25333 - trunk/debathena/scripts/installer
daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Sun Jul 31 15:40:55 2011
Date: Sun, 31 Jul 2011 15:40:46 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201107311844.p6VIiHuq016235@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1107311529020.7526@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Sun, 31 Jul 2011, Jonathan D Reed wrote:
> Author: jdreed
> Date: 2011-07-31 14:44:17 -0400 (Sun, 31 Jul 2011)
> New Revision: 25333
>
> Modified:
> trunk/debathena/scripts/installer/install-debathena.beta.sh
> Log:
> Disable acpi on the 790s so that they can reboot
>
> Modified: trunk/debathena/scripts/installer/install-debathena.beta.sh
> ===================================================================
> --- trunk/debathena/scripts/installer/install-debathena.beta.sh 2011-07-30 20:47:34 UTC (rev 25332)
> +++ trunk/debathena/scripts/installer/install-debathena.beta.sh 2011-07-31 18:44:17 UTC (rev 25333)
> @@ -103,6 +103,23 @@
> echo "sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true" |debconf-set-selections
> fi
>
> +if [ "$(cat /sys/class/dmi/id/product_name)" = "OptiPlex 790" ]; then
> + noacpi=y
> + if [ "$category" != "cluster" ]; then
> + echo "The Dell 790 sometimes has problems rebooting. The best way to"
> + echo "workaround this is to disable ACPI at boot time."
> + ask "Is it ok to do this now? [Y/n] " y
> + if [ y != "$answer" ]; then
We're inconsistent about quoting constant strings ("cluster" vs 'y'), but
it should still work ...
> + noacpi=n
> + fi
> + fi
> + if [ "$noacpi" = "y" ]; then
> + if sed -i -e 's/^GRUB_CMDLINE_LINUX="/GRUB_CMDLINE_LINUX="acpi=off /' /etc/default/grub; then
> + update-grub
> + fi
We should consider an elif !cluster clause to tell the user that the sed
failed ... though I guess that would only be if, like, /etc/default/grub
doesn't exist or something -- sed returns zero even if it doesn't change
anything. So maybe we shouldn't even bother checkint its return value.
ACK.
-Ben
> + fi
> +fi
> +
> echo "A summary of your choices:"
> echo " Category: $category"
> echo " Extra-software package: $csoft"
>
>