2015-04-03 13:20:23 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-04-09 19:49:35 +02:00
|
|
|
if test -r /root/fw.tgz; then
|
|
|
|
if ! test -d /1; then
|
|
|
|
mkdir /1
|
|
|
|
fi
|
|
|
|
cd /1
|
|
|
|
tar xvzf /root/fw.tgz
|
2015-08-03 16:57:27 +02:00
|
|
|
mkdir -p /dev/shm
|
|
|
|
mount -t tmpfs none /dev/shm -o size=1m,mode=330,uid=0,gid=0
|
2015-04-09 19:49:35 +02:00
|
|
|
mount --bind /dev /1/dev
|
2015-08-03 16:57:27 +02:00
|
|
|
mkdir /1/dev/shm
|
|
|
|
mount --bind /dev/shm /1/dev/shm
|
2015-04-09 19:49:35 +02:00
|
|
|
mount --bind /proc /1/proc
|
2015-08-03 16:57:27 +02:00
|
|
|
mount --bind /sys /1/sys
|
2015-04-09 19:49:35 +02:00
|
|
|
cp -av /root/syscall-dump.so /1/usr/lib
|
|
|
|
cp -av /root/s2i-dump.sh /1
|
|
|
|
cp -av /usr/bin/strace /1/usr/bin
|
2015-05-12 11:23:26 +02:00
|
|
|
rm /root/fw.tgz
|
2015-04-09 19:49:35 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
2015-08-03 16:57:27 +02:00
|
|
|
if ! test -d /.rwfs; then
|
|
|
|
mkdir -p /.rwfs
|
|
|
|
mount -t tmpfs -o size=30M,mode=0755 tmpfs /.rwfs
|
|
|
|
mkdir -p /.rwfs/etc
|
|
|
|
fi
|
2015-04-03 13:20:23 +02:00
|
|
|
if ! test -d /mnt/s2i-log; then
|
|
|
|
mkdir -p /mnt/s2i-log
|
|
|
|
mount -t tmpfs -o size=300M,mode=0755 tmpfs /mnt/s2i-log
|
|
|
|
fi
|
2015-04-03 21:10:51 +02:00
|
|
|
if ! test -d /mnt/ramdisk; then
|
|
|
|
mkdir -p /mnt/ramdisk
|
|
|
|
mount -t tmpfs -o size=1024k,mode=0755 tmpfs /mnt/ramdisk
|
|
|
|
fi
|
2015-08-03 16:57:27 +02:00
|
|
|
if ! test -d /mnt/data; then
|
|
|
|
mkdir -p /mnt/data
|
|
|
|
mount -t tmpfs -o size=30M,mode=0755 tmpfs /mnt/data
|
|
|
|
fi
|
|
|
|
mkdir -p /media
|
2015-04-09 19:49:35 +02:00
|
|
|
killall -9 mdnsd
|
|
|
|
rm -f /mnt/s2i-log/*
|
|
|
|
#TRACE="strace -r -ff -o /mnt/s2i-log/trace"
|
2015-04-03 13:20:23 +02:00
|
|
|
LD_PRELOAD=/usr/lib/syscall-dump.so \
|
|
|
|
SYSCALL_DUMP_LOG=/mnt/s2i-log/s2i.log \
|
2015-08-03 16:57:27 +02:00
|
|
|
LD_LIBRARY_PATH=/usr/local/lib \
|
2015-04-09 19:49:35 +02:00
|
|
|
$TRACE /root/s2i.bin
|