use tmpfs instead of ramfs

pull/5/head
Tomas M 2012-10-02 04:09:38 -05:00
parent d8acfb7fcf
commit 5cf10665dc
1 changed files with 6 additions and 6 deletions

View File

@ -109,7 +109,7 @@ create_bundle()
} }
# Move entire initramfs tree to ramfs mount. # Move entire initramfs tree to tmpfs mount.
# It's a bit tricky but is necessray to enable pivot_root # It's a bit tricky but is necessray to enable pivot_root
# even for initramfs boot image # even for initramfs boot image
# #
@ -119,7 +119,7 @@ transfer_initramfs()
echo "switch root from initramfs to ramfs" echo "switch root from initramfs to ramfs"
SWITCH=/m # one letter directory SWITCH=/m # one letter directory
mkdir -p $SWITCH mkdir -p $SWITCH
mount -t ramfs ramfs $SWITCH mount -t tmpfs -o size="100%" tmpfs $SWITCH
cp -a /??* $SWITCH 2>/dev/null # only copy two-and-more-letter directories cp -a /??* $SWITCH 2>/dev/null # only copy two-and-more-letter directories
cd $SWITCH cd $SWITCH
echo "This file indicates that we successfully escaped initramfs" > $SWITCH/lib/initramfs_escaped echo "This file indicates that we successfully escaped initramfs" > $SWITCH/lib/initramfs_escaped
@ -187,7 +187,7 @@ init_union()
echo "Setting up union using AUFS 3" echo "Setting up union using AUFS 3"
mkdir -p "$1" mkdir -p "$1"
mkdir -p "$2" mkdir -p "$2"
mount -t aufs -o xino="/.xino",br="$1" none "$2" mount -t aufs -o xino="/.xino",br="$1" aufs "$2"
} }
# Return device mounted for given directory # Return device mounted for given directory
@ -370,8 +370,8 @@ copy_to_ram()
echo "$RAM/$LIVEKITNAME" echo "$RAM/$LIVEKITNAME"
if grep -q perch /proc/cmdline; then if grep -q perch /proc/cmdline; then
umount "$2" umount "$2" 2>/dev/null
umount "$DM/$LIVEKITNAME/$CHANGES" umount "$DM/$LIVEKITNAME/$CHANGES" 2>/dev/null
umount "$DM/$LIVEKITNAME/$CHANGES" 2>/dev/null umount "$DM/$LIVEKITNAME/$CHANGES" 2>/dev/null
mount --bind "$RAM/$LIVEKITNAME/$CHANGES" "$2" mount --bind "$RAM/$LIVEKITNAME/$CHANGES" "$2"
fi fi
@ -394,7 +394,7 @@ union_append_bundles()
echo "* $BUNDLE" echo "* $BUNDLE"
mkdir -p "$2/$BUNDLE" mkdir -p "$2/$BUNDLE"
mount -o loop -t squashfs "$1/$BUNDLE" "$2/$BUNDLE" mount -o loop -t squashfs "$1/$BUNDLE" "$2/$BUNDLE"
mount -o remount,add:1:"$2/$BUNDLE" none "$3" mount -o remount,add:1:"$2/$BUNDLE" aufs "$3"
done done
} }