toaruos/util/make-cdrom.sh
Kevin Lange 39da315a48 Build a dynamic userspace.
- Builds (terrible, broken) shared versions of (most) third-party
  dependencies for the userspace.
- Fixes several incorrect dependency mappings in auto-dep.
- Makes auto-dep understand shared libraries (and that some things,
  like OSMesa, don't work with them).
- init must be built static because reasons
- some libraries were cleaned up to fix dependency calculation
- version bumped to 0.99.0 (saten) for eventual 1.0.0 release.
- CDs no longer drop teapot, select-wallpaper (space is available
  for them - we could even make the images smaller)
2016-12-03 17:10:48 +09:00

68 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Ensure we're in the root of the git repo.
cd $DIR/..
# Check that we're trying to build with our own toolchain,
# as it installs things to hdd/ and we're going to reset
# that directory to a clean slate (which will lose, eg.
# includes, libraries, etc.)
if [[ $TOOLCHAIN/ = $PWD/* ]]; then
echo "You should not try to build CD ISOs from your active"
echo "development repository, as the process is destructive"
echo "in its attempts to build small ramdisks."
echo ""
echo "Instead, create a new clone of your repository,"
echo "activate your development toolchain, and then run this"
echo "script again."
exit 1
fi
BLACKLIST="userspace/tests/* hdd/usr/share/wallpapers/{grandcanyon,paris,southbay,yokohama,yosemite}.png"
# Rebuild
echo "Rebuilding... (ignore warnings about time skew, this is intentional)"
eval rm $BLACKLIST
touch -d tomorrow toaruos-disk.img
make
i686-pc-toaru-strip hdd/bin/*
echo "Cloning CD source directory..."
rm -rf cdrom
cp -r util/cdrom cdrom
mv hdd/mod cdrom/mod
mkdir -p hdd/usr/share/terminfo/t
cp util/toaru.tic hdd/usr/share/terminfo/t/toaru
cat > hdd/home/local/.menu.desktop <<EOF
clock,clock-win,Clock
applications-painting,draw,Draw!
julia,julia,Julia Fractals
gears,gears,Gears
drawlines,drawlines,Lines
snow,make-it-snow,Make it Snow
pixman-demo,pixman-demo,Pixman Demo
plasma,plasma,Plasma
applications-simulation,game,RPG Demo
utilities-terminal,terminal,Terminal
ttk-demo,ttk-demo,TTK Demo
EOF
echo "Generating ramdisk..."
genext2fs -B 4096 -d hdd -D util/devtable -U -b 16384 -N 1024 cdrom/ramdisk.img
gzip cdrom/ramdisk.img
echo "Installing kernel..."
cp toaruos-kernel cdrom/kernel
echo "Building ISO..."
grub-mkrescue -d /usr/lib/grub/i386-pc -o toaruos.iso cdrom
echo "Restoring modules directory to hdd/mod..."
mv cdrom/mod hdd/mod
rm -r cdrom
eval git checkout $BLACKLIST