xbps-mklive: update to 0.3.0.

- Code is in public domain, thanks to yours truly.
- Always mount /sys, /dev and /proc before installing packages, GConf
  requires this to register schemas ?!?.

--HG--
extra : convert_revision : c305936c62bf09c05dd8b815c2f09209bcecd283
This commit is contained in:
Juan RP 2010-04-15 19:20:09 +02:00
parent 3e12e23235
commit 670f3cbf2d
2 changed files with 27 additions and 6 deletions

View file

@ -1,5 +1,7 @@
#!/bin/sh
#
# Public Domain, 2009-2010 - Juan RP <xtraeme@gmail.com>
#
trap "echo; error_out $?" INT QUIT
[ "$(id -u)" -ne 0 ] && echo "root perms are required." && exit 1
@ -38,11 +40,26 @@ info_msg()
printf "\033[1m$@\n\033[m"
}
mount_pseudofs()
{
for fs in sys proc dev; do
if [ ! -d $TEMP_ROOTFS/$fs ]; then
mkdir -p $TEMP_ROOTFS/$fs
fi
mount --bind /$fs $TEMP_ROOTFS/$fs || error_out
done
}
umount_pseudofs()
{
for fs in sys proc dev; do
umount -f $TEMP_ROOTFS/$fs 2>&1 >/dev/null
done
}
error_out()
{
[ -d $TEMP_ROOTFS/sys ] && umount -f $TEMP_ROOTFS/sys 2>&1 >/dev/null
[ -d $TEMP_ROOTFS/proc ] && umount -f $TEMP_ROOTFS/proc 2>&1 >/dev/null
[ -d $TEMP_ROOTFS/dev ] && umount -f $TEMP_ROOTFS/dev 2>&1 >/dev/null
umount_pseudofs
[ "$1" -ne 0 ] && echo "ERROR: stage mentioned above returned $1!"
info_msg "Cleaning up $BUILD_TMPDIR..."
@ -152,6 +169,8 @@ if [ ! -f "$ISOLINUX_DIR/vesamenu.c32" ]; then
cp -f $SYSLINUX_DATADIR/vesamenu.c32 "$ISOLINUX_DIR"
fi
mount_pseudofs
xbps_relver=$(xbps-bin.static -V)
xbps-uhelper.static cmpver ${xbps_relver} 20091222
if [ $? -eq 255 ]; then
@ -192,6 +211,8 @@ info_msg "Cleaning up rootfs..."
rm -f $TEMP_ROOTFS/boot/initrd*
rm -f $TEMP_ROOTFS/boot/vmlinuz*
umount_pseudofs
info_msg "Building squashed root filesystem..."
mksquashfs "$TEMP_ROOTFS" "$BUILD_TMPDIR/casper/filesystem.squashfs" \
-root-becomes / && \

View file

@ -1,6 +1,6 @@
# Template file for 'xbps-mklive'
pkgname=xbps-mklive
version=0.2.0
version=0.3.0
build_style=custom-install
short_desc="XBPS Live image maker"
maintainer="Juan RP <xtraeme@gmail.com>"