about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-09-21 09:31:43 +0200
committerJuan RP <xtraeme@gmail.com>2014-09-21 09:31:43 +0200
commit914e19372472552ace573ce196d18b8142be385b (patch)
tree42306f51b63791990e4f2a6fd964830ca69798c0
parent14381901e4c9fc1000fd6b4f6095cf4aa8ae1a1b (diff)
downloadhrmpf-914e19372472552ace573ce196d18b8142be385b.tar.gz
hrmpf-914e19372472552ace573ce196d18b8142be385b.tar.xz
hrmpf-914e19372472552ace573ce196d18b8142be385b.zip
mklive: add -a opt to set XBPS_ARCH (for musl); misc changes for dracut/adduser.
-rw-r--r--dracut/adduser.sh7
-rw-r--r--mklive.sh.in13
2 files changed, 15 insertions, 5 deletions
diff --git a/dracut/adduser.sh b/dracut/adduser.sh
index 8269730..8fbbc9a 100644
--- a/dracut/adduser.sh
+++ b/dracut/adduser.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -x
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
@@ -20,11 +20,12 @@ if ! grep -q ${USERSHELL} ${NEWROOT}/etc/shells ; then
 fi
 
 # Create new user and remove password. We'll use autologin by default.
-chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G wheel -s $USERSHELL
+chroot ${NEWROOT} useradd -m -c $USERNAME -G wheel -s $USERSHELL $USERNAME
 chroot ${NEWROOT} passwd -d $USERNAME >/dev/null 2>&1
 
-# Setup default root password (voidlinux).
+# Setup default root/user password (voidlinux).
 chroot ${NEWROOT} sh -c 'echo "root:voidlinux" | chpasswd -c SHA512'
+chroot ${NEWROOT} sh -c "echo "$USERNAME:voidlinux" | chpasswd -c SHA512"
 
 # Enable sudo permission by default.
 if [ -f ${NEWROOT}/etc/sudoers ]; then
diff --git a/mklive.sh.in b/mklive.sh.in
index 2a83647..431597a 100644
--- a/mklive.sh.in
+++ b/mklive.sh.in
@@ -49,6 +49,7 @@ usage() {
 Usage: $(basename $0) [options]
 
 Options:
+ -a <xbps-arch>     Set XBPS_ARCH (do not use it unless you know what it is)
  -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).
@@ -84,6 +85,9 @@ install_prereqs() {
 }
 
 install_packages() {
+    if [ -n "$BASE_ARCH" ]; then
+        export XBPS_ARCH="$BASE_ARCH"
+    fi
     # Check that all pkgs are reachable.
     ${XBPS_INSTALL_CMD} -r $ROOTFS $XBPS_REPOSITORY $XBPS_CACHEDIR -yn ${PACKAGE_LIST} >>$LOGFILE 2>&1
     if [ $? -ne 0 ]; then
@@ -107,6 +111,10 @@ install_packages() {
     fi
     # Cleanup and remove useless stuff.
     rm -rf $ROOTFS/var/cache/* $ROOTFS/run/* $ROOTFS/var/run/*
+
+    cp /home/juan/projects/runit-void/core-services/00-pseudofs.sh $ROOTFS/etc/runit/core-services/
+
+    unset XBPS_ARCH
 }
 
 copy_dracut_files() {
@@ -126,7 +134,7 @@ generate_initramfs() {
         _args="--omit systemd"
     fi
     xbps-uchroot $VOIDHOSTDIR /usr/bin/dracut --${INITRAMFS_COMPRESSION} \
-        --force-add "vmklive" ${_args} "/boot/initrd" $KERNELVERSION >>$LOGFILE 2>&1
+        --force-add "vmklive busybox" ${_args} "/boot/initrd" $KERNELVERSION >>$LOGFILE 2>&1
 
     mv $VOIDHOSTDIR/boot/initrd $BOOT_DIR
     cp $VOIDHOSTDIR/boot/vmlinuz-$KERNELVERSION $BOOT_DIR/vmlinuz
@@ -222,8 +230,9 @@ generate_iso_image() {
 #
 # main()
 #
-while getopts "b:r:c:C:T:k:l:i:s:o:p:h" opt; do
+while getopts "a:b:r:c:C:T:k:l:i:s:o:p:h" opt; do
     case $opt in
+        a) BASE_ARCH="$OPTARG";;
         b) BASE_SYSTEM_PKG="$OPTARG";;
         r) XBPS_REPOSITORY+="--repository=$OPTARG ";;
         c) XBPS_CACHEDIR="--cachedir=$OPTARG";;