pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/mklivecd Update to 0.16 (leaf package):
details: https://anonhg.NetBSD.org/pkgsrc/rev/00c2d31f51da
branches: trunk
changeset: 540113:00c2d31f51da
user: xtraeme <xtraeme%pkgsrc.org@localhost>
date: Thu Mar 27 20:54:09 2008 +0000
description:
Update to 0.16 (leaf package):
* Introduce the MOUNT_{PACKAGES,PKGSRC,PKGSRCDIST}_DIR options in the
configuration file, to use null mounts for them. By default neither
of these directories will be mounted by default.
* Introduce the concept of 'targets done'. If the user tries to issue
a 'base' target before the 'kernel' target an error message will be
printed and an appropiate error code returned (just an example, it is
done for all required targets). This is useful to avoid silly things
like:
[mklivecd kernel target was skipped here]
$ mklivecd base
$ mklivecd chroot
$ mklivecd iso
Obviously the 'iso' target failed because it couldn't find some
required files.
diffstat:
sysutils/mklivecd/Makefile | 4 +-
sysutils/mklivecd/files/mklivecd.8 | 24 ++-
sysutils/mklivecd/files/mklivecd.sh | 260 ++++++++++++++++++++---------------
3 files changed, 174 insertions(+), 114 deletions(-)
diffs (truncated from 448 to 300 lines):
diff -r 24628e09e6c7 -r 00c2d31f51da sysutils/mklivecd/Makefile
--- a/sysutils/mklivecd/Makefile Thu Mar 27 14:25:36 2008 +0000
+++ b/sysutils/mklivecd/Makefile Thu Mar 27 20:54:09 2008 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.44 2008/03/04 10:36:58 xtraeme Exp $
+# $NetBSD: Makefile,v 1.45 2008/03/27 20:54:09 xtraeme Exp $
-DISTNAME= mklivecd-0.15.3
+DISTNAME= mklivecd-0.16
CATEGORIES= sysutils
MASTER_SITES= # empty
DISTFILES= # empty
diff -r 24628e09e6c7 -r 00c2d31f51da sysutils/mklivecd/files/mklivecd.8
--- a/sysutils/mklivecd/files/mklivecd.8 Thu Mar 27 14:25:36 2008 +0000
+++ b/sysutils/mklivecd/files/mklivecd.8 Thu Mar 27 20:54:09 2008 +0000
@@ -1,8 +1,8 @@
-.\" $NetBSD: mklivecd.8,v 1.18 2007/12/01 20:27:16 wiz Exp $
+.\" $NetBSD: mklivecd.8,v 1.19 2008/03/27 20:54:09 xtraeme Exp $
.\"
.\" mklivecd - Make your own NetBSD/x86 Live CD-ROM/DVD-ROM
.\"
-.\" Copyright (c) 2004-2007 Juan Romero Pardines.
+.\" Copyright (c) 2004-2008 Juan Romero Pardines.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
@@ -36,7 +36,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd July 3, 2007
+.Dd March 27, 2008
.Dt MKLIVECD 8
.Os
.Sh NAME
@@ -158,6 +158,12 @@
and you could install any package.
Defaults to
.Pa /usr/pkgsrc .
+.It MOUNT_PKGSRC_DIR
+Mount the pkgsrc directory specified in the
+.Pa $PKGSRCDIR
+option.
+Defaults to
+.Pa no .
.It PKGSRCDISTDIR
The
.Nx
@@ -168,6 +174,12 @@
.Xr mount_null 8 .
Defaults to
.Pa /usr/pkgsrc/distfiles .
+.It MOUNT_PKGSRCDIST_DIR
+Mount the pkgsrc distfiles directory specified in the
+.Pa $PKGSRCDISTDIR
+option.
+Defaults to
+.Pa no .
.It PACKAGESDIR
The
.Nx
@@ -178,6 +190,12 @@
.Xr mount_null 8 .
Defaults to
.Pa /usr/pkgsrc/packages .
+.It MOUNT_PACKAGES_DIR
+Mount the packages pkgsrc directory specified in the
+.Pa $PACKAGESDIR
+option.
+Defaults to
+.Pa no .
.It SHAREDIR
The main directory used to store the Makefiles, kernel, example configuration
files, etc.
diff -r 24628e09e6c7 -r 00c2d31f51da sysutils/mklivecd/files/mklivecd.sh
--- a/sysutils/mklivecd/files/mklivecd.sh Thu Mar 27 14:25:36 2008 +0000
+++ b/sysutils/mklivecd/files/mklivecd.sh Thu Mar 27 20:54:09 2008 +0000
@@ -1,8 +1,8 @@
#!/bin/sh
#
-# $NetBSD: mklivecd.sh,v 1.46 2007/07/03 15:45:06 xtraeme Exp $
+# $NetBSD: mklivecd.sh,v 1.47 2008/03/27 20:54:09 xtraeme Exp $
#
-# Copyright (c) 2004-2007 Juan Romero Pardines.
+# Copyright (c) 2004-2008 Juan Romero Pardines.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
@@ -40,13 +40,19 @@
# mklivecd - Make your own NetBSD/x86 Live CD-ROM/DVD-ROM #
# ======================================================================== #
+#
+# Private stuff.
+#
: ${progname:=$(basename $0)}
: ${config_dir:=$HOME/.mklivecd}
: ${pers_conffile:=personal_config}
: ${tmp_file:=$(/usr/bin/mktemp /tmp/${progname}.XXXXXX)}
-: ${pkgsrc_mntstat:=$config_dir/pkgsrc_mount.stat}
-: ${pkgsrcdist_mntstat:=$config_dir/pkgsrcdist_mount.stat}
-: ${packages_mntstat:=$config_dir/packages_mount.stat}
+: ${pkgsrc_mntstat:=$config_dir/.pkgsrc_mount.stat}
+: ${pkgsrcdist_mntstat:=$config_dir/.pkgsrcdist_mount.stat}
+: ${packages_mntstat:=$config_dir/.packages_mount.stat}
+: ${kernel_stage_done:=$config_dir/.kernel_stage_done}
+: ${base_stage_done:=$config_dir/.base_stage_done}
+: ${chroot_stage_done:=$config_dir/.chroot_stage_done}
#
# Neeeded to disable GRUB on amd64.
@@ -187,7 +193,8 @@
do_conf()
{
- BASE_VARS="SOURCEDIR PACKAGESDIR PKGSRCDIR PKGSRCDISTDIR SHAREDIR BASEDIR \
+ BASE_VARS="SOURCEDIR MOUNT_PACKAGES_DIR PACKAGESDIR MOUNT_PKGSRC_DIR \
+ PKGSRCDIR MOUNT_PKGSRCDIST_DIR PKGSRCDISTDIR SHAREDIR BASEDIR \
WORKDIR ISODIR FETCH_SETS REMOTE_SETS_URL BASE_SETS_DIR \
X11_SETS_DIR BASE_SETS X11_SETS CHROOT_SHELL"
@@ -206,8 +213,11 @@
# Base directories/sets
: ${SOURCEDIR:=/usr/src}
+ : ${MOUNT_PACKAGES_DIR:=no}
: ${PACKAGESDIR:=/usr/pkgsrc/packages}
+ : ${MOUNT_PKGSRC_DIR:=no}
: ${PKGSRCDIR:=/usr/pkgsrc}
+ : ${MOUNT_PKGSRCDIST_DIR:=no}
: ${PKGSRCDISTDIR:=/usr/pkgsrc/distfiles}
: ${SHAREDIR:=@PREFIX@/share/mklivecd}
: ${BASEDIR:=$HOME/livecd}
@@ -471,7 +481,8 @@
. $config_file
YESNOVARS="FETCH_SETS ENABLE_X11 USE_GNU_GRUB \
- VND_COMPRESSION BLANK_BEFORE_BURN PERSONAL_CONFIG"
+ VND_COMPRESSION BLANK_BEFORE_BURN PERSONAL_CONFIG \
+ MOUNT_PKGSRC_DIR MOUNT_PKGSRCDIST_DIR MOUNT_PACKAGES_DIR"
for v in $YESNOVARS
do
@@ -559,6 +570,8 @@
copy_bootfiles
do_build_kernels
fi
+
+ touch $kernel_stage_done
;;
fetch)
#
@@ -566,8 +579,7 @@
#
if is_enabled FETCH_SETS; then
if [ ! -d $BASE_SETS_DIR ]; then
- showmsg "Couldn't find $BASE_SETS_DIR, exiting"
- bye 1
+ mkdir -p $BASE_SETS_DIR
fi
cd $BASE_SETS_DIR
for f in ${BASE_SETS}
@@ -601,6 +613,11 @@
;;
base)
+ if [ ! -f $kernel_stage_done ]; then
+ showmsg "The kernel target wasn't called, please do so."
+ bye 1
+ fi
+
for F in ${BASE_SETS}
do
if [ ! -f $BASE_SETS_DIR/$F ]; then
@@ -672,7 +689,7 @@
cat > $ISODIR/etc/rc.d/root <<_EOF_
#!/bin/sh
#
-# \$NetBSD: mklivecd.sh,v 1.46 2007/07/03 15:45:06 xtraeme Exp $
+# \$NetBSD: mklivecd.sh,v 1.47 2008/03/27 20:54:09 xtraeme Exp $
#
# PROVIDE: root
@@ -701,8 +718,14 @@
showmsgstring
showmsg "Target base finished."
[ -n "$verbose_mode" ] && showmsg "Next step: ${progname} chroot"
+ touch $base_stage_done
;;
chroot)
+ if [ ! -f $base_stage_done ]; then
+ showmsg "The base target wasn't called, please do so."
+ bye 1
+ fi
+
if [ ! -f $ISODIR/etc/profile ]; then
( \
echo "export PS1=\"$KERNEL_NAME> \""; \
@@ -724,55 +747,61 @@
showmsg "Entering into the chroot!"
- if [ -d $PKGSRCDIR ]; then
- if [ -f $pkgsrc_mntstat ]; then
- count=$(cat $pkgsrc_mntstat)
- count=$(($count + 1))
- echo $count > $pkgsrc_mntstat
- echo "=> pkgsrc directory already mounted."
- else
- mount_null $PKGSRCDIR $ISODIR/usr/pkgsrc
- if [ "$?" -eq 0 ]; then
- echo "=> pkgsrc directory ready."
- echo "1" > $pkgsrc_mntstat
+ if is_enabled MOUNT_PKGSRC_DIR; then
+ if [ -d $PKGSRCDIR ]; then
+ if [ -f $pkgsrc_mntstat ]; then
+ count=$(cat $pkgsrc_mntstat)
+ count=$(($count + 1))
+ echo $count > $pkgsrc_mntstat
+ echo "=> pkgsrc directory already mounted."
+ else
+ mount_null $PKGSRCDIR $ISODIR/usr/pkgsrc
+ if [ "$?" -eq 0 ]; then
+ echo "=> pkgsrc directory ready."
+ echo "1" > $pkgsrc_mntstat
+ fi
+ fi
+ else
+ showmsg "==> couldn't find $PKGSRCDIR."
+ fi
+ fi
+
+ if is_enabled MOUNT_PKGSRCDIST_DIR; then
+ if [ -d $PKGSRCDISTDIR ]; then
+ if [ -f $pkgsrcdist_mntstat ]; then
+ count=$(cat $pkgsrcdist_mntstat)
+ count=$(($count +1))
+ echo $count > $pkgsrcdist_mntstat
+ echo "=> distfiles directory already mounted."
+ else
+ mount_null $PKGSRCDISTDIR $ISODIR/usr/pkgsrc/distfiles
+ if [ "$?" -eq 0 ]; then
+ echo "=> distfiles directory ready."
+ echo "1" > $pkgsrcdist_mntstat
+ fi
+ fi
+ else
+ echo "==> couldn't find $PKGSRCDISTDIR."
+ fi
+ fi
+
+ if is_enabled MOUNT_PACKAGES_DIR; then
+ if [ -d $PACKAGESDIR ]; then
+ if [ -f $packages_mntstat ]; then
+ count=$(cat $packages_mntstat)
+ count=$(($count + 1))
+ echo $count > $packages_mntstat
+ echo "=> packages directory already mounted."
+ else
+ mount_null $PACKAGESDIR $ISODIR/usr/pkgsrc/packages
+ if [ "$?" -eq 0 ]; then
+ echo "=> packages directory ready."
+ echo "1" > $packages_mntstat
fi
fi
- else
- showmsg "==> couldn't find $PKGSRCDIR."
- fi
-
- if [ -d $PKGSRCDISTDIR ]; then
- if [ -f $pkgsrcdist_mntstat ]; then
- count=$(cat $pkgsrcdist_mntstat)
- count=$(($count +1))
- echo $count > $pkgsrcdist_mntstat
- echo "=> distfiles directory already mounted."
- else
- mount_null $PKGSRCDISTDIR $ISODIR/usr/pkgsrc/distfiles
- if [ "$?" -eq 0 ]; then
- echo "=> distfiles directory ready."
- echo "1" > $pkgsrcdist_mntstat
+ else
+ echo "==> couldn't find $PACKAGESDIR."
fi
- fi
- else
- echo "==> couldn't find $PKGSRCDISTDIR."
- fi
-
- if [ -d $PACKAGESDIR ]; then
- if [ -f $packages_mntstat ]; then
- count=$(cat $packages_mntstat)
- count=$(($count + 1))
- echo $count > $packages_mntstat
- echo "=> packages directory already mounted."
- else
- mount_null $PACKAGESDIR $ISODIR/usr/pkgsrc/packages
- if [ "$?" -eq 0 ]; then
- echo "=> packages directory ready."
- echo "1" > $packages_mntstat
- fi
Home |
Main Index |
Thread Index |
Old Index