Project Read Only Puppy

Booting, installing, newbie
Message
Author
pixelblip
Posts: 80
Joined: Sat 23 Aug 2008, 07:45

Project Read Only Puppy

#1 Post by pixelblip »

Hi
I wanted to make a bullet proof puppy installation (don't laugh!) that is installed into flash that is read only. It's a little project of mine I keep thinking about.

In the old days, you had computers like Acorn Archimedes that would contain the OS in Rom....just switch on and go...if it crashes switch off and then back on.........ahh the golden days..........RISC os loading up from Rom...........

Can anyone advise me how I might reproduce this scenario with Puppy Linux....I could boot from a CD (which I produce using the remaster method) - this is ok but I'd rather boot from a flash based device. So I want to remaster to a flash drive and make it non writeable....like the old days of EPROM.

Can anyone help here / advise me? Thanks for your help.

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

#2 Post by Béèm »

Like in the good all days, where cassette tapes could be put in read only (remember?) there aree flash cards with a read only facility.
I think Sandisk has those.
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]

pixelblip
Posts: 80
Joined: Sat 23 Aug 2008, 07:45

#3 Post by pixelblip »

Thanks Beem I'll take a look at that.
Mmmmm cassette tapes loading Spectrum and BBC Micro games..........what fun that was. :lol:

User avatar
tgeer43
Posts: 45
Joined: Fri 22 May 2009, 04:08

Re: Project Read Only Puppy

#4 Post by tgeer43 »

I have my 4.2.1 USB Flash install set up kind of like that, only a little better, I think. The automatic periodic save is disabled and I am prompted at shutdown to save everything or not. I get full read/write ability while I'm running but have to intentionally save the pup_save file to alter the contents of the USB install. The 'save' icon on the desktop still works, of course. It's a great way to run because now I'm pretty free to install stuff and tweak away at the system and if something goes awry then I just don't save the session. That way my installation keeps getting better and better without ever really endangering its previous incarnation.

It takes only a few minutes to set things up this way and you could bypass the save prompt on shutdown and have it never save just as easily. Pizzasgood has a couple of definitive threads on this in these forums. Let me know if you can't find what you're looking for.

tgeer

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 just saw a comment to go in Menu|System|Puppy event manager and set 0 in the tab save session.
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
tgeer43
Posts: 45
Joined: Fri 22 May 2009, 04:08

Re: Project Read Only Puppy

#6 Post by tgeer43 »

Béèm wrote:I just saw a comment to go in Menu|System|Puppy event manager and set 0 in the tab save session.
That takes care of the autosave. To get the prompt at shutdown/reboot, here are Pizzagood's instructions:
Shutdown script: /etc/rc.d/rc.shutdown
There should be a group of lines like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;

Modify it to be more like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
dialog --yesno "Save session?" 0 0 >/dev/console
if [ $? -eq 0 ]; then
echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
fi
;;

That should make it prompt before saving on shutdown with a Flash install.
Works perfectly and is easily modified to never save if one desires a true read only install.

tgeer

User avatar
lisek
Posts: 80
Joined: Thu 14 Feb 2008, 09:05
Location: PL

#7 Post by lisek »

Hi puppians,

I have puppy4.2 SMP on usb stick. [thanks aragon!]
I turned off the periodic 'save session' in Puppy Event Manager.
The installation is done without the pup_save file that is the saving session is done directly to entire usb flash during the rebbot/shutdown - not to pup_save file.

I would like none saving session and none prompt to save sesison during the reboot/shutdown. I wish to use the save-desktop icon when I need it.
So this method does't work for me:

Shutdown script: /etc/rc.d/rc.shutdown
There should be a group of lines like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;

Modify it to be more like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
dialog --yesno "Save session?" 0 0 >/dev/console
if [ $? -eq 0 ]; then
echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
fi
;;
I think the couse is I have not the extra pup_save file, my puppy4.2 SMP can occupy entire space of usb flash.
I don't know how to change the code. Anyone helps?
Thanks to all who do superb work for puppy project and help the begginers like me via forum. I really appreciate this.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#8 Post by jafadmin »

