[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 3/4] Import live-installer udeb source



From: Otavio Salvador <otavio at ossystems.com.br>


---

 packages/live-installer/Makefile.am                |    1 
 packages/live-installer/bootstrap                  |    7 ++
 packages/live-installer/configure.ac               |   26 ++++++
 packages/live-installer/debian/changelog           |    5 +
 packages/live-installer/debian/compat              |    1 
 packages/live-installer/debian/control             |   13 +++
 packages/live-installer/debian/copyright           |   24 ++++++
 packages/live-installer/debian/install             |    1 
 packages/live-installer/debian/po/POTFILES.in      |    1 
 packages/live-installer/debian/po/templates.pot    |   35 +++++++++
 packages/live-installer/debian/postinst            |   82 ++++++++++++++++++++
 packages/live-installer/debian/rules               |    7 ++
 .../live-installer/debian/source.lintian-overrides |    2 +
 packages/live-installer/debian/templates           |   17 ++++
 packages/live-installer/include/config.h.in        |   22 +++++
 packages/live-installer/live-installer.d/network   |    5 +
 .../live-installer.d/remove-packages               |    5 +
 .../live-installer/live-installer.d/xserver-xorg   |    6 ++
 packages/live-installer/src/Makefile.am            |    4 +
 packages/live-installer/src/print-inodes.c         |   40 ++++++++++
 packages/live-installer/support/dir                |   12 +++
 packages/live-installer/support/ext2               |   20 +++++
 packages/live-installer/support/ext3               |   20 +++++
 packages/live-installer/support/squashfs           |   20 +++++
 24 files changed, 376 insertions(+), 0 deletions(-)

