Patch for initramfs-tools (Was Re: process/procedure for fixes)
Paul Albrecht
albrecht at rdi1.com
Tue Aug 12 15:37:31 UTC 2008
On Tue, 2008-08-12 at 11:01 -0400, Ben Collins wrote:
> On Tue, 2008-08-12 at 06:51 -0600, Tim Gardner wrote:
> > (``-_-´´) -- Fernando wrote:
> > > Olá Ben e a todos.
> > >
> > > On Monday 04 August 2008 23:45:22 Ben Collins wrote:
> > >> Your email client ate some leading spaces on that diff. Send it properly (with a sane email client).
> > >
> > > Aint Evolution sane?
> > > X-Mailer: Evolution 2.22.3.1
> > >
> >
> > Not if it mangles patches. Its generally best if you send patches as
> > attachments because they are less likely to get munched.
>
> Nah, he just needs to insert the file better. Select "Preformat" and go
> to "Insert => Text File". That's how I send mine, and it doesn't eat
> them.
>
> >
Thought I had fixed the problem in my last post. Here's patch again
using the preformat option:
diff -Naur initramfs-tools-0.85eubuntu36.pristine/init initramfs-tools-0.85eubuntu36.hacked/init
--- initramfs-tools-0.85eubuntu36.pristine/init 2008-04-09 09:45:23.000000000 -0500
+++ initramfs-tools-0.85eubuntu36.hacked/init 2008-08-04 09:51:31.000000000 -0500
@@ -125,6 +125,15 @@
debug=y
set -x
;;
+ snapdev=*)
+ SNAPDEV=${x#snapdev=}
+ ;;
+ snapfstype=*)
+ SNAPFSTYPE=${x#snapfstype=}
+ ;;
+ aufs)
+ AUFS=y
+ ;;
break=*)
break=${x#break=}
;;
diff -Naur initramfs-tools-0.85eubuntu36.pristine/scripts/local initramfs-tools-0.85eubuntu36.hacked/scripts/local
--- initramfs-tools-0.85eubuntu36.pristine/scripts/local 2008-04-09 09:18:14.000000000 -0500
+++ initramfs-tools-0.85eubuntu36.hacked/scripts/local 2008-08-04 11:30:01.000000000 -0500
@@ -107,6 +107,20 @@
# FIXME This has no error checking
mount ${roflag} -o loop -t ${FSTYPE} ${LOOPFLAGS} "/host/${LOOP#/}" ${rootmnt}
+ # Optionally remount the loop device with a copy-on-write layer
+ if [ "$SNAPDEV" ] ; then
+ mkdir -p /snap
+ mount -n -t ${SNAPFSTYPE} ${SNAPDEV} /snap
+ if [ "$AUFS" = "y" ] ; then
+ mount -n -t aufs -o br:/snap=rw:${rootmnt}=ro none ${rootmnt}
+ else
+ mount -n -t unionfs -o dirs=/snap=rw:${rootmnt}=ro unionfs ${rootmnt}
+ fi
+ if [ -d ${rootmnt}/snap ]; then
+ mount -o move /snap ${rootmnt}/snap
+ fi
+ fi
+
if [ -d ${rootmnt}/host ]; then
mount -o move /host ${rootmnt}/host
fi
--
Paul Albrecht
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initramfs-tools.diff
Type: text/x-patch
Size: 1710 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20080812/15fb2022/attachment.bin>
More information about the kernel-team
mailing list