#
# Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it>
+# Copyright (C) 2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.28
+PKG_VERSION:=1.0.30
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=dee0dc77573d88af80b225d8810ab7a1
+PKG_MD5SUM:=d87b35670aa735ae5b7d3f8bf1b76245
-#UNPACK_CMD=dpkg-deb --fsys-tarfile $(DL_DIR)/$(PKG_SOURCE) | ( cd $(1) && tar -xf - )
UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.gz | ( cd $(1) && tar -xzf - )
include $(INCLUDE_DIR)/package.mk
define Package/debootstrap
- SECTION:=admin
- CATEGORY:=Administration
- TITLE:=Bootstrap a basic Debian system
- URL:=http://wiki.debian.org/Debootstrap
- DEPENDS:=+coreutils-chroot
- MAINTAINER:=Gianluigi Tiesi <sherpya@netfarm.it>
+ SECTION:=admin
+ CATEGORY:=Administration
+ TITLE:=Bootstrap a basic Debian system
+ URL:=http://wiki.debian.org/Debootstrap
+ DEPENDS:=+coreutils-chroot +coreutils-sha1sum
+ MAINTAINER:=Luka Perkov <openwrt@lukaperkov.net>
endef
define Package/debootstrap/description
- debootstrap is used to create a Debian base system from scratch,
- without requiring the availability of dpkg or apt. It does this by
- downloading .deb files from a mirror site, and carefully unpacking them
- into a directory which can eventually be chrooted into.
+ debootstrap is used to create a Debian base system from scratch, without
+ requiring the availability of dpkg or apt. It does this by downloading .deb
+ files from a mirror site, and carefully unpacking them into a directory which
+ can eventually be chrooted into.
endef
define Build/Compile
+# file pkgdetails.c was imported from debian package base-installer version 1.119
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) ./files/pkgdetails.c -o $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails
endef
define Package/debootstrap/install
- cd $(PKG_BUILD_DIR) && ( $(FIND) usr | cpio -pd $(1) )
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin
+ $(INSTALL_DIR) $(1)/usr/share/debootstrap
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails $(1)/usr/share/debootstrap
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/functions $(1)/usr/share/debootstrap
+ $(INSTALL_DIR) $(1)/usr/share/debootstrap/scripts
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/scripts/* $(1)/usr/share/debootstrap/scripts
endef
$(eval $(call BuildPackage,debootstrap))
#define MAX_LINE 1000
#define MAX_PKGS 100
+char *checksum_field=NULL;
+
static char *fieldcpy(char *dst, char *fld) {
while (*fld && *fld != ':')
fld++;
char cur_ver[MAX_LINE];
char cur_arch[MAX_LINE];
char cur_size[MAX_LINE];
- char cur_md5[MAX_LINE];
+ char cur_checksum[MAX_LINE];
char cur_filename[MAX_LINE];
char *pkgs[MAX_PKGS];
int i;
fieldcpy(cur_arch, buf);
} else if (strncasecmp(buf, "Size:", 5) == 0) {
fieldcpy(cur_size, buf);
- } else if (strncasecmp(buf, "MD5sum:", 7) == 0) {
- fieldcpy(cur_md5, buf);
+ } else if (strncasecmp(buf, checksum_field, strlen(checksum_field)) == 0
+ && buf[strlen(checksum_field)] == ':') {
+ fieldcpy(cur_checksum, buf);
} else if (strncasecmp(buf, "Filename:", 9) == 0) {
fieldcpy(cur_filename, buf);
} else if (!*buf) {
if (!pkgs[i]) continue;
any = 1;
if (strcmp(cur_field, pkgs[i]) == 0) {
- printf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_md5, cur_size);
+ printf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size);
if (uniq) pkgs[i] = NULL;
break;
}
}
int main(int argc, char *argv[]) {
+ checksum_field=getenv("DEBOOTSTRAP_CHECKSUM_FIELD");
+ if (checksum_field == NULL) {
+ checksum_field="MD5sum";
+ }
+
if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) {
if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]),
atoi(argv[4]), argc == 6 ? argv[5] : NULL))
+++ /dev/null
---- debootstrap-1.0.26/usr/share/debootstrap/functions 2010-11-12 13:07:47.000000000 +0100
-+++ debootstrap-1.0.26/usr/share/debootstrap/functions 2010-11-26 21:55:06.440000562 +0100
-@@ -800,8 +800,9 @@
-
- if [ -n "$EXTRACTOR_OVERRIDE" ]; then
- extractor="$EXTRACTOR_OVERRIDE"
-- elif type dpkg-deb >/dev/null 2>&1; then
-- extractor="dpkg-deb"
-+# busybox's dpkg-deb is not suitable for this script
-+# elif type dpkg-deb >/dev/null 2>&1; then
-+# extractor="dpkg-deb"
- else
- extractor="ar"
- fi
--- /dev/null
+Index: debootstrap-1.0.30/usr/share/debootstrap/functions
+===================================================================
+--- debootstrap-1.0.30.orig/usr/share/debootstrap/functions 2011-04-28 15:29:13.595340023 +0200
++++ debootstrap-1.0.30/usr/share/debootstrap/functions 2011-04-28 15:29:23.658843887 +0200
+@@ -800,8 +800,6 @@
+
+ if [ -n "$EXTRACTOR_OVERRIDE" ]; then
+ extractor="$EXTRACTOR_OVERRIDE"
+- elif type dpkg-deb >/dev/null 2>&1; then
+- extractor="dpkg-deb"
+ else
+ extractor="ar"
+ fi