Is there a way to set time out on boot menu?[solved]

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

Is there a way to set time out on boot menu?[solved]

#1 Post by DaveS »

Not Grub. I mean the menu that pops up during the boot process when there is more than one save file available. At present, boot stops and waits for input. Is there a way to set a time-out so that boot continues if left for say 5 seconds?
Last edited by DaveS on Mon 13 Jun 2011, 20:41, edited 1 time in total.
Spup Frugal HD and USB
Root forever!

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

Re: Is there a way to set time out on boot menu?

#2 Post by RetroTechGuy »

DaveS wrote:Not Grub. I mean the menu that pops up during the boot process when there is more than one save file available. At present, boot stops and waits for input. Is there a way to set a time-out so that boot continues if left for say 5 seconds?
How would you set the default? "0" appears first, so as it sits, a timeout might mean "boot to ram"...
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#3 Post by Béèm »

The addition in the script could be made in such a way that a default save file is indicated.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#4 Post by Karl Godt »

Code: Select all

case $NUMPUPSAVES in
  0)
   PUPSAVE=""
   ;;
  1)
   PUPMODE=8 #`expr $PUPMODE + 8`  #PUPMODE=12
   PUPSAVE="`cat /tmp/PUPSAVE2FSS`" #format: hda7,ext3,/pup220/${DISTRO_FILE_PREFIX}save.2fs
   ;;
  *)
   PUPSAVE=""
   CNTSAVE=1
   echo -e "\\033[1;36m" >/dev/console #36=aquablue
   echo "Type a number to choose which personal file to use:" > /dev/console
   echo "0  none" > /dev/console
echo -en "\\033[0;39m" >/dev/console
   read NUMSAVE
change "read NUMSAVE" to "read -t 10 NUMSAVE" or whatever seconds instead of 10 you 'd like to have ... ( code inside initrd.gz )
and add somthing like that afterwards :

Code: Select all

NUMSAVE=`echo "$NUMSAVE" | grep -o '[0-9]' | tr -d '\n'`
[ -z "$NUMSAVE" ] && NUMSAVE=0

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#5 Post by nooby »

Karl then he need to use initrd editor to do that would he not?
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#6 Post by RetroTechGuy »

nooby wrote:Karl then he need to use initrd editor to do that would he not?
Actually, IIRC he just need to unpack it "gzip -d initrd.gz", edit it, and then "gzip initrd" (of course, making a backup copy of the original initrd.gz file before beginning...)
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#7 Post by DaveS »

RetroTechGuy wrote:
nooby wrote:Karl then he need to use initrd editor to do that would he not?
Actually, IIRC he just need to unpack it "gzip -d initrd.gz", edit it, and then "gzip initrd" (of course, making a backup copy of the original initrd.gz file before beginning...)
Tried that... geany cannot read resulting unpacked file.
Spup Frugal HD and USB
Root forever!

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#8 Post by DaveS »

Karl Godt wrote:

Code: Select all

case $NUMPUPSAVES in
  0)
   PUPSAVE=""
   ;;
  1)
   PUPMODE=8 #`expr $PUPMODE + 8`  #PUPMODE=12
   PUPSAVE="`cat /tmp/PUPSAVE2FSS`" #format: hda7,ext3,/pup220/${DISTRO_FILE_PREFIX}save.2fs
   ;;
  *)
   PUPSAVE=""
   CNTSAVE=1
   echo -e "\\033[1;36m" >/dev/console #36=aquablue
   echo "Type a number to choose which personal file to use:" > /dev/console
   echo "0  none" > /dev/console
echo -en "\\033[0;39m" >/dev/console
   read NUMSAVE
change "read NUMSAVE" to "read -t 10 NUMSAVE" or whatever seconds instead of 10 you 'd like to have ... ( code inside initrd.gz )
and add somthing like that afterwards :

Code: Select all

NUMSAVE=`echo "$NUMSAVE" | grep -o '[0-9]' | tr -d '\n'`
[ -z "$NUMSAVE" ] && NUMSAVE=0
Tried this, but it made no difference :)


edit instructions are here :http://www.murga-linux.com/puppy/viewto ... 712#168712
Spup Frugal HD and USB
Root forever!

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#9 Post by DaveS »

Karl Godt wrote: change "read NUMSAVE" to "read -t 10 NUMSAVE" or whatever seconds instead of 10 you 'd like to have ... ( code inside initrd.gz )
and add somthing like that afterwards :

Code: Select all

NUMSAVE=`echo "$NUMSAVE" | grep -o '[0-9]' | tr -d '\n'`
[ -z "$NUMSAVE" ] && NUMSAVE=0
Thanks Karl.. this worked

Code: Select all

read -t 5 NUMSAVE
[ -z "$NUMSAVE" ] && NUMSAVE=1
where 5 seconds is the timeout and '1' is the required default. Interrupting with another option from the keyboard works correctly also.
Spup Frugal HD and USB
Root forever!

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#10 Post by nooby »

