2019-02-10 10:18:12 +00:00
|
|
|
if [ $(id -u) != 0 ]; then
|
|
|
|
echo "This needs to be run as root"
|
|
|
|
exit
|
|
|
|
fi
|
2019-05-04 00:50:10 +00:00
|
|
|
|
2018-11-09 00:25:31 +00:00
|
|
|
rm -vf _fs_contents.lock
|
2019-05-04 00:50:10 +00:00
|
|
|
|
|
|
|
# If target filesystem image doesn't exist, create it.
|
|
|
|
if [ ! -f _fs_contents ]; then
|
|
|
|
dd if=/dev/zero of=_fs_contents bs=1M count=512
|
|
|
|
fi
|
|
|
|
|
|
|
|
mke2fs -F -I 128 _fs_contents
|
2019-02-08 07:45:59 +00:00
|
|
|
chown 1000:1000 _fs_contents
|
2018-11-09 00:25:31 +00:00
|
|
|
mkdir -vp mnt
|
2018-10-23 08:12:50 +00:00
|
|
|
mount -o loop _fs_contents mnt/
|
2019-02-08 07:45:59 +00:00
|
|
|
mkdir -vp mnt/bin
|
|
|
|
mkdir -vp mnt/etc
|
|
|
|
mkdir -vp mnt/proc
|
2019-02-09 08:22:04 +00:00
|
|
|
mkdir -vp mnt/tmp
|
|
|
|
chmod 1777 mnt/tmp
|
2018-11-16 21:14:40 +00:00
|
|
|
mkdir -vp mnt/dev
|
2019-02-08 07:45:59 +00:00
|
|
|
mkdir -vp mnt/dev/pts
|
2019-02-21 14:45:31 +00:00
|
|
|
mknod -m 666 mnt/dev/bxvga b 82 413
|
2018-11-16 21:14:40 +00:00
|
|
|
mknod mnt/dev/tty0 c 4 0
|
|
|
|
mknod mnt/dev/tty1 c 4 1
|
|
|
|
mknod mnt/dev/tty2 c 4 2
|
|
|
|
mknod mnt/dev/tty3 c 4 3
|
2019-02-11 05:59:02 +00:00
|
|
|
mknod mnt/dev/random c 1 8
|
|
|
|
mknod mnt/dev/null c 1 3
|
|
|
|
mknod mnt/dev/zero c 1 5
|
|
|
|
mknod mnt/dev/full c 1 7
|
2019-04-18 14:08:52 +00:00
|
|
|
mknod -m 666 mnt/dev/debuglog c 1 18
|
2019-01-16 16:20:58 +00:00
|
|
|
mknod mnt/dev/keyboard c 85 1
|
2019-01-14 13:21:51 +00:00
|
|
|
mknod mnt/dev/psaux c 10 1
|
2019-02-21 14:45:31 +00:00
|
|
|
mknod -m 666 mnt/dev/ptmx c 5 2
|
2019-02-03 11:38:03 +00:00
|
|
|
ln -s /proc/self/fd/0 mnt/dev/stdin
|
|
|
|
ln -s /proc/self/fd/1 mnt/dev/stdout
|
|
|
|
ln -s /proc/self/fd/2 mnt/dev/stderr
|
2019-01-30 19:40:41 +00:00
|
|
|
cp -vR ../Base/* mnt/
|
2019-02-23 16:24:50 +00:00
|
|
|
cp -vR ../Root/* mnt/
|
2019-02-21 22:35:07 +00:00
|
|
|
mkdir mnt/home/anon
|
|
|
|
mkdir mnt/home/nona
|
2019-03-06 23:31:06 +00:00
|
|
|
cp ../ReadMe.md mnt/home/anon/
|
2019-02-10 10:18:12 +00:00
|
|
|
chown -vR 100:100 mnt/home/anon
|
2019-02-21 22:35:07 +00:00
|
|
|
chown -vR 200:200 mnt/home/nona
|
2019-04-15 11:53:27 +00:00
|
|
|
find ../Userland/ -type f -executable -exec cp -v {} mnt/bin/ \;
|
2019-02-21 22:35:07 +00:00
|
|
|
chmod 4755 mnt/bin/su
|
2019-02-10 07:35:01 +00:00
|
|
|
cp -v ../Applications/Terminal/Terminal mnt/bin/Terminal
|
|
|
|
cp -v ../Applications/FontEditor/FontEditor mnt/bin/FontEditor
|
|
|
|
cp -v ../Applications/Launcher/Launcher mnt/bin/Launcher
|
|
|
|
cp -v ../Applications/FileManager/FileManager mnt/bin/FileManager
|
2019-02-28 00:43:50 +00:00
|
|
|
cp -v ../Applications/ProcessManager/ProcessManager mnt/bin/ProcessManager
|
2019-02-12 14:23:07 +00:00
|
|
|
cp -v ../Applications/About/About mnt/bin/About
|
2019-03-06 23:31:06 +00:00
|
|
|
cp -v ../Applications/TextEditor/TextEditor mnt/bin/TextEditor
|
2019-03-15 11:14:23 +00:00
|
|
|
cp -v ../Applications/IRCClient/IRCClient mnt/bin/IRCClient
|
|
|
|
ln -s IRCClient mnt/bin/irc
|
2019-03-23 21:59:08 +00:00
|
|
|
ln -s FileManager mnt/bin/fm
|
2019-03-20 03:26:30 +00:00
|
|
|
cp -v ../Servers/LookupServer/LookupServer mnt/bin/LookupServer
|
2019-03-20 03:34:14 +00:00
|
|
|
cp -v ../Servers/WindowServer/WindowServer mnt/bin/WindowServer
|
2019-04-03 17:38:44 +00:00
|
|
|
cp -v ../Applications/Taskbar/Taskbar mnt/bin/Taskbar
|
|
|
|
ln -s Taskbar mnt/bin/tb
|
2019-04-07 12:36:10 +00:00
|
|
|
cp -v ../Applications/Downloader/Downloader mnt/bin/Downloader
|
|
|
|
ln -s Downloader mnt/bin/dl
|
2019-04-10 22:05:47 +00:00
|
|
|
cp -v ../Applications/VisualBuilder/VisualBuilder mnt/bin/VisualBuilder
|
|
|
|
ln -s VisualBuilder mnt/bin/vb
|
2019-04-13 01:08:16 +00:00
|
|
|
cp -v ../Games/Minesweeper/Minesweeper mnt/bin/Minesweeper
|
|
|
|
ln -s Minesweeper mnt/bin/ms
|
2019-04-20 01:24:50 +00:00
|
|
|
cp -v ../Games/Snake/Snake mnt/bin/Snake
|
|
|
|
ln -s Snake mnt/bin/sn
|
2018-11-09 00:25:31 +00:00
|
|
|
cp -v kernel.map mnt/
|
2019-05-04 00:50:10 +00:00
|
|
|
|
|
|
|
# Run local sync script, if it exists
|
|
|
|
if [ -f sync-local.sh ]; then
|
|
|
|
sh sync-local.sh
|
|
|
|
fi
|
|
|
|
|
2019-04-05 14:26:29 +00:00
|
|
|
umount mnt || ( sleep 0.5 && sync && umount mnt )
|