diff --git a/packages/live-installer/Makefile.am b/packages/live-installer/Makefile.am
new file mode 100644
index 0000000..af437a6
--- /dev/null
+++ b/packages/live-installer/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/packages/live-installer/bootstrap b/packages/live-installer/bootstrap
new file mode 100755
index 0000000..396c2a5
--- /dev/null
+++ b/packages/live-installer/bootstrap
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+aclocal --force
+autoheader --force
+autoconf --force
+automake --foreign --add-missing --copy --force-missing
+
diff --git a/packages/live-installer/configure.ac b/packages/live-installer/configure.ac
new file mode 100644
index 0000000..660195a
--- /dev/null
+++ b/packages/live-installer/configure.ac
@@ -0,0 +1,26 @@
+dnl Copyright (C) 2007 O.S. Systems
+dnl Copyright (C) 2007 Otavio Salvador <otavio at debian.org>
+
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+
+dnl You should have received a copy of the GNU General Public License along
+dnl with this program; if not, write to the Free Software Foundation, Inc.,
+dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+AC_INIT([squashfs-installer], [0])
+AC_CONFIG_HEADER(include/config.h:include/config.h.in)
+AM_INIT_AUTOMAKE([1.8])
+
+dnl Checks for programs we'd need for building
+AC_PROG_MAKE_SET
+AC_PROG_CC
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/packages/live-installer/debian/changelog b/packages/live-installer/debian/changelog
new file mode 100644
index 0000000..4a61769
--- /dev/null
+++ b/packages/live-installer/debian/changelog
@@ -0,0 +1,5 @@
+live-installer (0) UNRELEASED; urgency=low
+
+  * Initial release.
+
+ -- Otavio Salvador <otavio at ossystems.com.br>  Tue, 13 Mar 2007 00:09:27 -0300
diff --git a/packages/live-installer/debian/compat b/packages/live-installer/debian/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/packages/live-installer/debian/compat
@@ -0,0 +1 @@
+5
diff --git a/packages/live-installer/debian/control b/packages/live-installer/debian/control
new file mode 100644
index 0000000..2408fc5
--- /dev/null
+++ b/packages/live-installer/debian/control
@@ -0,0 +1,13 @@
+Source: live-installer
+Section: debian-installer
+Priority: optional
+Maintainer: Otavio Salvador <otavio at ossystems.com.br>
+Build-Depends: cdbs (>= 0.4.35), debhelper (>= 5.0), po-debconf
+
+Package: live-installer
+XC-Package-Type: udeb
+Architecture: any
+Depends: ${shlibs:Depends}, mounted-partitions, squashfs-modules
+Provides: kernel-installer, created-fstab, base-installer
+XB-Installer-Menu-Item: 6500
+Description: Install the system
diff --git a/packages/live-installer/debian/copyright b/packages/live-installer/debian/copyright
new file mode 100644
index 0000000..8f5e5b4
--- /dev/null
+++ b/packages/live-installer/debian/copyright
@@ -0,0 +1,24 @@
+This package was debianized by Otavio Salvador <otavio at ossystems.com.br> on
+Sex, 15 Jun 2007 00:00:00 -0300.
+
+License:
+
+        Copyright (C) 2007 O.S. Systems
+        Copyright (C) 2007 Otavio Salvador <otavio at ossystems.com.br>
+
+        This program is free software; you can redistribute it and/or modify
+        it under the terms of the GNU General Public License as published by
+        the Free Software Foundation; either version 2 of the License, or
+        (at your option) any later version.
+
+        This program is distributed in the hope that it will be useful,
+        but WITHOUT ANY WARRANTY; without even the implied warranty of
+        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+        GNU General Public License for more details.
+
+        You should have received a copy of the GNU General Public License
+        along with this program; if not, write to the Free Software
+        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in /usr/share/common-licenses/GPL file.
diff --git a/packages/live-installer/debian/install b/packages/live-installer/debian/install
new file mode 100644
index 0000000..5e8b2a7
--- /dev/null
+++ b/packages/live-installer/debian/install
@@ -0,0 +1 @@
+support/* /lib/live-installer/
diff --git a/packages/live-installer/debian/po/POTFILES.in b/packages/live-installer/debian/po/POTFILES.in
new file mode 100644
index 0000000..cef83a3
--- /dev/null
+++ b/packages/live-installer/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
diff --git a/packages/live-installer/debian/po/templates.pot b/packages/live-installer/debian/po/templates.pot
new file mode 100644
index 0000000..8f70e55
--- /dev/null
+++ b/packages/live-installer/debian/po/templates.pot
@@ -0,0 +1,35 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: otavio at ossystems.com.br\n"
+"POT-Creation-Date: 2007-06-15 22:00-0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: text
+#. Description
+#: ../templates:1001
+msgid "Install the system"
+msgstr ""
+
+#. Type: text
+#. Description
+#: ../templates:2001
+msgid "Installing the system"
+msgstr ""
+
+#. Type: text
+#. Description
+#: ../templates:3001
+msgid "Running ${SCRIPT}..."
+msgstr ""
diff --git a/packages/live-installer/debian/postinst b/packages/live-installer/debian/postinst
new file mode 100755
index 0000000..c3c632e
--- /dev/null
+++ b/packages/live-installer/debian/postinst
@@ -0,0 +1,82 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+
+log() {
+	logger -t live-installer "$@"
+}
+
+error() {
+	log "error: $*"
+}
+
+warning() {
+	log "warning: $*"
+}
+
+info() {
+	log "info: $*"
+}
+
+# Look at
+PLACES=""
+
+# Load filesystem support
+for script in $(ls /lib/live-installer/*); do
+	. $script
+done
+
+for place in $PLACES; do
+	if [ ! -e $place ]; then
+		info "$place doesn't exists"
+		continue
+	fi
+
+	SUPPORT=$(echo $place | sed 's,.*\.\(.*\)$,\1,g')
+
+	info "Using $SUPPORT support for $place"
+
+	eval ${SUPPORT}_prepare
+	STEPS=$(eval ${SUPPORT}_count)
+
+	db_progress INFO live-installer/progress/installing
+	db_progress START 0 $STEPS live-installer/progress/installing
+
+	for item in $(find .); do
+		if [ -d $item ]; then
+			mkdir -p /target/$item
+		else
+			mkdir -p /target/$(dirname $item)
+			cp -a $item /target/$item
+		fi
+
+		db_progress STEP 1
+	done
+
+	db_progress STOP
+done
+
+# run the scripts found in hook directory after copying the system
+partsdir="/usr/lib/live-installer.d"
+if [ -d "$partsdir" ]; then
+	for script in $(ls "$partsdir"/*); do
+		base=$(basename $script | sed 's/[0-9]*//')
+		if ! db_progress INFO live-installer/progress/$base; then
+			db_subst live-installer/progress/fallback SCRIPT "$base"
+			db_progress INFO live-installer/progress/fallback
+		fi
+		
+		if [ -x "$script" ] ; then
+			# be careful to preserve exit code
+			if log-output -t live-installer "$script"; then
+				:
+			else
+				warning "$script returned error code $?"
+			fi
+		else
+			error "Unable to execute $script"
+		fi
+	done
+fi
+
+exit 0
diff --git a/packages/live-installer/debian/rules b/packages/live-installer/debian/rules
new file mode 100755
index 0000000..23246f7
--- /dev/null
+++ b/packages/live-installer/debian/rules
@@ -0,0 +1,7 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+
+CFLAGS=-Os -Wall -g
+DEB_DH_INSTALLDEBCONF_ARGS=-n
\ No newline at end of file
diff --git a/packages/live-installer/debian/source.lintian-overrides b/packages/live-installer/debian/source.lintian-overrides
new file mode 100644
index 0000000..e4cc558
--- /dev/null
+++ b/packages/live-installer/debian/source.lintian-overrides
@@ -0,0 +1,2 @@
+no-standards-version-field
+maintainer-script-lacks-debhelper-token
diff --git a/packages/live-installer/debian/templates b/packages/live-installer/debian/templates
new file mode 100644
index 0000000..2fc3b6a
--- /dev/null
+++ b/packages/live-installer/debian/templates
@@ -0,0 +1,17 @@
+Template: debian-installer/live-installer/title
+Type: text
+_Description: Install the system
+
+Template: live-installer/progress/installing
+Type: text
+_Description: Installing the system
+
+Template: live-installer/progress/fallback
+Type: text
+_Description: Running ${SCRIPT}...
+
+Template: live-installer/enable
+Type: boolean
+Default: true
+Description: for internal use; can be preseeded
+ If false, uses base-installer for installation
diff --git a/packages/live-installer/include/config.h.in b/packages/live-installer/include/config.h.in
new file mode 100644
index 0000000..f6fee68
--- /dev/null
+++ b/packages/live-installer/include/config.h.in
@@ -0,0 +1,22 @@
+/* include/config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Version number of package */
+#undef VERSION
diff --git a/packages/live-installer/live-installer.d/network b/packages/live-installer/live-installer.d/network
new file mode 100755
index 0000000..87ae524
--- /dev/null
+++ b/packages/live-installer/live-installer.d/network
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+# Remove live-cd network data
+rm -f /target/etc/hostname /target/etc/hosts /target/etc/network/interfaces
+
diff --git a/packages/live-installer/live-installer.d/remove-packages b/packages/live-installer/live-installer.d/remove-packages
new file mode 100644
index 0000000..baa812f
--- /dev/null
+++ b/packages/live-installer/live-installer.d/remove-packages
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+in-target apt-get remove --purge live-initramfs
+in-target apt-get remove --purge live-sysvinit
+in-target apt-get remove --purge casper # Etch support
diff --git a/packages/live-installer/live-installer.d/xserver-xorg b/packages/live-installer/live-installer.d/xserver-xorg
new file mode 100755
index 0000000..51ea048
--- /dev/null
+++ b/packages/live-installer/live-installer.d/xserver-xorg
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+# Reconfigure X.org
+if [ -e /target/var/lib/dpkg/info/xserver-xorg.postinst ]; then
+	in-target dpkg-reconfigure -fnoninteractive --no-reload xserver-xorg
+fi
diff --git a/packages/live-installer/src/Makefile.am b/packages/live-installer/src/Makefile.am
new file mode 100644
index 0000000..f9f111e
--- /dev/null
+++ b/packages/live-installer/src/Makefile.am
@@ -0,0 +1,4 @@
+sbin_PROGRAMS = print-inodes
+
+print_inodes_includedir = -I$(top_srcdir)/include
+print_inodes_SOURCES = print-inodes.c
diff --git a/packages/live-installer/src/print-inodes.c b/packages/live-installer/src/print-inodes.c
new file mode 100644
index 0000000..d40a6a5
--- /dev/null
+++ b/packages/live-installer/src/print-inodes.c
@@ -0,0 +1,40 @@
+/*  Copyright (C) 2007 O.S. Systems */
+/*  Copyright (C) 2007 Otavio Salvador <otavio at debian.org> */
+
+/*  This program is free software; you can redistribute it and/or modify */
+/*  it under the terms of the GNU General Public License as published by */
+/*  the Free Software Foundation; either version 2 of the License, or */
+/*  (at your option) any later version. */
+
+/*  This program is distributed in the hope that it will be useful, */
+/*  but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the */
+/*  GNU General Public License for more details. */
+
+/*  You should have received a copy of the GNU General Public License along */
+/*  with this program; if not, write to the Free Software Foundation, Inc., */
+/*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <sys/statfs.h>
+
+int main(int argc, char** argv)
+{
+  struct statfs stat;
+  
+  if (argc != 2) {
+    printf("Wrong number of arguments, use: print-inodes mount-point\n");
+    return 1;
+  }
+
+  if (statfs(argv[1], &stat) != 0) {
+    perror("statfs has failed! ");
+    return 1;
+  }
+
+  printf("%ld\n", stat.f_files);
+
+  return 0;
+}
diff --git a/packages/live-installer/support/dir b/packages/live-installer/support/dir
new file mode 100644
index 0000000..e4a3ddb
--- /dev/null
+++ b/packages/live-installer/support/dir
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+PLACES="$PLACES /cdrom/live/filesystem.dir"
+PLACES="$PLACES /cdrom/casper/filesystem.dir" # Etch support
+
+dir_prepare() {
+	cd $place
+}
+
+dir_count() {
+	echo `find . | wc -l`
+}
diff --git a/packages/live-installer/support/ext2 b/packages/live-installer/support/ext2
new file mode 100644
index 0000000..7ad40bf
--- /dev/null
+++ b/packages/live-installer/support/ext2
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+PLACES="$PLACES /cdrom/live/filesystem.ext2"
+PLACES="$PLACES /cdrom/casper/filesystem.ext2" # Etch support
+
+ext2_prepare() {
+	modprobe ext2 || true
+
+	mkdir -p /mnt
+	if ! mount -t ext2 -o loop $place /mnt; then
+		error "$place has failed to be mounted as ext2."
+		exit 1
+	fi
+
+	cd /mnt
+}
+
+ext2_count() {
+	echo `print-inodes /mnt`
+}
diff --git a/packages/live-installer/support/ext3 b/packages/live-installer/support/ext3
new file mode 100644
index 0000000..9710ae8
--- /dev/null
+++ b/packages/live-installer/support/ext3
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+PLACES="$PLACES /cdrom/live/filesystem.ext3"
+PLACES="$PLACES /cdrom/casper/filesystem.ext3" # Etch support
+
+ext3_prepare() {
+	modprobe ext3 || true
+
+	mkdir -p /mnt
+	if ! mount -t ext3 -o loop $place /mnt; then
+		error "$place has failed to be mounted as ext3."
+		exit 1
+	fi
+
+	cd /mnt
+}
+
+ext3_count() {
+	echo `print-inodes /mnt`
+}
diff --git a/packages/live-installer/support/squashfs b/packages/live-installer/support/squashfs
new file mode 100644
index 0000000..3457870
--- /dev/null
+++ b/packages/live-installer/support/squashfs
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+PLACES="$PLACES /cdrom/live/filesystem.squashfs"
+PLACES="$PLACES /cdrom/casper/filesystem.squashfs" # Etch support
+
+squashfs_prepare() {
+	modprobe squashfs || true
+
+	mkdir -p /mnt
+	if ! mount -t squashfs -o loop $place /mnt; then
+		error "$place has failed to be mounted as squashfs."
+		exit 1
+	fi
+
+	cd /mnt
+}
+
+squashfs_count() {
+	echo `print-inodes /mnt`
+}




Reply to: