#!/bin/bash # 2009 Copyright Yejun Yang (yejunx AT gmail DOT com) # Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. # http://creativecommons.org/licenses/by-nc-sa/3.0/us/ PACKS="sed gawk coreutils filesystem texinfo grep pacman \ module-init-tools wget curl net-tools procps nano tar cpio zip \ gzip bzip2 lzma psmisc initscripts iputils dnsutils iproute2 \ less dash which" if [[ $1 == i686 ]]; then ARCH=i686 else ARCH=x86_64 fi ROOT=mini_$ARCH cat < pacman.conf [options] HoldPkg = pacman glibc SyncFirst = pacman [core] Server = ftp://mirror.cs.vt.edu/pub/ArchLinux/\$repo/os/$ARCH Server = http://archlinux.mirrors.uk2.net/\$repo/os/$ARCH Include = /etc/pacman.d/mirrorlist [extra] Server = ftp://mirror.cs.vt.edu/pub/ArchLinux/\$repo/os/$ARCH Server = http://archlinux.mirrors.uk2.net/\$repo/os/$ARCH Include = /etc/pacman.d/mirrorlist [community] Server = ftp://mirror.cs.vt.edu/pub/ArchLinux/\$repo/os/$ARCH Server = http://archlinux.mirrors.uk2.net/\$repo/os/$ARCH Include = /etc/pacman.d/mirrorlist EOF mkarchroot -C pacman.conf $ROOT $PACKS chmod 666 $ROOT/dev/null mknod -m 666 $ROOT/dev/random c 1 8 mknod -m 666 $ROOT/dev/urandom c 1 9 mknod -m 600 $ROOT/dev/console c 5 1 mkdir -m 755 $ROOT/dev/pts mkdir -m 1777 $ROOT/dev/shm echo nameserver 4.2.2.1 > $ROOT/etc/resolv.conf echo nameserver 4.2.2.2 >> $ROOT/etc/resolv.conf find $ROOT -depth -print | cpio -ov | lzma -5 > $ROOT.cpio.lzma