~ubuntu-branches/ubuntu/vivid/aufs/vivid

« back to all changes in this revision

Viewing changes to sample/diskless/linuxrc

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2007-12-15 23:32:51 UTC
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20071215233251-1emj2gj6sz0osjlr
Tags: upstream-0+20071211
ImportĀ upstreamĀ versionĀ 0+20071211

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# along with this program; if not, write to the Free Software
19
19
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
20
 
21
 
# $Id: linuxrc,v 1.5 2007/04/23 00:59:51 sfjro Exp $
 
21
# $Id: linuxrc,v 1.6 2007/07/09 05:48:23 sfjro Exp $
22
22
 
23
23
set -e
24
24
#echo here i am
32
32
 
33
33
eval `bootpc | egrep '^(HOSTNAME|SERVER|BOOTFILE|DOMAIN|DNSSRVS)='`
34
34
test `cat /proc/sys/kernel/hostname` = $HOSTNAME
35
 
export HOSTNAME SERVER BOOTFILE
 
35
export HOSTNAME SERVER BOOTFILE DOMAIN DNSSRVS
36
36
 
37
37
mount -t tmpfs tmp tmp
38
38
remote=`dirname $BOOTFILE`
62
62
if [ "$initrd" = "initramfs.gz" ]
63
63
then
64
64
        # rm
65
 
        umount /branch
 
65
        umount /branch || :
66
66
        mkdir -p aufs/branch
67
67
        #mount -t tmpfs none aufs/branch
68
68
        set -x
75
75
        done
76
76
 
77
77
        cd aufs
78
 
        /bin/mount -n --bind /tmp branch
79
 
        mount -nt proc proc /proc
80
 
        egrep -v ' (root|cram)fs ' /proc/mounts > etc/mtab
81
 
        umount /proc
82
 
        /bin/mount -n -o remount,ro aufsroot .
 
78
        if [ "$dl_label" = "faunos" ]
 
79
        then
 
80
                cd /tfs
 
81
        else
 
82
                /bin/mount -n --bind /tmp branch
 
83
                mount -nt proc proc /proc
 
84
                egrep -v ' (root|cram)fs ' /proc/mounts > etc/mtab
 
85
                umount /proc
 
86
                /bin/mount -n -o remount,ro aufsroot .
 
87
        fi
83
88
        /bin/mount -n --move . /
84
89
        test "$dl_label" = "knoppix" && mount -nt proc proc /proc
85
90
        #/bin/sh -i
86
91
        trap "" 0
87
 
        exec chroot . sbin/init < dev/console > dev/console 2>&1 dev/console
 
92
        if [ "$dl_label" = "faunos" ]
 
93
        then
 
94
                exec chroot . sbin/init s < dev/console > dev/console 2>&1 dev/console
 
95
        else
 
96
                exec chroot . sbin/init < dev/console > dev/console 2>&1 dev/console
 
97
        fi
88
98
else
89
99
        cd aufs
90
100
        mkdir -p initrd