freedom-maker: update patches for newer release
This commit is contained in:
parent
fe099af6d1
commit
19cdc0e545
8 changed files with 284 additions and 270 deletions
|
|
@ -12,23 +12,24 @@ index 1f2c207..c97d392 100644
|
|||
FreedomBox is a personal cloud server which can be installed on single board
|
||||
computers and Debian machines.
|
||||
diff --git a/freedommaker/builders/__init__.py b/freedommaker/builders/__init__.py
|
||||
index dd694f3..139c654 100644
|
||||
index 56c180db..139c6541 100644
|
||||
--- a/freedommaker/builders/__init__.py
|
||||
+++ b/freedommaker/builders/__init__.py
|
||||
@@ -25,10 +25,3 @@ from . import pine64_plus
|
||||
@@ -25,11 +25,3 @@ from . import pine64_plus
|
||||
from . import pine64_lts
|
||||
from . import qemu_amd64
|
||||
from . import qemu_i386
|
||||
-from . import raspberry_pi_2
|
||||
-from . import raspberry_pi_3
|
||||
-from . import raspberry_pi_3_b_plus
|
||||
-from . import raspberry_pi_64bit
|
||||
-from . import raspberry_pi_with_uboot
|
||||
-from . import vagrant
|
||||
-from . import virtualbox_amd64
|
||||
-from . import virtualbox_i386
|
||||
diff --git a/freedommaker/builders/raspberry_pi_2.py b/freedommaker/builders/raspberry_pi_2.py
|
||||
deleted file mode 100644
|
||||
index c226683..0000000
|
||||
index 439444e7..00000000
|
||||
--- a/freedommaker/builders/raspberry_pi_2.py
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
|
|
@ -46,13 +47,13 @@ index c226683..0000000
|
|||
- machine = 'raspberry2'
|
||||
- kernel_flavor = 'armmp'
|
||||
- flash_kernel_name = 'Raspberry Pi 2 Model B'
|
||||
- uboot_variant = 'rpi_2'
|
||||
- u_boot_rpi_variant = 'rpi_2'
|
||||
diff --git a/freedommaker/builders/raspberry_pi_3.py b/freedommaker/builders/raspberry_pi_3.py
|
||||
deleted file mode 100644
|
||||
index 797e8df..0000000
|
||||
index 3b9bf82b..00000000
|
||||
--- a/freedommaker/builders/raspberry_pi_3.py
|
||||
+++ /dev/null
|
||||
@@ -1,16 +0,0 @@
|
||||
@@ -1,15 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build Raspberry Pi 3 image.
|
||||
|
|
@ -65,34 +66,67 @@ index 797e8df..0000000
|
|||
- """Image builder for Raspberry Pi 3 target."""
|
||||
- architecture = 'armhf'
|
||||
- machine = 'raspberry3'
|
||||
- free = False
|
||||
- kernel_flavor = 'armmp'
|
||||
- flash_kernel_name = 'Raspberry Pi 3 Model B'
|
||||
- uboot_variant = 'rpi_3_32b'
|
||||
diff --git a/freedommaker/builders/raspberry_pi_3_b_plus.py b/freedommaker/builders/raspberry_pi_3_b_plus.py
|
||||
- u_boot_rpi_variant = 'rpi_3_32b'
|
||||
diff --git a/freedommaker/builders/raspberry_pi_64bit.py b/freedommaker/builders/raspberry_pi_64bit.py
|
||||
deleted file mode 100644
|
||||
index 7a54842..0000000
|
||||
--- a/freedommaker/builders/raspberry_pi_3_b_plus.py
|
||||
index e6a9ffa0..00000000
|
||||
--- a/freedommaker/builders/raspberry_pi_64bit.py
|
||||
+++ /dev/null
|
||||
@@ -1,12 +0,0 @@
|
||||
@@ -1,46 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build Raspberry Pi 3 Model B+ image.
|
||||
-Worker class to build Raspberry Pi 64-bit image.
|
||||
-"""
|
||||
-
|
||||
-from .raspberry_pi_3 import RaspberryPi3ImageBuilder
|
||||
-from .. import library
|
||||
-from ..builder import ImageBuilder
|
||||
-
|
||||
-
|
||||
-class RaspberryPi3BPlusImageBuilder(RaspberryPi3ImageBuilder):
|
||||
- """Image builder for Raspberry Pi 3 Model B+ target."""
|
||||
- machine = 'raspberry3-b-plus'
|
||||
- flash_kernel_name = 'Raspberry Pi 3 Model B+'
|
||||
-class RaspberryPi64ImageBuilder(ImageBuilder):
|
||||
- """Image builder for Raspberry Pi 64-bit target."""
|
||||
- architecture = 'arm64'
|
||||
- boot_loader = None
|
||||
- firmware_filesystem_type = 'vfat'
|
||||
- firmware_size = '256MiB'
|
||||
- include_non_free_firmware = True
|
||||
- kernel_flavor = 'arm64'
|
||||
- machine = 'raspberry64'
|
||||
- update_initramfs = False
|
||||
-
|
||||
- def __init__(self, arguments):
|
||||
- """Add to list of packages."""
|
||||
- super().__init__(arguments)
|
||||
- self.packages += ['firmware-brcm80211']
|
||||
-
|
||||
- @classmethod
|
||||
- def get_target_name(cls):
|
||||
- """Return the name of the target for an image builder."""
|
||||
- return getattr(cls, 'machine', None)
|
||||
-
|
||||
- def install_boot_loader(self, state):
|
||||
- """Install the firmware onto the image."""
|
||||
- uuid = library.get_uuid_of_device(state['devices']['root'])
|
||||
- script = '''
|
||||
-set -e
|
||||
-set -x
|
||||
-set -o pipefail
|
||||
-
|
||||
-# This will trigger installing firmware and updating initramfs.
|
||||
-apt-get install raspi-firmware
|
||||
-
|
||||
-# Fixup cmdline.txt and set defaults
|
||||
-echo "console=tty0 console=ttyS1,115200 root=UUID={uuid} rw fsck.repair=yes net.ifnames=0 rootwait" >/boot/firmware/cmdline.txt
|
||||
-sed -i 's/^#ROOTPART=.*/ROOTPART=UUID={uuid}/' /etc/default/raspi-firmware
|
||||
-'''.format(uuid=uuid)
|
||||
- library.run_in_chroot(state, ['bash', '-c', script])
|
||||
diff --git a/freedommaker/builders/raspberry_pi_with_uboot.py b/freedommaker/builders/raspberry_pi_with_uboot.py
|
||||
deleted file mode 100644
|
||||
index 8057f87..0000000
|
||||
index c4be09cd..00000000
|
||||
--- a/freedommaker/builders/raspberry_pi_with_uboot.py
|
||||
+++ /dev/null
|
||||
@@ -1,44 +0,0 @@
|
||||
@@ -1,46 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Base worker class to build Raspberry Pi 2 and 3 images.
|
||||
|
|
@ -104,14 +138,15 @@ index 8057f87..0000000
|
|||
-
|
||||
-class RaspberryPiWithUBoot(ARMImageBuilder):
|
||||
- """Base image builder for Raspberry Pi 2 and 3 targets."""
|
||||
- free = False
|
||||
- include_non_free_firmware = True
|
||||
- uboot_variant = None
|
||||
- firmware_filesystem_type = 'vfat'
|
||||
- firmware_size = '64MiB'
|
||||
- firmware_size = '256MiB'
|
||||
- u_boot_variant = 'rpi'
|
||||
-
|
||||
- def install_boot_loader(self, state):
|
||||
- """Install the boot loader onto the image."""
|
||||
- if not self.uboot_variant:
|
||||
- if not self.u_boot_rpi_variant:
|
||||
- raise NotImplementedError
|
||||
-
|
||||
- firmware_package = 'raspi-firmware'
|
||||
|
|
@ -133,29 +168,35 @@ index 8057f87..0000000
|
|||
-
|
||||
-# u-boot setup
|
||||
-apt-get install -y u-boot-rpi
|
||||
-cp /usr/lib/u-boot/{uboot_variant}/u-boot.bin /boot/firmware/kernel.img
|
||||
-cp /usr/lib/u-boot/{uboot_variant}/u-boot.bin /boot/firmware/kernel7.img
|
||||
-'''.format(firmware_package=firmware_package, uboot_variant=self.uboot_variant)
|
||||
-cp /usr/lib/u-boot/{u_boot_rpi_variant}/u-boot.bin /boot/firmware/kernel.img
|
||||
-cp /usr/lib/u-boot/{u_boot_rpi_variant}/u-boot.bin /boot/firmware/kernel7.img
|
||||
-'''.format(firmware_package=firmware_package,
|
||||
- u_boot_rpi_variant=self.u_boot_rpi_variant)
|
||||
- library.run_in_chroot(state, ['bash', '-c', script])
|
||||
diff --git a/freedommaker/builders/vagrant.py b/freedommaker/builders/vagrant.py
|
||||
deleted file mode 100644
|
||||
index 13d124d..0000000
|
||||
index 30df772b..00000000
|
||||
--- a/freedommaker/builders/vagrant.py
|
||||
+++ /dev/null
|
||||
@@ -1,41 +0,0 @@
|
||||
@@ -1,56 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build Vagrant images.
|
||||
-"""
|
||||
-
|
||||
-import logging
|
||||
-import os
|
||||
-import subprocess
|
||||
-
|
||||
-from .. import library
|
||||
-from .virtualbox_amd64 import VirtualBoxAmd64ImageBuilder
|
||||
-
|
||||
-logger = logging.getLogger(__name__)
|
||||
-
|
||||
-
|
||||
-class VagrantImageBuilder(VirtualBoxAmd64ImageBuilder):
|
||||
- """Image builder for Vagrant package."""
|
||||
- include_contrib = True
|
||||
- vagrant_extension = '.box'
|
||||
-
|
||||
- @classmethod
|
||||
|
|
@ -174,86 +215,23 @@ index 13d124d..0000000
|
|||
- self.create_vm_file(self.image_file, vm_file)
|
||||
- os.remove(self.image_file)
|
||||
- self.vagrant_package(vm_file, vagrant_file)
|
||||
- self.store_hash(vagrant_file)
|
||||
-
|
||||
- def vagrant_package(self, vm_file, vagrant_file):
|
||||
- """Create a vagrant package from VM file."""
|
||||
- command = [
|
||||
- 'bin/vagrant-package', '--distribution',
|
||||
- 'freedommaker/vagrant_package.py', '--distribution',
|
||||
- self.arguments.distribution, '--release-components'
|
||||
- ]
|
||||
- command.extend(self.release_components)
|
||||
- command += ['--output', vagrant_file, vm_file]
|
||||
- library.run(command)
|
||||
diff --git a/freedommaker/builders/virtualbox.py b/freedommaker/builders/virtualbox.py
|
||||
deleted file mode 100644
|
||||
index 73c1965..0000000
|
||||
--- a/freedommaker/builders/virtualbox.py
|
||||
+++ /dev/null
|
||||
@@ -1,31 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Base worker class to build VirtualBox images.
|
||||
-"""
|
||||
-
|
||||
-import os
|
||||
-
|
||||
-from .. import library
|
||||
-from .vm import VMImageBuilder
|
||||
-
|
||||
-
|
||||
-class VirtualBoxImageBuilder(VMImageBuilder):
|
||||
- """Base image builder for all VirtualBox targets."""
|
||||
- vm_image_extension = '.vdi'
|
||||
-
|
||||
- @classmethod
|
||||
- def get_target_name(cls):
|
||||
- """Return the name of the target for an image builder."""
|
||||
- if getattr(cls, 'architecture', None):
|
||||
- return 'virtualbox-' + cls.architecture
|
||||
-
|
||||
- return None
|
||||
-
|
||||
- def create_vm_file(self, image_file, vm_file):
|
||||
- """Create a VM file from image file."""
|
||||
- try:
|
||||
- os.remove(vm_file)
|
||||
- except FileNotFoundError:
|
||||
- pass
|
||||
-
|
||||
- library.run(['VBoxManage', 'convertdd', image_file, vm_file])
|
||||
diff --git a/freedommaker/builders/virtualbox_amd64.py b/freedommaker/builders/virtualbox_amd64.py
|
||||
deleted file mode 100644
|
||||
index 20108d6..0000000
|
||||
--- a/freedommaker/builders/virtualbox_amd64.py
|
||||
+++ /dev/null
|
||||
@@ -1,12 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build VirtualBox amd64 images.
|
||||
-"""
|
||||
-
|
||||
-from .virtualbox import VirtualBoxImageBuilder
|
||||
-
|
||||
-
|
||||
-class VirtualBoxAmd64ImageBuilder(VirtualBoxImageBuilder):
|
||||
- """Image builder for all VirtualBox amd64 targets."""
|
||||
- architecture = 'amd64'
|
||||
- kernel_flavor = 'amd64'
|
||||
diff --git a/freedommaker/builders/virtualbox_i386.py b/freedommaker/builders/virtualbox_i386.py
|
||||
deleted file mode 100644
|
||||
index 9380a6a..0000000
|
||||
--- a/freedommaker/builders/virtualbox_i386.py
|
||||
+++ /dev/null
|
||||
@@ -1,12 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build VirtualBox i386 images.
|
||||
-"""
|
||||
-
|
||||
-from .virtualbox import VirtualBoxImageBuilder
|
||||
-
|
||||
-
|
||||
-class VirtualBoxI386ImageBuilder(VirtualBoxImageBuilder):
|
||||
- """Image builder for all VirtualBox i386 targets."""
|
||||
- architecture = 'i386'
|
||||
- kernel_flavor = '686'
|
||||
- def store_hash(self, vagrant_file):
|
||||
- """Store the SHA-256 hash of the vagrant box file."""
|
||||
- output = subprocess.check_output(['sha256sum', vagrant_file])
|
||||
- result = output.decode()
|
||||
- logger.info('sha256sum: %s', result)
|
||||
- hash_filename = self._replace_extension(vagrant_file, '.sha256')
|
||||
- with open(hash_filename, 'w') as hash_file:
|
||||
- hash_file.write(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue