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.9, changes:
details: https://anonhg.NetBSD.org/pkgsrc/rev/3c6b48f9a7d3
branches: trunk
changeset: 487192:3c6b48f9a7d3
user: xtraeme <xtraeme%pkgsrc.org@localhost>
date: Tue Jan 11 02:08:53 2005 +0000
description:
Update to 0.9, changes:
* Don't overwrite $ISODIR/etc/profile every time chroot target is invoked,
provide defaults only the first time we run it.
* Ask interactively to the user if he/she wants to remove the current iso
image found on $BASEDIR/$IMAGE_NAME and create a new one if that was
selected.
diffstat:
sysutils/mklivecd/Makefile | 4 +-
sysutils/mklivecd/files/mklivecd.sh | 92 +++++++++++++++++++++++-------------
2 files changed, 60 insertions(+), 36 deletions(-)
diffs (143 lines):
diff -r acbdf56c8f9f -r 3c6b48f9a7d3 sysutils/mklivecd/Makefile
--- a/sysutils/mklivecd/Makefile Tue Jan 11 00:09:21 2005 +0000
+++ b/sysutils/mklivecd/Makefile Tue Jan 11 02:08:53 2005 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.13 2004/11/04 16:29:55 xtraeme Exp $
+# $NetBSD: Makefile,v 1.14 2005/01/11 02:08:53 xtraeme Exp $
-DISTNAME= mklivecd-0.8
+DISTNAME= mklivecd-0.9
CATEGORIES= sysutils
MASTER_SITES= # empty
DISTFILES= # empty
diff -r acbdf56c8f9f -r 3c6b48f9a7d3 sysutils/mklivecd/files/mklivecd.sh
--- a/sysutils/mklivecd/files/mklivecd.sh Tue Jan 11 00:09:21 2005 +0000
+++ b/sysutils/mklivecd/files/mklivecd.sh Tue Jan 11 02:08:53 2005 +0000
@@ -1,12 +1,12 @@
#!/bin/sh
#
-# $NetBSD: mklivecd.sh,v 1.16 2004/11/04 16:29:56 xtraeme Exp $
+# $NetBSD: mklivecd.sh,v 1.17 2005/01/11 02:08:53 xtraeme Exp $
#
-# Copyright (c) 2004 The NetBSD Foundation, Inc.
+# Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
-# by Juan RP <xtraeme%NetBSD.org@localhost>.
+# by Juan RP.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -374,7 +374,7 @@
cat > $ISODIR/etc/rc.d/root <<_EOF_
#!/bin/sh
#
-# \$NetBSD: mklivecd.sh,v 1.16 2004/11/04 16:29:56 xtraeme Exp $
+# \$NetBSD: mklivecd.sh,v 1.17 2005/01/11 02:08:53 xtraeme Exp $
#
# PROVIDE: root
@@ -407,10 +407,16 @@
fi
;;
chroot)
- ( \
- echo "export PS1=\"$KERNEL_NAME> \""; \
- echo "set -o emacs"; \
- ) > $ISODIR/etc/profile
+ if [ ! -f $ISODIR/etc/profile ]; then
+ ( \
+ echo "export PS1=\"$KERNEL_NAME> \""; \
+ echo "set -o emacs"; \
+ ) > $ISODIR/etc/profile
+ else
+ if [ "$verbose_mode" = "on" ]; then
+ showmsg "Not overwriting /etc/profile."
+ fi
+ fi
if [ ! -d $ISODIR/usr/pkgsrc/distfiles ]; then
mkdir -p $ISODIR/usr/pkgsrc/distfiles
@@ -598,37 +604,55 @@
showmsg "Done."
;;
iso)
- [ -d $ISODIR/$BOOTDIR ] && chown -R root:wheel $ISODIR/$BOOTDIR
+ _do_real_iso_image()
+ {
+ if [ "$verbose_mode" = "on" ]; then
+ echo "=> Removing $IMAGE_NAME.iso..."
+ fi
- if [ ! -f $ISODIR/stand/mfs_etc.tgz ]; then
- showmsg "Target iso failed!"
- showmsg "Can't find mfs_etc.tgz file."
- bye 1
- fi
+ [ -f "$BASEDIR/$IMAGE_NAME.iso" ] && rm $BASEDIR/$IMAGE_NAME.iso
+ [ -d $ISODIR/$BOOTDIR ] && chown -R root:wheel $ISODIR/$BOOTDIR
- showmsg "Removing not needed directories."
- for RM in ${REMOVE_DIRS}
- do
- if [ -d $ISODIR/$RM ]; then
- if [ "$verbose_mode" = "on" ]; then
- echo "=> Removing $RM..."
+ if [ ! -f $ISODIR/stand/mfs_etc.tgz ]; then
+ showmsg "Target iso failed!"
+ showmsg "Can't find mfs_etc.tgz file."
+ bye 1
fi
- rm -rf $ISODIR/$RM
- else
- echo "=> Nonexistent directory: $RM."
- fi
- done
+ showmsg "Removing not needed directories."
+ for RM in ${REMOVE_DIRS}
+ do
+ if [ -d $ISODIR/$RM ]; then
+ if [ "$verbose_mode" = "on" ]; then
+ echo "=> Removing $RM..."
+ fi
+ rm -rf $ISODIR/$RM
+ else
+ echo "=> Nonexistent directory: $RM."
+ fi
+ done
+
+ sleep 2 # Because I want to see the messages :-)
- sleep 2 # Because I want to see the messages :-)
-
- if [ ! -f $BASEDIR/$IMAGE_NAME.iso ]; then
- echo
- showmsg "Creating ISO CD9660 image"
- $MKISOFS $MKISOFS_FIXED_ARGS $MKISOFS_ARGS \
- -b $BOOTDIR/$BOOTIMAGE -o $BASEDIR/$IMAGE_NAME.iso \
- $ISODIR
+ showmsg "Creating ISO CD9660 image"
+ $MKISOFS $MKISOFS_FIXED_ARGS $MKISOFS_ARGS \
+ -b $BOOTDIR/$BOOTIMAGE \
+ -o $BASEDIR/$IMAGE_NAME.iso $ISODIR
+ }
+ if [ -f $BASEDIR/$IMAGE_NAME.iso ]; then
+ showmsg "Found a previous ISO image, do you want to override it?"
+ echo
+ echo "[Press the Enter key to keep your ISO image, otherwise"
+ echo " press any other key to proceed removing this file and"
+ echo " creating a new one called: $IMAGE_NAME.iso]"
+ read output_u
+ if [ -n "$output_u" ]; then
+ _do_real_iso_image
+ elif [ -z "$output_u" ]; then
+ showmsg "Not overwritting ISO image, skipped."
+ fi
+ else
+ _do_real_iso_image
fi
-
;;
burn)
if [ ! -f $BASEDIR/$IMAGE_NAME.iso ]; then
Home |
Main Index |
Thread Index |
Old Index