Bug#757883: Patch for Loopback cfg support

2014-08-16 Thread adrian15

I attach a patch for adding Loopback cfg support.

Development details


A) This patch has been based originally on: binary_grub2 . It has been 
improved thanks to some binary_syslinux bits.


B) binary_loopback_cfg needs to be run before binary_syslinux is run. 
The reason is that it reuses some code from binary_syslinux to avoid 
problems when binary_syslinux renames the kernel filenames.


C) This patch already supports CPU detection

D) Be sure to include the new binary_loopback_cfg file in package definition

E) I haven't tested all the possible scenarios for the script (with the 
latest version). When amd64 and 486 Gnu/Linux flavours is used and the 
bootloader is syslinux it works ok.


F) I have not implemented a disable switch for not generating it. 
Usually you always want loopback.cfg to be there.


G) Compared to binary_grub2 script I have removed the installation 
entries because I did not see any of them in binary_syslinux.


H) Please advise how to improve it so that it gets accepted upstream.

How to test
---

These are some steps to easily test if Looback cfg support is working ok.

0) We assume you have generated an iso
1) Make sure you have a partition that Grub understands. Plain ext4 or 
vfat should do it.

2) Create directory: /boot/boot-isos/
3) Put the iso file into that directory making sure it has an ISO or iso 
extension.
4) Setup your computer to boot from cdrom and use: Super Grub2 Disk 
2.00s2 (Hybrid version recommended)

5) Choose Boot manually...
6) Choose Bootable ISOs (in /boot- ... )
7) Choose (the detected) GRUB Loopback Config 
(hdN,msodsN)/boot/boot-ios/name-of-the.iso
8) You will be presented your loopback.cfg. Choose anyone of the entries 
(unless it does not match your cpu architecture of course).
9) You should boot into your Debian Live without problems (thanks to 
findiso boot parametre).


If you ever wanted to test from your grub2 installation instead from 
Super Grub2 Disk check: http://www.supergrubdisk.org/wiki/Loopback.cfg 
for an example.



adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
diff -urN original/usr/lib/live/build/binary 
fork_loopback_cfg/usr/lib/live/build/binary
--- original/usr/lib/live/build/binary  2014-08-16 03:09:01.512575406 +
+++ fork_loopback_cfg/usr/lib/live/build/binary 2014-08-16 03:09:37.377196377 
+
@@ -64,6 +64,7 @@
 lb binary_memtest ${@}
 lb binary_grub ${@}
 lb binary_grub2 ${@}
+lb binary_loopback_cfg ${@}
 lb binary_syslinux ${@}
 lb binary_yaboot ${@}
 lb binary_silo ${@}
