summaryrefslogtreecommitdiffstats
path: root/tools/unionfs-run-init
blob: af09bf00600d86f53653c917616e1799dab2a235 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Fix fuer UnionFS auf /
Nun gibts einfach eine Erweiterung fuer das Klibc-Tool run-init:

klibc1.3
usr/kinit/run-init/runinitlib.c

  /* Delete rootfs contents */
  if ( nuke_dir("/") )
    die("nuking initramfs contents");

  /* wild guess and try&error */
   if ( !lstat("/rorootfs", &rfs ) )
     if ( mount("/rorootfs", "/", NULL, MS_MOVE, NULL) )
       die("moving rorootfs");

  /* Overmount the root */
  if ( mount(".", "/", NULL, MS_MOVE, NULL) )
    die("overmounting root");

und vor dem Movemount fuer das eigentliche Root noch ein Movemount auf das
drunterliegende Rootfs ... Laengeres Rumprobieren und nun scheint es
erstmal zu klappen. Zur Zeit checkt der einfach nur (bis ich das raus
hatte :-)) ob ein "/rorootfs" da ist und verschiebt das dann. Wenn nicht,
bleibts so wie vorher.