Revert "mklive.sh.in: add custom scripts to init"

This reverts commit 3c68cc41588aa82fc30680e881f6b5f8c610be35.

This commit was not adequately reviewed and introduces unintentional
errors to the mklive system as well as unfavorable directory contents
in every published ISO.
This commit is contained in:
Michael Aldridge 2017-08-07 18:26:25 -07:00
parent 3c68cc4158
commit dbac38c0f7

View File

@ -78,8 +78,7 @@ Options:
-o <file> Output file name for the ISO image (auto if unset). -o <file> Output file name for the ISO image (auto if unset).
-p "pkg pkgN ..." Install additional packages into the ISO image. -p "pkg pkgN ..." Install additional packages into the ISO image.
-I <includedir> Include directory structure under given path into rootfs -I <includedir> Include directory structure under given path into rootfs
-H <hooksdir> Add scripts in given directory as startup hooks to the init
procedure.
-C "cmdline args" Add additional kernel command line arguments. -C "cmdline args" Add additional kernel command line arguments.
-T "title" Modify the bootloader title. -T "title" Modify the bootloader title.
-K Do not remove builddir. -K Do not remove builddir.
@ -182,13 +181,6 @@ cleanup_rootfs() {
rm -r $ROOTFS/usr/lib/dracut/modules.d/01autoinstaller rm -r $ROOTFS/usr/lib/dracut/modules.d/01autoinstaller
} }
setup_init_hooks() {
hooks_dir=/usr/local/custom-scripts/
mkdir -p ${ROOTFS}${hooks_dir}
find $HOOKS_DIRECTORY -mindepth 1 -maxdepth 1 -exec cp -rfpPv {} ${ROOTFS}${hooks_dir} \;
echo 'find '${hooks_dir}' -type f -executable -exec {} \;' >> $ROOTFS/etc/rc.local
}
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"
@ -304,7 +296,7 @@ generate_iso_image() {
# #
# main() # main()
# #
while getopts "a:b:r:c:C:T:Kk:l:i:I:H:s:S:o:p:h" opt; do while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do
case $opt in case $opt in
a) BASE_ARCH="$OPTARG";; a) BASE_ARCH="$OPTARG";;
b) BASE_SYSTEM_PKG="$OPTARG";; b) BASE_SYSTEM_PKG="$OPTARG";;
@ -314,8 +306,7 @@ while getopts "a:b:r:c:C:T:Kk:l:i:I:H:s:S:o:p:h" opt; do
k) KEYMAP="$OPTARG";; k) KEYMAP="$OPTARG";;
l) LOCALE="$OPTARG";; l) LOCALE="$OPTARG";;
i) INITRAMFS_COMPRESSION="$OPTARG";; i) INITRAMFS_COMPRESSION="$OPTARG";;
I) INCLUDE_DIRECTORY=$(cd "$OPTARG" && pwd);; I) INCLUDE_DIRECTORY="$OPTARG";;
H) HOOKS_DIRECTORY=$(cd "$OPTARG" && pwd);;
s) SQUASHFS_COMPRESSION="$OPTARG";; s) SQUASHFS_COMPRESSION="$OPTARG";;
S) ROOTFS_FREESIZE="$OPTARG";; S) ROOTFS_FREESIZE="$OPTARG";;
o) OUTPUT_FILE="$OPTARG";; o) OUTPUT_FILE="$OPTARG";;
@ -368,8 +359,7 @@ GRUB_DIR="$BOOT_DIR/grub"
ISOLINUX_CFG="$ISOLINUX_DIR/isolinux.cfg" ISOLINUX_CFG="$ISOLINUX_DIR/isolinux.cfg"
CURRENT_STEP=0 CURRENT_STEP=0
STEP_COUNT=9 STEP_COUNT=9
[ -n "${INCLUDE_DIRECTORY}" ] && STEP_COUNT=$((STEP_COUNT+1)) [ -n "${INCLUDE_DIRECTORY}" ] && ((STEP_COUNT=STEP_COUNT+1))
[ -n "${HOOKS_DIRECTORY}" ] && STEP_COUNT=$((STEP_COUNT+1))
: ${SYSLINUX_DATADIR:=$VOIDHOSTDIR/usr/share/syslinux} : ${SYSLINUX_DATADIR:=$VOIDHOSTDIR/usr/share/syslinux}
: ${GRUB_DATADIR:=$VOIDHOSTDIR/usr/share/grub} : ${GRUB_DATADIR:=$VOIDHOSTDIR/usr/share/grub}
@ -422,9 +412,6 @@ generate_grub_efi_boot
print_step "Cleaning up rootfs..." print_step "Cleaning up rootfs..."
cleanup_rootfs cleanup_rootfs
print_step "Creating startup hooks..."
setup_init_hooks
print_step "Generating squashfs image ($SQUASHFS_COMPRESSION) from rootfs..." print_step "Generating squashfs image ($SQUASHFS_COMPRESSION) from rootfs..."
generate_squashfs generate_squashfs