PKGBUILDs/scripts/distro-builder
2010-06-13 20:45:27 -07:00

31 lines
866 B
Bash
Executable file

#!/bin/bash
#
# Plugbox Linux Distribution Image Builder
# Version 0.0.3
#
# Licensed under the GPLv2.
#
# Usage: ./distro-builder workingdir
#
# NOTE: This script is interactive.
# Agree to installing packages and answer "y" to cleaning the Pacman database.
#
# ==== Variables to set ====
INSTALLEDPKGS="base kernel26-withlinux openssh openssl heimdal"
RELEASEVER=1.1
# ==== The Process ====
mkdir -p $1
echo -e "\033[1mInstalling packages...\033[0m"
mkdir -p $1/var/lib/pacman
pacman -Syy -r $1 $INSTALLEDPKGS
echo -e "\033[1mSetting the password to 'root' and cleaning up:\033[0m"
echo -e "root\nroot\n" | chroot $1/ /usr/bin/passwd root
chroot $1/ /usr/bin/pacman -Scc
echo -e "\033[1mCreating a rootfs.tar.gz...\033[0m"
cd $1
echo $RELEASEVER > /etc/plugbox-version
tar czf ../Plugbox-Linux-$RELEASEVER.tar.gz ./*
cd ../
echo -e "\033[1mAll done!\033[0m"