#!/bin/sh set -x tmp=/tmp/susebootstrap.$$ arch=aarch64 while true; do case $1 in --arch) arch=$2; shift; shift ;; *) break;; esac done dir=$1 if [ -d "$dir" ]; then echo "ERROR: $dir already exists" exit 1; fi mkdir $dir || exit 1 case $arch in arm) portsarch=armv7hl;; *) portsarch=$arch esac echo "[main]" > $tmp echo "arch = $portsarch" >> $tmp # set up skeletons > $dir/qemu-${arch} mount --bind /usr/bin/qemu-${arch} $dir/qemu-${arch} for f in /dev /proc /sys; do mkdir $dir/$f mount --bind /dev $dir/$f done ZYPP_CONF=$tmp zypper -n --root $dir ar http://download.opensuse.org/ports/${portsarch}/factory/repo/oss/ yast2 yes "a" | ZYPP_CONF=$tmp zypper --root $dir ref for f in passwd group resolv.conf shadow; do cp /etc/$f $dir/etc/$f done ZYPP_CONF=$tmp zypper -n --root $dir in -l aaa_base ZYPP_CONF=$tmp zypper -n --root $dir in -l zypper umount $dir/qemu-${arch} for f in /dev /proc /sys; do umount $dir/$f done rm -f $tmp