Cool that it worked. How did you accomplish that editing then :)
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#11 Post by DaveS »

nooby wrote:Cool that it worked. How did you accomplish that editing then :)
The link showing how is at the bottom, three posts up from here. Here it is again
http://www.murga-linux.com/puppy/viewto ... 712#168712
It was easier than it looks. So great to just turn on and walk away while it boots up if I just want to use my default save file............
Spup Frugal HD and USB
Root forever!

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#12 Post by rhadon »

Hi,
great possibility. :D

What about a simple textfile, maybe "bootdefault"? With t=xx and default=xx?
If this file exists, it uses this values, if it doesn't exist, it works as usual.

The advantage would be the easy changing of the values without editing initrd.gz (editing initrd.gz only one time for adding such code).

Rolf
Last edited by rhadon on Mon 20 Jun 2011, 16:19, edited 1 time in total.
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#13 Post by Burn_IT »

Or as a parameter...

Like the idea as I had been using a batch file before invoking Grub4dos under DOS to do it.
"Just think of it as leaving early to avoid the rush" - T Pratchett

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#14 Post by rhadon »

If anybody is interested in using a textfile for easy changing time and default, please read here.

It's the first time that I did something like that. 8)
No guaranty, no money back :wink:

Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

chilidog

#15 Post by chilidog »

@Burn_IT

There should be a boot parameter 'pupsave' but I do not know if and in which puppy this works!

I introduced the boot parameter pupsave myself in the initrd.gz for tahr puppy.

I attach relevant part of the modified init.
The lines I had to add, have #chilidog.

Code: Select all

#if pupsave file not already found, choose it here...
if [ ! "$PUPSAVE" ];then
 if [ "$PRAMONLY" != "yes" ];then
  if [ "$IGNORE" = "optical" ];then #narrow it down...
   #not booting off optical drive.
   grep "${PSUBDIR}/" /tmp/PUPSAVES > /tmp/PUPSAVES2 #note: need this as above probing may have got some invalid hits.
   if [ "$SAVEPART" ];then #set by file SAVEMARK, see above.
    grep "${SAVEPART} " /tmp/PUPSAVES2 > /tmp/PUPSAVES
   else #it must be in the boot partition...
    grep "${PDEV1} " /tmp/PUPSAVES2 > /tmp/PUPSAVES
   fi
  fi
  
  if [ -s /tmp/PUPSAVES ];then #100922
   touch /tmp/PUPSAVE2SFSS #so does not spit any erroros if not there
   cat /tmp/PUPSAVES |
   while read ONELINE
   do
    ONEDEV="`echo -n "$ONELINE" | cut -f 1 -d ' '`"
    ONEFS="`echo -n "$ONELINE" | cut -f 2 -d ' '`"
    ONEPUPSAVES="`echo -n "$ONELINE" | cut -f 3-99 -d ' '`"
    for ONEPUPSAVE in $ONEPUPSAVES
    do
     echo "${ONEDEV},${ONEFS},${ONEPUPSAVE}" >> /tmp/PUPSAVE2SFSS
    done
   done
   NUMPUPSAVES=`cat /tmp/PUPSAVE2SFSS | wc -l`
   if [ $NUMPUPSAVES -eq 1 ];then
    PUPSAVE="`cat /tmp/PUPSAVE2SFSS`"
   else
	[ $pupsave ] && PUPSAVETST=$pupsave #chilidog introducing the pupsave bootparameter for tahr puppy
    CNTSAVE=1
    echo -e "\\033[1;36m" >/dev/console #36=aquablue
    echo "Type a number to choose which personal file to use:" > /dev/console
    echo "0  none" > /dev/console
    for ONECHOICE in `cat /tmp/PUPSAVE2SFSS | tr '\n' ' '`
    do
     ONEFILE="`echo -n "$ONECHOICE" | cut -f 3 -d ','`"
     ONEPART="`echo -n "$ONECHOICE" | cut -f 1 -d ','`"
     echo -e "${CNTSAVE}  ${ONEPART}\\033[10G${ONEFILE}" > /dev/console #10 means move to that column.
		if [ "$ONEFILE" = "$PUPSAVETST" ];then #chilidog
		 NUMSAVE="${CNTSAVE}" #chilidog
		 echo "This pupsave matches the pupsave bootparameter. It will shoot!" > /dev/console #chilidog
		fi #chilidog
     CNTSAVE=`expr $CNTSAVE + 1`
    done
    echo -en "\\033[0;39m" >/dev/console
		if [ ! "${NUMSAVE}" ];then #chilidog
		 read NUMSAVE
		fi #chilidog
    [ $NUMSAVE -ne 0 ] && PUPSAVE="`cat /tmp/PUPSAVE2SFSS | tr '\n' ' ' | cut -f $NUMSAVE -d ' '`"
   fi
  fi
  
 fi
 [ "$PUPSAVE" ] && PUPMODE=`expr $PUPMODE + 8`
fi

Post Reply