mklive.sh.in: fix generation of local repo; use target xbps utils; indent
This commit is contained in:
30
mklive.sh.in
30
mklive.sh.in
@@ -23,13 +23,10 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#-
|
#-
|
||||||
|
|
||||||
# vim: set ts=4 sw=4 et:
|
|
||||||
|
|
||||||
trap "echo; error_out $?" INT QUIT
|
trap "echo; error_out $?" INT QUIT
|
||||||
|
|
||||||
CHROOT_CMD="linux-user-chroot --unshare-ipc --unshare-pid --unshare-net \
|
CHROOT_CMD="linux-user-chroot --unshare-ipc --unshare-pid --unshare-net \
|
||||||
--mount-bind /dev /dev --mount-bind /sys /sys --mount-proc /proc"
|
--mount-bind /dev /dev --mount-bind /sys /sys --mount-proc /proc"
|
||||||
|
|
||||||
info_msg() {
|
info_msg() {
|
||||||
printf "\033[1m$@\n\033[m"
|
printf "\033[1m$@\n\033[m"
|
||||||
@@ -47,7 +44,7 @@ error_out() {
|
|||||||
write_etc_motd() {
|
write_etc_motd() {
|
||||||
cat >> "$ROOTFS/etc/motd" <<_EOF
|
cat >> "$ROOTFS/etc/motd" <<_EOF
|
||||||
###############################################################################
|
###############################################################################
|
||||||
Autogenerated by void-mklive "@@MKLIVE_VERSION@@"
|
Autogenerated by void-mklive "0.10 3d7b51707195b6e765b4d1d59d70266ebe87ce1e"
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Welcome to the Void Linux Live system, you have been autologged in.
|
Welcome to the Void Linux Live system, you have been autologged in.
|
||||||
@@ -56,7 +53,7 @@ executing commands through sudo(8).
|
|||||||
|
|
||||||
To play with package management use the xbps-* utilities. Please visit:
|
To play with package management use the xbps-* utilities. Please visit:
|
||||||
|
|
||||||
http://code.google.com/p/xbps/
|
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. If you think it is useful, please make a donation
|
Package System. If you think it is useful, please make a donation
|
||||||
@@ -64,7 +61,7 @@ to improve further development from the above URL, thanks.
|
|||||||
|
|
||||||
To start the installation please type:
|
To start the installation please type:
|
||||||
|
|
||||||
$ sudo void-installer
|
$ sudo void-installer
|
||||||
|
|
||||||
and follow the on-screen instructions. Thanks for trying Void Linux.
|
and follow the on-screen instructions. Thanks for trying Void Linux.
|
||||||
|
|
||||||
@@ -113,7 +110,7 @@ Usage: $(basename $0) [options]
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
-C file Path to configuration file (defaults to ~/.mklive.conf)
|
-C file Path to configuration file (defaults to ~/.mklive.conf)
|
||||||
-c (gzip|bzip2|xz) Compression type for the squashfs/initramfs image.
|
-c (gzip|bzip2|xz) ompression type for the squashfs/initramfs image.
|
||||||
-l "pkgname ..." Generate a local repository in the image with these packages.
|
-l "pkgname ..." Generate a local repository in the image with these packages.
|
||||||
Packages must be delimited by blanks.
|
Packages must be delimited by blanks.
|
||||||
-r rootdir Use this directory to generate the image (if unset,
|
-r rootdir Use this directory to generate the image (if unset,
|
||||||
@@ -190,10 +187,11 @@ generate_local_repository() {
|
|||||||
while [ $# -ne 0 ]; do
|
while [ $# -ne 0 ]; do
|
||||||
pkgn=$1; action=$2; ver=$3; repo=$4; binpkg=$5; arch=$6
|
pkgn=$1; action=$2; ver=$3; repo=$4; binpkg=$5; arch=$6
|
||||||
shift 6
|
shift 6
|
||||||
bpkg=$repo/$arch/$binpkg
|
bpkg=$repo/$binpkg
|
||||||
cp -f $bpkg $ROOTFS/packages
|
cp -f $bpkg $ROOTFS/packages
|
||||||
done
|
done
|
||||||
$XBPS_RINDEX_CMD -a $ROOTFS/packages/*.xbps 2>&1 >>$LOGFILE
|
LD_PRELOAD="$ROOTFS/usr/lib/libxbps.so" \
|
||||||
|
$ROOTFS/usr/sbin/$XBPS_RINDEX_CMD -a $ROOTFS/packages/*.xbps 2>&1 >>$LOGFILE
|
||||||
rm -f $ROOTFS/packages/index-files.plist
|
rm -f $ROOTFS/packages/index-files.plist
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,11 +291,11 @@ while getopts "C:c:l:o:r:s:h" opt; do
|
|||||||
case $opt in
|
case $opt in
|
||||||
C) CONFIG_FILE="$OPTARG";;
|
C) CONFIG_FILE="$OPTARG";;
|
||||||
c) COMPRESSTYPE="$OPTARG";;
|
c) COMPRESSTYPE="$OPTARG";;
|
||||||
l) LOCALREPO_PKGLIST="$OPTARG";;
|
l) LOCALREPO_PKGLIST="$OPTARG";;
|
||||||
o) OUTPUT_FILE="$OPTARG";;
|
o) OUTPUT_FILE="$OPTARG";;
|
||||||
r) ROOTDIR="$OPTARG";;
|
r) ROOTDIR="$OPTARG";;
|
||||||
s) SPLASH_IMAGE="$OPTARG";;
|
s) SPLASH_IMAGE="$OPTARG";;
|
||||||
h) usage;;
|
h) usage;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $(($OPTIND - 1))
|
shift $(($OPTIND - 1))
|
||||||
@@ -395,9 +393,9 @@ if [ -n "$REPOSITORY_CACHE" ]; then
|
|||||||
fi
|
fi
|
||||||
XBPS_VERSION=$($XBPS_QUERY_CMD -V|awk '{print $2}')
|
XBPS_VERSION=$($XBPS_QUERY_CMD -V|awk '{print $2}')
|
||||||
case $XBPS_VERSION in
|
case $XBPS_VERSION in
|
||||||
# XBPS >= 0.18
|
# XBPS >= 0.18
|
||||||
[0-9].[1-9][8-9]*) ;;
|
[0-9].[1-9][8-9]*) ;;
|
||||||
*) echo "Your xbps utilities are too old ($XBPS_VERSION), 0.18 is required." && exit 1;;
|
*) echo "Your xbps utilities are too old ($XBPS_VERSION), 0.18 is required." && exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
KERNELVERSION=$($XBPS_QUERY_CMD -R --property version kernel)
|
KERNELVERSION=$($XBPS_QUERY_CMD -R --property version kernel)
|
||||||
@@ -472,3 +470,5 @@ hsize=$(du -sh "$OUTPUT_FILE"|awk '{print $1}')
|
|||||||
info_msg "Created $(readlink -f $OUTPUT_FILE) ($hsize) successfully."
|
info_msg "Created $(readlink -f $OUTPUT_FILE) ($hsize) successfully."
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
# vim: set ts=4 sw=4 et:
|
||||||
|
Reference in New Issue
Block a user