2009-01-03 05:38:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Plugbox Linux Distribution Image Builder
|
|
|
|
# Version 0.0.1
|
|
|
|
#
|
|
|
|
# Licensed under the GPLv2.
|
|
|
|
#
|
|
|
|
# Usage: ./distro-builder working/directory/
|
|
|
|
#
|
2010-06-13 16:00:33 +00:00
|
|
|
# NOTE: This script is interactive. Agree to installing packages and answer "y" to cleaning the Pacman database
|
2009-01-03 05:38:53 +00:00
|
|
|
# ==== Variables to set ====
|
2010-06-13 16:00:33 +00:00
|
|
|
INSTALLEDPKGS="base kernel26-withlinux openssh openssl"
|
2009-01-03 05:38:53 +00:00
|
|
|
RELEASEVER=1.1
|
|
|
|
# ==== The Process ====
|
|
|
|
mkdir -p $1
|
|
|
|
echo "Installing packages..."
|
|
|
|
mkdir -p $1/var/lib/pacman
|
|
|
|
pacman -Syy -r $1 $INSTALLEDPKGS
|
|
|
|
echo "Setting the password to 'root' and cleaning up"
|
|
|
|
echo -e "root\nroot\n" | chroot $1/ /usr/bin/passwd root
|
|
|
|
chroot $1/ /usr/bin/pacman -Scc
|
2010-06-13 16:00:33 +00:00
|
|
|
chroot $1/ /usr/bin/pacman -Q > /installed-pkgs.txt
|
|
|
|
mv $1/installed-pkgs.txt ./
|
2009-01-03 05:38:53 +00:00
|
|
|
echo "Creating a rootfs.tar.gz..."
|
|
|
|
cd $1
|
|
|
|
echo $RELEASEVER > /etc/plugbox-version
|
|
|
|
tar czf ../Plugbox-Linux-$RELEASEVER.tar.gz ./*
|
|
|
|
cd ../
|
|
|
|
echo "All done!"
|