Package: vmdebootstrap
Version: 1.7-1
Severity: wishlist
Tags: patch

Since dpkg-managed files cannot be placed on a FAT32 file system¹, it is
beneficial for platforms such as the Raspberry Pi 3 to mount the FAT32
boot partition of the image in /boot/firmware instead of /boot, and have
maintainer scripts/hooks manage the files in /boot/firmware.

The attached patch adds the --bootdirfmt setting, which can be changed
from its default value %s/boot/ to e.g. %s/boot/firmware/.

Please consider merging the attached patch. Thank you!

â‘  
https://wiki.debian.org/Teams/Dpkg/FAQ#Q:_What_are_the_filesystem_requirements_by_dpkg.3F

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armel, mipsel

Kernel: Linux 4.6.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages vmdebootstrap depends on:
ii  debootstrap         1.0.81
ii  kpartx              0.6.2-2
ii  libjs-sphinxdoc     1.4.8-1
ii  parted              3.2-15
ii  python-cliapp       1.20160724-1
ii  python-distro-info  0.14
ii  python2.7           2.7.12-2
pn  python:any          <none>
ii  qemu-utils          1:2.7+dfsg-3+b1

Versions of packages vmdebootstrap recommends:
ii  dosfstools        4.0-2
pn  extlinux          <none>
ii  grub2-common      2.02~beta2-36
pn  python-guestfs    <none>
pn  qemu-system       <none>
ii  qemu-user-static  1:2.7+dfsg-3+b1
pn  squashfs-tools    <none>

Versions of packages vmdebootstrap suggests:
pn  cmdtest       <none>
pn  mbr           <none>
pn  pandoc        <none>
pn  u-boot:armhf  <none>

-- no debconf information
>From 91b05c115580020f916d80438b9bc987f55f69d3 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <stapelb...@debian.org>
Date: Thu, 24 Nov 2016 10:34:15 +0100
Subject: [PATCH] Allow users to specify the boot directory path

---
 bin/vmdebootstrap | 5 +++--
 doc/overview.rst  | 6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap
index d9a697d..654588e 100755
--- a/bin/vmdebootstrap
+++ b/bin/vmdebootstrap
@@ -78,6 +78,7 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
         self.settings.string(['bootflag'], 'specify flag to set for /boot/', default='')
         self.settings.bytesize(['bootoffset'], 'Space to leave at start of the '
                                'image for bootloader', default='0')
+        self.settings.string(['bootdirfmt'], 'Format string for determining the path to /boot', default='%s/boot/')
         self.settings.boolean(['use-uefi'], 'Setup image for UEFI boot', default=False)
         self.settings.bytesize(['esp-size'], 'Size of EFI System Partition - '
                                'requires use-uefi', default='5mib')
@@ -248,9 +249,9 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
         elif bootdev:
             boottype = self.settings['boottype']
             filesystem.mkfs(bootdev, fstype=boottype)
-            self.bootdir = '%s/%s' % (rootdir, 'boot/')
+            self.bootdir = self.settings['bootdirfmt'] % rootdir
             filesystem.devices['bootdir'] = self.bootdir
-            os.mkdir(self.bootdir)
+            os.makedirs(self.bootdir)
             self.mount(bootdev, self.bootdir)
 
         # set user-specified flags, e.g. lba
diff --git a/doc/overview.rst b/doc/overview.rst
index 43693f2..5248a5c 100644
--- a/doc/overview.rst
+++ b/doc/overview.rst
@@ -107,6 +107,12 @@ Options
  --boottype=FSTYPE     Filesystem to use for the /boot partition. (default ext2)
  --bootflag=FLAG       Flag to set on the first partition. (default none)
  --bootoffset=SIZE     Space to leave at start of the image for bootloader
+ --bootdirfmt=FORMAT   Format string for determining the path to /boot.
+                       Default is ``%s/boot/``. To mount the boot partition
+                       at ``/boot/firmware/`` (e.g. for the Raspberry Pi), use::
+
+                        "%s/boot/firmware"
+
  --roottype=FSTYPE     Filesystem to use for the / (root) partition. (default ext4)
  --part-type=PART-TYPE
                        Partition type to use for this image. (default msdos)
-- 
2.9.3

Reply via email to