vmklive: always create generic initramfs, xbps-0.16 support.

This commit is contained in:
Juan RP 2012-06-01 12:02:04 +02:00
parent edfa855fd8
commit b1794246ca
2 changed files with 32 additions and 20 deletions

View file

@ -273,10 +273,8 @@ if [ -n "$REPOSITORY_CACHE" ]; then
fi
XBPS_VERSION=$($XBPS_BIN_CMD -V|awk '{print $2}')
case $XBPS_VERSION in
# XBPS >= 0.12
[0-9].[1-9][2-9]*);;
# XBPS < 0.12
*) purge_flag="-p" ;;
# XBPS >= 0.16
[0-9].[1-9][6-9]*) XBPS_016=1;;
esac
info_msg "Redirecting stdout/stderr to $LOGFILE..."
@ -295,7 +293,7 @@ if [ -z "$ROOTDIR" ]; then
2>&1|cat >> $LOGFILE || error_out
${XBPS_BIN_CMD} ${XBPS_ARGS} autoupdate \
2>&1|cat >> $LOGFILE || error_out
${XBPS_BIN_CMD} ${XBPS_ARGS} ${purge_flag} autoremove \
${XBPS_BIN_CMD} ${XBPS_ARGS} autoremove \
2>&1|cat >> $LOGFILE || error_out
fi
@ -313,7 +311,7 @@ write_etc_motd
# Create the initramfs with XZ compression.
#
info_msg "[3/9] Creating initramfs image ($COMPRESSTYPE)..."
dracut --add "dmsquash-live vmklive" --${COMPRESSTYPE} \
dracut --no-hostonly --add "dmsquash-live vmklive" --${COMPRESSTYPE} \
"${ISOLINUX_DIR}/initrd.lz" ${KERNELVERSION} 2>/dev/null || error_out
#
@ -345,6 +343,9 @@ fi
# Generate a conf for local repositories.
cat > $ROOTFS/etc/xbps/local-repos.conf <<_EOF
repositories = {
# XBPS >= 0.16
/packages,
# XBPS < 0.16
/packages/noarch,
/packages/i686,
/packages/x86_64
@ -353,6 +354,11 @@ _EOF
# Generate a conf for remote repositories.
cat > $ROOTFS/etc/xbps/network-repos.conf <<_EOF
repositories = {
# XBPS >= 0.16
http://xbps.hosting-unlimited.org/binpkgs,
http://xbps.goodluckwith.us/binpkgs,
http://xbps.nopcode.org/repos/current,
# XBPS < 0.16
http://xbps.goodluckwith.us/binpkgs/i686,
http://xbps.goodluckwith.us/binpkgs/noarch,
http://xbps.goodluckwith.us/binpkgs/nonfree/i686,
@ -365,23 +371,29 @@ chmod 644 $ROOTFS/etc/xbps/*.conf || error_out $?
# Create local repos for base-system and grub packages required by
# the void-installer pkg.
ROOTFS_REPODIR=$ROOTFS/packages
mkdir -p $ROOTFS_REPODIR
pkgs=$($XBPS_BIN_CMD -r /tmp/blah -n install base-system grub)
set -- ${pkgs}
while [ $# -ne 0 ]; do
pkgn=$1; action=$2; ver=$3; repo=$4; binpkg=$5
shift 5
repodir=$(basename $repo)
[ ! -d $ROOTFS_REPODIR/$repodir ] && mkdir $ROOTFS_REPODIR/$repodir
bpkg=$repo/$binpkg
cp -f $bpkg $ROOTFS_REPODIR/$repodir
done
for f in $ROOTFS_REPODIR/*; do
${XBPS_REPO_CMD} genindex $f 2>&1 >>$LOGFILE
# remove rindex-files.plist, unneeded.
rm -f $f/rindex-files.plist
pkgn=$1; action=$2; ver=$3; repo=$4; binpkg=$5; arch=$6
if [ -z "$XBPS_016" ]; then
arch=$(basename $repo)
shift 5
else
shift 6
fi
mkdir -p $ROOTFS/packages/$arch
bpkg=$repo/$arch/$binpkg
cp -f $bpkg $ROOTFS/packages/$arch
done
if [ -n "$XBPS_016" ]; then
$XBPS_REPO_CMD genindex $ROOTFS/packages 2>&1 >>$LOGFILE
rm -f $ROOTFS/packages/index-files.plist
else
for f in $ROOTFS_REPODIR/*; do
${XBPS_REPO_CMD} genindex $f 2>&1 >>$LOGFILE
rm -f $f/rindex-files.plist
done
fi
# install lsblk and blkid from util-linux. to avoid installing
# the whole package.

View file

@ -1,6 +1,6 @@
# Template file for 'vmklive'
pkgname=vmklive
version=0.9.2
version=0.9.3
replaces="xbps-mklive>=0 vanilla-mklive>=0"
noextract=yes
noarch=yes