Add lilo package for use in making bootable images for x86
[openwrt/svn-archive/archive.git] / utils / lilo / S11Pivot
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3
4 #pivot function blatantly stolen from the firstboot stuff in the WRT54 arch files
5 pivot() { # <new_root> <old_root>
6 mount -o move /proc $1/proc && \
7 pivot_root $1 $1$2 && {
8 mount -o move $2/dev /dev
9 mount -o move $2/tmp /tmp
10 mount -o move $2/sys /sys
11 return 0
12 }
13 }
14
15 #just a little bit of time for the usb to settle down and get plugged in
16 #technically it probably should be done in hotplug, but, we need to handle
17 #the case of no key at all, and fall thru to ramdisk when it's selected
18 sleep 5
19
20 if [[ "$NOPIVOT" = "1" ]]; then
21 echo starting from a ramdisk
22 else
23 mount /dev/discs/disc0/disc /mnt
24 mkdir -p /mnt/old
25 pivot /mnt /old
26 fi
27