Live(frugal)HD & LiveUSB Boot

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
floborg
Posts: 199
Joined: Thu 25 Oct 2007, 12:12
Location: Fort Worth, TX

Live(frugal)HD & LiveUSB Boot

#1 Post by floborg »

The closest I seem to be able to get a frugal install to boot just like the Live CD is with pfix=ram. The hard drive partition I boot from, however, remains mounted.

Pmount doesn't want to let go of the boot partition. The nifty icon on the desktop had a yellow dot on it rather than green.

Sure, I can run

Code: Select all

umount /dev/sdaX
to unmount it, but that's extra work.

Is there any boot option that will cause Puppy to release all media when startup is complete?

...or, will I have to dig into initrd.gz and add something to the startup script => hassle.


PS: While we're at it, which boot options can get me past the mouse selection screen and Xorg config screen? I already use pkeys=xx to get past the keyboard screen.
Last edited by floborg on Sat 18 Apr 2009, 16:36, edited 3 times in total.
Ubuntu 10.10 Maverick
Core 2 Quad 2.4 GHz | 2 GB RAM

jamesjeffries2
Posts: 196
Joined: Mon 28 Apr 2008, 00:50

#2 Post by jamesjeffries2 »

add that line to your /etc/rc.d/rc.local. It means it will be called every time at start up.

probably less hassle this way to be honest as then you dont have to remember the boot option everytime you want to start puppy. Also means you can boot then leave it to make breakfast instead of having to enter the option ;)

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 »

Interesting question, floborg.
What is your reasoning to absolutely unmount the partition you boot from?
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
floborg
Posts: 199
Joined: Thu 25 Oct 2007, 12:12
Location: Fort Worth, TX

#4 Post by floborg »

Béèm wrote:Interesting question, floborg.
What is your reasoning to absolutely unmount the partition you boot from?
Peace of mind. Like jamesjeffries2 said, it's nice to just start booting Puppy, walk away and come back to desktop - all ready to go. I want to take that a step further and run just like a LiveCD - completely in RAM, with no media mounted. Keep in mind, there's no pupsave file either.
Ubuntu 10.10 Maverick
Core 2 Quad 2.4 GHz | 2 GB RAM

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

#5 Post by Béèm »

I haven't seen an option for this.
I suppose there is a reason why the media the isn't released. But I don't know. You might PM Barry Kauler or Whodo.
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
floborg
Posts: 199
Joined: Thu 25 Oct 2007, 12:12
Location: Fort Worth, TX

#6 Post by floborg »

Our exalted developers-in-chief take random PMs?

Since posting this originally, I've learned that Knoppix has a "fromiso" boot option. Someone in the Ubuntu forums ported it to Ubuntu, and, when I tried it, it more or less behaved like the LiveCD. Now, it didn't release the HD, but the Ubuntu LiveCD doesn't either. If Puppy could be tricked into thinking a frugal install is a LiveCD with a fromiso option, I think the HD will be released.
Ubuntu 10.10 Maverick
Core 2 Quad 2.4 GHz | 2 GB RAM

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

#7 Post by Béèm »

You could try to edit the PUPMODE line to read 5 (boot from CD) in /etc/pupstate.
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
floborg
Posts: 199
Joined: Thu 25 Oct 2007, 12:12
Location: Fort Worth, TX

#8 Post by floborg »

On a related note, Puppy doesn't unmount a USB flash drive it boots from - even if the Puppy SFS file is copied to RAM.

Again, I had to manually run the umount command from the console. There were no problems with the live system afterwards, and the drive is fine.

What's so special about a CD boot that it's the only type that releases the boot media? Is this just a holdover from legacy Puppies that were only intended for LiveCD use?
Ubuntu 10.10 Maverick
Core 2 Quad 2.4 GHz | 2 GB RAM

User avatar
floborg
Posts: 199
Joined: Thu 25 Oct 2007, 12:12
Location: Fort Worth, TX

#9 Post by floborg »

I tried a sloppy hack in the init script inside initrd.gz. Near the end, there's this line:

Code: Select all

#v3.01 a bit untidy, but cd may still be mounted when it doesn't have to be...
case $PMEDIA in
 *cd)
  [ "$PDEV1" ] && umount /dev/$PDEV1 2>/dev/null #okay if it fails.
  ;;
esac
I just added another case - $PMEDIA in *flash). The result was that my USB flash drive was not mounted when the desktop came up. I did, however, get the warning message about not unplugging the flash drive. Otherwise, the live system behaved just fine.

