From 1adfa329bd1a10ba89267ed3e5ed4b47b34a6f30 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sun, 17 Apr 2016 02:25:08 +0200 Subject: Add a post-install customization hook to 'setup2hd'. A new file 'setup2hd.local' has been added to the liveslak sources. If you do not touch that one, it will be copied to: /usr/share/${LIVEMAIN}/setup2hd.$DISTRO.sample and serve as just that, a sample script. If on the other hand you rename the file to 'setup2hd.$DISTRO' before generating your ISO image ($DISTRO being the name of your own distro, like 'CINELIVE'), then this file will be installed in the ISO as /usr/share/${LIVEMAIN}/setup2hd.$DISTRO and this will be sourced by 'setup2hd' providing you a custom post-install customization hook for your own Live distro. Usage instructions are inside 'setup2hd.local'. --- make_slackware_live.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'make_slackware_live.sh') diff --git a/make_slackware_live.sh b/make_slackware_live.sh index 7734675..b92465c 100755 --- a/make_slackware_live.sh +++ b/make_slackware_live.sh @@ -1138,6 +1138,29 @@ if [ -f ${LIVE_ROOTDIR}/boot/vmlinuz-huge-* ]; then -e "s/@VERSION@/$VERSION/g" \ > ${LIVE_ROOTDIR}/usr/local/sbin/setup2hd chmod 755 ${LIVE_ROOTDIR}/usr/local/sbin/setup2hd + # Slackware Live HD post-install customization hook: + if [ -f ${LIVE_TOOLDIR}/setup2hd.local ]; then + # The '.local' suffix means: install it as a sample file only: + HOOK_SRC="${LIVE_TOOLDIR}/setup2hd.local" + HOOK_DST="${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/setup2hd.$DISTRO.sample" + elif [ -f ${LIVE_TOOLDIR}/setup2hd.$DISTRO ]; then + # Install the hook; the file will be sourced by "setup2hd". + HOOK_SRC="${LIVE_TOOLDIR}/setup2hd.$DISTRO" + HOOK_DST="${LIVE_ROOTDIR}/usr/share/${LIVEMAIN}/setup2hd.$DISTRO" + fi + cat ${HOOK_SRC} | sed \ + -e "s/@DIRSUFFIX@/$DIRSUFFIX/g" \ + -e "s/@DISTRO@/$DISTRO/g" \ + -e "s/@CDISTRO@/${DISTRO^}/g" \ + -e "s/@UDISTRO@/${DISTRO^^}/g" \ + -e "s/@KVER@/$KVER/g" \ + -e "s/@LIVEDE@/$LIVEDE/g" \ + -e "s/@LIVEMAIN@/$LIVEMAIN/g" \ + -e "s/@MARKER@/$MARKER/g" \ + -e "s/@SL_VERSION@/$SL_VERSION/g" \ + -e "s/@VERSION@/$VERSION/g" \ + > ${HOOK_DST} + chmod 644 ${HOOK_DST} fi # Add the documentation: -- cgit v1.2.3