Change like this:

Shutdown script: /etc/rc.d/rc.shutdown
There should be a group of lines like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;

Modify it to be more like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
#the above are in unionfs at /.
#echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
#/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;

kilon
Posts: 17
Joined: Fri 19 Jun 2009, 07:07

#9 Post by kilon »

I would like to thank pizzagod and all people here for posting this , as I had a similar question in another thread. Thanks

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

usb read only

#10 Post by sky king »

You could use a USB SD card reader or if you have a SD slot, no reader required. After getting it set up, set the switch to lock the card. At least I think that's the way they work. Never have used the little switch on one yet. Maybe some thumb drives have a switch, too.

There's yer classic reference, too. A switch like a (small) floppy has on it. The old IBM 8" or even 5"ers didn't have that, they were really "floppy".

User avatar
lisek
Posts: 80
Joined: Thu 14 Feb 2008, 09:05
Location: PL

#11 Post by lisek »

jafadmin wrote:Change like this:

Shutdown script: /etc/rc.d/rc.shutdown
There should be a group of lines like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;

Modify it to be more like this:
Code:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
#the above are in unionfs at /.
#echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
#/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;
Tkanks for your reply.
I changed these two lines but Puppy still is saving session at the rebbot/shutdown. :(

User avatar
lisek
Posts: 80
Joined: Thu 14 Feb 2008, 09:05
Location: PL

#12 Post by lisek »

NOW my shutdown script: /etc/rc.d/rc.shutdown
looks like this:
13) #PDEV1 and PUPSFS and PUPSAVE
#/initrd/pup_rw has tmpfs, pup_ro1 has pup_save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
#the above are in unionfs at /.
#echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
#/usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
;;
128) #1st shutdown, save to pup_save.2fs.
#partition already mounted on $SMNTPT.
echo "Saving session to $SAVEFILE file on $SAVEPART partition..." >/dev/console
mkdir /tmp/save1stpup
echo -n "Mounting ${SAVEFILE}..."
FILEFS="ext3"
[ ! "`echo -n "$SAVEFILE" | grep "2fs"`" = "" ] && FILEFS="ext2"

if [ "$CRYPTO" = "" ];then
mount -t $FILEFS -o noatime,rw,loop $SMNTPT$SAVEFILE /tmp/save1stpup
else
#note: loop2 is kept available for scripts to use. but, do this to find free one...
DEVLOOP="`losetup-FULL -f`"
Maybe some changes are needed in red area?

darwinev0lved
Posts: 83
Joined: Tue 29 Jul 2008, 12:19

#13 Post by darwinev0lved »

Hi, I changed the shut down script as Pizzagood suggested and it shuts down without saving. Brilliant. I've got Puppy set up as I want it and don't want to worry about changing it Only thing is - when I restart it, I get the warning screen saying that X seems to have exited uncleanly.
Is this something to worry about or not? Is there something to fix?
Puppy 430, frugal install, booting off a usb stick.

Regards, Jon.

Actually, this seems to be intermittent (which is code for: it's stopped, but I don't know why ...)
So: Pizzagood rules, Puppy is great.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#14 Post by Flash »

SD memory cards have a write-protect switch. I know because I've accidentally switched it on. It took me a while to figure out why the card wouldn't let me write to it any more. :oops:

I have a universal SD-to-USB converter, that I bought for about $15. I plug my camera's SD memory card into it so I can read the card without having to connect the camera to my computer. It's a two-piece solution to your problem.

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

#15 Post by alienjeff »

Appears that OP pixelblip has fallen off the edge of the earth ...
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

pupsgreat
Posts: 2
Joined: Thu 22 Oct 2009, 14:32
Location: New York

Fails???

#16 Post by pupsgreat »

My first post - I really find puppy to be a refreshing linux variant that's carved out a niche for itself among some of the bigger distros.

