diff options
author | Kim Hagen <kim@sentrium.io> | 2021-08-09 09:24:21 -0500 |
---|---|---|
committer | Kim Hagen <kim@sentrium.io> | 2021-08-09 09:24:21 -0500 |
commit | 301cd5b991caded9c84d1ce4bb214ac720ba5796 (patch) | |
tree | 8e2354a14a176e4dbe33e34507a62e8f4d9bd9c1 | |
parent | f81f65598555f88f1b0535807da7418e5326be67 (diff) | |
download | vyos-live-build-1.3.6.tar.gz vyos-live-build-1.3.6.zip |
add items for grub setup and enable persistence1.3.81.3.71.3.61.3.51.3.41.3.3-epa11.3.31.3.2equuleus
-rwxr-xr-x | functions/defaults.sh | 12 | ||||
-rwxr-xr-x | functions/losetup.sh | 4 | ||||
-rwxr-xr-x | scripts/build/binary_grub-legacy | 4 | ||||
-rwxr-xr-x | scripts/build/binary_hdd | 11 | ||||
-rwxr-xr-x | scripts/build/binary_linux-image | 2 | ||||
-rwxr-xr-x | scripts/build/binary_loopback_cfg | 41 | ||||
-rwxr-xr-x | scripts/build/binary_manifest | 2 | ||||
-rwxr-xr-x | scripts/build/binary_memtest | 2 | ||||
-rwxr-xr-x | scripts/build/binary_rootfs | 2 | ||||
-rwxr-xr-x | scripts/build/config | 104 |
10 files changed, 174 insertions, 10 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh index c48955104..b1e30e5e9 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -595,6 +595,15 @@ Set_defaults () case "${LB_INITRAMFS}" in live-boot) LB_BOOTAPPEND_LIVE="${LB_BOOTAPPEND_LIVE:-boot=live components quiet splash}" + LB_BOOTAPPEND_VYOS_CONSOLE_1="${LB_BOOTAPPEND_VYOS_CONSOLE_1:-none}" + LB_BOOTAPPEND_VYOS_CONSOLE_2="${LB_BOOTAPPEND_VYOS_CONSOLE_2:-none}" + LB_BOOTAPPEND_VYOS_CONSOLE_3="${LB_BOOTAPPEND_VYOS_CONSOLE_3:-none}" + LB_BOOTAPPEND_VYOS_PW_CONSOLE_1="${LB_BOOTAPPEND_VYOS_PW_CONSOLE_1:-none}" + LB_BOOTAPPEND_VYOS_PW_CONSOLE_2="${LB_BOOTAPPEND_VYOS_PW_CONSOLE_2:-none}" + LB_BOOTAPPEND_VYOS_PW_CONSOLE_3="${LB_BOOTAPPEND_VYOS_PW_CONSOLE_3:-none}" + LB_VYOS_CONSOLE_1="${LB_VYOS_CONSOLE_1:-none}" + LB_VYOS_CONSOLE_2="${LB_VYOS_CONSOLE_2:-none}" + LB_VYOS_CONSOLE_3="${LB_VYOS_CONSOLE_3:-none}" LB_BOOTAPPEND_LIVE_FAILSAFE="${LB_BOOTAPPEND_LIVE_FAILSAFE:-boot=live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal}" ;; @@ -870,4 +879,7 @@ Check_defaults () # Ports using foreign bootstrap need a working qemu-*-system. This is the location it LB_BOOTSTRAP_QEMU_STATIC="${LB_BOOTSTRAP_QEMU_STATIC:-}" + LB_VYOS_VERSION="${LB_VYOS_VERSION:-live}" + LB_VYOS_PERSISTENCE="${LB_VYOS_PERSISTENCE:-false}" + } diff --git a/functions/losetup.sh b/functions/losetup.sh index 8cacfcf82..d2791b365 100755 --- a/functions/losetup.sh +++ b/functions/losetup.sh @@ -31,7 +31,7 @@ Lodetach () sync sleep 1 - if [ "${LB_IMAGE_TYPE}" = "hdd" ]; + if [ "${LIVE_IMAGE_TYPE}" = "hdd" ]; then case "${LB_BUILD_WITH_CHROOT}" in true) @@ -79,7 +79,7 @@ Losetup () LOOPDEVICE="$(echo ${DEVICE}p${PARTITION})" - if [ "${LB_IMAGE_TYPE}" = "hdd" ] + if [ "${LIVE_IMAGE_TYPE}" = "hdd" ] then losetup --partscan "${DEVICE}" "${FILE}" case "${LB_BUILD_WITH_CHROOT}" in diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy index fea9b7b6a..76c7da500 100755 --- a/scripts/build/binary_grub-legacy +++ b/scripts/build/binary_grub-legacy @@ -127,7 +127,7 @@ fi case "${LB_INITRAMFS}" in live-boot) - INITFS="live" + INITFS="${LB_VYOS_VERSION}" ;; *) @@ -140,7 +140,7 @@ case "${LIVE_IMAGE_TYPE}" in iso*|tar) case "${LB_INITRAMFS}" in live-boot) - DESTDIR_LIVE="binary/live" + DESTDIR="binary/${LB_VYOS_VERSION}" ;; *) diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd index dee92017e..8cf44126e 100755 --- a/scripts/build/binary_hdd +++ b/scripts/build/binary_hdd @@ -275,6 +275,17 @@ else fi cp -T ${CP_OPTIONS} binary/ chroot/binary.tmp +if [ "${LB_VYOS_PERSISTENCE}" = "true" ] +then + mkdir -p chroot/binary.tmp/${LB_VYOS_VERSION}/rw + mkdir -p chroot/binary.tmp/${LB_VYOS_VERSION}/work + mv chroot/binary.tmp/${LB_VYOS_VERSION}/filesystem.squashfs \ + chroot/binary.tmp/${LB_VYOS_VERSION}/$(basename ${LB_VYOS_VERSION}).squashfs + cat > chroot/binary.tmp/persistence.conf << EOF +/ union +EOF +fi + if [ -n "${GRUB_PC_ENABLED}" ] then case "${LB_BUILD_WITH_CHROOT}" in diff --git a/scripts/build/binary_linux-image b/scripts/build/binary_linux-image index 12a6304a1..9b46a104a 100755 --- a/scripts/build/binary_linux-image +++ b/scripts/build/binary_linux-image @@ -45,7 +45,7 @@ Create_lockfile .lock case "${LB_INITRAMFS}" in live-boot) - DESTDIR="binary/live" + DESTDIR="binary/${LB_VYOS_VERSION}" ;; *) diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_loopback_cfg index f710ed483..71b2dca33 100755 --- a/scripts/build/binary_loopback_cfg +++ b/scripts/build/binary_loopback_cfg @@ -146,7 +146,7 @@ fi case "${LB_INITRAMFS}" in live-boot) - INITFS="live" + INITFS="${LB_VYOS_VERSION}" ;; *) @@ -210,6 +210,45 @@ if [ "${_AMD64_686_NUMBER}" -ge 2 ] ; then "/${INITFS}/${_686_INITRD}" \ "${LB_BOOTAPPEND_LIVE_FAILSAFE}" fi +elif [ "${LB_VYOS_VERSION}" != "live" ]; then + if [ "${LB_BOOTAPPEND_VYOS_CONSOLE_1}" != "none" ]; then + Grub_live_entry "VyOS $(basename ${LB_VYOS_VERSION}) linux (${LB_VYOS_CONSOLE_1} console)" \ + "/${INITFS}/${DEFAULT_KERNEL}" \ + "/${INITFS}/${DEFAULT_INITRD}" \ + "${LB_BOOTAPPEND_VYOS_CONSOLE_1}" + fi + if [ "${LB_BOOTAPPEND_VYOS_CONSOLE_2}" != "none" ]; then + Grub_live_entry "VyOS $(basename ${LB_VYOS_VERSION}) linux (${LB_VYOS_CONSOLE_2} console)" \ + "/${INITFS}/${DEFAULT_KERNEL}" \ + "/${INITFS}/${DEFAULT_INITRD}" \ + "${LB_BOOTAPPEND_VYOS_CONSOLE_2}" + fi + if [ "${LB_BOOTAPPEND_VYOS_CONSOLE_3}" != "none" ]; then + Grub_live_entry "VyOS $(basename ${LB_VYOS_VERSION}) linux (${LB_VYOS_CONSOLE_3} console)" \ + "/${INITFS}/${DEFAULT_KERNEL}" \ + "/${INITFS}/${DEFAULT_INITRD}" \ + "${LB_BOOTAPPEND_VYOS_CONSOLE_3}" + fi + if [ "${LB_BOOTAPPEND_VYOS_PW_CONSOLE_1}" != "none" ]; then + Grub_live_entry "Lost password change $(basename ${LB_VYOS_VERSION}) linux (${LB_VYOS_CONSOLE_1} console)" \ + "/${INITFS}/${DEFAULT_KERNEL}" \ + "/${INITFS}/${DEFAULT_INITRD}" \ + "${LB_BOOTAPPEND_VYOS_PW_CONSOLE_1}" + fi + if [ "${LB_BOOTAPPEND_VYOS_PW_CONSOLE_2}" != "none" ]; then + Grub_live_entry "Lost password change $(basename ${LB_VYOS_VERSION}) linux (${LB_VYOS_CONSOLE_2} console)" \ + "/${INITFS}/${DEFAULT_KERNEL}" \ + "/${INITFS}/${DEFAULT_INITRD}" \ + "${LB_BOOTAPPEND_VYOS_PW_CONSOLE_2}" + fi + if [ "${LB_BOOTAPPEND_VYOS_PW_CONSOLE_3}" != "none" ]; then + Grub_live_entry "Lost password change $(basename ${LB_VYOS_VERSION}) linux (${LB_VYOS_CONSOLE_3} console)" \ + "/${INITFS}/${DEFAULT_KERNEL}" \ + "/${INITFS}/${DEFAULT_INITRD}" \ + "${LB_BOOTAPPEND_VYOS_PW_CONSOLE_3}" + fi + + else Grub_live_entry "Live system" "/${INITFS}/${DEFAULT_KERNEL}" "/${INITFS}/${DEFAULT_INITRD}" "${APPEND_LIVE}" if [ "${LB_BOOTAPPEND_LIVE_FAILSAFE}" != "none" ] diff --git a/scripts/build/binary_manifest b/scripts/build/binary_manifest index ceee2c380..963e27cda 100755 --- a/scripts/build/binary_manifest +++ b/scripts/build/binary_manifest @@ -45,7 +45,7 @@ Create_lockfile .lock case "${LB_INITRAMFS}" in live-boot) - INITFS="live" + INITFS="${LB_VYOS_VERSION}" SUFFIX="packages" ;; diff --git a/scripts/build/binary_memtest b/scripts/build/binary_memtest index 96fb4f101..035809b83 100755 --- a/scripts/build/binary_memtest +++ b/scripts/build/binary_memtest @@ -81,7 +81,7 @@ Install_package # Setting destination directory case "${LB_INITRAMFS}" in live-boot) - DESTDIR="binary/live" + DESTDIR="binary/${LB_VYOS_VERSION}" ;; *) diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs index d50cf3b43..1e288073c 100755 --- a/scripts/build/binary_rootfs +++ b/scripts/build/binary_rootfs @@ -50,7 +50,7 @@ esac case "${LB_INITRAMFS}" in live-boot) - INITFS="live" + INITFS="${LB_VYOS_VERSION}" ;; *) diff --git a/scripts/build/config b/scripts/build/config index 6c2ab3b7b..bf20f3653 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -31,7 +31,17 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--binary-filesystem fat16|fat32|ext2|ext3|ext4|ntfs]\n\ \t [--bootappend-install PARAMETER|\"PARAMETERS\"]\n\ \t [--bootappend-live PARAMETER|\"PARAMETERS\"]\n\ +\t [--bootappend-vyos-console-1 PARAMETER|\"PARAMETERS\"]\n\ +\t [--bootappend-vyos-console-2 PARAMETER|\"PARAMETERS\"]\n\ +\t [--bootappend-vyos-console-3 PARAMETER|\"PARAMETERS\"]\n\ +\t [--bootappend-vyos-pw-console-1 PARAMETER|\"PARAMETERS\"]\n\ +\t [--bootappend-vyos-pw-console-2 PARAMETER|\"PARAMETERS\"]\n\ +\t [--bootappend-vyos-pw-console-3 PARAMETER|\"PARAMETERS\"]\n\ \t [--bootappend-live-failsafe PARAMETER|\"PARAMETERS\"]\n\ +\t [--vyos-console-1 KVM|Serial|USB]\n\ +\t [--vyos-console-2 KVM|Serial|USB]\n\ +\t [--vyos-console-3 KVM|Serial|USB]\n\ +\t [--vyos-persistence true|false]\n\ \t [--bootloaders grub-legacy|grub-pc|syslinux|grub-efi]\n\ \t [--cache true|false]\n\ \t [--cache-indices true|false]\n\ @@ -123,6 +133,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--backports true|false]\n\ \t [--verbose]\n\ \t [--loadlin true|false]\n\ +\t [--vyos-version]\n\ \t [--win32-loader true|false]\n\ \t [--bootstrap-qemu-exclude PACKAGES]\n\ \t [--bootstrap-qemu-static PATH]\n\ @@ -144,13 +155,16 @@ Local_arguments () gzip-options:,image-name:,interactive:,keyring-packages:,linux-flavours:,linux-packages:, security:,updates:,backports:,binary-filesystem:,binary-images:, apt-indices:,bootappend-install:,bootappend-live:,bootappend-live-failsafe:,bootloader:,bootloaders:,checksums:,compression:,config:,zsync:,build-with-chroot:, + bootappend-vyos-console-1:,bootappend-vyos-console-2:,bootappend-vyos-console-3:, + bootappend-vyos-pw-console-1:,bootappend-vyos-pw-console-2:,bootappend-vyos-pw-console-3:, + vyos-console-1:,vyos-console-2:,vyos-console-3:,vyos-persistence:, debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:, grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,hdd-partition-start:,iso-application:,iso-preparer:,iso-publisher:, iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:, net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:, net-cow-server:,net-tarball:,onie:,onie-kernel-cmdline:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:, loadlin:,win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force, - help,ignore-system-defaults,quiet,usage,verbose,version,bootstrap-qemu-static:,bootstrap-qemu-arch:, + help,ignore-system-defaults,quiet,usage,verbose,version,vyos-version:,bootstrap-qemu-static:,bootstrap-qemu-arch:, uefi-secure-boot:, bootstrap-qemu-exclude:" # Remove spaces added by indentation @@ -493,11 +507,61 @@ Local_arguments () shift 2 ;; + --bootappend-vyos-console-1) + LB_BOOTAPPEND_VYOS_CONSOLE_1="${2}" + shift 2 + ;; + + --bootappend-vyos-console-2) + LB_BOOTAPPEND_VYOS_CONSOLE_2="${2}" + shift 2 + ;; + + --bootappend-vyos-console-3) + LB_BOOTAPPEND_VYOS_CONSOLE_3="${2}" + shift 2 + ;; + + --bootappend-vyos-pw-console-1) + LB_BOOTAPPEND_VYOS_PW_CONSOLE_1="${2}" + shift 2 + ;; + + --bootappend-vyos-pw-console-2) + LB_BOOTAPPEND_VYOS_PW_CONSOLE_2="${2}" + shift 2 + ;; + + --bootappend-vyos-pw-console-3) + LB_BOOTAPPEND_VYOS_PW_CONSOLE_3="${2}" + shift 2 + ;; + --bootappend-live-failsafe) LB_BOOTAPPEND_LIVE_FAILSAFE="${2}" shift 2 ;; + --vyos-console-1) + LB_VYOS_CONSOLE_1="${2}" + shift 2 + ;; + + --vyos-console-2) + LB_VYOS_CONSOLE_2="${2}" + shift 2 + ;; + + --vyos-console-3) + LB_VYOS_CONSOLE_3="${2}" + shift 2 + ;; + + --vyos-persistence) + LB_VYOS_PERSISTENCE="${2}" + shift 2 + ;; + --bootappend-install) LB_BOOTAPPEND_INSTALL="${2}" shift 2 @@ -698,6 +762,11 @@ Local_arguments () shift 2 ;; + --vyos-version) + LB_VYOS_VERSION="boot/${2}" + shift 2 + ;; + --win32-loader) LB_WIN32_LOADER="${2}" shift 2 @@ -1174,6 +1243,36 @@ LB_APT_INDICES="${LB_APT_INDICES}" # (Default: empty) LB_BOOTAPPEND_LIVE="${LB_BOOTAPPEND_LIVE}" +# Set boot parameters +LB_BOOTAPPEND_VYOS_CONSOLE_1="${LB_BOOTAPPEND_VYOS_CONSOLE_1}" + +# Set boot parameters +LB_BOOTAPPEND_VYOS_CONSOLE_2="${LB_BOOTAPPEND_VYOS_CONSOLE_2}" + +# Set boot parameters +LB_BOOTAPPEND_VYOS_CONSOLE_3="${LB_BOOTAPPEND_VYOS_CONSOLE_3}" + +# Set boot parameters +LB_BOOTAPPEND_VYOS_PW_CONSOLE_1="${LB_BOOTAPPEND_VYOS_PW_CONSOLE_1}" + +# Set boot parameters +LB_BOOTAPPEND_VYOS_PW_CONSOLE_2="${LB_BOOTAPPEND_VYOS_PW_CONSOLE_2}" + +# Set boot parameters +LB_BOOTAPPEND_VYOS_PW_CONSOLE_3="${LB_BOOTAPPEND_VYOS_PW_CONSOLE_3}" + +# Set console +LB_VYOS_CONSOLE_1="${LB_VYOS_CONSOLE_1}" + +# Set console +LB_VYOS_CONSOLE_2="${LB_VYOS_CONSOLE_2}" + +# Set console +LB_VYOS_CONSOLE_3="${LB_VYOS_CONSOLE_3}" + +# Set VyOS presistence +LB_VYOS_PERSISTENCE="${LB_VYOS_PERSISTENCE}" + # \$LB_BOOTAPPEND_INSTALL: set boot parameters # (Default: empty) LB_BOOTAPPEND_INSTALL="${LB_BOOTAPPEND_INSTALL}" @@ -1263,6 +1362,9 @@ LB_MEMTEST="${LB_MEMTEST}" # (Default: ${LB_LOADLIN}) LB_LOADLIN="${LB_LOADLIN}" +# Set VyOS version +LB_VYOS_VERSION="${LB_VYOS_VERSION}" + # \$LB_WIN32_LOADER: set win32-loader # (Default: ${LB_WIN32_LOADER}) LB_WIN32_LOADER="${LB_WIN32_LOADER}" |