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

[PATCH V2] d-i hd-media support for armhf



On Mon, Sep 22, 2014 at 12:17:23AM +0200, Karsten Merker wrote:

> I have started working on implementing hd-media support for the
> armhf platform in debian-installer.
[snip]
> I have run some tests with the resulting tarball contents and a
> Jesse CD1 iso copied onto a USB stick; booting and detecting the
> ISO worked as expected on a Cubietruck (armhf/sunxi) with
> mainline u-boot. I have not yet made a full installation due to
> the kernel mismatch, but will do as soon kernel 3.16.3 has
> made it onto the weekly CD.

Attached is V2 of my patch for hd-media support on armhf.  I have
successfully installed a Cubietruck from a USB stick, set up from
the hd-media tarball generated by this patch and with the current
weekly armhf CD#1 iso copied to the stick.

Changes since V1:

- boot script:

  * Add the "console=" parameter to bootargs only if ${console}
    is set.

  * Reword the error message that is printed when the boot script
    is run on a non-mainline or an old-style mainline u-boot.  

- Cut down the module list in pkg-lists/hd-media/armhf.cfg to the
  necessary amount.

- Explicitly list all files to go into the hd-media tarball
  instead of passing "." as file list to tar. This avoids 
  accidentally setting permissions on the current directory
  when unpacking the tarball.

Kibi, is this OK to apply to d-i git?

Regards,
Karsten
-- 
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
>From 0aa19ad8b7f454fa5945ed712c41b4f3bb8b789d Mon Sep 17 00:00:00 2001
From: Karsten Merker <merker@debian.org>
Date: Sat, 20 Sep 2014 07:02:54 +0200
Subject: [PATCH V2] Add hd-media support for the armhf platform

---
 build/boot/arm/bootscr.mainline_common | 33 +++++++++++++++++++++++++++++++++
 build/config/armhf.cfg                 |  2 +-
 build/config/armhf/hd-media.cfg        | 30 ++++++++++++++++++++++++++++++
 build/pkg-lists/hd-media/armhf.cfg     | 22 ++++++++++++++++++++++
 4 files changed, 86 insertions(+), 1 deletion(-)
 create mode 100644 build/boot/arm/bootscr.mainline_common
 create mode 100644 build/config/armhf/hd-media.cfg
 create mode 100644 build/pkg-lists/hd-media/armhf.cfg

diff --git a/build/boot/arm/bootscr.mainline_common b/build/boot/arm/bootscr.mainline_common
new file mode 100644
index 0000000..dbab316
--- /dev/null
+++ b/build/boot/arm/bootscr.mainline_common
@@ -0,0 +1,33 @@
+# Bootscript using the new unified bootcmd handling
+# introduced with u-boot v2014.10
+
+if test -n "${boot_targets}"; then
+  echo "Mainline u-boot / new-style environment detected."
+else
+  echo "Non-mainline u-boot or old-style mainline u-boot detected."
+  echo "This boot script uses the unified bootcmd handling of mainline"
+  echo "u-boot >=v2014.10, which is not available on your system."
+  echo "Please boot the installer manually."
+  exit 0
+fi
+
+if test -z "${fdtfile}"; then
+  echo 'fdtfile environment variable not set. Aborting boot process.'
+  exit 0
+fi
+
+if test ! -e ${devtype} ${devnum}:${bootpart} dtbs/${fdtfile}; then
+  echo "This installer medium does not contain a suitable device-tree file for"
+  echo "this system (${fdtfile}). Aborting boot process."
+  exit 0
+fi
+
+if test -z "${console}"; then
+  setenv bootargs "${bootargs} console=${console}"
+fi
+
+load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} vmlinuz \
+&& load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} dtbs/${fdtfile} \
+&& load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} initrd.gz \
+&& echo "Booting the Debian installer..." \
+&& bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
diff --git a/build/config/armhf.cfg b/build/config/armhf.cfg
index 681eae2..1332c3a 100644
--- a/build/config/armhf.cfg
+++ b/build/config/armhf.cfg
@@ -1,4 +1,4 @@
-MEDIUM_SUPPORTED = netboot network-console netboot-gtk device-tree
+MEDIUM_SUPPORTED = hd-media netboot network-console netboot-gtk device-tree
 
 MKLIBS = mklibs --ldlib=/lib/ld-linux-armhf.so.3
 
diff --git a/build/config/armhf/hd-media.cfg b/build/config/armhf/hd-media.cfg
new file mode 100644
index 0000000..31d3583
--- /dev/null
+++ b/build/config/armhf/hd-media.cfg
@@ -0,0 +1,30 @@
+FLAVOUR_SUPPORTED = ""
+
+GZIPPED = .gz
+EXTRANAME = hd-media/
+
+TARGET = $(KERNEL) $(INITRD) hd-media_dtbs hd-media_bootscript hd-media_tarball
+
+MANIFEST-INITRD = "Initrd for use on USB memory sticks"
+MANIFEST-KERNEL = "Kernel for use on USB memory sticks"
+
+.PHONY: hd-media_dtbs
+hd-media_dtbs: $(TEMP_DTBS)
+	mkdir -p $(SOME_DEST)/$(EXTRANAME)dtbs
+	set -ex ; for dtb in $(TEMP_DTBS)/*.dtb ; do \
+		tgt=$(SOME_DEST)/$(EXTRANAME)dtbs/$$(basename $$dtb); \
+		cp $$dtb $$tgt ; \
+		update-manifest $$tgt "Device Tree Blob: $$(basename $$dtb)";\
+	done
+	cp boot/README.device-tree $(SOME_DEST)/$(EXTRANAME)dtbs/README
+	update-manifest $(SOME_DEST)/$(EXTRANAME)dtbs/README  "Device Tree Blobs README"
+
+.PHONY: hd-media_bootscript
+hd-media_bootscript:
+	mkimage -T script -A arm -d boot/arm/bootscr.mainline_common $(SOME_DEST)/$(EXTRANAME)boot.scr
+	update-manifest $(SOME_DEST)/$(EXTRANAME)boot.scr "Universal boot script for mainline u-boot (>= v2014.10)"
+
+.PHONY: hd-media_tarball
+hd-media_tarball: $(KERNEL) $(INITRD) hd-media_dtbs hd-media_bootscript
+	tar -C $(SOME_DEST)/$(EXTRANAME) -zcf $(TEMP)/hd-media.tar.gz boot.scr initrd.gz vmlinuz dtbs/
+	mv  $(TEMP)/hd-media.tar.gz $(SOME_DEST)/$(EXTRANAME)
diff --git a/build/pkg-lists/hd-media/armhf.cfg b/build/pkg-lists/hd-media/armhf.cfg
new file mode 100644
index 0000000..deb1d15
--- /dev/null
+++ b/build/pkg-lists/hd-media/armhf.cfg
@@ -0,0 +1,22 @@
+console-setup-pc-ekmap
+
+console-setup-udeb
+kbd-udeb
+bogl-bterm-udeb
+hw-detect
+
+fat-modules-${kernel:Version}
+ext4-modules-${kernel:Version}
+fuse-modules-${kernel:Version}
+isofs-modules-${kernel:Version}
+udf-modules-${kernel:Version}
+
+sata-modules-${kernel:Version}
+pata-modules-${kernel:Version}
+mmc-modules-${kernel:Version}
+usb-modules-${kernel:Version}
+usb-storage-modules-${kernel:Version}
+scsi-core-modules-${kernel:Version}
+scsi-modules-${kernel:Version}
+
+loop-modules-${kernel:Version}
-- 
2.1.1


Reply to: