freedom-maker: port freedom-maker to aramo
This commit is contained in:
parent
6c91649405
commit
05a3f2aa37
9 changed files with 834 additions and 0 deletions
|
|
@ -0,0 +1,164 @@
|
|||
diff --git a/README.md b/README.md
|
||||
index cd1815f..aaa7caa 100644
|
||||
--- a/README.md
|
||||
+++ b/README.md
|
||||
@@ -26,31 +26,32 @@ tweaks, see the *Build Images* section below.
|
||||
|
||||
Freedom-maker supports building for the following targets:
|
||||
|
||||
-
|
||||
-- *a20-olinuxino-lime*: A20 OLinuXino Lime's SD card
|
||||
-- *a20-olinuxino-lime2*: A20 OLinuXino Lime2's SD card
|
||||
-- *a20-olinuxino-micro*: A20 OLinuXino MICRO's SD card
|
||||
-- *amd64*: Disk image for any machine with amd64 architecture
|
||||
-- *arm64*: Disk image for any machine with arm64/aarch64 architecture
|
||||
-- *armhf*: Disk image for any machine with arm32 architecture
|
||||
-- *banana-pro*: Banana Pro's SD card
|
||||
-- *beaglebone*: BeagleBone Black's SD card
|
||||
-- *cubieboard2*: Cubieboard2's SD card
|
||||
-- *cubietruck*: Cubietruck's SD card
|
||||
-- *i386*: Disk image for any machine with i386 architecture
|
||||
-- *lamobo-r1*: Lamobo R1 aka BananaPi Router SD card
|
||||
-- *orange-pi-zero*: Orange Pi Zero's SD card
|
||||
-- *pcduino3*: pcDuino3's SD card
|
||||
-- *pine64-lts*: Pine64 LTS board's SD card
|
||||
-- *pine64-plus*: Pine64+ board's SD card
|
||||
-- *qemu-amd64*: 64-bit image for the Qemu virtualization tool
|
||||
-- *qemu-i386*: 32-bit image for the Qemu virtualization tool
|
||||
-- *raspberry2*: RasbperryPi 2's SD card
|
||||
-- *raspberry3*: RasbperryPi 3's SD card
|
||||
-- *raspberry3-b-plus*: RasbperryPi 3 Model B+'s SD card
|
||||
-- *test*: build virtualbox i386 image and run diagnostics tests on it
|
||||
-- *virtualbox-amd64*: 64-bit image for the VirtualBox virtualization tool
|
||||
-- *virtualbox-i386*: 32-bit image for the VirtualBox virtualization tool
|
||||
+| target | description |
|
||||
+|-----------------------|-------------|
|
||||
+| *a20-olinuxino-lime* | A20 OLinuXino Lime's SD card |
|
||||
+| *a20-olinuxino-lime2* | A20 OLinuXino Lime2's SD card |
|
||||
+| *a20-olinuxino-micro* | A20 OLinuXino MICRO's SD card |
|
||||
+| *amd64* | Disk image for any machine with amd64 architecture |
|
||||
+| *arm64* | Disk image for any machine with arm64/aarch64 architecture |
|
||||
+| *armhf* | Disk image for any machine with arm32 architecture |
|
||||
+| *banana-pro* | Banana Pro's SD card |
|
||||
+| *beaglebone* | BeagleBone Black's SD card |
|
||||
+| *cubieboard2* | Cubieboard2's SD card |
|
||||
+| *cubietruck* | Cubietruck's SD card |
|
||||
+| *i386* | Disk image for any machine with i386 architecture |
|
||||
+| *lamobo-r1* | Lamobo R1 aka BananaPi Router SD card |
|
||||
+| *orange-pi-zero* | Orange Pi Zero's SD card |
|
||||
+| *pcduino3* | pcDuino3's SD card |
|
||||
+| *pine64-lts* | Pine64 LTS board's SD card |
|
||||
+| *pine64-plus* | Pine64+ board's SD card |
|
||||
+| *qemu-amd64* | 64-bit image for the Qemu virtualization tool |
|
||||
+| *qemu-i386* | 32-bit image for the Qemu virtualization tool |
|
||||
+| *raspberry2* | RasbperryPi 2's SD card |
|
||||
+| *raspberry3* | RasbperryPi 3's SD card |
|
||||
+| *raspberry3-b-plus* | RasbperryPi 3 Model B+'s SD card |
|
||||
+| *test* | build virtualbox i386 image and run diagnostics tests on it
|
||||
+| *virtualbox-amd64* | 64-bit image for the VirtualBox virtualization tool |
|
||||
+| *virtualbox-i386* | 32-bit image for the VirtualBox virtualization tool |
|
||||
|
||||
## Running Build
|
||||
|
||||
@@ -72,10 +73,12 @@ Freedom-maker supports building for the following targets:
|
||||
to run "parted".
|
||||
|
||||
```
|
||||
- $ sudo python3 -m freedommaker a20-olinuxino-lime2
|
||||
+ $ sudo python3 -m freedommaker <TARGET>
|
||||
```
|
||||
+ where: <TARGET> is one of the 'Supported Targets' above.
|
||||
+
|
||||
Take a break from your computer - this takes some time. :)
|
||||
-
|
||||
+
|
||||
To see the full list of options read the help-page:
|
||||
```
|
||||
$ python3 -m freedommaker --help
|
||||
@@ -94,25 +97,48 @@ for this task. Otherwise follow the steps:
|
||||
|
||||
A. Unplug your card.
|
||||
|
||||
- B. Run "lsblk -p" to show which storage devices are connected to your system.
|
||||
+ B. Run `lsblk -p` to show which storage devices are connected to your system.
|
||||
+ For example, if your computer has one internal SATA storage device
|
||||
+ (the most common configuration), it will be identified as */dev/sda*;
|
||||
+ and the result may look similar to this:
|
||||
+
|
||||
+ $ lsblk -p
|
||||
+ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||
+ /dev/sda 8:0 0 119.2G 0 disk
|
||||
+ ├─/dev/sda1 8:1 0 2G 0 part /boot
|
||||
+ ├─/dev/sda2 8:2 0 22.5G 0 part /
|
||||
+ └─/dev/sda3 8:3 0 94.8G 0 part /home
|
||||
+
|
||||
+ C. Plug in your SDcard and run `lsblk -p` again. Find the new device and note
|
||||
+ the name. For example, if the SDcard is unformatted (empty), the result may
|
||||
+ look similar to this:
|
||||
+
|
||||
+ $ lsblk -p
|
||||
+ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||
+ /dev/sda 8:0 0 119.2G 0 disk
|
||||
+ ├─/dev/sda1 8:1 0 2G 0 part /boot
|
||||
+ ├─/dev/sda2 8:2 0 22.5G 0 part /
|
||||
+ └─/dev/sda3 8:3 0 94.8G 0 part /home
|
||||
+ /dev/sdb 8:32 1 29.7G 0 disk
|
||||
+
|
||||
+ Or, if the SDcard is already formatted, it may look more like this:
|
||||
+
|
||||
|
||||
- C. Plug your card in and run "lsblk -p" again. Find the new device and note
|
||||
- the name.
|
||||
-
|
||||
$ lsblk -p
|
||||
- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
||||
- /dev/sdg 8:0 1 14.9G 0 disk
|
||||
- /dev/nvme0n1 259:0 0 477G 0 disk
|
||||
- ├─/dev/nvme0n1p1 259:1 0 512M 0 part /boot/efi
|
||||
- ├─/dev/nvme0n1p2 259:2 0 244M 0 part /boot
|
||||
- └─/dev/nvme0n1p3 259:3 0 476.2G 0 part
|
||||
- └─/dev/mapper/nvme0n1p3_crypt 253:0 0 476.2G 0 crypt
|
||||
- ├─/dev/mapper/mjw--t470--vg-root 253:1 0 468.4G 0 lvm /
|
||||
- └─/dev/mapper/mjw--t470--vg-swap_1 253:2 0 7.8G 0 lvm [SWAP]
|
||||
-
|
||||
- D. In the above case, the disk that is newly inserted is available
|
||||
- as */dev/sdg*. You can also verify the size (16 GB in this example).
|
||||
- Carefully note this and use it in the copying step below.
|
||||
+ NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||
+ /dev/sda 8:0 0 119.2G 0 disk
|
||||
+ ├─/dev/sda1 8:1 0 2G 0 part /boot
|
||||
+ ├─/dev/sda2 8:2 0 22.5G 0 part /
|
||||
+ └─/dev/sda3 8:3 0 94.8G 0 part /home
|
||||
+ /dev/sdb 8:32 1 29.7G 0 disk
|
||||
+ ├─/dev/sdb1 8:33 1 100M 0 part
|
||||
+ └─/dev/sdb2 8:36 1 29.6G 0 part
|
||||
+
|
||||
+ D. In the above cases, the newly inserted SDcard is identified
|
||||
+ as */dev/sdb*. To be more certain, you can compare the reported sizes
|
||||
+ (approximately - the SDcard is 30 GB in this example - reported 29.7G).
|
||||
+ Most importantly, */dev/sda*. is usually not the SDcard.
|
||||
+ Carefully note this identifier and use it in the copying step below.
|
||||
|
||||
2. Copy the image to your card. Double check and make sure you don't
|
||||
write to your computer's main storage (such as /dev/sda). Also
|
||||
diff --git a/freedommaker/__main__.py b/freedommaker/__main__.py
|
||||
index 9b883f0..614fd20 100644
|
||||
--- a/freedommaker/__main__.py
|
||||
+++ b/freedommaker/__main__.py
|
||||
@@ -4,7 +4,15 @@
|
||||
Module to provide ability to run this freedommaker package.
|
||||
|
||||
Run the package as:
|
||||
- python3 -m freedommaker
|
||||
+ $ sudo python3 -m freedommaker <TARGET>
|
||||
+where:
|
||||
+ <TARGET> is one of:
|
||||
+ $ grep -r 'machine = ' freedommaker/builders/ | cut -d '=' -f 2
|
||||
+eg:
|
||||
+ $ sudo python3 -m freedommaker a20-olinuxino-lime2
|
||||
+
|
||||
+To see the full list of options read the help-page:
|
||||
+ $ python3 -m freedommaker --help
|
||||
"""
|
||||
|
||||
from .application import Application
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
diff --git a/freedommaker/builder.py b/freedommaker/builder.py
|
||||
index ca998d9..1b051e2 100644
|
||||
--- a/freedommaker/builder.py
|
||||
+++ b/freedommaker/builder.py
|
||||
@@ -8,6 +8,8 @@ import os
|
||||
|
||||
from . import internal, library
|
||||
|
||||
+DISTRO_BRAND = 'Debian'
|
||||
+
|
||||
# initramfs-tools is a dependency for the kernel-image package. However, when
|
||||
# kernel is not installed, as in case of Raspberry Pi image, explicit
|
||||
# dependency is needed.
|
||||
@@ -114,14 +116,15 @@ class ImageBuilder(object): # pylint: disable=too-many-instance-attributes
|
||||
elif 'contrib' in self.release_components:
|
||||
free_tag = 'contrib'
|
||||
else:
|
||||
- free_tag = 'free'
|
||||
+ free_tag = 'libre'
|
||||
else:
|
||||
- free_tag = 'nonfree'
|
||||
+ free_tag = 'libre'
|
||||
|
||||
build_stamp = self.arguments.build_stamp
|
||||
build_stamp = build_stamp + '_' if build_stamp else ''
|
||||
- return 'freedombox-{distribution}-{free_tag}_{build_stamp}{machine}' \
|
||||
+ return '{distro}freedombox-{distribution}-{free_tag}_{build_stamp}_{machine}' \
|
||||
'-{architecture}'.format(
|
||||
+ distro=DISTRO_BRAND.lower() + '-' if DISTRO_BRAND else '',
|
||||
distribution=self.arguments.distribution, free_tag=free_tag,
|
||||
build_stamp=build_stamp, machine=self.machine,
|
||||
architecture=self.architecture)
|
||||
114
helpers/DATA/freedom-maker/0003-trisquelize-documentation.patch
Normal file
114
helpers/DATA/freedom-maker/0003-trisquelize-documentation.patch
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
diff --git a/README.md b/README.md
|
||||
index aaa7caa..293545b 100644
|
||||
--- a/README.md
|
||||
+++ b/README.md
|
||||
@@ -1,7 +1,3 @@
|
||||
-[](https://salsa.debian.org/freedombox-team/freedom-maker/commits/master)
|
||||
-[](https://packages.debian.org/unstable/freedom-maker)
|
||||
-[](https://packages.debian.org/testing/freedom-maker)
|
||||
-
|
||||
# Freedom-Maker: The FreedomBox image builder
|
||||
|
||||
These scripts build FreedomBox-images for various supported hardware
|
||||
@@ -13,9 +9,9 @@ during releases and for advanced users who intend to build their own
|
||||
images. Regular users who wish to turn their devices into
|
||||
FreedomBoxes should instead download the pre-built images.
|
||||
|
||||
-Get a pre-built image via https://freedombox.org/download/. There
|
||||
+Get a pre-built image via https://cdimage.trisquel.info/trisquel-images/. There
|
||||
are images available for all supported target devices. You also find
|
||||
-the setup instructions on the [Wiki](https://wiki.debian.org/FreedomBox/).
|
||||
+the setup instructions on the [Wiki](https://trisquel.info/en/wiki/FreedomBox/).
|
||||
|
||||
If you wish to create your own FreedomBox image, perhaps with some
|
||||
tweaks, see the *Build Images* section below.
|
||||
@@ -24,7 +20,7 @@ tweaks, see the *Build Images* section below.
|
||||
|
||||
## Supported Targets
|
||||
|
||||
-Freedom-maker supports building for the following targets:
|
||||
+Trisquel Freedom-maker supports building for the following targets:
|
||||
|
||||
| target | description |
|
||||
|-----------------------|-------------|
|
||||
@@ -46,25 +42,18 @@ Freedom-maker supports building for the following targets:
|
||||
| *pine64-plus* | Pine64+ board's SD card |
|
||||
| *qemu-amd64* | 64-bit image for the Qemu virtualization tool |
|
||||
| *qemu-i386* | 32-bit image for the Qemu virtualization tool |
|
||||
-| *raspberry2* | RasbperryPi 2's SD card |
|
||||
-| *raspberry3* | RasbperryPi 3's SD card |
|
||||
-| *raspberry3-b-plus* | RasbperryPi 3 Model B+'s SD card |
|
||||
-| *test* | build virtualbox i386 image and run diagnostics tests on it
|
||||
-| *virtualbox-amd64* | 64-bit image for the VirtualBox virtualization tool |
|
||||
-| *virtualbox-i386* | 32-bit image for the VirtualBox virtualization tool |
|
||||
|
||||
## Running Build
|
||||
|
||||
-1. Fetch the git source of freedom-maker:
|
||||
+1. Fetch the 'freedom-maker' source code:
|
||||
```
|
||||
- $ git clone https://salsa.debian.org/freedombox-team/freedom-maker.git
|
||||
+ $ apt source freedom-maker
|
||||
```
|
||||
|
||||
2. Install the required dependencies:
|
||||
```shell
|
||||
$ sudo apt install btrfs-progs debootstrap kpartx parted qemu-user-static qemu-utils sshpass
|
||||
- $ cd freedom-maker
|
||||
- $ sudo apt build-dep .
|
||||
+ $ sudo apt build-dep freedom-maker
|
||||
```
|
||||
|
||||
3. Build images:
|
||||
@@ -73,6 +62,7 @@ Freedom-maker supports building for the following targets:
|
||||
to run "parted".
|
||||
|
||||
```
|
||||
+ $ cd $(find -type d -name 'freedom-maker-*')
|
||||
$ sudo python3 -m freedommaker <TARGET>
|
||||
```
|
||||
where: <TARGET> is one of the 'Supported Targets' above.
|
||||
diff --git a/debian/freedom-maker.1 b/debian/freedom-maker.1
|
||||
index 71a9a9b..58051f3 100644
|
||||
--- a/debian/freedom-maker.1
|
||||
+++ b/debian/freedom-maker.1
|
||||
@@ -51,17 +51,17 @@ Size of the image to build
|
||||
.PP
|
||||
\fB\-\-build\-mirror\fR
|
||||
.RS 4
|
||||
-Debian mirror to use for building
|
||||
+Trisquel mirror to use for building
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-mirror\fR
|
||||
.RS 4
|
||||
-Debian mirror to use in built image
|
||||
+Trisquel mirror to use in built image
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-distribution\fR
|
||||
.RS 4
|
||||
-Debian release to use in built image
|
||||
+Trisquel release to use in built image
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-package\fR
|
||||
@@ -101,7 +101,7 @@ Force rebuild of images even when required image exists
|
||||
.PP
|
||||
\fBtargets\fR
|
||||
.RS 4
|
||||
-Image targets to build\&. Choose one or more of a20\-olinuxino\-lime, a20\-olinuxino\-lime2, a20\-olinuxino\-micro, amd64, arm64, armhf, banana\-pro, beaglebone, cubieboard2, cubietruck, i386, lamobo\-r1, orange\-pi\-zero, pcduino3, pine64\-lts, pine64\-plus, qemu\-amd64, qemu\-i386, raspberry2, raspberry3, raspberry3\-b\-plus, test, virtualbox\-amd64, virtualbox\-i386
|
||||
+Image targets to build\&. Choose one or more of freedommaker, dreamplug, beaglebone, cubieboard2, cubietruck, a20\-olinuxino\-lime, a20\-olinuxino\-lime2, a20\-olinuxino\-micro, i386, amd64, qemu\-i386, qemu\-amd64, pcDuino3
|
||||
.RE
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
@@ -128,8 +128,7 @@ Build a FreedomBox image for the BeagleBone Single Board Computer\&.
|
||||
$ freedommaker a20\-olinuxino\-lime a20\-olinuxino\-lime2
|
||||
a20\-olinuxino\-micro amd64 arm64 armhf banana\-pro beaglebone cubieboard2
|
||||
cubietruck i386 lamobo\-r1 orange\-pi\-zero pcduino3 pine64\-lts pine64\-plus
|
||||
- qemu\-amd64 qemu\-i386 raspberry2 raspberry3 raspberry3\-b\-plus test
|
||||
- virtualbox\-amd64 virtualbox\-i386
|
||||
+ qemu\-amd64 qemu\-i386
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/freedommaker/builder.py b/ffreedommaker/builder.py
|
||||
index 1b051e2..da19bec 100644
|
||||
--- a/freedommaker/builder.py
|
||||
+++ b/freedommaker/builder.py
|
||||
@@ -8,7 +8,7 @@ import os
|
||||
|
||||
from . import internal, library
|
||||
|
||||
-DISTRO_BRAND = 'Debian'
|
||||
+DISTRO_BRAND = 'Trisquel'
|
||||
|
||||
# initramfs-tools is a dependency for the kernel-image package. However, when
|
||||
# kernel is not installed, as in case of Raspberry Pi image, explicit
|
||||
38
helpers/DATA/freedom-maker/0005-trisquelize-code.patch
Normal file
38
helpers/DATA/freedom-maker/0005-trisquelize-code.patch
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
diff --git a/freedommaker/application.py b/freedommaker/application.py
|
||||
index c5175a8..a479721 100644
|
||||
--- a/freedommaker/application.py
|
||||
+++ b/freedommaker/application.py
|
||||
@@ -15,9 +15,9 @@ import freedommaker
|
||||
from .builder import ImageBuilder
|
||||
|
||||
IMAGE_SIZE = '3800M'
|
||||
-BUILD_MIRROR = 'http://deb.debian.org/debian'
|
||||
-MIRROR = 'http://deb.debian.org/debian'
|
||||
-DISTRIBUTION = 'unstable'
|
||||
+BUILD_MIRROR = 'http://archive.trisquel.org/trisquel'
|
||||
+MIRROR = 'http://archive.trisquel.org/trisquel'
|
||||
+DISTRIBUTION = 'aramo'
|
||||
BUILD_DIR = 'build'
|
||||
LOG_LEVEL = 'debug'
|
||||
HOSTNAME = 'freedombox'
|
||||
diff --git a/freedommaker/library.py b/freedommaker/library.py
|
||||
index f8ea629..04954b5 100644
|
||||
--- a/freedommaker/library.py
|
||||
+++ b/freedommaker/library.py
|
||||
@@ -493,12 +493,12 @@ deb {mirror} {distribution}-updates {components}
|
||||
deb-src {mirror} {distribution}-updates {components}
|
||||
'''
|
||||
security_template = '''
|
||||
-deb http://security.debian.org/debian-security/ {distribution}-security {components}
|
||||
-deb-src http://security.debian.org/debian-security/ {distribution}-security {components}
|
||||
+deb {mirror} {distribution}-security {components}
|
||||
+deb-src {mirror} {distribution}-security {components}
|
||||
'''
|
||||
backports_template = f'''
|
||||
-deb http://deb.debian.org/debian {STABLE_CODENAME}-backports main
|
||||
-deb-src http://deb.debian.org/debian {STABLE_CODENAME}-backports main
|
||||
+#deb {mirror} {distribution}-backports {components}
|
||||
+#deb-src {mirror} {distribution}-backports {components}
|
||||
'''
|
||||
file_path = path_in_mount(state, 'etc/apt/sources.list')
|
||||
with open(file_path, 'w') as file_handle:
|
||||
259
helpers/DATA/freedom-maker/0006-remove-nonfree-support.patch
Normal file
259
helpers/DATA/freedom-maker/0006-remove-nonfree-support.patch
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
diff --git a/debian/control b/debian/control
|
||||
index 1f2c207..c97d392 100644
|
||||
--- a/debian/control
|
||||
+++ b/debian/control
|
||||
@@ -42,7 +42,7 @@ Depends:
|
||||
u-boot-tools,
|
||||
xz-utils
|
||||
Suggests:
|
||||
- virtualbox
|
||||
+ debootstrap
|
||||
Description: FreedomBox image builder
|
||||
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
|
||||
--- a/freedommaker/builders/__init__.py
|
||||
+++ b/freedommaker/builders/__init__.py
|
||||
@@ -25,10 +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_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
|
||||
--- a/freedommaker/builders/raspberry_pi_2.py
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build Raspberry Pi 2 image.
|
||||
-"""
|
||||
-
|
||||
-from .raspberry_pi_with_uboot import RaspberryPiWithUBoot
|
||||
-
|
||||
-
|
||||
-class RaspberryPi2ImageBuilder(RaspberryPiWithUBoot):
|
||||
- """Image builder for Raspberry Pi 2 target."""
|
||||
- architecture = 'armhf'
|
||||
- machine = 'raspberry2'
|
||||
- kernel_flavor = 'armmp'
|
||||
- flash_kernel_name = 'Raspberry Pi 2 Model B'
|
||||
- uboot_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
|
||||
--- a/freedommaker/builders/raspberry_pi_3.py
|
||||
+++ /dev/null
|
||||
@@ -1,16 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build Raspberry Pi 3 image.
|
||||
-"""
|
||||
-
|
||||
-from .raspberry_pi_with_uboot import RaspberryPiWithUBoot
|
||||
-
|
||||
-
|
||||
-class RaspberryPi3ImageBuilder(RaspberryPiWithUBoot):
|
||||
- """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
|
||||
deleted file mode 100644
|
||||
index 7a54842..0000000
|
||||
--- a/freedommaker/builders/raspberry_pi_3_b_plus.py
|
||||
+++ /dev/null
|
||||
@@ -1,12 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build Raspberry Pi 3 Model B+ image.
|
||||
-"""
|
||||
-
|
||||
-from .raspberry_pi_3 import RaspberryPi3ImageBuilder
|
||||
-
|
||||
-
|
||||
-class RaspberryPi3BPlusImageBuilder(RaspberryPi3ImageBuilder):
|
||||
- """Image builder for Raspberry Pi 3 Model B+ target."""
|
||||
- machine = 'raspberry3-b-plus'
|
||||
- flash_kernel_name = 'Raspberry Pi 3 Model B+'
|
||||
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
|
||||
--- a/freedommaker/builders/raspberry_pi_with_uboot.py
|
||||
+++ /dev/null
|
||||
@@ -1,44 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Base worker class to build Raspberry Pi 2 and 3 images.
|
||||
-"""
|
||||
-
|
||||
-from .. import library
|
||||
-from .arm import ARMImageBuilder
|
||||
-
|
||||
-
|
||||
-class RaspberryPiWithUBoot(ARMImageBuilder):
|
||||
- """Base image builder for Raspberry Pi 2 and 3 targets."""
|
||||
- free = False
|
||||
- uboot_variant = None
|
||||
- firmware_filesystem_type = 'vfat'
|
||||
- firmware_size = '64MiB'
|
||||
-
|
||||
- def install_boot_loader(self, state):
|
||||
- """Install the boot loader onto the image."""
|
||||
- if not self.uboot_variant:
|
||||
- raise NotImplementedError
|
||||
-
|
||||
- firmware_package = 'raspi-firmware'
|
||||
- script = '''
|
||||
-set -e
|
||||
-set -x
|
||||
-set -o pipefail
|
||||
-
|
||||
-apt-get install --no-install-recommends -y dpkg-dev
|
||||
-cd /tmp
|
||||
-apt-get source {firmware_package}
|
||||
-cp {firmware_package}*/boot/* /boot/firmware
|
||||
-rm -rf {firmware_package}*
|
||||
-cd /
|
||||
-
|
||||
-# remove unneeded firmware files
|
||||
-rm -f /boot/firmware/fixup_*
|
||||
-rm -f /boot/firmware/start_*
|
||||
-
|
||||
-# 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)
|
||||
- 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
|
||||
--- a/freedommaker/builders/vagrant.py
|
||||
+++ /dev/null
|
||||
@@ -1,41 +0,0 @@
|
||||
-# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-"""
|
||||
-Worker class to build Vagrant images.
|
||||
-"""
|
||||
-
|
||||
-import os
|
||||
-
|
||||
-from .. import library
|
||||
-from .virtualbox_amd64 import VirtualBoxAmd64ImageBuilder
|
||||
-
|
||||
-
|
||||
-class VagrantImageBuilder(VirtualBoxAmd64ImageBuilder):
|
||||
- """Image builder for Vagrant package."""
|
||||
- vagrant_extension = '.box'
|
||||
-
|
||||
- @classmethod
|
||||
- def get_target_name(cls):
|
||||
- """Return the name of the target for an image builder."""
|
||||
- return 'vagrant'
|
||||
-
|
||||
- def build(self):
|
||||
- """Run the image building process."""
|
||||
- vm_file = self._replace_extension(self.image_file,
|
||||
- self.vm_image_extension)
|
||||
- vagrant_file = self._replace_extension(self.image_file,
|
||||
- self.vagrant_extension)
|
||||
-
|
||||
- self.make_image()
|
||||
- self.create_vm_file(self.image_file, vm_file)
|
||||
- os.remove(self.image_file)
|
||||
- self.vagrant_package(vm_file, vagrant_file)
|
||||
-
|
||||
- def vagrant_package(self, vm_file, vagrant_file):
|
||||
- """Create a vagrant package from VM file."""
|
||||
- command = [
|
||||
- 'bin/vagrant-package', '--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'
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
diff --git a/freedommaker/tests/test_library.py b/freedommaker/tests/test_library.py
|
||||
index 2cc840a..6e63917 100644
|
||||
--- a/freedommaker/tests/test_library.py
|
||||
+++ b/freedommaker/tests/test_library.py
|
||||
@@ -422,13 +422,13 @@ modify x x
|
||||
@patch('freedommaker.library.run')
|
||||
def test_debootstrap(self, run):
|
||||
"""Test debootstrapping."""
|
||||
- library.debootstrap(self.state, 'i386', 'stretch', 'minbase',
|
||||
- ['main', 'contrib'], ['p1', 'p2'],
|
||||
- 'http://deb.debian.org/debian')
|
||||
+ library.debootstrap(self.state, 'amd64', 'nabia', 'minbase',
|
||||
+ ['main'], ['p1', 'p2'],
|
||||
+ 'http://archive.trisquel.org/trisquel')
|
||||
run.assert_called_with([
|
||||
- 'debootstrap', '--arch=i386', '--variant=minbase',
|
||||
- '--components=main,contrib', '--include=p1,p2', 'stretch',
|
||||
- self.state['mount_point'], 'http://deb.debian.org/debian'
|
||||
+ 'debootstrap', '--arch=amd64', '--variant=minbase',
|
||||
+ '--components=main', '--include=p1,p2', 'nabia',
|
||||
+ self.state['mount_point'], 'http://archive.trisquel.org/trisquel'
|
||||
])
|
||||
|
||||
self.assertEqual(self.state['cleanup'], [[
|
||||
@@ -574,31 +574,37 @@ ff02::2 ip6-allrouters
|
||||
sources_path = self.state['mount_point'] + '/etc/apt/sources.list'
|
||||
|
||||
stable_content = '''
|
||||
-deb http://deb.debian.org/debian stable main
|
||||
-deb-src http://deb.debian.org/debian stable main
|
||||
+deb http://archive.trisquel.org/trisquel nabia main
|
||||
+deb-src http://archive.trisquel.org/trisquel nabia main
|
||||
|
||||
-deb http://deb.debian.org/debian stable-updates main
|
||||
-deb-src http://deb.debian.org/debian stable-updates main
|
||||
+deb http://archive.trisquel.org/trisquel nabia-updates main
|
||||
+deb-src http://archive.trisquel.org/trisquel nabia-updates main
|
||||
|
||||
-deb http://security.debian.org/debian-security/ stable-security main
|
||||
-deb-src http://security.debian.org/debian-security/ stable-security main
|
||||
+deb http://archive.trisquel.org/trisquel nabia-security main
|
||||
+deb-src http://archive.trisquel.org/trisquel nabia-security main
|
||||
'''
|
||||
with self.assert_file_change(sources_path, None, stable_content):
|
||||
- library.setup_apt(self.state, 'http://deb.debian.org/debian',
|
||||
- 'stable', ['main'])
|
||||
+ library.setup_apt(self.state, 'http://archive.trisquel.org/trisquel',
|
||||
+ 'nabia', ['main'])
|
||||
|
||||
self.assertEqual(run.call_args_list, [
|
||||
call(self.state, ['apt-get', 'update']),
|
||||
call(self.state, ['apt-get', 'clean'])
|
||||
])
|
||||
|
||||
- unstable_content = '''
|
||||
-deb http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||
-deb-src http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||
+ aramo_content = '''
|
||||
+deb http://archive.trisquel.org/trisquel aramo main
|
||||
+deb-src http://archive.trisquel.org/trisquel aramo main
|
||||
+
|
||||
+deb http://archive.trisquel.org/trisquel aramo-updates main
|
||||
+deb-src http://archive.trisquel.org/trisquel aramo-updates main
|
||||
+
|
||||
+deb http://archive.trisquel.org/trisquel aramo-security main
|
||||
+deb-src http://archive.trisquel.org/trisquel aramo-security main
|
||||
'''
|
||||
- with self.assert_file_change(sources_path, None, unstable_content):
|
||||
- library.setup_apt(self.state, 'http://ftp.us.debian.org/debian',
|
||||
- 'unstable', ['main', 'contrib', 'non-free'])
|
||||
+ with self.assert_file_change(sources_path, None, aramo_content):
|
||||
+ library.setup_apt(self.state, 'http://archive.trisquel.org/trisquel',
|
||||
+ 'aramo', ['main'])
|
||||
|
||||
@patch('freedommaker.library.run_in_chroot')
|
||||
def test_setup_flash_kernel(self, run):
|
||||
105
helpers/DATA/freedom-maker/0008-specify-generic-kernels.patch
Normal file
105
helpers/DATA/freedom-maker/0008-specify-generic-kernels.patch
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
diff --git a/freedommaker/builders/a20.py b/ffreedommaker/builders/a20.py
|
||||
index ff7f807..ad94e1c 100644
|
||||
--- a/freedommaker/builders/a20.py
|
||||
+++ b/ffreedommaker/builders/a20.py
|
||||
@@ -10,7 +10,7 @@ from .arm import ARMImageBuilder
|
||||
class A20ImageBuilder(ARMImageBuilder):
|
||||
"""Base image builder for all Allwinner A20 board based targets."""
|
||||
architecture = 'armhf'
|
||||
- kernel_flavor = 'armmp-lpae'
|
||||
+ kernel_flavor = 'generic'
|
||||
u_boot_path = None
|
||||
|
||||
def install_boot_loader(self, state):
|
||||
diff --git a/freedommaker/builders/a64.py b/ffreedommaker/builders/a64.py
|
||||
index 7314724..21f3ae1 100644
|
||||
--- a/freedommaker/builders/a64.py
|
||||
+++ b/ffreedommaker/builders/a64.py
|
||||
@@ -12,7 +12,7 @@ from .arm import ARMImageBuilder
|
||||
class A64ImageBuilder(ARMImageBuilder):
|
||||
"""Image builder for all Allwinner A64 board targets."""
|
||||
architecture = 'arm64'
|
||||
- kernel_flavor = 'arm64'
|
||||
+ kernel_flavor = 'generic'
|
||||
u_boot_target = None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
diff --git a/freedommaker/builders/amd64.py b/ffreedommaker/builders/amd64.py
|
||||
index d577ece..1b758f8 100644
|
||||
--- a/freedommaker/builders/amd64.py
|
||||
+++ b/ffreedommaker/builders/amd64.py
|
||||
@@ -9,4 +9,4 @@ from .amd_intel import AMDIntelImageBuilder
|
||||
class AMD64ImageBuilder(AMDIntelImageBuilder):
|
||||
"""Image builder for all amd64 targets."""
|
||||
architecture = 'amd64'
|
||||
- kernel_flavor = 'amd64'
|
||||
+ kernel_flavor = 'generic'
|
||||
diff --git a/freedommaker/builders/arm64.py b/ffreedommaker/builders/arm64.py
|
||||
index 4576d3e..fc593f9 100644
|
||||
--- a/freedommaker/builders/arm64.py
|
||||
+++ b/ffreedommaker/builders/arm64.py
|
||||
@@ -9,7 +9,7 @@ from .arm_efi import ARMEFIImageBuilder
|
||||
class ARM64ImageBuilder(ARMEFIImageBuilder):
|
||||
"""Image builder a universal ARM64 images using UEFI."""
|
||||
architecture = 'arm64'
|
||||
- kernel_flavor = 'arm64'
|
||||
+ kernel_flavor = 'generic'
|
||||
efi_architecture = 'aa64'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
diff --git a/freedommaker/builders/armhf.py b/ffreedommaker/builders/armhf.py
|
||||
index 6571c8a..6fba0a2 100644
|
||||
--- a/freedommaker/builders/armhf.py
|
||||
+++ b/ffreedommaker/builders/armhf.py
|
||||
@@ -9,7 +9,7 @@ from .arm_efi import ARMEFIImageBuilder
|
||||
class ARMHFImageBuilder(ARMEFIImageBuilder):
|
||||
"""Image builder a universal ARM32 images using UEFI."""
|
||||
architecture = 'armhf'
|
||||
- kernel_flavor = 'armmp-lpae'
|
||||
+ kernel_flavor = 'generic'
|
||||
efi_architecture = 'arm'
|
||||
grub_target = 'arm-efi'
|
||||
|
||||
diff --git a/freedommaker/builders/beaglebone.py b/ffreedommaker/builders/beaglebone.py
|
||||
index 13c0c48..0dcaddc 100644
|
||||
--- a/freedommaker/builders/beaglebone.py
|
||||
+++ b/ffreedommaker/builders/beaglebone.py
|
||||
@@ -11,7 +11,7 @@ class BeagleBoneImageBuilder(ARMImageBuilder):
|
||||
"""Image builder for BeagleBone target."""
|
||||
architecture = 'armhf'
|
||||
machine = 'beaglebone'
|
||||
- kernel_flavor = 'armmp'
|
||||
+ kernel_flavor = 'generic'
|
||||
flash_kernel_name = 'TI AM335x BeagleBone Black'
|
||||
flash_kernel_options = 'console=ttyO0'
|
||||
|
||||
diff --git a/freedommaker/builders/i386.py b/ffreedommaker/builders/i386.py
|
||||
index 98a48da..692122d 100644
|
||||
--- a/freedommaker/builders/i386.py
|
||||
+++ b/ffreedommaker/builders/i386.py
|
||||
@@ -9,4 +9,4 @@ from .amd_intel import AMDIntelImageBuilder
|
||||
class I386ImageBuilder(AMDIntelImageBuilder):
|
||||
"""Image builder for all i386 targets."""
|
||||
architecture = 'i386'
|
||||
- kernel_flavor = '686'
|
||||
+ kernel_flavor = 'generic'
|
||||
diff --git a/freedommaker/builders/qemu_amd64.py b/ffreedommaker/builders/qemu_amd64.py
|
||||
index bb28f0a..61e5863 100644
|
||||
--- a/freedommaker/builders/qemu_amd64.py
|
||||
+++ b/ffreedommaker/builders/qemu_amd64.py
|
||||
@@ -9,4 +9,4 @@ from .qemu import QemuImageBuilder
|
||||
class QemuAmd64ImageBuilder(QemuImageBuilder):
|
||||
"""Image builder for all Qemu amd64 targets."""
|
||||
architecture = 'amd64'
|
||||
- kernel_flavor = 'amd64'
|
||||
+ kernel_flavor = 'generic'
|
||||
diff --git a/freedommaker/builders/qemu_i386.py b/ffreedommaker/builders/qemu_i386.py
|
||||
index ea9646a..e3bbda5 100644
|
||||
--- a/freedommaker/builders/qemu_i386.py
|
||||
+++ b/ffreedommaker/builders/qemu_i386.py
|
||||
@@ -9,4 +9,4 @@ from .qemu import QemuImageBuilder
|
||||
class QemuI386ImageBuilder(QemuImageBuilder):
|
||||
"""Image builder for all Qemu i386 targets."""
|
||||
architecture = 'i386'
|
||||
- kernel_flavor = '686'
|
||||
+ kernel_flavor = 'generic'
|
||||
33
helpers/make-freedom-maker
Normal file
33
helpers/make-freedom-maker
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
# trisquel package helper for 'freedom-maker'
|
||||
#
|
||||
# Copyright (C) 2022 bill-auger <bill-auger@programmer.net>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
VERSION=1
|
||||
|
||||
. ./config
|
||||
|
||||
for patch in $(ls -v ${DATA}/*.patch)
|
||||
do
|
||||
echo "Applying $patch"
|
||||
patch -Np1 < $patch
|
||||
done
|
||||
|
||||
changelog "Build from Trisquel repos - Delete support for non-free hardware and emulators"
|
||||
|
||||
compile
|
||||
Loading…
Add table
Add a link
Reference in a new issue