about summary refs log tree commit diff
path: root/mklive.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'mklive.sh.in')
-rw-r--r--mklive.sh.in27
1 files changed, 24 insertions, 3 deletions
diff --git a/mklive.sh.in b/mklive.sh.in
index ed710f9..80f3aad 100644
--- a/mklive.sh.in
+++ b/mklive.sh.in
@@ -66,6 +66,7 @@ Usage: $PROGNAME [options]
 
 Options:
  -a <xbps-arch>     Set XBPS_ARCH (do not use it unless you know what it is)
+ -A "pkg pkgN"      Set xbps-alternatives for packages.
  -b <system-pkg>    Set an alternative base-system package (defaults to base-system).
  -r <repo-url>      Use this XBPS repository (may be specified multiple times).
  -c <cachedir>      Use this XBPS cache directory (/var/cache/xbps if unset).
@@ -76,11 +77,13 @@ Options:
  -S <freesize>      Allocate this free size (MB) for the rootfs.
  -o <file>          Output file name for the ISO image (auto if unset).
  -p "pkg pkgN ..."  Install additional packages into the ISO image.
+ -U "pkg pkgN ..."  Install additional unconfigured packages into the ISO image.
  -I <includedir>    Include directory structure under given path into rootfs
 
  -C "cmdline args"  Add additional kernel command line arguments.
  -T "title"         Modify the bootloader title.
  -K                 Do not remove builddir.
+ -B <file>          Add file to /boot
 
 The $PROGNAME script generates a live image of the Void Linux distribution.
 This ISO image can be written to a CD/DVD-ROM or any USB stick.
@@ -131,6 +134,17 @@ install_packages() {
     fi
     chroot $ROOTFS env -i xbps-reconfigure -a
 
+    xbps-query -r $ROOTFS -l >installed.pkgs
+    for a in $ALTERNATIVES; do
+        xbps-alternatives -r $ROOTFS -s $a
+    done
+    xbps-alternatives -r $ROOTFS -l >installed.alternatives
+
+    if [ "$UNCONF_PACKAGE_LIST" ]; then
+        XBPS_ARCH=$BASE_ARCH ${XBPS_INSTALL_CMD} -r $ROOTFS \
+            $XBPS_REPOSITORY $XBPS_CACHEDIR -y -U ${UNCONF_PACKAGE_LIST}
+    fi
+
     if [ -x installer.sh ]; then
         install -Dm755 installer.sh $ROOTFS/usr/sbin/void-installer
     else
@@ -159,6 +173,9 @@ generate_initramfs() {
 
     mv $ROOTFS/boot/initrd $BOOT_DIR
     cp $ROOTFS/boot/vmlinuz-$KERNELVERSION $BOOT_DIR/vmlinuz
+    if [ "$BOOT_FILES" ]; then
+        cp $BOOT_FILES $BOOT_DIR
+    fi
 }
 
 cleanup_rootfs() {
@@ -180,6 +197,7 @@ generate_isolinux_boot() {
     cp -f $SYSLINUX_DATADIR/vesamenu.c32 "$ISOLINUX_DIR"
     cp -f $SYSLINUX_DATADIR/libutil.c32 "$ISOLINUX_DIR"
     cp -f $SYSLINUX_DATADIR/chain.c32 "$ISOLINUX_DIR"
+    cp -f $SYSLINUX_DATADIR/memdisk "$ISOLINUX_DIR"
     cp -f isolinux/isolinux.cfg.in "$ISOLINUX_DIR"/isolinux.cfg
     cp -f ${SPLASH_IMAGE} "$ISOLINUX_DIR"
 
@@ -292,10 +310,12 @@ generate_iso_image() {
 #
 # main()
 #
-while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do
+while getopts "a:A:B:b:r:c:C:T:Kk:l:i:I:s:S:o:p:U:h" opt; do
     case $opt in
         a) BASE_ARCH="$OPTARG";;
+        A) ALTERNATIVES="$OPTARG";;
         b) BASE_SYSTEM_PKG="$OPTARG";;
+        B) BOOT_FILES="$BOOT_FILES $OPTARG";;
         r) XBPS_REPOSITORY="--repository=$OPTARG $XBPS_REPOSITORY";;
         c) XBPS_CACHEDIR="--cachedir=$OPTARG";;
         K) readonly KEEP_BUILDDIR=1;;
@@ -307,6 +327,7 @@ while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do
         S) ROOTFS_FREESIZE="$OPTARG";;
         o) OUTPUT_FILE="$OPTARG";;
         p) PACKAGE_LIST="$OPTARG";;
+        U) UNCONF_PACKAGE_LIST="$OPTARG";;
         C) BOOT_CMDLINE="$OPTARG";;
         T) BOOT_TITLE="$OPTARG";;
         h) usage;;
@@ -379,14 +400,14 @@ _linux_series=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r $ROOTFS ${XBPS_REPOSITOR
 _kver=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r $ROOTFS ${XBPS_REPOSITORY:=-R} -p pkgver ${_linux_series})
 KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver})
 
-: ${OUTPUT_FILE="void-live-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d).iso"}
+: ${OUTPUT_FILE="hrmpf-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d).iso"}
 
 print_step "Installing software to generate the image: ${REQUIRED_PKGS} ..."
 install_prereqs
 
 mkdir -p "$ROOTFS"/etc
 [ -s data/motd ] && cp data/motd $ROOTFS/etc
-[ -s data/issue ] && cp data/issue $ROOTFS/etc
+[ -s data/issue.in ] && sed "s/@@VERSION@@/hrmpf-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d)/" data/issue.in >$ROOTFS/etc/issue
 
 print_step "Installing void pkgs into the rootfs: ${PACKAGE_LIST} ..."
 install_packages