diff -urN original/usr/lib/live/build/binary_loopback_cfg 
fork_loopback_cfg/usr/lib/live/build/binary_loopback_cfg
--- original/usr/lib/live/build/binary_loopback_cfg 1970-01-01 
00:00:00.0 +
+++ fork_loopback_cfg/usr/lib/live/build/binary_loopback_cfg2014-08-16 
23:12:21.746935266 +
@@ -0,0 +1,305 @@
+#!/bin/sh
+
+## live-build(7) - System Build Scripts
+## Copyright (C) 2006-2013 Daniel Baumann dan...@debian.org
+##
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+set -e
+
+# Including common functions
+[ -e ${LIVE_BUILD}/scripts/build.sh ]  . ${LIVE_BUILD}/scripts/build.sh 
|| . /usr/lib/live/build.sh
+
+# Setting static variables
+DESCRIPTION=$(Echo 'installs loopback.cfg into binary')
+HELP=
+USAGE=${PROGRAM} [--force]
+
+Arguments ${@}
+
+# Reading configuration files
+Read_conffiles config/all config/common config/bootstrap config/chroot 
config/binary config/source
+Set_defaults
+
+Echo_message Begin installing loopback.cfg...
+
+# Requiring stage file
+Require_stagefile .build/config .build/bootstrap
+
+# Checking stage file
+Check_stagefile .build/binary_loopback_cfg
+
+# Checking grub2 templates
+Check_templates grub2
+
+# Checking lock file
+Check_lockfile .lock
+
+# Creating lock file
+Create_lockfile .lock
+
+# Check architecture
+Check_architectures amd64 i386
+Check_crossarchitectures
+
+# Checking depends
+#Check_package chroot/usr/bin/grub-mkimage grub-pc
+
+# Restoring cache
+Restore_cache cache/packages.binary
+
+# Installing depends
+Install_package
+
+# Local functions
+Grub_live_entry_commands ()
+{
+   local KERNEL=${1}
+   local INITRD=${2}
+   local APPEND=${3}
+
+   LINUX_LIVE=${LINUX_LIVE}\nlinux\t\t/${KERNEL} ${INITFS:+boot=${INITFS} 
}config LB_BOOTAPPEND_LIVE ${APPEND}
+   LINUX_LIVE=${LINUX_LIVE}\ninitrd\t\t/${INITRD}
+}
+
+Grub_live_entry ()
+{
+   local LABEL=${1}
+   local KERNEL=${2}
+   local INITRD=${3}
+   local APPEND=${4}
+
+   LINUX_LIVE=${LINUX_LIVE}\nmenuentry \Debian GNU/Linux - ${LABEL}\ {
+   Grub_live_entry_commands ${KERNEL} ${INITRD} ${APPEND} 
findiso=\${iso_path}
+   LINUX_LIVE=${LINUX_LIVE}\n}
+}
+
+Grub_live_autodetect_entry ()
+{
+   

binary-grub2 stage file filename doubt

2014-08-16 Thread adrian15

(This applies to Debian Stable's Debian Live)

I have noticed that:

/usr/lib/live/build/binary_grub2

has these two lines:

  # Checking stage file
  Check_stagefile .build/binary_grub

  # Creating stage file
  Create_stagefile .build/binary_grub

which I suppose should be renamed to be:

  # Checking stage file
  Check_stagefile .build/binary_grub2

  # Creating stage file
  Create_stagefile .build/binary_grub2


As grub2 is not grub2 but grub version 2 I was asking myself if that 
TYPO was made on purpose or if I should file a bug for it.


Thank you.

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/



--
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/53effc90.6080...@gmail.com



Progress-linux and customisation

2014-08-16 Thread adrian15

(This applies to Debian Stable's Debian Live)

While editing:

/usr/lib/live/build/binary_syslinux

I have discovered a reference to Progress Linux. That is a Linux 
distribution from Daniel (dba)'s company I think. I suspect that Debian 
Live was an internal Progress Linux project that was given to Debian ?


I comment it because I find references in live-build package in:

binary_checksums
binary_debian-installer
binary_disk
and much more files at:
/usr/lib/live/build directory .

As Daniel is one of the most active Debian Live developers I wanted to 
discuss about it here just before issuing a bug.


So my initial thought bug: Get rid of everything Progress Linux 
related I think could rephrased into something like:


Convert everything Progress Linux related into hooks or variables so 
that one can achieve the same functionality by customisation driven by 
Debian Live standard procedures.


So...

1) Is there any schedule for recycling all of these Progress Linux stuff?
2) Maybe some of these references have been already scheduled for removal?
3) Maybe the policy is to recycle them as people need those specific 
functionalities?
4) Maybe we can remove all of these embedded code because Progress Linux 
no longer uses it but only official Debian Live customisation procedures?
5) Is there (much?) more Progress Linux stuff ? (I have only checked in 
live-build package. /usr/lib/live/build directory).



Thank you.

adrian15
--
Support free software. Donate to Super Grub Disk. Apoya el software 
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/



--
To UNSUBSCRIBE, email to debian-live-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/53f00f22.6090...@gmail.com