[Vmdebootstrap-devel] Bug#845526: [PATCH] Allow users to specify the boot directory path
Petter Reinholdtsen
pere at hungry.com
Thu Sep 21 07:37:40 UTC 2017
[Lars Wirzenius]
> I'm afraid I don't think this feature will ever land in vmdebootstrap.
> Let me explain.
I sure understand your point of view, and unwillingness to keep working on
vmdeboostrap when you want users to switch to vmdb2, and the problems it
causes for testing the program, but keep in mind that the changes we talk
about here are very small and will have great impact.
The patches in bugs #845526 (52 line diff) and #845439 (30 line diff) will
transform Debian from being a platform _unable_ to create boot images
for one of most popular hobbyist computers (Raspberry Pi), to becoming
a platform where it is possible to create fully working SD card images
for Raspberry Pi 3. It will open up a huge user segment for Debian that
is currently mostly handled by Raspian, for the many million Raspberry Pi
units sold all over the world.
The changes needed for Raspberry Pi 3 support are very small, and as far
as I can tell make perfect sense:
diff -ur vmdebootstrap-1.8/bin/vmdebootstrap vmdebootstrap-1.8-pere/bin/vmdebootstrap
--- vmdebootstrap-1.8/bin/vmdebootstrap 2017-09-17 16:02:13.000000000 +0200
+++ vmdebootstrap-1.8-pere/bin/vmdebootstrap 2017-09-21 09:25:19.078153178 +0200
@@ -78,6 +78,7 @@
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(['bootdir'], 'Mount point of /boot partition', default='/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 @@
elif bootdev:
boottype = self.settings['boottype']
filesystem.mkfs(bootdev, fstype=boottype)
- self.bootdir = '%s/%s' % (rootdir, 'boot/')
+ self.bootdir = '%s/%s' % (rootdir, self.settings['bootdir'])
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 -ur vmdebootstrap-1.8/doc/overview.rst vmdebootstrap-1.8-pere/doc/overview.rst
--- vmdebootstrap-1.8/doc/overview.rst 2017-09-17 16:02:13.000000000 +0200
+++ vmdebootstrap-1.8-pere/doc/overview.rst 2017-09-21 09:25:19.082153224 +0200
@@ -107,6 +107,8 @@
--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
+ --bootdir=PATH Mount point of /boot partition.
+ Default is ``/boot/``.
--roottype=FSTYPE Filesystem to use for the / (root) partition. (default ext4)
--part-type=PART-TYPE
Partition type to use for this image. (default msdos)
diff -ur vmdebootstrap-1.8/man/overview.rst vmdebootstrap-1.8-pere/man/overview.rst
--- vmdebootstrap-1.8/man/overview.rst 2017-09-17 16:02:13.000000000 +0200
+++ vmdebootstrap-1.8-pere/man/overview.rst 2017-09-21 09:25:19.082153224 +0200
@@ -107,6 +107,8 @@
--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
+ --bootdir=PATH Mount point of /boot partition.
+ Default is ``/boot/``.
--roottype=FSTYPE Filesystem to use for the / (root) partition. (default ext4)
--part-type=PART-TYPE
Partition type to use for this image. (default msdos)
diff -ur vmdebootstrap-1.8/vmdebootstrap/constants.py vmdebootstrap-1.8-pere/vmdebootstrap/constants.py
--- vmdebootstrap-1.8/vmdebootstrap/constants.py 2017-09-17 16:02:13.000000000 +0200
+++ vmdebootstrap-1.8-pere/vmdebootstrap/constants.py 2017-09-21 09:25:47.482484574 +0200
@@ -46,7 +46,7 @@
'package': 'grub-efi-arm64',
'bin_package': 'grub-efi-arm64-bin',
'extra': None,
- 'exclusive': True,
+ 'exclusive': False,
'target': 'arm64-efi',
}
}
diff -ur vmdebootstrap-1.8/vmdebootstrap/filesystem.py vmdebootstrap-1.8-pere/vmdebootstrap/filesystem.py
--- vmdebootstrap-1.8/vmdebootstrap/filesystem.py 2017-09-17 16:02:13.000000000 +0200
+++ vmdebootstrap-1.8-pere/vmdebootstrap/filesystem.py 2017-09-21 09:25:19.086153271 +0200
@@ -171,8 +171,8 @@
fstab.write('%s / %s %s 0 1\n' %
(rootdevstr, roottype, self.get_mount_flags(roottype)))
if bootdevstr:
- fstab.write('%s /boot %s %s 0 2\n' %
- (bootdevstr, boottype, self.get_mount_flags(boottype)))
+ fstab.write('%s %s %s %s 0 2\n' %
+ (bootdevstr, self.settings['bootdir'], boottype, self.get_mount_flags(boottype)))
if self.settings['swap'] > 0:
fstab.write("/dev/sda3 swap swap defaults 0 0\n")
elif self.settings['swap'] > 0:
Is there something, like testing, we can do to make you less sceptical?
Please reconsider.
--
Happy hacking
Petter Reinholdtsen
More information about the Vmdebootstrap-devel
mailing list