|
@@ -5,12 +5,19 @@ TEXTDOMAIN=vbootstrap
|
|
TEXTDOMAINDIR=/usr/share/locale
|
|
TEXTDOMAINDIR=/usr/share/locale
|
|
|
|
|
|
Usage(){
|
|
Usage(){
|
|
|
|
+ UARCH=$(uname -i)
|
|
|
|
+ case "${UARCH}" in
|
|
|
|
+ arm*)
|
|
|
|
+ UARCH="arm"
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+
|
|
cat<<EOF
|
|
cat<<EOF
|
|
-Usage: $(basename $0) {--version [version]} {--arch [arch]} {--category [categories]} {--dist-upgrade} {--target [target]} {--with-compat32} {--rpmbuild-define [macro_expr]} {--rpmbuild-with [bcond_with]} {--rpmbuild-without [bcond_with]} {--sign} {--no-install} {--bootstrap-dir [directory]} {--cache-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]|show-info}
|
|
+Usage: $(basename $0) {--version [version]} {--arch [arch]} {--category [categories]} {--dist-upgrade} {--target [target]} {--with-compat32} {--rpmbuild-define [macro_expr]} {--rpmbuild-with [bcond_with]} {--rpmbuild-without [bcond_with]} {--sign} {--no-install} {--debug} {--help} {--bootstrap-dir [directory]} {--unionfs-dir [directory]} {--cache-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]|show-info}
|
|
|
|
|
|
Options:
|
|
Options:
|
|
--version: set [version] (default: ${DEFAULT_VERSION})
|
|
--version: set [version] (default: ${DEFAULT_VERSION})
|
|
- --arch: set [arch] (default: $(uname -i))
|
|
+ --arch: set [arch] (default: ${UARCH})
|
|
--category: set [categories] (default: ${CATEGORIES})
|
|
--category: set [categories] (default: ${CATEGORIES})
|
|
--dist-upgrade: make VineSeed bootstrap via ${STABLE_VERSION}
|
|
--dist-upgrade: make VineSeed bootstrap via ${STABLE_VERSION}
|
|
--unionfs: cover a bootstrap with unionfs
|
|
--unionfs: cover a bootstrap with unionfs
|
|
@@ -21,10 +28,13 @@ Options:
|
|
--rpmbuild-without: give a option --without [bcond_with] to rpmbuild
|
|
--rpmbuild-without: give a option --without [bcond_with] to rpmbuild
|
|
--sign: sign built rpms
|
|
--sign: sign built rpms
|
|
--no-install: build only a source rpm - do NOT install a built rpm
|
|
--no-install: build only a source rpm - do NOT install a built rpm
|
|
|
|
+ --login: login in chroot as root user
|
|
--bootstrap-dir: set a bootstrap directory (default: ${VBOOTSTRAP_DIR})
|
|
--bootstrap-dir: set a bootstrap directory (default: ${VBOOTSTRAP_DIR})
|
|
--unionfs-dir: set a directory to store unionfs images of vbootstrap (default: ${UNIONFS_DIR})
|
|
--unionfs-dir: set a directory to store unionfs images of vbootstrap (default: ${UNIONFS_DIR})
|
|
--cache-dir: set a directory to cache rpms (default: ${CACHE_DIR})
|
|
--cache-dir: set a directory to cache rpms (default: ${CACHE_DIR})
|
|
--built-rpms-dir: set a directory to store built rpms in chroot (default: ${BUILT_RPMS_DIR})
|
|
--built-rpms-dir: set a directory to store built rpms in chroot (default: ${BUILT_RPMS_DIR})
|
|
|
|
+ --debug: enable debug mode
|
|
|
|
+ --help: show this help
|
|
|
|
|
|
Actions:
|
|
Actions:
|
|
clean: clean the boostrap of [version]
|
|
clean: clean the boostrap of [version]
|
|
@@ -69,7 +79,7 @@ check-parameter(){
|
|
shift
|
|
shift
|
|
check-next-parameter $1 || return 1
|
|
check-next-parameter $1 || return 1
|
|
;;
|
|
;;
|
|
- --dist-upgrade|--unionfs|--with-compat32|--sign|--no-install)
|
|
+ --dist-upgrade|--unionfs|--with-compat32|--sign|--no-install|--login|--debug)
|
|
[ $with_actions -eq 1 ] && \
|
|
[ $with_actions -eq 1 ] && \
|
|
echo $"E: You can give no more options after actions" && \
|
|
echo $"E: You can give no more options after actions" && \
|
|
return 1
|
|
return 1
|
|
@@ -131,12 +141,14 @@ setup-vbuilder(){
|
|
## set current stable relase version
|
|
## set current stable relase version
|
|
STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
|
|
STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
|
|
|
|
|
|
- ## set boolian
|
|
+ ## set boolian variables
|
|
with_setup_vbootstrap=0
|
|
with_setup_vbootstrap=0
|
|
with_dist_upgrade=0
|
|
with_dist_upgrade=0
|
|
with_unionfs=0
|
|
with_unionfs=0
|
|
with_sign=0
|
|
with_sign=0
|
|
with_no_install=0
|
|
with_no_install=0
|
|
|
|
+ with_login=0
|
|
|
|
+ with_debug=0
|
|
with_actions=0
|
|
with_actions=0
|
|
with_ix86_on_x86_64=0
|
|
with_ix86_on_x86_64=0
|
|
with_category_main=0
|
|
with_category_main=0
|
|
@@ -153,24 +165,45 @@ setup-vbootstrap(){
|
|
if [ ${with_setup_vbootstrap} -eq 0 ]; then
|
|
if [ ${with_setup_vbootstrap} -eq 0 ]; then
|
|
with_setup_vbootstrap=1
|
|
with_setup_vbootstrap=1
|
|
|
|
|
|
|
|
+ ## check debug mode
|
|
|
|
+ [ ${with_debug} -eq 1 ] && \
|
|
|
|
+ set && set -x
|
|
|
|
+
|
|
## check some directories
|
|
## check some directories
|
|
## Note: create $BUILT_RPMS_DIR in RPM_Build()
|
|
## Note: create $BUILT_RPMS_DIR in RPM_Build()
|
|
[ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
|
|
[ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
|
|
[ -d $CACHE_DIR ] || mkdir -p $CACHE_DIR
|
|
[ -d $CACHE_DIR ] || mkdir -p $CACHE_DIR
|
|
|
|
|
|
|
|
+ UARCH=$(uname -i)
|
|
|
|
+ case "${UARCH}" in
|
|
|
|
+ arm*)
|
|
|
|
+ UARCH="arm"
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+
|
|
|
|
+ case "${VARCH}" in
|
|
|
|
+ arm*)
|
|
|
|
+ VARCH="arm"
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+
|
|
## check a chroot archtecture
|
|
## check a chroot archtecture
|
|
if [ -z ${VARCH} ]; then
|
|
if [ -z ${VARCH} ]; then
|
|
- VARCH=$(uname -i)
|
|
+ VARCH=${UARCH}
|
|
else
|
|
else
|
|
case "${VARCH}" in
|
|
case "${VARCH}" in
|
|
i386|i686|x86_64)
|
|
i386|i686|x86_64)
|
|
- [ "$(uname -i)" = "ppc" ] && \
|
|
+ [ "$(uname -i)" = "ppc" -o "${UARCH}" = "arm" ] && \
|
|
echo $"E: arch ${VARCH} is NOT supported on $(uname -i)" && return 1
|
|
echo $"E: arch ${VARCH} is NOT supported on $(uname -i)" && return 1
|
|
;;
|
|
;;
|
|
ppc)
|
|
ppc)
|
|
- [ "$(uname -i)" = "i386" -o "$(uname -i)" = "i686" -o "$(uname -i)" = "x86_64" ] && \
|
|
+ [ "$(uname -i)" = "i386" -o "$(uname -i)" = "i686" -o "$(uname -i)" = "x86_64" -o "${UARCH}" = "arm" ] && \
|
|
echo $"E: arch ${VARCH} is NOT supported on $(uname -i)" && return 1
|
|
echo $"E: arch ${VARCH} is NOT supported on $(uname -i)" && return 1
|
|
;;
|
|
;;
|
|
|
|
+ arm)
|
|
|
|
+ [ "${UARCH}" = "i386" -o "${UARCH}" = "i686" -o "${UARCH}" = "x86_64" -o "${UARCH}" = "ppc" ] && \
|
|
|
|
+ echo $"E: arch ${VARCH} is NOT supported on ${UARCH}" && return 1
|
|
|
|
+ ;;
|
|
esac
|
|
esac
|
|
fi
|
|
fi
|
|
|
|
|
|
@@ -180,11 +213,21 @@ setup-vbootstrap(){
|
|
return 1
|
|
return 1
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+ ##!! 4.2 is NO support on VARCH=arm
|
|
|
|
+ if [ "${VERSION}" = "4.2" -a "${VARCH}" = "arm" ]; then
|
|
|
|
+ echo $"E: ${VERSION} is NOT supported"
|
|
|
|
+ return 1
|
|
|
|
+ fi
|
|
|
|
+
|
|
## support i386 chroot on x86_64 below:
|
|
## support i386 chroot on x86_64 below:
|
|
- [ "${VARCH}" != "$(uname -i)" ] && \
|
|
+ [ "${VARCH}" != "${UARCH}" ] && \
|
|
VERSION=${VERSION}_${VARCH} && \
|
|
VERSION=${VERSION}_${VARCH} && \
|
|
with_ix86_on_x86_64=1
|
|
with_ix86_on_x86_64=1
|
|
|
|
|
|
|
|
+ ## hack arm repository to local
|
|
|
|
+ [ "${VARCH}" = "arm" ] && \
|
|
|
|
+ VERSION=${VERSION}_${VARCH}
|
|
|
|
+
|
|
## check support ${VERSION}
|
|
## check support ${VERSION}
|
|
if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${VERSION})" ]; then
|
|
if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${VERSION})" ]; then
|
|
echo $"E: ${VERSION} is NOT supported"
|
|
echo $"E: ${VERSION} is NOT supported"
|
|
@@ -251,7 +294,7 @@ setup-vbootstrap(){
|
|
fi
|
|
fi
|
|
|
|
|
|
## set ${RPM_PKG_ARCH_LIST}
|
|
## set ${RPM_PKG_ARCH_LIST}
|
|
- RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch SRPMS"
|
|
+ RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch RPMS/armv3l RPMS/armv4l RPMS/armv4tl RPMS/armv5tejl RPMS/armv5tel RPMS/armv6l RPMS/armv7l SRPMS"
|
|
[ -z "${TARGET}" ] || \
|
|
[ -z "${TARGET}" ] || \
|
|
RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
|
|
RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
|
|
|
|
|
|
@@ -345,12 +388,9 @@ mount-chroot-umount(){
|
|
fi
|
|
fi
|
|
;;
|
|
;;
|
|
vfs)
|
|
vfs)
|
|
- # for dir in /sys /proc /dev/shm /dev/pts /dev; do
|
|
+ for dir in /sys /proc /dev/shm /dev/pts /dev; do
|
|
- # mount-chroot-umount ${dir} || return 1
|
|
+ mount-chroot-umount ${dir} || return 1
|
|
- # done
|
|
+ done
|
|
- [ -d ${BUILD_ROOT}/proc ] || return 1
|
|
|
|
- [ -z "$(mount | grep ${BUILD_ROOT}/proc)" ] || \
|
|
|
|
- umount ${BUILD_ROOT}/proc
|
|
|
|
;;
|
|
;;
|
|
archives_dir)
|
|
archives_dir)
|
|
[ -d ${ARCHIVES_DIR} ] || return 1
|
|
[ -d ${ARCHIVES_DIR} ] || return 1
|
|
@@ -378,34 +418,48 @@ mount-chroot-umount(){
|
|
## mount-chroot-mount [file system|name]
|
|
## mount-chroot-mount [file system|name]
|
|
mount-chroot-mount(){
|
|
mount-chroot-mount(){
|
|
local fs=$1
|
|
local fs=$1
|
|
- local mnt_opts=""
|
|
|
|
|
|
|
|
case $fs in
|
|
case $fs in
|
|
/home)
|
|
/home)
|
|
- mnt_opts="-o _netdev,rbind"
|
|
+ [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
|
|
|
|
+ [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
|
|
|
|
+ mount -o _netdev,rbind ${fs} ${BUILD_ROOT}${fs}
|
|
;;
|
|
;;
|
|
- *)
|
|
+ /tmp|/dev)
|
|
- mnt_opts="--bind -o _netdev"
|
|
+ [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
|
|
|
|
+ [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
|
|
|
|
+ mount --bind -o _netdev ${fs} ${BUILD_ROOT}${fs}
|
|
;;
|
|
;;
|
|
- esac
|
|
+ /sys)
|
|
-
|
|
+ [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
|
|
- case $fs in
|
|
+ [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
|
|
- /home|/tmp|/sys|/proc|/dev/shm|/dev/pts|/dev)
|
|
+ mount -o _netdev -t sysfs vbuildersysfs ${BUILD_ROOT}${fs}
|
|
|
|
+ ;;
|
|
|
|
+ /proc)
|
|
|
|
+ [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
|
|
|
|
+ [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
|
|
|
|
+ mount -o _netdev -t proc vbuilderproc ${BUILD_ROOT}${fs}
|
|
|
|
+ ;;
|
|
|
|
+ /dev/shm)
|
|
[ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
|
|
[ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
|
|
[ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
|
|
[ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
|
|
- mount ${mnt_opts} ${fs} ${BUILD_ROOT}${fs}
|
|
+ mount -o _netdev -t tmpfs vbuildertmpfs ${BUILD_ROOT}${fs}
|
|
|
|
+ ;;
|
|
|
|
+ /dev/pts)
|
|
|
|
+ [ -d ${BUILD_ROOT}${fs} ] || mkdir -p ${BUILD_ROOT}${fs}
|
|
|
|
+ [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] && \
|
|
|
|
+ mount -o gid=5,mode=620,_netdev -t devpts vbuilderdevpts ${BUILD_ROOT}${fs}
|
|
;;
|
|
;;
|
|
vfs)
|
|
vfs)
|
|
- # for dir in /dev /dev/pts /dev/shm /proc /sys; do
|
|
+ for dir in /dev /dev/pts /dev/shm /proc /sys; do
|
|
- # mount-chroot-mount ${dir} || return 1
|
|
+ mount-chroot-mount ${dir} || return 1
|
|
- # done
|
|
+ done
|
|
- mount-chroot-mount /proc || return 1
|
|
|
|
;;
|
|
;;
|
|
archives_dir)
|
|
archives_dir)
|
|
[ -d ${EXTERNAL_ARCHIVES_DIR} ] || mkdir -p ${EXTERNAL_ARCHIVES_DIR}
|
|
[ -d ${EXTERNAL_ARCHIVES_DIR} ] || mkdir -p ${EXTERNAL_ARCHIVES_DIR}
|
|
[ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
|
|
[ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
|
|
[ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
|
|
[ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
|
|
- mount ${mnt_opts} ${EXTERNAL_ARCHIVES_DIR} ${ARCHIVES_DIR}
|
|
+ mount --bind -o _netdev ${EXTERNAL_ARCHIVES_DIR} ${ARCHIVES_DIR}
|
|
[ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
|
|
[ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
|
|
;;
|
|
;;
|
|
unionfs_dir)
|
|
unionfs_dir)
|
|
@@ -485,15 +539,13 @@ user_from_uid () {
|
|
Clean(){
|
|
Clean(){
|
|
setup-vbootstrap || return 1
|
|
setup-vbootstrap || return 1
|
|
|
|
|
|
- # # output end-of-line in $VBUILDER_LOG
|
|
|
|
- # [ -f $VBUILDER_LOG ] && write-vbuilder-log ${HRULE}
|
|
|
|
- # Show-Info
|
|
|
|
-
|
|
|
|
# mount-chroot --umount /home
|
|
# mount-chroot --umount /home
|
|
- # mount-chroot --umount /tmp
|
|
+ mount-chroot --umount /tmp
|
|
- mount-chroot --umount vfs
|
|
+ mount-chroot --umount /dev/shm
|
|
|
|
+ mount-chroot --umount /dev/pts
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount unionfs_dir
|
|
mount-chroot --umount unionfs_dir
|
|
|
|
+ mount-chroot --umount /proc
|
|
apt-get-update --host
|
|
apt-get-update --host
|
|
|
|
|
|
if [ $with_unionfs -eq 1 ]; then
|
|
if [ $with_unionfs -eq 1 ]; then
|
|
@@ -530,8 +582,10 @@ Build(){
|
|
/usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
|
|
/usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+ mount-chroot /proc
|
|
mount-chroot archives_dir
|
|
mount-chroot archives_dir
|
|
- mount-chroot vfs
|
|
+ mount-chroot /dev/pts
|
|
|
|
+ mount-chroot /dev/shm
|
|
# mount-chroot /tmp
|
|
# mount-chroot /tmp
|
|
# mount-chroot /home
|
|
# mount-chroot /home
|
|
|
|
|
|
@@ -575,10 +629,13 @@ Build(){
|
|
$__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
|
|
$__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
|
|
|
|
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
|
|
|
|
+ $__chroot_sh 'cd /dev && /sbin/MAKEDEV ptmx'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV random'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV random'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV urandom'
|
|
$__chroot_sh 'cd /dev && /sbin/MAKEDEV urandom'
|
|
|
|
+ $__chroot_sh 'cd /dev && mkdir -p shm && chmod 777 shm'
|
|
|
|
+ $__chroot_sh 'cd /dev && mkdir -p pts && chmod 755 pts'
|
|
|
|
|
|
$__chroot_sh '/usr/sbin/pwconv'
|
|
$__chroot_sh '/usr/sbin/pwconv'
|
|
$__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"
|
|
$__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"
|
|
@@ -595,8 +652,10 @@ Build(){
|
|
|
|
|
|
# mount-chroot --umount /home
|
|
# mount-chroot --umount /home
|
|
# mount-chroot --umount /tmp
|
|
# mount-chroot --umount /tmp
|
|
- mount-chroot --umount vfs
|
|
+ mount-chroot --umount /dev/shm
|
|
|
|
+ mount-chroot --umount /dev/pts
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount archives_dir
|
|
|
|
+ mount-chroot --umount /proc
|
|
apt-get-update --host
|
|
apt-get-update --host
|
|
|
|
|
|
echo $"Making a build farm for ${VERSION} done."
|
|
echo $"Making a build farm for ${VERSION} done."
|
|
@@ -613,9 +672,11 @@ Show-Info(){
|
|
|
|
|
|
RPM_Remove(){
|
|
RPM_Remove(){
|
|
setup-vbootstrap-rpm || return 1
|
|
setup-vbootstrap-rpm || return 1
|
|
|
|
+ mount-chroot /proc
|
|
mount-chroot unionfs_dir
|
|
mount-chroot unionfs_dir
|
|
mount-chroot archives_dir
|
|
mount-chroot archives_dir
|
|
- mount-chroot vfs
|
|
+ mount-chroot /dev/pts
|
|
|
|
+ mount-chroot /dev/shm
|
|
apt-get-update --chroot
|
|
apt-get-update --chroot
|
|
|
|
|
|
[ -f $RPM_PKG ] && \
|
|
[ -f $RPM_PKG ] && \
|
|
@@ -624,9 +685,11 @@ RPM_Remove(){
|
|
|
|
|
|
write-vbuilder-log "remove-rpm $RPM_PKG"
|
|
write-vbuilder-log "remove-rpm $RPM_PKG"
|
|
|
|
|
|
- mount-chroot --umount vfs
|
|
+ mount-chroot --umount /dev/shm
|
|
|
|
+ mount-chroot --umount /dev/pts
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount unionfs_dir
|
|
mount-chroot --umount unionfs_dir
|
|
|
|
+ mount-chroot --umount /proc
|
|
apt-get-update --host
|
|
apt-get-update --host
|
|
|
|
|
|
return 0
|
|
return 0
|
|
@@ -634,18 +697,23 @@ RPM_Remove(){
|
|
|
|
|
|
RPM_Install(){
|
|
RPM_Install(){
|
|
setup-vbootstrap-rpm || return 1
|
|
setup-vbootstrap-rpm || return 1
|
|
|
|
+ mount-chroot /proc
|
|
mount-chroot unionfs_dir
|
|
mount-chroot unionfs_dir
|
|
mount-chroot archives_dir
|
|
mount-chroot archives_dir
|
|
- mount-chroot vfs
|
|
+ mount-chroot /dev/pts
|
|
|
|
+ mount-chroot /dev/shm
|
|
|
|
+
|
|
apt-get-update --chroot
|
|
apt-get-update --chroot
|
|
|
|
|
|
$__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
|
|
$__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
|
|
|
|
|
|
write-vbuilder-log "install-rpm $RPM_PKG"
|
|
write-vbuilder-log "install-rpm $RPM_PKG"
|
|
|
|
|
|
- mount-chroot --umount vfs
|
|
+ mount-chroot --umount /dev/shm
|
|
|
|
+ mount-chroot --umount /dev/pts
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount unionfs_dir
|
|
mount-chroot --umount unionfs_dir
|
|
|
|
+ mount-chroot --umount /proc
|
|
apt-get-update --host
|
|
apt-get-update --host
|
|
|
|
|
|
return 0
|
|
return 0
|
|
@@ -653,9 +721,11 @@ RPM_Install(){
|
|
|
|
|
|
RPM_Build(){
|
|
RPM_Build(){
|
|
setup-vbootstrap-rpm || return 1
|
|
setup-vbootstrap-rpm || return 1
|
|
|
|
+ mount-chroot /proc
|
|
mount-chroot unionfs_dir
|
|
mount-chroot unionfs_dir
|
|
mount-chroot archives_dir
|
|
mount-chroot archives_dir
|
|
- mount-chroot vfs
|
|
+ mount-chroot /dev/pts
|
|
|
|
+ mount-chroot /dev/shm
|
|
apt-get-update --chroot
|
|
apt-get-update --chroot
|
|
|
|
|
|
[ ! -f $RPM_PKG ] && \
|
|
[ ! -f $RPM_PKG ] && \
|
|
@@ -696,9 +766,11 @@ RPM_Build(){
|
|
|
|
|
|
write-vbuilder-log "build-rpm $RPM_PKG"
|
|
write-vbuilder-log "build-rpm $RPM_PKG"
|
|
|
|
|
|
- mount-chroot --umount vfs
|
|
+ mount-chroot --umount /dev/shm
|
|
|
|
+ mount-chroot --umount /dev/pts
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount archives_dir
|
|
mount-chroot --umount unionfs_dir
|
|
mount-chroot --umount unionfs_dir
|
|
|
|
+ mount-chroot --umount /proc
|
|
apt-get-update --host
|
|
apt-get-update --host
|
|
|
|
|
|
echo $"done."
|
|
echo $"done."
|
|
@@ -732,6 +804,47 @@ RPM_Sign(){
|
|
return 0
|
|
return 0
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+Login_Chroot(){
|
|
|
|
+ [ $with_login -eq 1 ] || return 1
|
|
|
|
+
|
|
|
|
+ setup-vbootstrap || return 1
|
|
|
|
+
|
|
|
|
+ __chroot="/usr/sbin/chroot ${BUILD_ROOT}"
|
|
|
|
+ ## setarch ix86 if ix86 chroot on x86_64 host
|
|
|
|
+ [ $with_ix86_on_x86_64 -eq 1 ] && \
|
|
|
|
+ __chroot="/usr/sbin/chroot ${BUILD_ROOT} setarch ${VARCH}"
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ mount-chroot /proc
|
|
|
|
+ mount-chroot unionfs_dir
|
|
|
|
+ mount-chroot archives_dir
|
|
|
|
+ mount-chroot /dev/pts
|
|
|
|
+ mount-chroot /dev/shm
|
|
|
|
+ mount-chroot /tmp
|
|
|
|
+ # mount-chroot /home
|
|
|
|
+ apt-get-update --chroot
|
|
|
|
+
|
|
|
|
+ ## copy host's configurations of /etc
|
|
|
|
+ #passwd shadow group gshadow
|
|
|
|
+ for i in resolv.conf hosts; do
|
|
|
|
+ cp -pf /etc/${i} ${BUILD_ROOT}/etc
|
|
|
|
+ done
|
|
|
|
+ cp -Ppf /etc/localtime ${BUILD_ROOT}/etc
|
|
|
|
+
|
|
|
|
+ $__chroot /bin/bash || return 1
|
|
|
|
+
|
|
|
|
+ # mount-chroot --umount /home
|
|
|
|
+ mount-chroot --umount /tmp
|
|
|
|
+ mount-chroot --umount /dev/shm
|
|
|
|
+ mount-chroot --umount /dev/pts
|
|
|
|
+ mount-chroot --umount archives_dir
|
|
|
|
+ mount-chroot --umount unionfs_dir
|
|
|
|
+ mount-chroot --umount /proc
|
|
|
|
+ apt-get-update --host
|
|
|
|
+
|
|
|
|
+ return 0
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
##############################################################################
|
|
##############################################################################
|
|
|
|
|
|
@@ -745,7 +858,7 @@ while [ $# -gt 0 ]; do
|
|
--version|--arch|--category|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
|
|
--version|--arch|--category|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
|
|
shift
|
|
shift
|
|
;;
|
|
;;
|
|
- --dist-upgrade|--unionfs|--with-compat32|--sign|--no-install)
|
|
+ --dist-upgrade|--unionfs|--with-compat32|--sign|--no-install|--login|--debug)
|
|
;;
|
|
;;
|
|
--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
|
|
--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
|
|
shift
|
|
shift
|
|
@@ -796,6 +909,9 @@ while [ $# -gt 0 ]; do
|
|
--no-install)
|
|
--no-install)
|
|
with_no_install=1
|
|
with_no_install=1
|
|
;;
|
|
;;
|
|
|
|
+ --login)
|
|
|
|
+ with_login=1
|
|
|
|
+ ;;
|
|
--bootstrap-dir)
|
|
--bootstrap-dir)
|
|
VBOOTSTRAP_DIR=$1
|
|
VBOOTSTRAP_DIR=$1
|
|
;;
|
|
;;
|
|
@@ -808,6 +924,9 @@ while [ $# -gt 0 ]; do
|
|
--built-rpms-dir)
|
|
--built-rpms-dir)
|
|
BUILT_RPMS_DIR=$1
|
|
BUILT_RPMS_DIR=$1
|
|
;;
|
|
;;
|
|
|
|
+ --debug)
|
|
|
|
+ with_debug=1
|
|
|
|
+ ;;
|
|
--build-rpm|build-rpm)
|
|
--build-rpm|build-rpm)
|
|
RPM_PKG=$1
|
|
RPM_PKG=$1
|
|
RPM_Build || exit 1
|
|
RPM_Build || exit 1
|
|
@@ -835,4 +954,6 @@ done
|
|
|
|
|
|
RPM_Sign
|
|
RPM_Sign
|
|
|
|
|
|
|
|
+Login_Chroot
|
|
|
|
+
|
|
exit
|
|
exit
|