[patch] Mythbuntu: add aufs support and various other options to initramfs

Bug #190016 reported by laga
8
Affects Status Importance Assigned to Milestone
ltsp (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

Hello,

here are the initramfs changes I've been talking about for a while. They include the patch from #184549.

I haven't had a chance to test my newest changes, but it's possible to boot with aufs (another unionfs) and an NFS overlay. It's posted for review now and will get some better testing next weekend.

Instead of writing a new description, I'll just post my additions to conf.d/ltsp where I've documented the options I've added:

# MINRAM: if we have less than $MINRAM kB of RAM, we'll add swap
# Default is 49152
# Note: can be overridden with minram= at boot time
# MINRAM=

# WOLADDRESS: MAC address (aa:bb:cc:dd:ee:ff notation) of the box you
# want to wake up
# Note: etherwake has to be installed
# Note: can be overridden with wol=aa:bb:cc:dd:ee:ff boot option
# WOLADDRESS=

# OVERLAY can be set to "tmpfs" to use the default behaviour of writing
# all changes to tmpfs or you can specify:
# * a NFS share prefixed with "nfs="
# * "nfs" or "NFS" to auto-detect the NFS share which is to be used
# (NFS server will be the nbdroot server, path will be "/opt/ltsp/overlay")
# * or a block device, eg /dev/sda1 (will be
# interpreted by mount, UUID might work as well)
#
# Note: can be overridden with overlay= boot option
# Note: default is "tmpfs"
# Note: If you're going to use NFS, it's recommended you set UNIONTYPE="aufs"
# Examples:
# OVERLAY="/dev/sda1/"
# OVERLAY="nfs=192.168.0.1:/my/share/"
# OVERLAY=

# OVERLAYKEY: valid options: "MAC", "HOSTNAME" or any string of your choice
# A new directory will be created inside the file system described by $OVERLAY.
# Its name will either be the MAC address of the NIC used to bring up your
# system ("MAC"), the hostname ("HOSTNAME") (as given out by your dhcpd or
# as specified using the ip= boot option) or any other string you might
# have entered here.
# All changes you will make to the root file system will be preserved in this
# directory and they'll be available even after reboots. That's the plan
# at least, so make sure your backups are up to date.
# Note: can be overridden with overlaykey= boot option
# Note: this option is not used with OVERLAY=tmpfs to preserve default behavior
# Note: OVERLAYKEY defaults to "MAC"
# Note: If you're using MAC, colons will stripped from the MAC address
# OVERLAYKEY=""

# UNIONTYPE: which stacking file system do you want to use
# Defaults to unionfs if not set
# valid choices: "aufs", empty
# Note: can be overriden with union= boot option
# UNIONTYPE="aufs"

# HOSTNAMEOVERRIDE: set the hostname of the client to the overlay key
# If $OVERLAYKEY is used and you set this option to "true",
# the host name of the client will be set to the string represented by
# $OVERLAYKEY (eg OVERLAYKEY="MAC" will set the host name to the MAC address
# without colons)
# Valid choices: "true", empty
# Note: can be overriden with hostnameoverride= boot option
HOSTNAMEOVERRIDE=""

Revision history for this message
laga (laga) wrote :

BTW, this is against ltsp-trunk.

Murat Gunes (mgunes)
Changed in ltsp:
importance: Undecided → Wishlist
Revision history for this message
laga (laga) wrote :

Oops. Fixes:

* Make sure that default behavior (tmpfs) is used when OVERLAY is empty
* Make OVERLAY="nfs" work

I'm attaching an updated diff.

Diff from the previous diff:

=== modified file 'client/initramfs/scripts/ltsp_nbd'
--- client/initramfs/scripts/ltsp_nbd 2008-02-07 19:59:17 +0000
+++ client/initramfs/scripts/ltsp_nbd 2008-02-07 22:00:56 +0000
@@ -145,13 +145,19 @@
        fi

     # mount the overlay file system
- if [ ! "x$OVERLAY" = "xtmpfs" ]; then
+ if [ ! "x$OVERLAY" = "xtmpfs" ] && [ -n "$OVERLAY" ]; then

                case "$OVERLAY" in
                        # either specify the share using nfs=
                        # or say NFS or nfs to enable auto-detection
                        nfs=*|NFS|nfs)
- OL="${OVERLAY#nfs=}"
+
+ OL="${OVERLAY#nfs=}"
+
+ if [ "x$OL" = "xnfs" ] || [ "x$OL" = "xNFS" ]; then
+ OL=""
+ fi
+
                        # Sorry if this is a bit messy, but I don't want to overwrite variables

                        # borrowed from scripts/nfs (initramfs-tools package)
@@ -168,7 +174,9 @@
                                        # is this the correct path?
                                        OVERLAYPATH="/opt/ltsp/overlay/"
                        fi
+
                        SHARE="${OVERLAYSERVER}:${OVERLAYPATH}"
+ log_begin_msg "Mounting NFS overlay $SHARE"
                        # I wish this could be wrapped in a while loop like nbd-client
                        # But I can't think of a good way to check if the file system was successfully mounted
                        nfsmount -o rw -o nolock ${NFSOPTS} ${SHARE} /cow

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

We minimalized the initramfs code and switched to using a custom init=/sbin/init-ltsp. The patch no longer applies in the current code, marking as won't fix.

Changed in ltsp (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.