Greetings,

In 2006 I tried to provide initng support in a Debian Live-based
distribution. This was also a bounty from Safedesk. I contacted them
(after the deadline) but I got no answer, therefore I'm releasing this
brief patch.

You'll find attached a debdiff patch between the current live-package
and a live-package which supports initng. This was meant to work for
0.99.14, but I think it works in the current version, too.

As of 0.5.2, Debian initng packages also requires a patch (which I'm
sending to the BTS) in order to work from a Live CD. Using live-package
0.99.14 and initng 0.5.2, I was able to build a nice LiveCD which uses
initng. It works quite OK.

I send this patch to this list so it can be discussed and considered as
an addition to the Debian Live project. Keep up the good work.

Jose

-- 
José M. Parrella -> Debian Sid, k2.6.18
Escuela de Ingenieria Electrica
Universidad Central de Venezuela -> ucvlug.info
only in patch2:
unchanged:
--- live-package-0.99.19.orig/src/scripts/21image.sh
+++ live-package-0.99.19/src/scripts/21image.sh
@@ -189,6 +189,19 @@
                                sed -i -e 
"s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" 
"${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
                                sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" 
"${LIVE_ROOT}"/binary/isolinux/f1.txt
                                sed -i -e "s/LIVE_VERSION/${VERSION}/" 
"${LIVE_ROOT}"/binary/isolinux/f10.txt
+
+                               # initng substitutions in ISOLINUX
+                               if [ "${LIVE_INITNG}" = "installed" ]
+                               then
+                                       LIVE_INITNGAPPEND="label initng\n    
kernel vmlinuz\n    append initrd=initrd.gz boot=casper ${LIVE_BOOTAPPEND} 
init=/sbin/initng"
+                                        
LIVE_INITNGISOLINUX="\^O0finitng\^O07\n  Start the live system with the initng 
boot system."
+                                        sed -i -e 
"s#LIVE_INITNGAPPEND#${LIVE_INITNGAPPEND}#" 
"${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
+                                        sed -i -e 
"s#LIVE_INITNGISOLINUX#${LIVE_INITNGISOLINUX}#" 
"${LIVE_ROOT}"/binary/isolinux/f3.txt
+                                else
+                                        sed -i -e "/LIVE_INITNGAPPEND/d" 
"${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
+                                        sed -i -e "/LIVE_INITNGISOLINUX/d" 
"${LIVE_ROOT}"/binary/isolinux/f3.txt
+                                fi
+
                                ;;
 
                        net)
@@ -212,6 +225,19 @@
                                sed -i -e 
"s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e 
"s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e 
"s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" 
"${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
                                sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" 
"${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f1.txt
                                sed -i -e "s/LIVE_VERSION/${VERSION}/" 
"${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f10.txt
+
+                                # initng substitutions in SYSLINUX
+                                 if [ "${LIVE_INITNG}" = "installed" ]
+                                 then
+                                         LIVE_INITNGAPPEND="label initng\n  
kernel vmlinuz\n  append initrd=initrd.gz boot=casper netboot 
nfsroot=${LIVE_SERVER_ADDRESS}:$LIVE_SERVER_PATH} $LIVE_BOOTAPPEND} 
init=/sbin/initng"
+                                         
LIVE_INITNGISOLINUX="\^O0finitng\^O07\n  Start the live system with the initng 
boot system."
+                                         sed -i -e 
"s#LIVE_INITNGAPPEND#${LIVE_INITNGAPPEND}#" 
"${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
+                                         sed -i -e 
"s#LIVE_INITNGISOLINUX#${LIVE_INITNGISOLINUX}#" 
"${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f3.txt
+                                 else
+                                         sed -i -e "s/LIVE_INITNGAPPEND/d" 
"${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default
+                                         sed -i -e "s/LIVE_INITNGISOLINUX/d" 
"${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f3.txt
+                                 fi
+
                                ;;
                esac
 
only in patch2:
unchanged:
--- live-package-0.99.19.orig/src/scripts/13chroot.sh
+++ live-package-0.99.19/src/scripts/13chroot.sh
@@ -157,6 +157,21 @@
                        cd "${OLDPWD}"
                fi
 
+                # Install initng, if requested
+                if [ "${LIVE_INITNG}" = "yes" ]
+               then
+                       if [ -n "${LIVE_INITNG_PACKAGE}" ]
+                       then
+                               dpkg --root=${LIVE_CHROOT} -i 
${LIVE_INITNG_PACKAGE}
+                               LIVE_INITNG="installed"
+                       elif [ `Chroot_exec \"aptitude show initng\"` ]
+                       then
+                               Chroot_exec "aptitude install --assume-yes 
initng"
+                               LIVE_INITNG="installed"
+                       fi
+                fi
+
+
                # Process flavour specific hooks
                if [ -r "${BASE}"/hooks/"${LIVE_FLAVOUR}" ]
                then
only in patch2:
unchanged:
--- live-package-0.99.19.orig/src/main.sh
+++ live-package-0.99.19/src/main.sh
@@ -97,6 +97,8 @@
        echo "  --without-generic-indices: disables generic debian package 
indices."
        echo "  --with-recommends: installes recommended packages too."
        echo "  --without-recommends: does not install recommended packages 
(default)."
+        echo "  --with-initng: provides a boot option linuxng to boot with 
initng."
+        echo "  --with-initng-package: specifies a .deb package for initng to 
be installed if --with-initng is used."
        echo
        echo "Environment:"
        echo "  All settings can be also specified trough environment 
