xbps-mklive: update to 0.3.2, multiple improvements.

--HG--
rename : srcpkgs/xbps-mklive/files/xbps-mklive.sh => srcpkgs/xbps-mklive/files/xbps-mklive.sh.in
This commit is contained in:
Juan RP 2010-05-14 05:09:23 +02:00
parent b4fb5178a8
commit 0d4d02dd91
2 changed files with 36 additions and 31 deletions

View file

@ -16,8 +16,8 @@ CONFIG_FILE="$HOME/.xbps-mklive.conf"
# The following vars are overwritten by the config file. # The following vars are overwritten by the config file.
# #
PACKAGE_REPO="/storage/xbps/packages" PACKAGE_REPO="/storage/xbps/packages"
OUTPUT_FILE="$HOME/xbps-live-$(uname -m).iso" OUTPUT_FILE="$HOME/xbps-live-$(uname -m)-$(date +%Y%m%d).iso"
ISO_VOLUME="XBPS GNU/Linux Live" ISO_VOLUME="XBPS GNU/Linux Live $(uname -m)"
SYSLINUX_DATADIR="/usr/share/syslinux" SYSLINUX_DATADIR="/usr/share/syslinux"
SPLASH_IMAGE=$HOME/splash.rle SPLASH_IMAGE=$HOME/splash.rle
@ -53,7 +53,7 @@ mount_pseudofs()
umount_pseudofs() umount_pseudofs()
{ {
for fs in sys proc dev; do for fs in sys proc dev; do
umount -f $TEMP_ROOTFS/$fs 2>&1 >/dev/null umount -f $TEMP_ROOTFS/$fs >/dev/null 2>&1
done done
} }
@ -70,6 +70,10 @@ error_out()
write_etc_motd() write_etc_motd()
{ {
cat >> "$TEMP_ROOTFS/etc/motd" <<_EOF cat >> "$TEMP_ROOTFS/etc/motd" <<_EOF
###############################################################################
Autogenerated by xbps-mklive @@MKLIVE_VERSION@@.
-------------------------------------------------------------------------------
Welcome to the XBPS GNU/Linux Live system, you have been autologged in. Welcome to the XBPS GNU/Linux Live system, you have been autologged in.
This user has full sudo(8) permissions without any password, be careful This user has full sudo(8) permissions without any password, be careful
executing commands through sudo(8). executing commands through sudo(8).
@ -77,13 +81,19 @@ executing commands through sudo(8).
To play with package management use the xbps-bin(8) and xbps-repo(8) To play with package management use the xbps-bin(8) and xbps-repo(8)
utilities. Please visit: utilities. Please visit:
http://xbps.nopcode.org/ http://code.google.com/p/xbps/
For more information and/or documentation about using the X Binary For more information and/or documentation about using the X Binary
Package System. Enjoy it. Package System. Enjoy it.
Juan RP <xtraeme@gmail.com> Please also visit my personal blog and click to any of the Google ADs,
to help continuining developping XBPS. Thank you.
http://xtraeme.blogspot.com/
-- Juan RP <xtraeme@gmail.com>
###############################################################################
_EOF _EOF
} }
@ -110,15 +120,15 @@ MENU COLOR border * #00000000 #00000000 none
MENU COLOR sel * #ffffffff #FF5255FF * MENU COLOR sel * #ffffffff #FF5255FF *
LABEL linux LABEL linux
MENU LABEL Boot XBPS GNU/Linux ${kver} MENU LABEL Boot XBPS GNU/Linux ${kver} ($(uname -m))
KERNEL /casper/vmlinuz KERNEL /casper/vmlinuz
INITRD /casper/initrd.gz INITRD /casper/initrd.lz
APPEND boot=casper keymap=es locale=es_ES APPEND boot=casper keymap=es locale=es_ES
LABEL linuxtoram LABEL linuxtoram
MENU LABEL Boot XBPS GNU/Linux ${kver} (toram) MENU LABEL Boot XBPS GNU/Linux ${kver} (toram) ($(uname -m))
KERNEL /casper/vmlinuz KERNEL /casper/vmlinuz
INITRD /casper/initrd.gz INITRD /casper/initrd.lz
APPEND boot=casper toram keymap=es locale=es_ES APPEND boot=casper toram keymap=es locale=es_ES
LABEL c LABEL c
@ -132,8 +142,6 @@ _EOF
[ -z "$ISO_VOLUME" ] && error_out [ -z "$ISO_VOLUME" ] && error_out
[ -z "$PACKAGE_REPO" ] && error_out [ -z "$PACKAGE_REPO" ] && error_out
[ ! -d "$TEMP_ROOTFS/var/db/xbps" ] && mkdir -p "$TEMP_ROOTFS/var/db/xbps"
for _repo_ in ${PACKAGE_REPO}; do for _repo_ in ${PACKAGE_REPO}; do
info_msg "Adding ${_repo_} package repository..." info_msg "Adding ${_repo_} package repository..."
xbps-repo.static -r $TEMP_ROOTFS add ${_repo_} xbps-repo.static -r $TEMP_ROOTFS add ${_repo_}
@ -172,23 +180,15 @@ fi
mount_pseudofs mount_pseudofs
xbps_relver=$(xbps-bin.static -V) xbps_relver=$(xbps-bin.static -V)
xbps-uhelper.static cmpver ${xbps_relver} 20091222 xbps-uhelper.static cmpver ${xbps_relver} 20100511
if [ $? -eq 255 ]; then if [ $? -eq 255 ]; then
yesflag="-f" info_msg "Your XBPS utilities are outdated... please update to >= 0.5.1"
for _pkg_ in ${PACKAGE_LIST}; do error_out 1
info_msg "Installing ${_pkg_} package..."
xbps-bin.static -r $TEMP_ROOTFS ${yesflag} install ${_pkg_}
[ $? -ne 0 ] && error_out $?
done
else
yesflag="-y"
xbps-bin.static -r $TEMP_ROOTFS ${yesflag} install ${PACKAGE_LIST}
[ $? -ne 0 ] && error_out $?
fi fi
xbps-bin.static -r $TEMP_ROOTFS ${yesflag} autoupdate || error_out $? xbps-bin.static -r $TEMP_ROOTFS -y install ${PACKAGE_LIST} || error_out $?
xbps-bin.static -r $TEMP_ROOTFS ${yesflag} autoremove || error_out $? xbps-bin.static -r $TEMP_ROOTFS -y autoupdate || error_out $?
xbps-bin.static -r $TEMP_ROOTFS ${yesflag} purge all || error_out $? xbps-bin.static -r $TEMP_ROOTFS -yp autoremove || error_out $?
xbps-bin.static -r $TEMP_ROOTFS list > $BUILD_TMPDIR/packages.txt xbps-bin.static -r $TEMP_ROOTFS list > ${OUTPUT_FILE%.iso}-package-list.txt
info_msg "Creating /etc/motd..." info_msg "Creating /etc/motd..."
write_etc_motd write_etc_motd
@ -197,10 +197,10 @@ info_msg "Rebuilding and copying initramfs..."
# Set lzma compression for the initramfs, to save space. # Set lzma compression for the initramfs, to save space.
sed -i -e "s|COMPRESSION_TYPE=gzip|COMPRESSION_TYPE=lzma|" \ sed -i -e "s|COMPRESSION_TYPE=gzip|COMPRESSION_TYPE=lzma|" \
$TEMP_ROOTFS/etc/initramfs-tools/initramfs.conf $TEMP_ROOTFS/etc/initramfs-tools/initramfs.conf
xbps-bin -r $TEMP_ROOTFS -f reconfigure kernel xbps-bin.static -r $TEMP_ROOTFS -f reconfigure kernel
[ $? -ne 0 ] && error_out $? [ $? -ne 0 ] && error_out $?
cp -f "$TEMP_ROOTFS/boot/initrd.img-${kernel_ver}" \ cp -f "$TEMP_ROOTFS/boot/initrd.img-${kernel_ver}" \
"$BUILD_TMPDIR/casper/initrd.gz" || error_out $? "$BUILD_TMPDIR/casper/initrd.lz" || error_out $?
mkdir -p $TEMP_ROOTFS/cow mkdir -p $TEMP_ROOTFS/cow
info_msg "Copying kernel binary..." info_msg "Copying kernel binary..."

View file

@ -1,6 +1,6 @@
# Template file for 'xbps-mklive' # Template file for 'xbps-mklive'
pkgname=xbps-mklive pkgname=xbps-mklive
version=0.3.1 version=0.3.2
build_style=custom-install build_style=custom-install
short_desc="XBPS Live image maker" short_desc="XBPS Live image maker"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
@ -15,8 +15,13 @@ Add_dependency full cdrtools
Add_dependency full squashfs-tools Add_dependency full squashfs-tools
Add_dependency full syslinux Add_dependency full syslinux
do_build()
{
sed "s|@@MKLIVE_VERSION@@|${version}|g" \
${FILESDIR}/${pkgname}.sh.in > ${wrksrc}/${pkgname}.sh
}
do_install() do_install()
{ {
install -D -m755 ${FILESDIR}/xbps-mklive.sh \ install -D -m755 ${wrksrc}/${pkgname}.sh ${DESTDIR}/usr/sbin/xbps-mklive
${DESTDIR}/usr/sbin/xbps-mklive
} }