View difference between Paste ID: siEiZPJz and QYyATWJG
SHOW: | | - or go back to the newest paste.
1-
*** local.orig  2012-12-01 15:45:04.000000000 +0100
1+
*** init.orig   2012-12-10 21:53:20.000000000 +0100
2-
--- local       2012-12-10 22:31:52.000000000 +0100
2+
--- init        2012-12-11 17:34:30.759184089 +0100
3
***************
4
*** 137,142 ****
5
--- 138,146 ----
6
        loopfstype=*)
7
                LOOPFSTYPE="${x#loopfstype=}"
8
                ;;
9
+       rootsubdir=*)
10
+               ROOTSUBDIR="${x#rootsubdir=}"
11
+               ;;
12
        cryptopts=*)
13
                cryptopts="${x#cryptopts=}"
14
                ;;
15
*** scripts/local.orig  2012-12-01 15:45:04.000000000 +0100
16
--- scripts/local       2012-12-10 22:31:52.000000000 +0100
17
***************
18
*** 140,145 ****
19
--- 140,167 ----
20
                if [ -d ${rootmnt}/host ]; then
21
                        mount -o move /host ${rootmnt}/host
22
                fi
23
+       elif [ "$ROOTSUBDIR" ]; then
24
+               if [ "$mountroot_status" != 0 ]; then
25
+                       panic "
26
+ Could not mount the partition ${ROOT}.
27
+ This could also happen if the file system is not clean because of an operating
28
+ system crash, an interrupted boot process, an improper shutdown, or unplugging
29
+ of a removable device without first unmounting or ejecting it.
30
+ (filesystem = ${FSTYPE}, error code = $mountroot_status)
31
+ "
32
+               fi
33
+ 
34
+               mkdir -p /host
35
+               mount -o move ${rootmnt} /host
36
+ 
37
+               if [ ! -d "/host/$ROOTSUBDIR" ]; then
38
+                   panic "Failed to bind folder ${ROOTSUBDIR} as root: folder does not exist."
39
+               fi
40
+ 
41
+               mount -o bind /host/$ROOTSUBDIR ${rootmnt}
42
+               if [ -d ${rootmnt}/host ]; then
43
+                       mount -o move /host ${rootmnt}/host
44
+               fi
45
        fi
46
  
47
        [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom"