Patch for initramfs-tools (Was Re: process/procedure for fixes)
Paul Albrecht
albrecht at rdi1.com
Mon Aug 4 18:27:12 UTC 2008
On Sat, 2008-08-02 at 08:04 -0600, Tim Gardner wrote:
> Paul Albrecht wrote:
> > Hi,
> >
> > Does ubuntu have a process/procedure for fixes? How do I get a fix to
> > initramfs-tools pushed upstream?
> >
>
> Propose a patch on this list.
Hi Tim,
OK, Here's a patch to initramfs-tools that allows a user to optionally
specify a device to union mount with a loop device:
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
Please review and apply to initramfs-tools. Thanks.
--
Paul Albrecht
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my.initramfs-tools.patch
Type: text/x-patch
Size: 1710 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20080804/9199d8cd/attachment.bin>
More information about the kernel-team
mailing list