summaryrefslogtreecommitdiffstats
path: root/make_slackware_live.sh
diff options
context:
space:
mode:
Diffstat (limited to 'make_slackware_live.sh')
-rwxr-xr-xmake_slackware_live.sh28
1 files changed, 21 insertions, 7 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index 7a073ee..a5b4cfb 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2014, 2015, 2016 Eric Hameleers, Eindhoven, NL
+# Copyright 2014, 2015, 2016, 2017 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -188,7 +188,7 @@ SEQ_DLACK="tagfile:a,ap,d,e,f,k,l,n,t,tcl,x,xap pkglist:slackextra,systemd,dlack
# List of kernel modules required for a live medium to boot properly;
# Lots of HID modules added to support keyboard input for LUKS password entry:
-KMODS=${KMODS:-"squashfs:overlay:loop:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:usb-storage:hid:usbhid:i2c-hid:hid-generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd:mbcache:ext3:ext4:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat"}
+KMODS=${KMODS:-"squashfs:overlay:loop:xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:usb-storage:hid:usbhid:i2c-hid:hid-generic:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd:mbcache:ext3:ext4:isofs:fat:nls_cp437:nls_iso8859-1:msdos:vfat:ntfs"}
# Firmware for wired network cards required for NFS root support:
NETFIRMWARE="3com acenic adaptec bnx tigon e100 sun kaweth tr_smctr cxgb3"
@@ -1328,7 +1328,7 @@ mkdir -p ${LIVE_ROOTDIR}/var/lib/tftpboot/pxelinux.cfg
cp -ia /usr/share/syslinux/pxelinux.0 ${LIVE_ROOTDIR}/var/lib/tftpboot/
ln -s /mnt/livemedia/boot/generic ${LIVE_ROOTDIR}/var/lib/tftpboot/
ln -s /mnt/livemedia/boot/initrd.img ${LIVE_ROOTDIR}/var/lib/tftpboot/
-cat ${LIVE_TOOLDIR}/pxeserver | sed \
+cat ${LIVE_TOOLDIR}/pxeserver.tpl | sed \
-e "s/@DIRSUFFIX@/$DIRSUFFIX/g" \
-e "s/@DISTRO@/$DISTRO/g" \
-e "s/@CDISTRO@/${DISTRO^}/g" \
@@ -1353,20 +1353,34 @@ if ls ${LIVE_ROOTDIR}/boot/vmlinuz-huge-* 1>/dev/null 2>/dev/null; then
uncompressfs ${DEF_SL_PKGROOT}/../isolinux/initrd.img | cpio -i -d -H newc --no-absolute-filenames usr/lib/setup/* sbin/probe sbin/fixdate
mv -i usr/lib/setup/* sbin/probe sbin/fixdate .
rm -r usr sbin
+ rm -f setup
cd - 1>/dev/null
# Fix some occurrences of '/mnt' that should not be used in the Live ISO:
- sed -i -e 's, /mnt, ${T_PX},g' -e 's,=/mnt/,=${T_PX}/,g' -e 's,T_PX=/mnt,T_PX=/setup2hd,g' ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/*
+ sed -i -e 's, /mnt, ${T_PX},g' -e 's,=/mnt$,=${T_PX},g' -e 's,=/mnt/,=${T_PX}/,g' -e 's,T_PX=/mnt,T_PX="`cat $TMP/SeTT_PX`",g' ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/*
+ # If T_PX is used in a script, it should be defined first:
+ for FILE in ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/* ; do
+ if grep -q T_PX $FILE ; then
+ if ! grep -q "^T_PX=" $FILE ; then
+ if ! grep -q "^TMP=" $FILE ; then
+ sed -e '/#!/a T_PX="`cat $TMP/SeTT_PX`"' -i $FILE
+ sed -e '/#!/a TMP=/var/log/setup/tmp' -i $FILE
+ else
+ sed -e '/^TMP=/a T_PX="`cat $TMP/SeTT_PX`"' -i $FILE
+ fi
+ fi
+ fi
+ done
if [ -f ${LIVE_ROOTDIR}/sbin/liloconfig ]; then
patch ${LIVE_ROOTDIR}/sbin/liloconfig ${LIVE_TOOLDIR}/patches/liloconfig.patch
fi
if [ -f ${LIVE_ROOTDIR}/usr/sbin/eliloconfig ]; then
patch ${LIVE_ROOTDIR}/usr/sbin/eliloconfig ${LIVE_TOOLDIR}/patches/eliloconfig.patch
fi
- # Fix some occurrences of '/usr/lib/setup/' are covered by $PATH:
+ # Fix some occurrences of '/usr/lib/setup/' that are covered by $PATH:
sed -i -e 's,/usr/lib/setup/,,g' -e 's,:/usr/lib/setup,:/usr/share/${LIVEMAIN},g' ${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/*
# Add the Slackware Live HD installer:
mkdir -p ${LIVE_ROOTDIR}/usr/local/sbin
- cat ${LIVE_TOOLDIR}/setup2hd | sed \
+ cat ${LIVE_TOOLDIR}/setup2hd.tpl | sed \
-e "s/@DIRSUFFIX@/$DIRSUFFIX/g" \
-e "s/@DISTRO@/$DISTRO/g" \
-e "s/@CDISTRO@/${DISTRO^}/g" \
@@ -1895,7 +1909,7 @@ fi
echo "-- Creating initrd for kernel-generic $KVER ..."
chroot ${LIVE_ROOTDIR} /sbin/mkinitrd -c -w ${WAIT} -l us -o /boot/initrd_${KVER}.img -k ${KVER} -m ${KMODS} -L -C dummy 1>${DBGOUT} 2>${DBGOUT}
# Modify the initrd content for the Live OS:
-cat $LIVE_TOOLDIR/liveinit | sed \
+cat $LIVE_TOOLDIR/liveinit.tpl | sed \
-e "s/@LIVEMAIN@/$LIVEMAIN/g" \
-e "s/@MARKER@/$MARKER/g" \
-e "s/@MEDIALABEL@/$MEDIALABEL/g" \