add ability to EXCLUDE packages, don't do locale gen.

ubuntu/precise
LaMont Jones 20 years ago
parent 0019664568
commit 2a556e0689

@ -27,6 +27,15 @@ kill_users() {
done done
} }
without_package() {
echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
}
subst_package() {
echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
}
if [ $(id -u) != 0 ];then if [ $(id -u) != 0 ];then
echo "must be run as root" echo "must be run as root"
exit 2 exit 2
@ -47,17 +56,17 @@ USZ="400*1024" # 400MB for the user
# And how many inodes? Default currently gives them > 100000 # And how many inodes? Default currently gives them > 100000
UINUM="" # blank (default), or number of inodes desired. UINUM="" # blank (default), or number of inodes desired.
STE=hoary STE=hoary
EXCLUDE=""
if /bin/false; then # not right now
while getopts :i:ms:: name; do case $name in while getopts :e:i:ms:: name; do case $name in
s) USZ=$(sanitize int "$OPTARG");; e) EXCLUDE="$EXCLUDE $OPTARG";;
i) UINUM=$(sanitize int "$OPTARG");; i) UINUM=$(sanitize int "$OPTARG");;
m) MIRROR=$(sanitize url "$OPTARG");; m) MIRROR=$(sanitize url "$OPTARG");;
\?) echo bad usage >&2; exit 2;; s) USZ=$(sanitize int "$OPTARG");;
\:) echo missing argument >&2; exit 2;; \?) echo bad usage >&2; exit 2;;
esac; done; \:) echo missing argument >&2; exit 2;;
shift $((OPTIND-1)) esac; done;
fi shift $((OPTIND-1))
if (( $# == 0 )) || [ "X$1" = "Xall" ]; then if (( $# == 0 )) || [ "X$1" = "Xall" ]; then
set -- ubuntu kubuntu set -- ubuntu kubuntu
@ -133,12 +142,6 @@ do_bootloader = no
do_bootfloppy = no do_bootfloppy = no
do_initrd = yes do_initrd = yes
link_in_boot = no link_in_boot = no
@@EOF
cat << @@EOF > ${ROOT}etc/locale.gen
en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
en_ZA.UTF-8 UTF-8
@@EOF @@EOF
mkdir -p ${ROOT}proc mkdir -p ${ROOT}proc
@ -156,11 +159,17 @@ en_ZA.UTF-8 UTF-8
powerpc) LIST="$LIST linux-powerpc linux-power3 linux-power4";; powerpc) LIST="$LIST linux-powerpc linux-power3 linux-power4";;
# and the bastard stepchildren # and the bastard stepchildren
hppa) LIST="$LIST linux-hppa32-smp linux-hppa64-smp";; hppa) LIST="$LIST linux-hppa32-smp linux-hppa64-smp"
EXCLUDE="$EXCLUDE ubuntu-desktop kubuntu-desktop" # can't handle it yet.
;;
sparc*) LIST="$LIST linux-sparc64";; sparc*) LIST="$LIST linux-sparc64";;
*) echo "Unknown architecture: no kernel."; exit 1;; *) echo "Unknown architecture: no kernel."; exit 1;;
esac esac
for x in $EXCLUDE; do
LIST="$(without_package "$x" "$LIST")"
done
# Create a good sources.list, and finish the install # Create a good sources.list, and finish the install
echo deb $MIRROR $STE main restricted > ${ROOT}etc/apt/sources.list echo deb $MIRROR $STE main restricted > ${ROOT}etc/apt/sources.list
chroot $ROOT apt-get update chroot $ROOT apt-get update
@ -169,7 +178,6 @@ en_ZA.UTF-8 UTF-8
chroot $ROOT /etc/cron.daily/slocate chroot $ROOT /etc/cron.daily/slocate
chroot $ROOT /etc/cron.daily/man-db chroot $ROOT /etc/cron.daily/man-db
chroot $ROOT /usr/sbin/locale-gen
# remove our diversions # remove our diversions
for file in $DIVERTS; do for file in $DIVERTS; do

Loading…
Cancel
Save