Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Jan 2020, 12:38
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to cleanly unmount your filesystem on shutdowns
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 4 [54 Posts]   Goto page: Previous 1, 2, 3, 4
Author Message
nooby

Joined: 29 Jun 2008
Posts: 10548
Location: SwedenEurope

PostPosted: Sat 03 Jul 2010, 18:29    Post subject:  

I noticed now this one

Quote:
"/pup_new/mnt/unrootfs/init"


Was there other differences too?

_________________
I use Google Search on Puppy Forum
not an ideal solution though
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Sat 03 Jul 2010, 20:11    Post subject: Re: bug in init code??
Subject description: Answer: I see init just fine ...
 

Hmmm .....

gyro wrote:
Patriot,

I was just reviewing my code changes to the init script in initrd.gz, and I noticed something odd with your code: ........

That code block you were referring to should be read with the last line to receive enlightenment: Cool
Code:
# Patriot: init from tmpfs
mkdir -p /pup_new/mnt/unrootfs
mount -t tmpfs tmpfs /pup_new/mnt/unrootfs -o size=4m
cp /bin/busybox /pup_new/mnt/unrootfs/init
if [ "$(readlink /pup_new/sbin/init)" != "/mnt/unrootfs/init" ]; then
  ln -sf /mnt/unrootfs/init /pup_new/sbin/init
fi
sync

exec switch_root /pup_new /sbin/init

The link is checked/made before switching rootfs, so it took into account where (busybox) init is going to be afterwards. After rootfs switch, /pup_new will "automagically disappear". If you still believe its a bug, feel free to test out your theory ... just watch out for kernel panics ... Laughing


Rgds
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Sun 04 Jul 2010, 14:25    Post subject: Re: bug in init code??
Subject description: Answer: I see init just fine ...
 

Patriot wrote:
That code block you were referring to should be read with the last line to receive enlightenment:
Thanks for the explanation.
Sorry, my mistake. I was looking at the code in a "diff" file, and hence in isolation. All makes sense now.

gyro
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Sun 04 Jul 2010, 19:54    Post subject:  

Patriot,

Sorry to be a bother, but there is just 1 more thing.

In the cleanup script in "rc.shutdown" there is block of code starting with
Code:
# Find and detach loop devices
for onelodev in $(losetup|tr -d " ")
that may have a difficulty.
In my puppy 431, a blank "losetup" command, will only display loop devices 0..9. I used to specifically use /dev/loop10 and had to issue "losetup /dev/loop10" to see the info for this device. Hence your code would not detach /dev/loop10 on my system.
Maybe something like the following, (based on load_sfs code):
Code:
# Find and detach loop devices
current_loops=$(expr $(ls -1 /dev/loop* | wc -l) - 1)
for n in $(seq 0 $current_loops); do
  losetup -d /dev/loop${n} 2>/dev/null
done
might work more reliably on puppies using more than 10 loop devices.

gyro
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Sun 04 Jul 2010, 23:25    Post subject:  

Hmmm .....

Ah yes, I've forgotten about busybox losetup limits of 10 devices. Ok, it's a simple fix:

Code:
# Find and detach loop devices
for onelodev in $(grep "^/dev/loop" /proc/mounts | tr -s " " ":")
do
  losetup -d ${onelodev%%:*} 2>/dev/null
  sync
done

Quick test runs were done with 16 mounted loop devices.


Rgds
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Mon 12 Jul 2010, 03:29    Post subject:  

I've updated "rc.update-431.pet" to include this latest fix to rc.shutdown.

See my earlier post for download.

gyro
Back to top
View user's profile Send private message 
AlexS


Joined: 24 Nov 2006
Posts: 47
Location: Munich

PostPosted: Fri 24 Sep 2010, 06:31    Post subject:  

i've tried to follow this thread, but i have one question: can these fixes be applied to a ext2 encrypted pupsave? If not how could one implement that? I need encrypted pupsaves for real world usage.
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Wed 29 Sep 2010, 15:37    Post subject:  

AlexS wrote:
i've tried to follow this thread, but i have one question: can these fixes be applied to a ext2 encrypted pupsave? If not how could one implement that? I need encrypted pupsaves for real world usage.
My guess is, yes. I would defer to Patriot on this, but I don't think having an encrypted pupsave should make any difference. Just change the scripts as outlined by Patriot.

gyro
Back to top
View user's profile Send private message 
AlexS


Joined: 24 Nov 2006
Posts: 47
Location: Munich

PostPosted: Wed 29 Sep 2010, 16:24    Post subject:  

ok, I went for the simple approach (the first suggested by patriot), I'll see how it works out over the next couple of days
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 4 [54 Posts]   Goto page: Previous 1, 2, 3, 4
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0624s ][ Queries: 12 (0.0254s) ][ GZIP on ]