|
@@ -71,11 +71,19 @@ write_conf_file() {
|
|
# Default configuration file for vmklive-@VERSION@.
|
|
# Default configuration file for vmklive-@VERSION@.
|
|
#
|
|
#
|
|
# List of packages to be installed into the live image.
|
|
# List of packages to be installed into the live image.
|
|
-# By default the 'base-system-live' pkg is always installed because
|
|
|
|
-# it is required to generate a working image.
|
|
|
|
-#PACKAGE_LIST="foo blah"
|
|
|
|
-
|
|
|
|
-# Syslinux splash image.
|
|
|
|
|
|
+#
|
|
|
|
+# The 'base-system' package is always added to the generated image.
|
|
|
|
+#
|
|
|
|
+# To build an official live image add the following packages:
|
|
|
|
+# - dialog
|
|
|
|
+# - dracut-network
|
|
|
|
+# - dosfstools
|
|
|
|
+# - f2fs-tools
|
|
|
|
+# - grub-x86_64-efi
|
|
|
|
+# - parted
|
|
|
|
+PACKAGE_LIST="dialog dracut-network dosfstools f2fs-tools grub-x86_64-efi parted"
|
|
|
|
+
|
|
|
|
+# Default Void Linux splash image for grub/syslinux.
|
|
SPLASH_IMAGE=/usr/share/void-artwork/splash.png
|
|
SPLASH_IMAGE=/usr/share/void-artwork/splash.png
|
|
|
|
|
|
# Default keymap to use.
|
|
# Default keymap to use.
|
|
@@ -105,11 +113,8 @@ 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.
|
|
|
|
- -l "pkgname ..." Generate a local repository in the image with these packages.
|
|
|
|
- Packages must be delimited by blanks.
|
|
|
|
- -r rootdir Use this directory to generate the image (if unset,
|
|
|
|
- current working directory will be used).
|
|
|
|
|
|
+ -c (gzip|bzip2|xz) Compression type for the initramfs/squashfs image.
|
|
|
|
+ -r rootdir Use this directory to generate the image (if unset, defaults to cwd).
|
|
-o outfile Output file name for the ISO image.
|
|
-o outfile Output file name for the ISO image.
|
|
-s splash Splash image file for isolinux.
|
|
-s splash Splash image file for isolinux.
|
|
-V Show version.
|
|
-V Show version.
|
|
@@ -130,7 +135,10 @@ install_packages() {
|
|
${XBPS_INSTALL_CMD} ${XBPS_ARGS} ${PACKAGE_LIST} >>$LOGFILE 2>&1
|
|
${XBPS_INSTALL_CMD} ${XBPS_ARGS} ${PACKAGE_LIST} >>$LOGFILE 2>&1
|
|
${XBPS_INSTALL_CMD} ${XBPS_ARGS} -u >>$LOGFILE 2>&1
|
|
${XBPS_INSTALL_CMD} ${XBPS_ARGS} -u >>$LOGFILE 2>&1
|
|
${XBPS_REMOVE_CMD} ${XBPS_ARGS} -o >>$LOGFILE 2>&1
|
|
${XBPS_REMOVE_CMD} ${XBPS_ARGS} -o >>$LOGFILE 2>&1
|
|
- ${XBPS_QUERY_CMD} -r "$ROOTFS" -l > "${OUTPUT_FILE%.iso}"-package-list.txt
|
|
|
|
|
|
+ ${XBPS_QUERY_CMD} -r "$ROOTFS" -l | sort > "${OUTPUT_FILE%.iso}"-package-list.txt
|
|
|
|
+
|
|
|
|
+ # Enable choosen UTF-8 locale and generate it into the target rootfs.
|
|
|
|
+ sed -e "s/\#\(${LOCALE}.*\)/\1/g" -i $ROOTFS/etc/default/libc-locales
|
|
|
|
|
|
systemd-nspawn -D $ROOTFS xbps-reconfigure -fa >>$LOGFILE 2>&1
|
|
systemd-nspawn -D $ROOTFS xbps-reconfigure -fa >>$LOGFILE 2>&1
|
|
|
|
|
|
@@ -152,32 +160,10 @@ generate_initramfs() {
|
|
--force-add "vmklive" "/boot/initrd.lz" $KERNELVERSION >>$LOGFILE 2>&1
|
|
--force-add "vmklive" "/boot/initrd.lz" $KERNELVERSION >>$LOGFILE 2>&1
|
|
|
|
|
|
mv $ROOTFS/kernel_temp/boot/initrd.lz $BOOT_DIR
|
|
mv $ROOTFS/kernel_temp/boot/initrd.lz $BOOT_DIR
|
|
-}
|
|
|
|
-
|
|
|
|
-copy_kernel_and_modules() {
|
|
|
|
- cp -a $ROOTFS/kernel_temp/boot/vmlinuz-$KERNELVERSION $BOOT_DIR/vmlinuz
|
|
|
|
- # Copy kernel modules to the rootfs.
|
|
|
|
- mkdir -p $ROOTFS/usr/lib/modules
|
|
|
|
- cp -a $ROOTFS/kernel_temp/usr/lib/modules/$KERNELVERSION \
|
|
|
|
- $ROOTFS/usr/lib/modules
|
|
|
|
- # remove temporary rootfs.
|
|
|
|
|
|
+ cp $ROOTFS/kernel_temp/boot/vmlinuz-$KERNELVERSION $BOOT_DIR/vmlinuz
|
|
rm -rf $ROOTFS/kernel_temp
|
|
rm -rf $ROOTFS/kernel_temp
|
|
}
|
|
}
|
|
|
|
|
|
-generate_local_repository() {
|
|
|
|
- mkdir -p $ROOTFS/packages
|
|
|
|
- pkgs=$($XBPS_INSTALL_CMD -r /tmp/blah -n ${LOCALREPO_PKGLIST})
|
|
|
|
- set -- ${pkgs}
|
|
|
|
- while [ $# -ne 0 ]; do
|
|
|
|
- pkg=$1; action=$2; arch=$3; repo=$4;
|
|
|
|
- shift 4
|
|
|
|
- bpkg=${repo}/${pkg}.${arch}.xbps
|
|
|
|
- cp -f $bpkg $ROOTFS/packages
|
|
|
|
- done
|
|
|
|
- LD_LIBRARY_PATH="$ROOTFS/usr/lib" \
|
|
|
|
- $ROOTFS/usr/sbin/$XBPS_RINDEX_CMD -a $ROOTFS/packages/*.xbps 2>&1 >>$LOGFILE
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
generate_isolinux_boot() {
|
|
generate_isolinux_boot() {
|
|
cp -f $SYSLINUX_DATADIR/isolinux.bin "$ISOLINUX_DIR"
|
|
cp -f $SYSLINUX_DATADIR/isolinux.bin "$ISOLINUX_DIR"
|
|
cp -f $SYSLINUX_DATADIR/ldlinux.c32 "$ISOLINUX_DIR"
|
|
cp -f $SYSLINUX_DATADIR/ldlinux.c32 "$ISOLINUX_DIR"
|
|
@@ -266,11 +252,10 @@ generate_iso_image() {
|
|
#
|
|
#
|
|
# main()
|
|
# main()
|
|
#
|
|
#
|
|
-while getopts "C:c:l:o:r:s:hV" opt; do
|
|
|
|
|
|
+while getopts "C:c:o:r:s:hV" 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";;
|
|
|
|
o) OUTPUT_FILE="$OPTARG";;
|
|
o) OUTPUT_FILE="$OPTARG";;
|
|
r) ROOTDIR="$OPTARG";;
|
|
r) ROOTDIR="$OPTARG";;
|
|
s) SPLASH_IMAGE="$OPTARG";;
|
|
s) SPLASH_IMAGE="$OPTARG";;
|
|
@@ -332,9 +317,9 @@ fi
|
|
. $CONFIG_FILE
|
|
. $CONFIG_FILE
|
|
|
|
|
|
if [ -z "$PACKAGE_LIST" ]; then
|
|
if [ -z "$PACKAGE_LIST" ]; then
|
|
- PACKAGE_LIST="base-system-live"
|
|
|
|
|
|
+ PACKAGE_LIST="base-system"
|
|
else
|
|
else
|
|
- PACKAGE_LIST="$PACKAGE_LIST"
|
|
|
|
|
|
+ PACKAGE_LIST="base-system $PACKAGE_LIST"
|
|
fi
|
|
fi
|
|
if [ ! -f $SYSLINUX_DATADIR/isolinux.bin ]; then
|
|
if [ ! -f $SYSLINUX_DATADIR/isolinux.bin ]; then
|
|
echo "Missing required isolinux files in $SYSLINUX_DATADIR, exiting..."
|
|
echo "Missing required isolinux files in $SYSLINUX_DATADIR, exiting..."
|
|
@@ -393,7 +378,7 @@ info_msg "Redirecting stdout/stderr to $LOGFILE ..."
|
|
#
|
|
#
|
|
# Install live system and specified packages.
|
|
# Install live system and specified packages.
|
|
#
|
|
#
|
|
-info_msg "[1/9] Installing packages into the rootfs..."
|
|
|
|
|
|
+info_msg "[1/7] Installing packages into the rootfs..."
|
|
install_packages
|
|
install_packages
|
|
|
|
|
|
#
|
|
#
|
|
@@ -405,50 +390,34 @@ write_etc_motd
|
|
#
|
|
#
|
|
# Generate the initramfs.
|
|
# Generate the initramfs.
|
|
#
|
|
#
|
|
-info_msg "[2/9] Generating initramfs image ($COMPRESSTYPE)..."
|
|
|
|
|
|
+info_msg "[2/7] Generating initramfs image ($COMPRESSTYPE)..."
|
|
generate_initramfs
|
|
generate_initramfs
|
|
|
|
|
|
-#
|
|
|
|
-# Copy linux kernel and modules to rootfs.
|
|
|
|
-#
|
|
|
|
-info_msg "[3/9] Copying kernel image/modules from temporary rootfs..."
|
|
|
|
-copy_kernel_and_modules
|
|
|
|
-
|
|
|
|
-#
|
|
|
|
-# Generate the package local repository for void-installer.
|
|
|
|
-#
|
|
|
|
-if [ -z "$LOCALREPO_PKGLIST" ]; then
|
|
|
|
- _skip="(disabled)"
|
|
|
|
-fi
|
|
|
|
-info_msg "[4/9] Generating package local repository ${_skip}..."
|
|
|
|
-if [ -n "$LOCALREPO_PKGLIST" ]; then
|
|
|
|
- generate_local_repository
|
|
|
|
-fi
|
|
|
|
#
|
|
#
|
|
# Generate the isolinux boot.
|
|
# Generate the isolinux boot.
|
|
#
|
|
#
|
|
-info_msg "[5/9] Generating isolinux support for PC-BIOS systems..."
|
|
|
|
|
|
+info_msg "[3/7] Generating isolinux support for PC-BIOS systems..."
|
|
generate_isolinux_boot
|
|
generate_isolinux_boot
|
|
|
|
|
|
#
|
|
#
|
|
# Generate the GRUB EFI boot.
|
|
# Generate the GRUB EFI boot.
|
|
#
|
|
#
|
|
-info_msg "[6/9] Generating GRUB support for EFI systems..."
|
|
|
|
|
|
+info_msg "[4/7] Generating GRUB support for EFI systems..."
|
|
generate_grub_efi_boot
|
|
generate_grub_efi_boot
|
|
|
|
|
|
#
|
|
#
|
|
# Generate the squashfs image from rootfs.
|
|
# Generate the squashfs image from rootfs.
|
|
#
|
|
#
|
|
-info_msg "[7/9] Generating squashfs image ($COMPRESSTYPE) from rootfs..."
|
|
|
|
|
|
+info_msg "[5/7] Generating squashfs image ($COMPRESSTYPE) from rootfs..."
|
|
generate_squashfs
|
|
generate_squashfs
|
|
|
|
|
|
#
|
|
#
|
|
# Generate the ISO image.
|
|
# Generate the ISO image.
|
|
#
|
|
#
|
|
-info_msg "[8/9] Generating ISO image..."
|
|
|
|
|
|
+info_msg "[6/7] Generating ISO image..."
|
|
generate_iso_image
|
|
generate_iso_image
|
|
|
|
|
|
-info_msg "[9/9] Removing build directory..."
|
|
|
|
|
|
+info_msg "[7/7] Removing build directory..."
|
|
rm -rf "$BUILDDIR"
|
|
rm -rf "$BUILDDIR"
|
|
|
|
|
|
hsize=$(du -sh "$OUTPUT_FILE"|awk '{print $1}')
|
|
hsize=$(du -sh "$OUTPUT_FILE"|awk '{print $1}')
|