variables. Please see make-live.conf(5) for more information."
@@ -166,7 +168,7 @@
 
 Main ()
 {
-       ARGUMENTS="`getopt --longoptions 
root:,tasks:,type:,architecture:,bootappend:,clone:,config:,chroot:,distribution:,filesystem:,flavour:,bootstrap-config:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,keyring:,mirror-security:,output:,packages:,package-list:,proxy-ftp:,preseed:,proxy-http:,repositories:,section:,server-address:,server-path:,templates:,with-generic-indices,without-generic-indices,with-recommends,without-recommends,with-source,without-source,help,usage,version
 --name=${PROGRAM} --options r:t:a:b:c:d:f:k:m:o:p:s:huv --shell sh -- "[EMAIL 
PROTECTED]"`"
+       ARGUMENTS="`getopt --longoptions 
root:,tasks:,type:,architecture:,bootappend:,clone:,config:,chroot:,distribution:,filesystem:,flavour:,bootstrap-config:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,keyring:,mirror-security:,output:,packages:,package-list:,proxy-ftp:,preseed:,proxy-http:,repositories:,section:,server-address:,server-path:,templates:,with-generic-indices,without-generic-indices,with-recommends,without-recommends,with-initng,with-initng-package,with-source,without-source,help,usage,version
 --name=${PROGRAM} --options r:t:a:b:c:d:f:k:m:o:p:s:huv --shell sh -- "[EMAIL 
PROTECTED]"`"
 
        if [ "${?}" != "0" ]
        then
@@ -317,6 +319,14 @@
                                LIVE_RECOMMENDS="no"; shift
                                ;;
 
+                        --with-initng)
+                                LIVE_INITNG="yes"; shift
+                                ;;
+ 
+                        --with-initng-package)
+                                LIVE_INITNG_PACKAGE="${2}"; shift 2
+                                ;;
+
                        --with-source)
                                LIVE_SOURCE="yes"; shift
                                ;;
@@ -353,6 +363,16 @@
        Configuration
        Defaults
 
+        # Brief check for initng support
+        if [ ${LIVE_INITNG} = "yes" ] && [ ! -n ${LIVE_INITNG_PACKAGE} ]
+        then
+                echo ""
+                echo "WARNING! Currently there's no support for initng in Sid 
or Etch. If you're providing a repository with initng,"
+                echo "you should not worry. If you're not, please provide a 
--with-initng-package option if you want initng support."
+                echo "Waiting 3 seconds before continuing..."
+                sleep 3
+        fi
+
        # Building live system
        Bootstrap
        Chroot
only in patch2:
unchanged:
--- live-package-0.99.19.orig/templates/syslinux/isolinux.cfg
+++ live-package-0.99.19/templates/syslinux/isolinux.cfg
@@ -2,6 +2,7 @@
 label linux
   kernel vmlinuz
   append initrd=initrd.gz boot=casper LIVE_BOOTAPPEND
+LIVE_INITNGAPPEND
 label memtest
   kernel memtest
 display isolinux.txt
only in patch2:
unchanged:
--- live-package-0.99.19.orig/templates/syslinux/f3.txt
+++ live-package-0.99.19/templates/syslinux/f3.txt
@@ -4,6 +4,7 @@
 
 0flinux07
   Start the live system -- this is the default CD-ROM mode.
+LIVE_INITNGISOLINUX
 0fmemtest07
   Start the memtest86+ RAM tester.
 
only in patch2:
unchanged:
--- live-package-0.99.19.orig/templates/syslinux/pxelinux.cfg
+++ live-package-0.99.19/templates/syslinux/pxelinux.cfg
@@ -16,6 +16,7 @@
   append initrd=initrd.gz boot=casper root=/dev/cifs 
nfsroot=LIVE_SERVER_ADDRESS:LIVE_SERVER_PATH LIVE_BOOTAPPEND
 label memtest
   kernel memtest
+LIVE_INITNGAPPEND
 display isolinux.txt
 timeout 0
 prompt 1
only in patch2:
unchanged:
--- live-package-0.99.19.orig/doc/faq.txt
+++ live-package-0.99.19/doc/faq.txt
@@ -7,3 +7,13 @@
 
 Q: What is the user password?
 A: The user password for casper is 'live'.
+
+Q: What's the deal with the initng support?
+A: You should call make-live with the special --with-initng option, which 
enables
+   a special "initng" label at boot time in Syslinux. Since the most usable 
version
+   of initng is either in non-offical repositories or in experimental, you 
should
+   provide a .deb package using the --with-initng-package option.
+
+   Then, before hooks are executed, make-live will pick up your package and 
install
+   it inside the chroot. Everything else will be taken care of by make-live.
+
only in patch2:
unchanged:
--- live-package-0.99.19.orig/doc/man/make-live.8
+++ live-package-0.99.19/doc/man/make-live.8
@@ -61,6 +61,9 @@
 .RB [\| \-\-without-generic-indices \|]
 .RB [\| \-\-with-source \|]
 .RB [\| \-\-without-source \|]
+.RB [\| \-\-with-initng \|]
+.RB [\| \-\-with-initng-package
+.IR FILE \|]
 .PP
 .B make-live
 .RB \-h \||\| \-\-help
@@ -169,6 +172,12 @@
 .TP
 .B \-\-without-source
 disables generation of source images. Instead of this flag, the environment 
variable LIVE_SOURCE can be used (Default: no).
+.TP
+.B \-\-with-initng
+enables optional initng support through special initng label in ISOLINUX 
(Default: no).
+.TP
+.BI "\-\-with-initng-package " FILE
+specifies a particular initng .deb package to be installed inside the chroot 
(Default: none).
 .PP
 .TP
 .B \-h, \-\-help
_______________________________________________
Debian-live-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel

Reply via email to