Start integration of void-installer and start conversion to non-busybox utils.

This commit is contained in:
Juan RP 2013-05-19 09:39:56 +02:00
parent ab5201f3ba
commit 44423c3700
7 changed files with 1345 additions and 36 deletions

4
.gitignore vendored
View File

@ -1 +1,3 @@
void-mklive.sh installer.sh
mklive.sh
mkrootfs.sh

View File

@ -1,5 +1,3 @@
Simplified BSD:
# Copyright (c) 2009-2013 Juan Romero Pardines. # Copyright (c) 2009-2013 Juan Romero Pardines.
# All rights reserved. # All rights reserved.
# #

View File

@ -1,17 +1,23 @@
GITVER := $(shell git rev-parse HEAD) GITVER := $(shell git rev-parse HEAD)
VERSION = 0.12 VERSION = 0.13
PREFIX ?= /usr/local PREFIX ?= /usr/local
SBINDIR ?= $(PREFIX)/sbin SBINDIR ?= $(PREFIX)/sbin
SHAREDIR ?= $(PREFIX)/share SHAREDIR ?= $(PREFIX)/share
DRACUTMODDIR ?= $(PREFIX)/lib/dracut/modules.d/01vmklive DRACUTMODDIR ?= $(PREFIX)/lib/dracut/modules.d/01vmklive
all: SHIN += $(shell find -type f -name '*.sh.in')
sed -e "s|@@MKLIVE_VERSION@@|$(VERSION) $(GITVER)|g" mklive.sh.in > mklive.sh SCRIPTS += $(SHIN:.sh.in=.sh)
%.sh: %.sh.in
sed -e "s|@@MKLIVE_VERSION@@|$(VERSION) $(GITVER)|g" $^ > $@
all: $(SCRIPTS)
install: all install: all
install -d $(DESTDIR)$(SBINDIR) install -d $(DESTDIR)$(SBINDIR)
install -m755 mklive.sh $(DESTDIR)$(SBINDIR)/void-mklive install -m755 mklive.sh $(DESTDIR)$(SBINDIR)/void-mklive
install -m755 void-mkrootfs.sh $(DESTDIR)$(SBINDIR)/void-mkrootfs install -m755 mkrootfs.sh $(DESTDIR)$(SBINDIR)/void-mkrootfs
install -m755 installer.sh $(DESTDIR)$(SBINDIR)/void-installer
install -d $(DESTDIR)$(DRACUTMODDIR) install -d $(DESTDIR)$(DRACUTMODDIR)
install -m755 dracut/*.sh $(DESTDIR)$(DRACUTMODDIR) install -m755 dracut/*.sh $(DESTDIR)$(DRACUTMODDIR)
install -d $(DESTDIR)$(SHAREDIR)/void-mklive install -d $(DESTDIR)$(SHAREDIR)/void-mklive
@ -19,7 +25,7 @@ install: all
install -m644 isolinux/*.cfg* $(DESTDIR)$(SHAREDIR)/void-mklive install -m644 isolinux/*.cfg* $(DESTDIR)$(SHAREDIR)/void-mklive
clean: clean:
-rm -f mklive.sh -rm -f *.sh
dist: dist:
@echo "Building distribution tarball for tag: v$(VERSION) ..." @echo "Building distribution tarball for tag: v$(VERSION) ..."

7
README
View File

@ -1,7 +1,7 @@
void-mklive - The Void Linux live image maker void-mklive - The Void Linux live image maker
This is a simple shell script to build a live image for the This is a simple shell script to build a live image for the Void
Void linux distribution. The images contain the void-installer package Linux distribution. The images contain a simple dialog-based installer
to be able to install Void linux to storage disks. to be able to install Void linux to storage disks.
The generated image can be booted from BIOS and EFI systems (dual boot). The generated image can be booted from BIOS and EFI systems (dual boot).
@ -34,4 +34,7 @@ Options:
Take a look at the configuration file (~/mklive.conf) to tweak some Take a look at the configuration file (~/mklive.conf) to tweak some
default parameters in the generated image. default parameters in the generated image.
Additionally void-mkrootfs generates a rootfs tarball suitable for unpacking
on a directory ready to 'chroot'.
-- Juan RP <xtraeme@gmail.com> -- Juan RP <xtraeme@gmail.com>

1311
installer.sh.in Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
#
# vim: set ts=4 sw=4 et:
#
#- #-
# Copyright (c) 2009-2013 Juan Romero Pardines. # Copyright (c) 2009-2013 Juan Romero Pardines.
# All rights reserved. # All rights reserved.
@ -41,8 +44,8 @@ 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 "@@MKLIVE_VERSION@@"
------------------------------------------------------------------------------- ###############################################################################
Welcome to the Void Linux Live system, you have been autologged in. Welcome to the Void Linux Live system, you have been autologged in.
This user has full sudo(8) permissions without any password, be careful This user has full sudo(8) permissions without any password, be careful
@ -50,9 +53,11 @@ executing commands through sudo(8).
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 using Void Linux.
http://www.voidlinux.eu
############################################################################### ###############################################################################
_EOF _EOF
@ -92,8 +97,7 @@ _EOF
chmod 644 "$1" chmod 644 "$1"
} }
usage() usage() {
{
cat <<_EOF cat <<_EOF
Usage: $(basename $0) [options] Usage: $(basename $0) [options]
@ -137,6 +141,8 @@ install_packages() {
if [ -f $ROOTFS/usr/lib/systemd/system/NetworkManager.service ]; then if [ -f $ROOTFS/usr/lib/systemd/system/NetworkManager.service ]; then
systemd-nspawn -D $ROOTFS systemctl enable NetworkManager.service >>$LOGFILE 2>&1 systemd-nspawn -D $ROOTFS systemctl enable NetworkManager.service >>$LOGFILE 2>&1
fi fi
install -Dm755 /usr/sbin/void-installer $ROOTFS/usr/sbin/void-installer
} }
generate_initramfs() { generate_initramfs() {
@ -145,31 +151,16 @@ generate_initramfs() {
$XBPS_INSTALL_CMD -r $ROOTFS/kernel_temp -y \ $XBPS_INSTALL_CMD -r $ROOTFS/kernel_temp -y \
base-system void-mklive >>$LOGFILE 2>&1 base-system void-mklive >>$LOGFILE 2>&1
# Install some required utilities from util-linux.
install -Dm755 $ROOTFS/kernel_temp/usr/bin/mount "$ROOTFS/usr/bin/mount"
install -Dm755 $ROOTFS/kernel_temp/usr/sbin/agetty "$ROOTFS/usr/sbin/agetty"
install -Dm755 $ROOTFS/kernel_temp/usr/bin/lsblk "$ROOTFS/usr/bin/lsblk"
# Install stdbuf from coreutils, required by void-installer.
install -Dm755 $ROOTFS/kernel_temp/usr/bin/stdbuf "$ROOTFS/usr/bin/stdbuf"
install -Dm755 $ROOTFS/kernel_temp/usr/libexec/coreutils/libstdbuf.so \
"$ROOTFS/usr/libexec/coreutils/libstdbuf.so"
chroot $ROOTFS/kernel_temp /usr/bin/dracut --no-hostonly \ chroot $ROOTFS/kernel_temp /usr/bin/dracut --no-hostonly \
--add " dmsquash-live vmklive " --${COMPRESSTYPE} \ --add "drm dmsquash-live vmklive" --omit "caps" \
--add-drivers "xfs vfat ext2 ext3 ext4 btrfs" --${COMPRESSTYPE} \
"/boot/initrd.lz" $KERNELVERSION >>$LOGFILE 2>&1 "/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
# We rely on pam now, so let's install the host login config.
install -Dm644 $ROOTFS/kernel_temp/etc/pam.d/login \
"$ROOTFS/etc/pam.d/login"
# Remove pam_motd.so; busybox login already prints it.
sed -e '/^.*pam_motd.so*/d' -i "$ROOTFS/etc/pam.d/login"
} }
copy_kernel_and_modules() { copy_kernel_and_modules() {
cp -a $ROOTFS/kernel_temp/boot/vmlinuz-$KERNELVERSION $BOOT_DIR/vmlinuz cp -a $ROOTFS/kernel_temp/boot/vmlinuz-$KERNELVERSION $BOOT_DIR/vmlinuz
mkdir -p $ROOTFS/lib/modules
cp -a $ROOTFS/kernel_temp/lib/modules/$KERNELVERSION $ROOTFS/lib/modules
# remove temporary rootfs. # remove temporary rootfs.
rm -rf $ROOTFS/kernel_temp rm -rf $ROOTFS/kernel_temp
@ -341,7 +332,7 @@ fi
if [ -z "$PACKAGE_LIST" ]; then if [ -z "$PACKAGE_LIST" ]; then
PACKAGE_LIST="base-system-live" PACKAGE_LIST="base-system-live"
else else
PACKAGE_LIST="base-system-live $PACKAGE_LIST" PACKAGE_LIST="$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..."
@ -461,5 +452,3 @@ 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:

0
void-mkrootfs.sh → mkrootfs.sh.in Executable file → Normal file
View File