Working distro-builder script

This commit is contained in:
Mike Staszel 2010-06-13 20:45:27 -07:00
parent b3efbc44aa
commit e95084ef88

22
scripts/distro-builder Normal file → Executable file
View file

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