Who maintains initramfs-tools?
Paul Albrecht
albrecht at rdi1.com
Thu Jul 24 16:37:35 UTC 2008
On Thu, 2008-07-24 at 12:10 -0400, Ben Collins wrote:
> On Thu, 2008-07-24 at 10:54 -0500, Paul Albrecht wrote:
> > On Thu, 2008-07-24 at 11:30 -0400, Ben Collins wrote:
> > > On Thu, 2008-07-24 at 09:56 -0500, Paul Albrecht wrote:
> > > > On Tue, 2008-07-22 at 10:13 -0400, Ben Collins wrote:
> > > > > On Tue, 2008-07-22 at 09:08 -0500, Paul Albrecht wrote:
> > > > > > On Tue, 2008-07-22 at 07:31 -0600, Tim Gardner wrote:
> > > > > > > Paul Albrecht wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Who maintains the initramfs-tools package?
> > > > > > > >
> > > > > > >
> > > > > > > >From the changelog I see 5 different people for the last 5 uploads. What
> > > > > > > do you need?
> > > > > > >
> > > > > >
> > > > > > I hacked initramfs-tools so I could run ubuntu on a 2 gigabyte partition
> > > > > > and I was wondering whether it was worthwhile pushing the changes
> > > > > > upstream.
> > > > > >
> > > > > > What I do specifically is first install ubuntu on a 8 gigabyte flash
> > > > > > disk. Then I further configure the system the way I want and squash the
> > > > > > root file system. Finally, I write the squashed root file system to a 2
> > > > > > gigabyte flash disk.
> > > > > >
> > > > > > With my hack to initramfs-tools, which simply union mounts the squashed
> > > > > > root with a cow layer, I get a usable desktop on a 2 gigabyte partition.
> > > > >
> > > > > This sounds a lot like our livecd, and even more like the work we've
> > > > > done for the classmate PC. I'd compare what you've done with that and
> > > > > see if there is anything common.
> > > > >
> > > >
> > > > Rereading your response I'm not sure I understood you. Are you saying
> > > > you think I should look at what you did for the classmate PC? How would
> > > > I do that?
> > > >
> > > > The reason I posted here was because I'd like to get the code that
> > > > handles loop file systems tweaked a bit so I don't have to pin the
> > > > initramfs-package.
> > >
> > > I didn't do the classmate PC stuff. If you talk to ogra on Freenode IRC,
> > > he can tell you where his code is. All I'm saying is that there's at
> > > least three different implementations, and we need to settle on one :)
> > >
> > > Last thing I want to do is have three different ways for this to be done
> > > in initramfs-tools.
> > >
> >
> > Why do you think you need three different implementations? It doesn't
> > matter how liveCDs or PC classmate are handled. It's really irrelevant.
> >
> > I'm simply suggesting a minor enhancement to the way loop file systems
> > are handled for the case of a local mount. This isn't much more than
> > tweak to code that handles the init loop option which is at the end of
> > mountroot routine in local/scripts.
> >
> > Of course, I can fix up the initrd to work the way I want, but then I
> > have to pin the package which I'd rather avoid because then I can't pick
> > up updates to the package.
> >
> > Didn't think there would be any objection because the change is small,
> > the risk of regression is negligible, and the change is possibly useful
> > to others.
>
> Maybe if you attached a patch I could give you better comments...
>
I don't have a patch for you, but I have attached a copy of
scripts/local which I hacked to do what I want. I haven't indented my
changes so they should be easy to spot at line numbers 78-94. This is
after the root device is mounted and before mountroot deals with any
loop file systems present on the device.
What I'm suggesting is fixing up the code that handles loop file system
so that it can be optionally union mounted with a cow layer. Then my
hack wouldn't be needed.
--
Paul Albrecht
-------------- next part --------------
1 # Local filesystem mounting -*- shell-script -*-
2
3 # Parameter: Where to mount the filesystem
4 mountroot ()
5 {
6 [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top"
7 run_scripts /scripts/local-top
8 [ "$quiet" != "y" ] && log_end_msg
9
10 # If the root device hasn't shown up yet, give it a little while
11 # to deal with removable devices
12 if [ ! -e "${ROOT}" ] || ! /lib/udev/vol_id "${ROOT}" >/dev/null 2>&1; then
13 log_begin_msg "Waiting for root file system..."
14
15 # Default delay is 180s
16 if [ -z "${ROOTDELAY}" ]; then
17 slumber=180
18 else
19 slumber=${ROOTDELAY}
20 fi
21 if [ -x /sbin/usplash_write ]; then
22 /sbin/usplash_write "TIMEOUT ${slumber}" || true
23 fi
24
25 slumber=$(( ${slumber} * 10 ))
26 while [ ! -e "${ROOT}" ] || ! /lib/udev/vol_id "${ROOT}" >/dev/null 2>&1; do
27 /bin/sleep 0.1
28 slumber=$(( ${slumber} - 1 ))
29 [ ${slumber} -gt 0 ] || break
30 done
31
32 if [ ${slumber} -gt 0 ]; then
33 log_end_msg 0
34 else
35 log_end_msg 1 || true
36 fi
37 if [ -x /sbin/usplash_write ]; then
38 /sbin/usplash_write "TIMEOUT 15" || true
39 fi
40 fi
41
42 # We've given up, but we'll let the user fix matters if they can
43 while [ ! -e "${ROOT}" ] || ! /lib/udev/vol_id "${ROOT}" >/dev/null 2>&1; do
44 echo " Check root= bootarg cat /proc/cmdline"
45 echo " or missing modules, devices: cat /proc/modules ls /dev"
46 panic -r "ALERT! ${ROOT} does not exist. Dropping to a shell!"
47 done
48
49 # Get the root filesystem type if not set
50 if [ -z "${ROOTFSTYPE}" ]; then
51 eval $(fstype < ${ROOT})
52 else
53 FSTYPE=${ROOTFSTYPE}
54 fi
55 if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then
56 FSTYPE=$(/lib/udev/vol_id -t ${ROOT})
57 [ -z "$FSTYPE" ] && FSTYPE="unknown"
58 fi
59
60 [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount"
61 run_scripts /scripts/local-premount
62 [ "$quiet" != "y" ] && log_end_msg
63
64 if [ ${readonly} = y ] && \
65 [ -z "$LOOP" ]; then
66 roflag=-r
67 else
68 roflag=-w
69 fi
70
71 # FIXME This has no error checking
72 modprobe -Qb ${FSTYPE}
73
74 # FIXME This has no error checking
75 # Mount root
76 mount ${roflag} -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} ${rootmnt}
77
78 modprobe loop
79 modprobe squashfs
80
81 mkdir -p /rofs /snap
82 chmod 700 /rofs /snap
83
84 if [ -n "$snap" ] ; then
85 mount -n -t ext3 /dev/$snap /snap
86 else
87 mount -n -t tmpfs tmpfs /snap
88 fi
89
90 mount -n -t squashfs ${rootmnt}/ubuntu.squash /rofs -o loop
91 mount -n -t aufs -o br:/snap=rw:/rofs=ro none ${rootmnt}
92
93 mount -o move /rofs ${rootmnt}/rofs
94 mount -o move /snap ${rootmnt}/snap
95
96 if [ "$LOOP" ]; then
97 mkdir -p /host
98 mount -o move ${rootmnt} /host
99
100 while [ ! -e "/host/${LOOP#/}" ]; do
101 panic "ALERT! /host/${LOOP#/} does not exist. Dropping to a shell!"
102 done
103
104 # Get the loop filesystem type if not set
105 if [ -z "${LOOPFSTYPE}" ]; then
106 eval $(fstype < "/host/${LOOP#/}")
107 else
108 FSTYPE="${LOOPFSTYPE}"
109 fi
110 if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then
111 FSTYPE=$(/lib/udev/vol_id -t "/host/${LOOP#/}")
112 [ -z "$FSTYPE" ] && FSTYPE="unknown"
113 fi
114
115 if [ ${readonly} = y ]; then
116 roflag=-r
117 else
118 roflag=-w
119 fi
120
121 # FIXME This has no error checking
122 modprobe -Qb loop
123 modprobe -Qb ${FSTYPE}
124
125 # FIXME This has no error checking
126 mount ${roflag} -o loop -t ${FSTYPE} ${LOOPFLAGS} "/host/${LOOP#/}" ${rootmnt}
127
128 if [ -d ${rootmnt}/host ]; then
129 mount -o move /host ${rootmnt}/host
130 fi
131 fi
132
133 [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom"
134 run_scripts /scripts/local-bottom
135 [ "$quiet" != "y" ] && log_end_msg
136 }
More information about the kernel-team
mailing list