mirror of
https://github.com/jon4hz/debian-live-builder-vagrant.git
synced 2025-12-20 00:26:34 +01:00
upgrade to debian 12 (bookworm)
This commit is contained in:
28
README.md
28
README.md
@@ -4,11 +4,23 @@ This is a [Vagrant](https://www.vagrantup.com/) Environment for creating custom
|
||||
|
||||
Install the [Base Debian Vagrant Box](https://github.com/rgl/debian-vagrant).
|
||||
|
||||
Run `vagrant up builder --no-destroy-on-error` to launch the debian live builder. This will build the ISO image and copy it to the current directory as `live-image-amd64.hybrid.iso`.
|
||||
Launch the debian live builder, this will build the ISO image and copy it to the current directory as `live-image-amd64.hybrid.iso`:
|
||||
|
||||
Run `vagrant up bios` to boot the generated ISO in [BIOS](https://en.wikipedia.org/wiki/BIOS) mode.
|
||||
```bash
|
||||
vagrant up builder --no-destroy-on-error
|
||||
```
|
||||
|
||||
Run `vagrant up efi` to boot the generated ISO in [EFI](https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface) mode.
|
||||
Boot the generated ISO in [BIOS](https://en.wikipedia.org/wiki/BIOS) mode:
|
||||
|
||||
```bash
|
||||
vagrant up bios --no-destroy-on-error
|
||||
```
|
||||
|
||||
Boot the generated ISO in [EFI](https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface) mode:
|
||||
|
||||
```bash
|
||||
vagrant up efi --no-destroy-on-error
|
||||
```
|
||||
|
||||
To build a netboot image, set the `LB_BUILD_TYPE` environment variable to `netboot` before launching vagrant, e.g. `LB_BUILD_TYPE=netboot vagrant up builder`. This will build the netboot image and copy it to the current directory as `live-image-amd64.netboot.tar`.
|
||||
|
||||
@@ -47,7 +59,7 @@ The arm64 architecture image can be executed in an emulated virtual machine as:
|
||||
# virtio-gpu-pci and serial0 console.
|
||||
mkdir tmp
|
||||
cd tmp
|
||||
sudo apt-get install -y qemu-efi-aarch64 cloud-image-utils
|
||||
sudo apt-get install -y qemu-system-arm qemu-efi-aarch64 cloud-image-utils
|
||||
cat >cloud-init-user-data.yml <<EOF
|
||||
#cloud-config
|
||||
hostname: arm64
|
||||
@@ -96,10 +108,10 @@ ssh vagrant@localhost -p 2222
|
||||
# Reference
|
||||
|
||||
* [Live Systems Manual](https://live-team.pages.debian.net/live-manual/html/live-manual/index.en.html)
|
||||
* [lb(1)](https://manpages.debian.org/bullseye/live-build/lb.1.en.html)
|
||||
* [live-build(7)](https://manpages.debian.org/bullseye/live-build/live-build.7.en.html)
|
||||
* [lb_config(1)](https://manpages.debian.org/bullseye/live-build/lb_config.1.en.html)
|
||||
* [initramfs-tools(7)](https://manpages.debian.org/bullseye/initramfs-tools-core/initramfs-tools.7.en.html)
|
||||
* [lb(1)](https://manpages.debian.org/bookworm/live-build/lb.1.en.html)
|
||||
* [live-build(7)](https://manpages.debian.org/bookworm/live-build/live-build.7.en.html)
|
||||
* [lb_config(1)](https://manpages.debian.org/bookworm/live-build/lb_config.1.en.html)
|
||||
* [initramfs-tools(7)](https://manpages.debian.org/bookworm/initramfs-tools-core/initramfs-tools.7.en.html)
|
||||
* [Debian Live Team Repositories](https://salsa.debian.org/live-team)
|
||||
* [Debian Live Wiki](http://wiki.debian.org/DebianLive): Information about the Debian Live team and its contacts.
|
||||
* [run emulated arm under qemu](https://gist.github.com/rgl/b02c24f9eb1b4bdb4ac6f970d4bfc885)
|
||||
|
||||
6
Vagrantfile
vendored
6
Vagrantfile
vendored
@@ -4,7 +4,7 @@ ENV['VAGRANT_NO_PARALLEL'] = 'yes'
|
||||
|
||||
Vagrant.configure('2') do |config|
|
||||
config.vm.provider :libvirt do |lv, config|
|
||||
lv.memory = 2048
|
||||
lv.memory = 2 * 1024
|
||||
lv.cpus = 4
|
||||
lv.cpu_mode = 'host-passthrough'
|
||||
# lv.nested = true # nested virtualization.
|
||||
@@ -14,7 +14,7 @@ Vagrant.configure('2') do |config|
|
||||
|
||||
config.vm.provider :hyperv do |hv, config|
|
||||
hv.linked_clone = true
|
||||
hv.memory = 2048
|
||||
hv.memory = 2 * 1024
|
||||
hv.cpus = 4
|
||||
# hv.enable_virtualization_extensions = true # nested virtualization.
|
||||
hv.vlan_id = ENV['HYPERV_VLAN_ID']
|
||||
@@ -28,7 +28,7 @@ Vagrant.configure('2') do |config|
|
||||
end
|
||||
|
||||
config.vm.define :builder do |config|
|
||||
config.vm.box = 'debian-11-amd64'
|
||||
config.vm.box = 'debian-12-amd64'
|
||||
config.vm.hostname = 'builder'
|
||||
config.vm.provision :shell, path: 'builder.sh', env: {
|
||||
'LB_BUILD_TYPE' => ENV['LB_BUILD_TYPE'] || 'iso',
|
||||
|
||||
15
builder.sh
15
builder.sh
@@ -124,9 +124,9 @@ mkdir custom-image-$LB_BUILD_ARCH && pushd custom-image-$LB_BUILD_ARCH
|
||||
|
||||
# configure it.
|
||||
# see https://live-team.pages.debian.net/live-manual/html/live-manual/index.en.html
|
||||
# see lb(1) at https://manpages.debian.org/bullseye/live-build/lb.1.en.html
|
||||
# see live-build(7) at https://manpages.debian.org/bullseye/live-build/live-build.7.en.html
|
||||
# see lb_config(1) at https://manpages.debian.org/bullseye/live-build/lb_config.1.en.html
|
||||
# see lb(1) at https://manpages.debian.org/bookworm/live-build/lb.1.en.html
|
||||
# see live-build(7) at https://manpages.debian.org/bookworm/live-build/live-build.7.en.html
|
||||
# see lb_config(1) at https://manpages.debian.org/bookworm/live-build/lb_config.1.en.html
|
||||
# NB default images configurations are defined in a branch at https://salsa.debian.org/live-team/live-images
|
||||
# e.g. https://salsa.debian.org/live-team/live-images/-/tree/debian/images/standard
|
||||
|
||||
@@ -158,8 +158,11 @@ set -eux
|
||||
lb config noauto \\
|
||||
$lb_config \\
|
||||
--mode debian \\
|
||||
--distribution bullseye \\
|
||||
--distribution bookworm \\
|
||||
--architectures $LB_BUILD_ARCH \\
|
||||
--archive-areas main,non-free-firmware \\
|
||||
--firmware-binary false \\
|
||||
--firmware-chroot false \\
|
||||
--bootappend-live 'boot=live components username=vagrant' \\
|
||||
--mirror-bootstrap http://ftp.pt.debian.org/debian/ \\
|
||||
--mirror-binary http://ftp.pt.debian.org/debian/ \\
|
||||
@@ -339,7 +342,7 @@ cat >config/hooks/normal/9990-vagrant-user.hook.chroot <<'EOF'
|
||||
set -eux
|
||||
|
||||
# create the vagrant user and group.
|
||||
adduser --gecos '' --disabled-login vagrant
|
||||
adduser --gecos '' vagrant
|
||||
echo vagrant:vagrant | chpasswd -m
|
||||
|
||||
# let him use root permissions without sudo asking for a password.
|
||||
@@ -439,7 +442,7 @@ fi
|
||||
# from the network and do not need to use space in the filesystem.
|
||||
# NB this is used by mksquashfs as -wildcards -ef /excludes.
|
||||
# see /usr/lib/live/build/binary_rootfs
|
||||
# see https://manpages.debian.org/bullseye/squashfs-tools/mksquashfs.1.en.html#ef
|
||||
# see https://manpages.debian.org/bookworm/squashfs-tools/mksquashfs.1.en.html#ef
|
||||
install -d config/rootfs
|
||||
cat >config/rootfs/excludes <<'EOF'
|
||||
boot/
|
||||
|
||||
@@ -6,8 +6,8 @@ mkdir -p tmp-empty-box
|
||||
pushd tmp-empty-box
|
||||
|
||||
# create and add an empty box to the libvirt provider.
|
||||
TEMPLATE_BOX=~/.vagrant.d/boxes/debian-11-amd64/0/libvirt
|
||||
if [ ! -d ~/.vagrant.d/boxes/empty/0/libvirt ] && [ -d "$TEMPLATE_BOX" ]; then
|
||||
TEMPLATE_BOX=~/.vagrant.d/boxes/debian-12-amd64/0.0.0/libvirt
|
||||
if [ ! -d ~/.vagrant.d/boxes/empty/0.0.0/libvirt ] && [ -d "$TEMPLATE_BOX" ]; then
|
||||
rm -f *
|
||||
cp "$TEMPLATE_BOX/Vagrantfile" .
|
||||
echo '{"format":"qcow2","provider":"libvirt","virtual_size":10}' >metadata.json
|
||||
|
||||
Reference in New Issue
Block a user