Has anyone actually gotten puppy to run from a write-protected usb stick?
I'm running 4.2.1 and have disabled save-periodically, save on shutdown, and can run without any problem this way. When I shutdown, flip the switch on the flash drive to write-protected and try to boot, the kernel loads, init starts running, but drops down to a shell with the error:

No Puppy files found. Dropping out to initial-ramdisk console...

I can find this section in the init file, but haven't quite figured out the logic of what's it's doing.

Any thoughts or verifications that puppy on write-protected flash can be done in version 4 ( I had this working once back in version 2)?

pupsgreat
Posts: 2
Joined: Thu 22 Oct 2009, 14:32
Location: New York

Solved

#17 Post by pupsgreat »

OK, after looking at the init script and booting into the root shell, I manually tried to mount the write-protected flash drive - and it failed. So, of course there was no chance to load the puppy files!

Why didn't it mount? I had originally formatted the drive ext3, thinking it's more robust than ext2. However, after shutting down puppy running with the flash drive in READ/WRITE mode, it somehow got into an "unclean" state. Then, after write-protecting and booting, dmesg showed mount quietly complained that the journal needed recovery. But, with readonly access, it couldn't be recovered, so the mount failed.

Solution: switch to ext2 on the flash drive. Boot into a backup copy of puppy, and then plug in the problematic flash drive to work on it. fsck to recover the journal, then tune2fs to drop it back to an ext2.

Now, it boots beautifully, either read/write or switched into write-protected mode. Booting r/w and making some changes to the desktop, then saving and rebooting in w-p mode goes without a hitch.

I'm not sure why ext3 would get into trouble. Maybe puppy shuts down too quickly after saving and that causes journal problems? Perhaps the modified rc.shutdown (as quoted by tgeer48 above) has an ill effect. It might be interesting to see if anyone else running with "limited saves" is seeing any issues with ext3 flash drives.

Anyhow, this configuration now offers all the benefits of a true live-CD with it's guaranteed clean startup state, plus the convenience of the multisession CD mode that allows for modifications when desired - just by flipping the switch on the flash drive and rebooting. Very nice!

Combined with the firewall, Firefox running as a restricted user, and some FF addons (RequestPolicy et al), I'm fairly comfortable turning this system over to my wife for online banking.

pixelblip
Posts: 80
Joined: Sat 23 Aug 2008, 07:45

#18 Post by pixelblip »

I'm still here!

McKenna
Posts: 2
Joined: Sun 27 Jun 2010, 14:38

Project Read Only Puppy

#19 Post by McKenna »

Hello,

I'm fairly new to Puppy and have created a read only puppy based on 4.31 with Pizzagoods modification.

Unfortunately I get the same problem like darwinev0lved. In my case it is not intermittent:

darwinev0lved wrote:Hi, I changed the shut down script as Pizzagood suggested and it shuts down without saving. Brilliant. I've got Puppy set up as I want it and don't want to worry about changing it Only thing is - when I restart it, I get the warning screen saying that X seems to have exited uncleanly.
Is this something to worry about or not? Is there something to fix?
Puppy 430, frugal install, booting off a usb stick.

Regards, Jon.

Actually, this seems to be intermittent (which is code for: it's stopped, but I don't know why ...)
So: Pizzagood rules, Puppy is great.
Any Ideas?

Regards

Andreas

Bruce B

#20 Post by Bruce B »

Reading, writing and updating is essential to the operation distro.

If we constrain the writing and updating to RAM only, we have for practical purposes a read only operating system.

To accomplish this in the most simple way, one would boot Puppy and not make a save file.

This is fine if you only plan to make a few boots. But for regular use it would be better to configure the pup_save file, merge it with the pup_xxx.sfs file, and modify the shutdown script to not bug you to make a pup_save file

The user would still have the option to write to devices of choice as he pleases, just that Puppy is always bit for bit the same on each boot.

Post Reply