* [PATCH] add readonly overlay support for dmsquash
@ 2010-02-26 14:44 Joey Boggs
[not found] ` <1267195469-32522-1-git-send-email-jboggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Joey Boggs @ 2010-02-26 14:44 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Joey Boggs
Adds the readonly_overlay karg for cases where the dm snapshot should be set to readonly. Use case would be a livecd that is configured to have a readonly root where filling up the dm snapshot would cause a problem.
---
modules.d/90dmsquash-live/dmsquash-live-root | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root
index acec91d..f40e048 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root
+++ b/modules.d/90dmsquash-live/dmsquash-live-root
@@ -20,6 +20,7 @@ live_dir=$(getarg live_dir)
[ -z "$live_dir" ] && live_dir="LiveOS"
getarg live_ram && live_ram="yes"
getarg reset_overlay && reset_overlay="yes"
+getarg readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
overlay=$(getarg overlay)
# FIXME: we need to be able to hide the plymouth splash for the check really
@@ -95,7 +96,7 @@ do_live_overlay() {
fi
# set up the snapshot
- echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
+ echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
}
# live cd helper function
--
1.6.6.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] add readonly overlay support for dmsquash
[not found] ` <1267195469-32522-1-git-send-email-jboggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2010-02-26 20:23 ` Karel Zak
[not found] ` <20100226202326.GG8702-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
2010-03-04 13:07 ` Harald Hoyer
1 sibling, 1 reply; 6+ messages in thread
From: Karel Zak @ 2010-02-26 20:23 UTC (permalink / raw)
To: Joey Boggs; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On Fri, Feb 26, 2010 at 09:44:29AM -0500, Joey Boggs wrote:
> # set up the snapshot
> - echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
> + echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
^^^^^^^^^^^^^^^^^
Don't use --getsize, this option is deprecated and it's based
on BLKGETSIZE ioctl that returns *32-bit* sector count (= 2TiB only).
Please, use --getsz. For more details see blockdev(8) man page.
Karel
--
Karel Zak <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] add readonly overlay support for dmsquash
[not found] ` <1267195469-32522-1-git-send-email-jboggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-02-26 20:23 ` Karel Zak
@ 2010-03-04 13:07 ` Harald Hoyer
1 sibling, 0 replies; 6+ messages in thread
From: Harald Hoyer @ 2010-03-04 13:07 UTC (permalink / raw)
To: Joey Boggs; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On 02/26/2010 03:44 PM, Joey Boggs wrote:
> Adds the readonly_overlay karg for cases where the dm snapshot should be set to readonly. Use case would be a livecd that is configured to have a readonly root where filling up the dm snapshot would cause a problem.
>
> ---
> modules.d/90dmsquash-live/dmsquash-live-root | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root
> index acec91d..f40e048 100755
> --- a/modules.d/90dmsquash-live/dmsquash-live-root
> +++ b/modules.d/90dmsquash-live/dmsquash-live-root
> @@ -20,6 +20,7 @@ live_dir=$(getarg live_dir)
> [ -z "$live_dir" ]&& live_dir="LiveOS"
> getarg live_ram&& live_ram="yes"
> getarg reset_overlay&& reset_overlay="yes"
> +getarg readonly_overlay&& readonly_overlay="--readonly" || readonly_overlay=""
> overlay=$(getarg overlay)
>
> # FIXME: we need to be able to hide the plymouth splash for the check really
> @@ -95,7 +96,7 @@ do_live_overlay() {
> fi
>
> # set up the snapshot
> - echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
> + echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
> }
>
> # live cd helper function
pushed
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] add readonly overlay support for dmsquash
[not found] ` <20100226202326.GG8702-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
@ 2010-03-04 13:07 ` Harald Hoyer
[not found] ` <4B8FB0A5.2090309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Harald Hoyer @ 2010-03-04 13:07 UTC (permalink / raw)
To: Karel Zak; +Cc: Joey Boggs, initramfs-u79uwXL29TY76Z2rM5mHXA
On 02/26/2010 09:23 PM, Karel Zak wrote:
> On Fri, Feb 26, 2010 at 09:44:29AM -0500, Joey Boggs wrote:
>> # set up the snapshot
>> - echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
>> + echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
> ^^^^^^^^^^^^^^^^^
>
> Don't use --getsize, this option is deprecated and it's based
> on BLKGETSIZE ioctl that returns *32-bit* sector count (= 2TiB only).
>
> Please, use --getsz. For more details see blockdev(8) man page.
>
> Karel
>
patched to use --getsize64
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] add readonly overlay support for dmsquash
[not found] ` <4B8FB0A5.2090309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2010-03-04 14:16 ` Karel Zak
[not found] ` <20100304141633.GA18077-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Karel Zak @ 2010-03-04 14:16 UTC (permalink / raw)
To: Harald Hoyer; +Cc: Joey Boggs, initramfs-u79uwXL29TY76Z2rM5mHXA
On Thu, Mar 04, 2010 at 02:07:49PM +0100, Harald Hoyer wrote:
> On 02/26/2010 09:23 PM, Karel Zak wrote:
>> On Fri, Feb 26, 2010 at 09:44:29AM -0500, Joey Boggs wrote:
>>> # set up the snapshot
>>> - echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
>>> + echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
>> ^^^^^^^^^^^^^^^^^
>>
>> Don't use --getsize, this option is deprecated and it's based
>> on BLKGETSIZE ioctl that returns *32-bit* sector count (= 2TiB only).
>>
>> Please, use --getsz. For more details see blockdev(8) man page.
^^^^^^^^^^^^^^^^^^^^^
>>
>> Karel
>>
>
> patched to use --getsize64
That's wrong solution. The --getsize64 option returns size in bytes,
but you need size in 512-byte sectors. Use --getsz, read "man
blockdev" ;-)
Karel
--
Karel Zak <kzak-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] add readonly overlay support for dmsquash
[not found] ` <20100304141633.GA18077-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
@ 2010-03-04 14:28 ` Harald Hoyer
0 siblings, 0 replies; 6+ messages in thread
From: Harald Hoyer @ 2010-03-04 14:28 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Joey Boggs
On 03/04/2010 03:16 PM, Karel Zak wrote:
> On Thu, Mar 04, 2010 at 02:07:49PM +0100, Harald Hoyer wrote:
>> On 02/26/2010 09:23 PM, Karel Zak wrote:
>>> On Fri, Feb 26, 2010 at 09:44:29AM -0500, Joey Boggs wrote:
>>>> # set up the snapshot
>>>> - echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
>>>> + echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
>>> ^^^^^^^^^^^^^^^^^
>>>
>>> Don't use --getsize, this option is deprecated and it's based
>>> on BLKGETSIZE ioctl that returns *32-bit* sector count (= 2TiB only).
>>>
>>> Please, use --getsz. For more details see blockdev(8) man page.
> ^^^^^^^^^^^^^^^^^^^^^
>>>
>>> Karel
>>>
>>
>> patched to use --getsize64
>
> That's wrong solution. The --getsize64 option returns size in bytes,
> but you need size in 512-byte sectors. Use --getsz, read "man
> blockdev" ;-)
>
> Karel
>
doh :) stupid me
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-04 14:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-26 14:44 [PATCH] add readonly overlay support for dmsquash Joey Boggs
[not found] ` <1267195469-32522-1-git-send-email-jboggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-02-26 20:23 ` Karel Zak
[not found] ` <20100226202326.GG8702-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
2010-03-04 13:07 ` Harald Hoyer
[not found] ` <4B8FB0A5.2090309-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-03-04 14:16 ` Karel Zak
[not found] ` <20100304141633.GA18077-sHeGUpI7y9L/9pzu0YdTqQ@public.gmane.org>
2010-03-04 14:28 ` Harald Hoyer
2010-03-04 13:07 ` Harald Hoyer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.