<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Grub Parameter]]></title><description><![CDATA[<pre><code>#!/bin/sh 

# a simple script to reboot into windows once without user
# intervention.  Assumes that the menu listing corresponding to
# windows at least has &quot;win&quot; in the title.  If it doesn't, you can
# change the WINSTRING variable below.

WINSTRING=win
GRUBMENU=/boot/grub/menu.lst

let &quot;WINNUM = `grep title $GRUBMENU | grep -in $WINSTRING | cut -d: -f1` - 1&quot;
#echo &quot;num is $WINNUM&quot;
/sbin/grub --device-map=/boot/grub/device.map --batch &lt;&lt;FOO
savedefault --default=$WINNUM --once
quit
FOO
/usr/bin/reboot
</code></pre>
<p>Ich habe im Internet dieses Shell Script gefunden und möchte es ein wenig für mich anpassen. Allerdings verstehe ich einige Stellen nicht so ganz:</p>
<p>Was bewirkt das &lt;&lt;FOO und auch das FOO 2 Zeilen drunter? savedefault hat doch zumindest in der menu.lst den Zweck, dass das gebootete OS zum default wird. Wie spiel das dann mit --once zusammen (oder welche Bedeutung hat der Parameter ... habe nirgends etwas dazu gefunden)?</p>
<p>Ziel ist es, den Rechner mit einem bestimmten OS zu rebooten.</p>
<p>Zur Zeit sieht es so aus:</p>
<pre><code>#!/bin/sh

MENUFILE=/mnt/gentoo-boot/grub/menu.lst

OSNAM=$(grep title $MENUFILE | cut -d ' ' -f 2- | zenity --list --column &quot;Betriebssysteme&quot; --title &quot;Neustart&quot; --text &quot;Betriebssystem auswählen:&quot;)
OSNUM=$(($(grep title $MENUFILE | grep -n -m 1 &quot;$OSNAM&quot; | cut -f1 -d:) - 1))

grub --device-map=/mnt/gentoo-boot/grub/device.map --batch &lt;&lt;FOO
savedefault --default=$OSNUM --timeout=0 --once
quit
FOO
/usr/lib/klibc/bin/reboot
</code></pre>
<p>Funktioniert soweit, aber wie oben schon geschrieben ist das über den Dialog ausgewählte OS dann default. Hab noch nich probiert, savedefault wegzulassen da ich gerne erstmal wüsste, wie es mit --once zusammenhängt. --timeout hat scheinbar leider keine Wirkung.</p>
<p>Vieleicht kann jemand ja kurz en bischen was erklären ... danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/244603/grub-parameter</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 10:16:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/244603.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Jul 2009 16:19:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Grub Parameter on Thu, 02 Jul 2009 16:19:05 GMT]]></title><description><![CDATA[<pre><code>#!/bin/sh 

# a simple script to reboot into windows once without user
# intervention.  Assumes that the menu listing corresponding to
# windows at least has &quot;win&quot; in the title.  If it doesn't, you can
# change the WINSTRING variable below.

WINSTRING=win
GRUBMENU=/boot/grub/menu.lst

let &quot;WINNUM = `grep title $GRUBMENU | grep -in $WINSTRING | cut -d: -f1` - 1&quot;
#echo &quot;num is $WINNUM&quot;
/sbin/grub --device-map=/boot/grub/device.map --batch &lt;&lt;FOO
savedefault --default=$WINNUM --once
quit
FOO
/usr/bin/reboot
</code></pre>
<p>Ich habe im Internet dieses Shell Script gefunden und möchte es ein wenig für mich anpassen. Allerdings verstehe ich einige Stellen nicht so ganz:</p>
<p>Was bewirkt das &lt;&lt;FOO und auch das FOO 2 Zeilen drunter? savedefault hat doch zumindest in der menu.lst den Zweck, dass das gebootete OS zum default wird. Wie spiel das dann mit --once zusammen (oder welche Bedeutung hat der Parameter ... habe nirgends etwas dazu gefunden)?</p>
<p>Ziel ist es, den Rechner mit einem bestimmten OS zu rebooten.</p>
<p>Zur Zeit sieht es so aus:</p>
<pre><code>#!/bin/sh

MENUFILE=/mnt/gentoo-boot/grub/menu.lst

OSNAM=$(grep title $MENUFILE | cut -d ' ' -f 2- | zenity --list --column &quot;Betriebssysteme&quot; --title &quot;Neustart&quot; --text &quot;Betriebssystem auswählen:&quot;)
OSNUM=$(($(grep title $MENUFILE | grep -n -m 1 &quot;$OSNAM&quot; | cut -f1 -d:) - 1))

grub --device-map=/mnt/gentoo-boot/grub/device.map --batch &lt;&lt;FOO
savedefault --default=$OSNUM --timeout=0 --once
quit
FOO
/usr/lib/klibc/bin/reboot
</code></pre>
<p>Funktioniert soweit, aber wie oben schon geschrieben ist das über den Dialog ausgewählte OS dann default. Hab noch nich probiert, savedefault wegzulassen da ich gerne erstmal wüsste, wie es mit --once zusammenhängt. --timeout hat scheinbar leider keine Wirkung.</p>
<p>Vieleicht kann jemand ja kurz en bischen was erklären ... danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736165</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736165</guid><dc:creator><![CDATA[wyfrn__]]></dc:creator><pubDate>Thu, 02 Jul 2009 16:19:05 GMT</pubDate></item><item><title><![CDATA[Reply to Grub Parameter on Thu, 02 Jul 2009 17:11:54 GMT]]></title><description><![CDATA[<p>Ich bin mir nicht ganz sicher, aber anhand eines andere Beispiels auf <a href="http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU%20GRUB%20simplified.html" rel="nofollow">http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU GRUB simplified.html</a> sieht es so aus, als wenn das, was zwischen &lt;&lt;X und X (in deinem Fall halt das &lt;&lt;FOO und FOO) steht, das ist was automatisch in die normalerweise interaktiven grub shell eingegeben wird.</p>
<p>Das heißt grub shell wird aufgerufen, &quot;savedefault --default=$WINNUM --once&quot; wird eingegeben und dann mit quit wieder beendet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736199</guid><dc:creator><![CDATA[Tobiking2]]></dc:creator><pubDate>Thu, 02 Jul 2009 17:11:54 GMT</pubDate></item><item><title><![CDATA[Reply to Grub Parameter on Thu, 02 Jul 2009 17:27:02 GMT]]></title><description><![CDATA[<blockquote>
<p>Ich bin mir nicht ganz sicher, aber anhand eines andere Beispiels auf <a href="http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU%20GRUB%20simplified.html" rel="nofollow">http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU GRUB simplified.html</a> sieht es so aus, als wenn das, was zwischen &lt;&lt;X und X (in deinem Fall halt das &lt;&lt;FOO und FOO) steht, das ist was automatisch in die normalerweise interaktiven grub shell eingegeben wird.</p>
</blockquote>
<p>Das macht Sinn und sowas in der Richtung hab ich auchschon vermutet, aber:<br />
Wenn ich in der Grub - Shell mit help alle gültigen Befehle abrufe, taucht --default und --once nicht auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736213</guid><dc:creator><![CDATA[wyfrn__]]></dc:creator><pubDate>Thu, 02 Jul 2009 17:27:02 GMT</pubDate></item><item><title><![CDATA[Reply to Grub Parameter on Thu, 02 Jul 2009 17:35:35 GMT]]></title><description><![CDATA[<p>Ähm ja ... ich war wohl etwas zu voreilig. Wie du oben schon geschrieben hast, sind es wohl Parameter von savedefault. Allerdings finde ich dazu rein garnichts im Inet. Aber irgendwie muss es ja gehen, zumindest KDE 3.5.x bringt standardmässig so ein Feature mit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736220</guid><dc:creator><![CDATA[wyfrn__]]></dc:creator><pubDate>Thu, 02 Jul 2009 17:35:35 GMT</pubDate></item></channel></rss>