I think a better approach would be modify the official script to unmount any type of boot media as long as the SFS was copied to RAM and there's no pup save file on it.
Ubuntu 10.10 Maverick
Core 2 Quad 2.4 GHz | 2 GB RAM

sky king
Posts: 72
Joined: Wed 08 Apr 2009, 08:42

booting from usb to ram

#10 Post by sky king »

I have an older laptop that I have got to boot first from CD, then usb. This has resulted in the system running off the usb, not running in ram. I still want a pup_save file to remember all my settings. Maybe I should just run frugal from the hard drive. I really don't want to mess with the boot partition on the hard drive, maybe I could still just use the CD to boot to the HD. Then again, maybe I'm saving wear on the HD by using the cheap usb stick. Decisions...

User avatar
floborg
Posts: 199
Joined: Thu 25 Oct 2007, 12:12
Location: Fort Worth, TX

#11 Post by floborg »

So, here's the fix:

Code: Select all

# Unmount boot device if first boot and Puppy SFS copied to RAM
if [ "$PUPMODE" = 5 ] && [ "$COPY2RAM" = "yes" ];then
umount /dev/$PDEV1 2>/dev/null
fi
I put this into the init script right after the code that unmounts the cd (quoted earlier). This worked when I tried a pfix=ram boot from a frugal hard drive install and a USB flash install. Once again, the live system worked fine. I am concerned that this is not the best method, based on Barry's comment on the cd unmount code.

The "Don't unplug" message was still displayed. That's because I missed something in the delayedrun file that exists inside the Puppy SFS file. The fix entails another edit to the init script:

Code: Select all

#/etc/PUPSTATE passes useful variables to the running puppy...
mkdir -p /pup_rw/etc/rc.d
echo "PUPMODE=$PUPMODE" > /pup_rw/etc/rc.d/PUPSTATE
echo "PDEV1='$PDEV1'" >> /pup_rw/etc/rc.d/PUPSTATE
echo "DEV1FS='$DEV1FS'" >> /pup_rw/etc/rc.d/PUPSTATE
echo "PUPSFS='$PUPSFS'" >> /pup_rw/etc/rc.d/PUPSTATE
echo "PUPSAVE='$PUPSAVE'" >> /pup_rw/etc/rc.d/PUPSTATE
echo "PMEDIA='$PMEDIA'" >> /pup_rw/etc/rc.d/PUPSTATE
echo "COPY2RAM='$COPY2RAM'" >> /pup_rw/etc/rc.d/PUPSTATE
I added the COPY2RAM line. Also needed is a change to the delayedrun script. I probably have the wrong logic, but here it is:

Code: Select all

#v2.16 popup a warning if booting from usb flash...
#  ...only if it is still mounted
if [ "$PUPMODE" = 5 ] && [ "$COPY2RAM" = "yes" ];then
else
if [ "$PMEDIA" = "usbflash" ];then
 yaf-splash -font "8x16" -outline 0 -margin 4 -bg yellow -text "WARNING! Do not unplug USB Flash drive!" &
 X1PID=$!
 X1RET=$?
 sleep 3
 [ $X1RET -eq 0 ] && kill $X1PID
fi
fi
I would appreciate it if someone would inspect this and include it in the next release. The updated files are attached.
Attachments
delayedrun-original.tar.gz
(1.79 KiB) Downloaded 627 times
init.tar.gz
(17.37 KiB) Downloaded 612 times
Ubuntu 10.10 Maverick
Core 2 Quad 2.4 GHz | 2 GB RAM

polarops3
Posts: 3
Joined: Sun 22 Jun 2008, 01:57
Location: salem, oregon usa

how do you handle keyboard and resolution spec'?

#12 Post by polarops3 »

Thank you very much for doing this! This is exactly the way I like to run my old sony vaio pcg r505tl to get the most snap out of my hardware and the longest duration out of my battery. (Fan runs almost continuously, though, probably due to excessive RAM usage.)

So how do you handle keyboard region and screen resolution specification for a nice clean "go make some coffee" boot?

Also, for hacks like moi, this might be helpful for how to unpack and repack the initrd.gz:

http://www.murga-linux.com/puppy/viewto ... 712#168712

James.Esperantist
Posts: 5
Joined: Fri 06 Nov 2009, 22:29

#13 Post by James.Esperantist »

Is is safe for sure? Can it be incorporated in a ...safer way? =D

Post Reply