first working Live Kit
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
#!/bin/bash
|
||||
# we're using precompiled busybox i486 binary, which runs on 64bit systems as well!
|
||||
wget -O ./busybox http://busybox.net/downloads/binaries/latest/busybox-i486
|
||||
|
||||
# Automatically determine the architecture we're building on:
|
||||
if [ -z "$MYARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) export MYARCH=i486 ;;
|
||||
arm*) export MYARCH=arm ;;
|
||||
# Unless $MYARCH is already set, use uname -m for all other archs:
|
||||
*) export MYARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
wget -O ./busybox http://busybox.net/downloads/binaries/latest/busybox-$MYARCH
|
||||
chmod a+x ./busybox
|
||||
|
||||
+11
-10
@@ -4,12 +4,16 @@
|
||||
|
||||
MEMORYDIR=/memory
|
||||
UNIONDIR=/union
|
||||
DATADIR=/mnt/data
|
||||
BUNDLESDIR=/mnt/bundles
|
||||
|
||||
export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
. /.config
|
||||
. /livekitlib
|
||||
|
||||
header "Starting $LIVEKITNAME ..."
|
||||
|
||||
init_proc
|
||||
init_devs
|
||||
init_aufs
|
||||
@@ -17,21 +21,18 @@ init_zram
|
||||
init_union $MEMORYDIR $UNIONDIR
|
||||
|
||||
# find data dir with filesystem bundles
|
||||
DATA="$(find_data $LIVEKITNAME)"
|
||||
DATA="$(find_data $LIVEKITNAME $DATADIR)"
|
||||
|
||||
# copy to RAM if needed
|
||||
|
||||
# add data to union
|
||||
union_append_bundles "$DATA"
|
||||
union_append_bundles "$DATA" "$BUNDLESDIR" "$UNIONDIR"
|
||||
|
||||
# create empty fstab
|
||||
fstab_create "$UNIONDIR"
|
||||
|
||||
mkdir /m
|
||||
mount /dev/sr0 /m
|
||||
modprobe squashfs
|
||||
mkdir /s
|
||||
mount -o loop -t squashfs /m/mylinux/core.sb /s
|
||||
# possibly switch root
|
||||
header "Live Kit phase ends, starting $LIVEKITNAME"
|
||||
change_root "$UNIONDIR"
|
||||
|
||||
# testing message
|
||||
echo "If you see this message, then something went terribly wrong. Sorry!"
|
||||
header "!!ERROR!!"
|
||||
/bin/sh
|
||||
|
||||
Reference in New Issue
Block a user