|
@@ -32,10 +32,6 @@ info_msg() {
|
|
mount_pseudofs() {
|
|
mount_pseudofs() {
|
|
local fs
|
|
local fs
|
|
|
|
|
|
- if [ -n "$ROOTDIR" ]; then
|
|
|
|
- mount --bind "$ROOTDIR" "$ROOTFS" || error_out $?
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
for fs in sys proc dev; do
|
|
for fs in sys proc dev; do
|
|
if [ ! -d "$ROOTFS/$fs" ]; then
|
|
if [ ! -d "$ROOTFS/$fs" ]; then
|
|
mkdir -p "$ROOTFS/$fs"
|
|
mkdir -p "$ROOTFS/$fs"
|
|
@@ -50,9 +46,6 @@ umount_pseudofs() {
|
|
for fs in sys proc dev; do
|
|
for fs in sys proc dev; do
|
|
umount -f "$ROOTFS/$fs" >/dev/null 2>&1
|
|
umount -f "$ROOTFS/$fs" >/dev/null 2>&1
|
|
done
|
|
done
|
|
- if [ -n "$1" -a -n "$ROOTDIR" ]; then
|
|
|
|
- umount -f "$ROOTFS" >/dev/null 2>&1
|
|
|
|
- fi
|
|
|
|
}
|
|
}
|
|
|
|
|
|
error_out() {
|
|
error_out() {
|
|
@@ -177,7 +170,6 @@ Options:
|
|
-c (gzip|bzip2|xz) Compression type for the squashfs/initramfs image.
|
|
-c (gzip|bzip2|xz) Compression type for the squashfs/initramfs image.
|
|
-k version Kernel version to use.
|
|
-k version Kernel version to use.
|
|
-o outfile Output file name for the ISO image.
|
|
-o outfile Output file name for the ISO image.
|
|
- -r rootdir Rootfs directory.
|
|
|
|
-s splash Splash image file for isolinux.
|
|
-s splash Splash image file for isolinux.
|
|
-v volname ISO Volume name.
|
|
-v volname ISO Volume name.
|
|
_EOF
|
|
_EOF
|
|
@@ -187,13 +179,12 @@ _EOF
|
|
#
|
|
#
|
|
# main()
|
|
# main()
|
|
#
|
|
#
|
|
-while getopts "C:c:k:o:r:s:v:h" opt; do
|
|
|
|
|
|
+while getopts "C:c:k:o:s:v:h" opt; do
|
|
case $opt in
|
|
case $opt in
|
|
C) CONFIG_FILE="$OPTARG";;
|
|
C) CONFIG_FILE="$OPTARG";;
|
|
c) COMPRESSTYPE="$OPTARG";;
|
|
c) COMPRESSTYPE="$OPTARG";;
|
|
k) KERNELVERSION="$OPTARG";;
|
|
k) KERNELVERSION="$OPTARG";;
|
|
o) OUTPUT_FILE="$OPTARG";;
|
|
o) OUTPUT_FILE="$OPTARG";;
|
|
- r) ROOTDIR="$OPTARG";;
|
|
|
|
s) SPLASH_IMAGE="$OPTARG";;
|
|
s) SPLASH_IMAGE="$OPTARG";;
|
|
v) ISO_VOLUME="$OPTARG";;
|
|
v) ISO_VOLUME="$OPTARG";;
|
|
h) usage;;
|
|
h) usage;;
|
|
@@ -292,25 +283,23 @@ case $XBPS_VERSION in
|
|
[0-9].[1-9][6-9]*) XBPS_016=1;;
|
|
[0-9].[1-9][6-9]*) XBPS_016=1;;
|
|
esac
|
|
esac
|
|
|
|
|
|
-info_msg "Redirecting stdout/stderr to $LOGFILE..."
|
|
|
|
|
|
+info_msg "Redirecting stdout/stderr to $LOGFILE ..."
|
|
info_msg "[1/9] Installing packages into the rootfs..."
|
|
info_msg "[1/9] Installing packages into the rootfs..."
|
|
for f in ${PACKAGE_LIST}; do
|
|
for f in ${PACKAGE_LIST}; do
|
|
info_msg " $f"
|
|
info_msg " $f"
|
|
done
|
|
done
|
|
-if [ -z "$ROOTDIR" ]; then
|
|
|
|
- # Check that all pkgs are reachable.
|
|
|
|
- ${XBPS_BIN_CMD} ${XBPS_ARGS} -n install ${PACKAGE_LIST} >>$LOGFILE 2>&1
|
|
|
|
- if [ $? -ne 0 ]; then
|
|
|
|
- info_msg "Missing required binary packages, exiting..."
|
|
|
|
- error_out
|
|
|
|
- fi
|
|
|
|
- ${XBPS_BIN_CMD} ${XBPS_ARGS} install ${PACKAGE_LIST} \
|
|
|
|
- 2>&1|cat >> $LOGFILE || error_out
|
|
|
|
- ${XBPS_BIN_CMD} ${XBPS_ARGS} autoupdate \
|
|
|
|
- 2>&1|cat >> $LOGFILE || error_out
|
|
|
|
- ${XBPS_BIN_CMD} ${XBPS_ARGS} autoremove \
|
|
|
|
- 2>&1|cat >> $LOGFILE || error_out
|
|
|
|
|
|
+# Check that all pkgs are reachable.
|
|
|
|
+${XBPS_BIN_CMD} ${XBPS_ARGS} -n install ${PACKAGE_LIST} >>$LOGFILE 2>&1
|
|
|
|
+if [ $? -ne 0 ]; then
|
|
|
|
+ info_msg "Missing required binary packages, exiting..."
|
|
|
|
+ error_out
|
|
fi
|
|
fi
|
|
|
|
+${XBPS_BIN_CMD} ${XBPS_ARGS} install ${PACKAGE_LIST} \
|
|
|
|
+ 2>&1|cat >> $LOGFILE || error_out
|
|
|
|
+${XBPS_BIN_CMD} ${XBPS_ARGS} autoupdate \
|
|
|
|
+ 2>&1|cat >> $LOGFILE || error_out
|
|
|
|
+${XBPS_BIN_CMD} ${XBPS_ARGS} autoremove \
|
|
|
|
+ 2>&1|cat >> $LOGFILE || error_out
|
|
|
|
|
|
${XBPS_BIN_CMD} -r "$ROOTFS" list > \
|
|
${XBPS_BIN_CMD} -r "$ROOTFS" list > \
|
|
"${OUTPUT_FILE%.iso}"-package-list.txt || error_out
|
|
"${OUTPUT_FILE%.iso}"-package-list.txt || error_out
|
|
@@ -339,7 +328,7 @@ cp -a /lib/modules/${KERNELVERSION} "$ROOTFS/lib/modules" || error_out $?
|
|
|
|
|
|
# Generate a sane xbps.conf for the rootfs.
|
|
# Generate a sane xbps.conf for the rootfs.
|
|
rm -f $ROOTFS/etc/xbps/xbps.conf
|
|
rm -f $ROOTFS/etc/xbps/xbps.conf
|
|
-echo "# xbps.conf generated by vmklive-0.8.5" \
|
|
|
|
|
|
+echo "# xbps.conf generated by void-mklive-@@MKLIVE_VERSION@@" \
|
|
> $ROOTFS/etc/xbps/xbps.conf
|
|
> $ROOTFS/etc/xbps/xbps.conf
|
|
echo "TransactionFrequencyFlush = 0" \
|
|
echo "TransactionFrequencyFlush = 0" \
|
|
>> $ROOTFS/etc/xbps/xbps.conf
|
|
>> $ROOTFS/etc/xbps/xbps.conf
|