|
@@ -3,11 +3,16 @@
|
|
|
|
|
|
Usage_C(){
|
|
Usage_C(){
|
|
cat<<EOF
|
|
cat<<EOF
|
|
-Usage: $(basename $0) {--version [version]} {--arch [arch]} {--target [target]|--with-compat32} {--build|--clean|--build-rpm [src.rpm]|--install-rpm [arch.rpm|package]|--remove-rpm [package]}
|
|
+Usage: $(basename $0) {--version [version]} {--arch [arch]} {--dist-upgrade} {--target [target]} {--with-compat32} {--build|--clean|--build-rpm [src.rpm]|--install-rpm [arch.rpm|package]|--remove-rpm [package]}
|
|
|
|
+
|
|
|
|
+Options:
|
|
--version: set [version] (default: ${DEFAULT_VERSION})
|
|
--version: set [version] (default: ${DEFAULT_VERSION})
|
|
--arch: set [arch] (default: $(uname -i))
|
|
--arch: set [arch] (default: $(uname -i))
|
|
|
|
+ --dist-upgrade: build VineSeed bootstrap via ${STABLE_VERSION}
|
|
--target: build rpms with [target]
|
|
--target: build rpms with [target]
|
|
--with-compat32: build rpms with compat32 on boostrap
|
|
--with-compat32: build rpms with compat32 on boostrap
|
|
|
|
+
|
|
|
|
+Actions:
|
|
--clean: clean boostrap of [version]
|
|
--clean: clean boostrap of [version]
|
|
--build: build boostrap of [version]
|
|
--build: build boostrap of [version]
|
|
--build-rpm: build [src.rpm] on boostrap
|
|
--build-rpm: build [src.rpm] on boostrap
|
|
@@ -67,6 +72,16 @@ Msg_NoSupportVERSION_ja(){
|
|
Msg_NoSupportVERSION_C
|
|
Msg_NoSupportVERSION_C
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+Msg_NoSupportDistUpgradeVERSION_C(){
|
|
|
|
+ cat<<EOF
|
|
|
|
+E: version ${VERSION} does not support --dist-upgrade option
|
|
|
|
+EOF
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Msg_NoSupportDistUpgradeVERSION_ja(){
|
|
|
|
+ Msg_NoSupportDistUpgradeVERSION_C
|
|
|
|
+}
|
|
|
|
+
|
|
Msg_NoSupportTARGET_C(){
|
|
Msg_NoSupportTARGET_C(){
|
|
cat<<EOF
|
|
cat<<EOF
|
|
E: rpm build target ${TARGET} is NO support
|
|
E: rpm build target ${TARGET} is NO support
|
|
@@ -93,11 +108,18 @@ setup-vbuilder(){
|
|
[ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
|
|
[ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
|
|
VERSION=$DEFAULT_VERSION
|
|
VERSION=$DEFAULT_VERSION
|
|
|
|
|
|
|
|
+ ## current stable relase version
|
|
|
|
+ STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
|
|
|
|
+
|
|
## set locale
|
|
## set locale
|
|
case $LANG in
|
|
case $LANG in
|
|
ja*) LOCALE=ja ;;
|
|
ja*) LOCALE=ja ;;
|
|
*) LOCALE=C ;;
|
|
*) LOCALE=C ;;
|
|
esac
|
|
esac
|
|
|
|
+
|
|
|
|
+ ## set boolian
|
|
|
|
+ with_setup_vbootstrap=0
|
|
|
|
+ with_dist_upgrade=0
|
|
}
|
|
}
|
|
|
|
|
|
check-next-parameter(){
|
|
check-next-parameter(){
|
|
@@ -109,10 +131,9 @@ check-next-parameter(){
|
|
done
|
|
done
|
|
}
|
|
}
|
|
|
|
|
|
-FLAG_setup_vbootstrap=0
|
|
|
|
setup-vbootstrap(){
|
|
setup-vbootstrap(){
|
|
- if [ ${FLAG_setup_vbootstrap} -eq 0 ]; then
|
|
+ if [ ${with_setup_vbootstrap} -eq 0 ]; then
|
|
- FLAG_setup_vbootstrap=1
|
|
+ with_setup_vbootstrap=1
|
|
|
|
|
|
## check a chroot archtecture
|
|
## check a chroot archtecture
|
|
if [ ! -z ${VARCH} ]; then
|
|
if [ ! -z ${VARCH} ]; then
|
|
@@ -152,6 +173,14 @@ setup-vbootstrap(){
|
|
exit 1
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+ ## check ${VERSION} equals VineSeed*, when with_dist_upgrade=1
|
|
|
|
+ if [ $with_dist_upgrade -eq 1 ]; then
|
|
|
|
+ if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" != "VineSeed" ]; then
|
|
|
|
+ Msg_NoSupportDistUpgradeVERSION_$LOCALE
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+
|
|
## check build target option ${TARGET}
|
|
## check build target option ${TARGET}
|
|
if [ ! -z "${TARGET}" ]; then
|
|
if [ ! -z "${TARGET}" ]; then
|
|
RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
|
|
RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
|
|
@@ -209,7 +238,18 @@ Clean(){
|
|
Build(){
|
|
Build(){
|
|
setup-vbootstrap
|
|
setup-vbootstrap
|
|
|
|
|
|
- /usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
|
|
+ if [ $with_dist_upgrade -eq 1 ]; then
|
|
|
|
+ ## make bootstrap of ${STABLE_VERSION}
|
|
|
|
+ /usr/sbin/vbootstrap \
|
|
|
|
+ $(echo ${VERSION} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
|
|
|
|
+ ${BUILD_ROOT}
|
|
|
|
+
|
|
|
|
+ ## aim apt-line to VineSeed
|
|
|
|
+ sed -i "s/apt ${STABLE_VERSION}/apt VineSeed/g" \
|
|
|
|
+ ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
|
|
|
|
+ else
|
|
|
|
+ /usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
|
|
|
|
+ fi
|
|
|
|
|
|
# ## mount virtual file systems
|
|
# ## mount virtual file systems
|
|
# for dir in /dev /dev/pts /dev/shm /proc /sys; do
|
|
# for dir in /dev /dev/pts /dev/shm /proc /sys; do
|
|
@@ -239,8 +279,16 @@ Build(){
|
|
/bin/sh -c 'apt-get -y install apt-sourceslist-plus && apt-get update'
|
|
/bin/sh -c 'apt-get -y install apt-sourceslist-plus && apt-get update'
|
|
/usr/sbin/chroot ${BUILD_ROOT} \
|
|
/usr/sbin/chroot ${BUILD_ROOT} \
|
|
/bin/sh -c 'apt-get -y install apt-sourceslist-nonfree && apt-get update'
|
|
/bin/sh -c 'apt-get -y install apt-sourceslist-nonfree && apt-get update'
|
|
|
|
+
|
|
|
|
+ if [ $with_dist_upgrade -eq 1 ]; then
|
|
|
|
+ /usr/sbin/chroot ${BUILD_ROOT} \
|
|
|
|
+ /bin/sh -c 'apt-get update && apt-get -y dist-upgrade'
|
|
|
|
+ fi
|
|
|
|
+ /usr/sbin/chroot ${BUILD_ROOT} \
|
|
|
|
+ /bin/sh -c 'apt-get -y install build-essential'
|
|
/usr/sbin/chroot ${BUILD_ROOT} \
|
|
/usr/sbin/chroot ${BUILD_ROOT} \
|
|
- /bin/sh -c 'apt-get -y install build-essential self-build-setup'
|
|
+ /bin/sh -c 'apt-get -y install self-build-setup'
|
|
|
|
+
|
|
/usr/sbin/chroot ${BUILD_ROOT} \
|
|
/usr/sbin/chroot ${BUILD_ROOT} \
|
|
/bin/sh -c 'apt-get -y install etcskel shadow-utils'
|
|
/bin/sh -c 'apt-get -y install etcskel shadow-utils'
|
|
|
|
|
|
@@ -341,14 +389,14 @@ setup-vbuilder
|
|
|
|
|
|
[ $# -eq 0 ] && Usage_$LOCALE
|
|
[ $# -eq 0 ] && Usage_$LOCALE
|
|
while [ $# -gt 0 ]; do
|
|
while [ $# -gt 0 ]; do
|
|
- tmpARG="$1"
|
|
+ tmpARG=$1
|
|
- case "$1" in
|
|
+ case $tmpARG in
|
|
--version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
|
|
--version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
|
|
shift
|
|
shift
|
|
echo $1 | check-next-parameter
|
|
echo $1 | check-next-parameter
|
|
[ $? -eq 1 ] && exit 1
|
|
[ $? -eq 1 ] && exit 1
|
|
;;
|
|
;;
|
|
- --with-compat32|--build|--clean)
|
|
+ --dist-upgrade|--with-compat32|--build|--clean)
|
|
;;
|
|
;;
|
|
*)
|
|
*)
|
|
Usage_$LOCALE
|
|
Usage_$LOCALE
|
|
@@ -356,13 +404,16 @@ while [ $# -gt 0 ]; do
|
|
;;
|
|
;;
|
|
esac
|
|
esac
|
|
|
|
|
|
- case "$tmpARG" in
|
|
+ case $tmpARG in
|
|
--version)
|
|
--version)
|
|
VERSION=$1
|
|
VERSION=$1
|
|
;;
|
|
;;
|
|
--arch)
|
|
--arch)
|
|
VARCH=$1
|
|
VARCH=$1
|
|
;;
|
|
;;
|
|
|
|
+ --dist-upgrade)
|
|
|
|
+ with_dist_upgrade=1
|
|
|
|
+ ;;
|
|
--target)
|
|
--target)
|
|
TARGET=$1
|
|
TARGET=$1
|
|
RPM_OPTS="${RPM_OPTS} --target $TARGET"
|
|
RPM_OPTS="${RPM_OPTS} --target $TARGET"
|
|
@@ -393,4 +444,3 @@ while [ $# -gt 0 ]; do
|
|
done
|
|
done
|
|
|
|
|
|
exit
|
|
exit
|
|
-
|
|
|