commit: 89f57e145f82193e1f4e21478a3ad064073cb520 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> AuthorDate: Wed Apr 8 07:23:00 2020 +0000 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> CommitDate: Thu Apr 9 18:47:23 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=89f57e14
targets: Delete the netboot target netboot2 is better and has existed for a long time. No specs in releng.git use this target. Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> catalyst/defaults.py | 2 +- catalyst/targets/netboot.py | 132 ----------------------------------- examples/netboot_template.spec | 152 ----------------------------------------- targets/netboot/chroot.sh | 6 -- targets/netboot/combine.sh | 112 ------------------------------ targets/netboot/controller.sh | 82 ---------------------- targets/netboot/image.sh | 13 ---- 7 files changed, 1 insertion(+), 498 deletions(-) diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 7d1de119..11f99070 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -18,7 +18,7 @@ required_build_targets = ["targetbase", "generic_stage_target"] # new build types should be added here valid_build_targets = ["stage1_target", "stage2_target", "stage3_target", "stage4_target", "livecd_stage1_target", "livecd_stage2_target", - "embedded_target", "snapshot_target", "netboot_target", + "embedded_target", "snapshot_target", "netboot2_target" ] diff --git a/catalyst/targets/netboot.py b/catalyst/targets/netboot.py deleted file mode 100644 index 161300db..00000000 --- a/catalyst/targets/netboot.py +++ /dev/null @@ -1,132 +0,0 @@ -""" -netboot target, version 1 -""" -# NOTE: That^^ docstring has influence catalyst-spec(5) man page generation. - -import os - -from catalyst import log -from catalyst.support import (CatalystError, normpath, - cmd, file_locate) - -from catalyst.base.stagebase import StageBase - - -class netboot(StageBase): - """ - Builder class for a netboot build. - """ - def __init__(self,spec,addlargs): - self.valid_values = [ - "netboot/kernel/sources", - "netboot/kernel/config", - "netboot/kernel/prebuilt", - - "netboot/busybox_config", - - "netboot/extra_files", - "netboot/packages" - ] - self.required_values=[] - - try: - # XXX: This code does nothing because the for loop below is disabled. - if "netboot/packages" in addlargs: - if isinstance(addlargs['netboot/packages'], str): - _loopy = [addlargs["netboot/packages"]] - else: - _loopy = addlargs["netboot/packages"] - - # for x in loopy: - # self.required_values.append("netboot/packages/"+x+"/files") - except: - raise CatalystError("configuration error in netboot/packages.") - - StageBase.__init__(self,spec,addlargs) - if "netboot/busybox_config" in addlargs: - file_locate(self.settings, ["netboot/busybox_config"]) - - # Custom Kernel Tarball --- use that instead ... - - # unless the user wants specific CFLAGS/CXXFLAGS, let's use -Os - - for envvar in "CFLAGS", "CXXFLAGS": - if envvar not in os.environ and envvar not in addlargs: - self.settings[envvar] = "-Os -pipe" - - def set_root_path(self): - # ROOT= variable for emerges - self.settings["root_path"]=normpath("/tmp/image") - log.info('netboot root path is %s', self.settings['root_path']) - -# def build_packages(self): -# # build packages -# if "netboot/packages" in self.settings: -# try: -# cmd([self.settings['controller_file'], 'packages'] + -# self.settings['netboot/packages'], env=self.env) -# except CatalystError: -# self.unbind() -# raise CatalystError('netboot build aborting due to error.', -# print_traceback=True) - - def build_busybox(self): - # build busybox - if "netboot/busybox_config" in self.settings: - mycmd = [self.settings['netboot/busybox_config']] - else: - mycmd = [] - try: - cmd([self.settings['controller_file'], 'busybox'] + mycmd, env=self.env) - except CatalystError: - self.unbind() - raise CatalystError("netboot build aborting due to error.", - print_traceback=True) - - def copy_files_to_image(self): - # create image - myfiles=[] - if "netboot/packages" in self.settings: - if isinstance(self.settings['netboot/packages'], str): - loopy=[self.settings["netboot/packages"]] - else: - loopy=self.settings["netboot/packages"] - - for x in loopy: - if "netboot/packages/"+x+"/files" in self.settings: - if isinstance(type(self.settings['netboot/packages/'+x+'/files']), str): - myfiles.extend(self.settings["netboot/packages/"+x+"/files"]) - else: - myfiles.append(self.settings["netboot/packages/"+x+"/files"]) - - if "netboot/extra_files" in self.settings: - if isinstance(self.settings['netboot/extra_files'], list): - myfiles.extend(self.settings["netboot/extra_files"]) - else: - myfiles.append(self.settings["netboot/extra_files"]) - - try: - cmd([self.settings['controller_file'], 'image'] + myfiles, - env=self.env) - except CatalystError: - self.unbind() - raise CatalystError("netboot build aborting due to error.", - print_traceback=True) - - def create_netboot_files(self): - # finish it all up - try: - cmd([self.settings['controller_file'], 'finish'], env=self.env) - except CatalystError: - self.unbind() - raise CatalystError("netboot build aborting due to error.", - print_traceback=True) - # end - log.notice('netboot: build finished !') - - def set_action_sequence(self): - self.settings["action_sequence"]=["unpack","unpack_snapshot", - "config_profile_link","setup_confdir","bind","chroot_setup",\ - "setup_environment","build_packages","build_busybox",\ - "build_kernel","copy_files_to_image",\ - "clean","create_netboot_files","unbind","clear_autoresume"] diff --git a/examples/netboot_template.spec b/examples/netboot_template.spec deleted file mode 100644 index c1726103..00000000 --- a/examples/netboot_template.spec +++ /dev/null @@ -1,152 +0,0 @@ -# generic netboot image specfile -# used to build a network bootable image - -# The subarch can be any of the supported catalyst subarches (like athlon-xp). -# Refer to "man catalyst" or <https://wiki.gentoo.org/wiki/Catalyst> -# for supported subarches -# example: -# subarch: athlon-xp -subarch: - -# The version stamp is an identifier for the build. It can be anything you wish -# it to be, but it is usually a date. -# example: -# version_stamp: 2006.1 -version_stamp: - -# The target specifies what target we want catalyst to do. For building a -# netboot image, we use the netboot target. -# example: -# target: netboot -target: - -# The rel_type defines what kind of build we are doing. This is merely another -# identifier, but it useful for allowing multiple concurrent builds. Usually, -# default will suffice. -# example: -# rel_type: default -rel_type: - -# This is the system profile to be used by catalyst to build this target. It is -# specified as a relative path from /var/db/repos/gentoo/profiles. -# example: -# profile: default-linux/x86/2006.1 -profile: - -# This specifies which snapshot to use for building this target. -# example: -# snapshot: 2006.1 -snapshot: - -# This specifies where the seed stage comes from for this target, The path is -# relative to $clst_sharedir/builds. The rel_type is also used as a path prefix -# for the seed. -# example: -# default/stage3-x86-2006.1 -source_subpath: - -# These are the hosts used as distcc slaves when distcc is enabled in your -# catalyst.conf. It follows the same syntax as distcc-config --set-hosts and -# is entirely optional. -# example: -# distcc_hosts: 127.0.0.1 192.168.0.1 -distcc_hosts: - -# This is an optional directory containing portage configuration files. It -# follows the same syntax as /etc/portage and should be consistent across all -# targets to minimize problems. -# example: -# portage_confdir: /etc/portage -portage_confdir: - -# This option specifies the location to a portage overlay that you would like to -# have used when building this target. -# example: -# portage_overlay: /usr/local/portage -portage_overlay: - -# This allows the optional directory containing the output packages for -# catalyst. Mainly used as a way for different spec files to access the same -# cache directory. Default behavior is for this location to be autogenerated -# by catalyst based on the spec file. -# example: -# pkgcache_path: /tmp/packages -pkgcache_path: - -# This allows the optional directory containing the output packages for kernel -# builds. Mainly used as a way for different spec files to access the same -# cache directory. Default behavior is for this location to be autogenerated -# by catalyst based on the spec file. -# example: -# kerncache_path: /tmp/kernel -kerncache_path: - -# This option tells catalyst which kernel sources to merge for building this -# image. This can use normal portage atoms to specify a specific version. -# example: -# netboot/kernel/sources: gentoo-sources -netboot/kernel/sources: - -# This option is the full path and filename to a kernel .config file that is -# used by genkernel to compile the kernel for this image. -# example: -# netboot/kernel/config: /tmp/2.6.11-netboot.config -netboot/kernel/config: - -# This option sets the USE flags used to build the kernel. These USE flags are -# additive from the default USE for the specified profile. -# example: -# netboot/kernel/use: ultra1 -netboot/kernel/use: - -# This option sets the USE flags with which the optional packages below are -# built. Like the kernel USE, they are additive. -# example: -# netboot/use: -netboot/use: - -# The netboot target builds busybox for its root filesystem. This option is -# where you specify the full path and filename to your busybox configuration. -# example -# netboot/busybox_config: /tmp/busybox.config -netboot/busybox_config: - -# This is the full path and filename to the tarball to use as the base for the -# netboot image. -# example: -# netboot/base_tarball: /usr/share/catalyst/netboot/netboot-base.tar.bz2 -netboot/base_tarball: - -# These are the packages that will be built for your netboot image using the USE -# flags set in netboot/use. These package names are also labels used later when -# determining what files to copy into your netboot image. -# example: -# netboot/packages: raidtools xfsprogs e2fsprogs reiserfsprogs - -# This is where you tell catalyst which files from each package to copy into the -# netboot image. -# example: -# netboot/packages/raidtools/files: /sbin/raidstart /sbin/mkraid /sbin/detect_multipath /sbin/raidreconf /sbin/raidstop /sbin/raidhotadd /sbin/raidhotremove /sbin/raidsetfaulty /sbin/raid0run -netboot/packages/raidtools/files: - -# Here is the same thing for xfsprogs. -# example: -# netboot/packages/xfsprogs/files: /sbin/mkfs.xfs /sbin/xfs_repair /bin/xfs_check -netboot/packages/xfsprogs/files: - -# Here is the same thing for e2fsprogs. -# example: -# netboot/packages/e2fsprogs/files: /sbin/mke2fs -netboot/packages/e2fsprogs/files: - -# Here is the same thing for reiserfsprogs. -# example: -# netboot/packages/reiserfsprogs/files: /sbin/mkreiserfs -netboot/packages/reiserfsprogs/files: - -# This is a list of any other files, not belonging to the above packages, that -# you would wish to have copied into your netboot image. -# example: -# netboot/extra_files: /lib/libresolv.so.2 /lib/libnss_compat.so.2 /lib/libnss_dns.so.2 /lib/libnss_files.so.2 /sbin/consoletype -netboot/extra_files: - diff --git a/targets/netboot/chroot.sh b/targets/netboot/chroot.sh deleted file mode 100755 index 3115cac8..00000000 --- a/targets/netboot/chroot.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -source /tmp/chroot-functions.sh - -# START BUILD -run_merge "${clst_packages}" diff --git a/targets/netboot/combine.sh b/targets/netboot/combine.sh deleted file mode 100755 index 5eef0d01..00000000 --- a/targets/netboot/combine.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash - -source ${clst_shdir}/support/chroot-functions.sh -source ${clst_shdir}/support/functions.sh -source ${clst_shdir}/support/filesystem-functions.sh - -update_env_settings - -setup_myfeatures - -# Ssetup our environment -export FEATURES="${clst_myfeatures}" - -# First install the boot package that we need -booter="" -case ${clst_hostarch} in - alpha) - booter="" - ;; - arm) - booter="" - ;; - hppa) - booter=palo - ;; - sparc*) - booter=sparc-utils - ;; - x86|amd64) - booter=netboot - ;; - *) - exit 1 - ;; -esac - -#if [ ! -z "${booter}" ] ; then -# run_merge ${booter} || exit 1 -#fi - -extract_kernels ${clst_chroot_path}/tmp - -# Then generate the netboot image ! :D -for kname in ${clst_boot_kernel} -do - mkdir -p ${clst_chroot_path}/tmp/staging/initrd-${kname} - cp -r ${clst_chroot_path}/tmp/image ${clst_chroot_path}/tmp/staging/initrd-${kname} - extract_modules ${clst_chroot_path}/tmp/staging/initrd-${kname} ${kname} - create_normal_loop ${clst_chroot_path}/tmp/staging/initrd-${kname} ${clst_target_path}/ initrd-${kname}.igz - rm -r ${clst_chroot_path}/tmp/staging/initrd-${kname} - - case ${clst_hostarch} in - alpha) - # Until aboot is patched this is broken currently. - # please use catalyst 1.1.5 or older - - #TEST TEST TEST TEST - #https://lists.debian.org/debian-alpha/2004/07/msg00094.html - #make \ - # -C /usr/src/linux \ - # INITRD=/initrd.gz \ - # HPATH="/usr/src/linux/include" \ - # vmlinux bootpfile \ - # || exit 1 - #cp /usr/src/linux/arch/alpha/boot/bootpfile /netboot.alpha || exit 1 - ;; - arm) - #TEST TEST TEST TEST - cp /${clst_chroot_path}/tmp/${kname} /netboot-${kname}.arm || exit 1 - cat /${clst_target_path}/initrd-${kname}.igz >> /${clst_target_path}/netboot-${kname}.arm || exit 1 - #make \ - # -C /usr/src/linux \ - # INITRD=/initrd.gz \ - # bootpImage \ - # || exit 1 - ;; - hppa) - # We have to remove the previous image because the file is - # considered as a tape by palo and then not truncated but rewritten. - #TEST TEST TEST TEST - rm -f /netboot-${kname}.hppa - - palo \ - -k /${clst_chroot_path}/tmp/${kname} \ - -r /${clst_target_path}/initrd-${kname}.igz \ - -s /${clst_target_path}/netboot-${kname}.hppa \ - -f foo \ - -b /usr/share/palo/iplboot \ - -c "0/vmlinux root=/dev/ram0 ${cmdline_opts}" \ - || exit 1 - ;; - sparc*) - #TEST TEST TEST TEST - #elftoaout -o /netboot-${kname}.${clst_hostarch} /usr/src/linux/vmlinux - #elftoaout -o /netboot-${kname}.${clst_hostarch} /${kname} - #piggy=${clst_hostarch/sparc/piggyback} - #${piggy} /netboot-${kname}.${clst_hostarch} /usr/src/linux/System.map /initrd-${kname}.igz - ;; - x86) - mknbi-linux \ - -k /${clst_chroot_path}/tmp/${kname} \ - -r /${clst_target_path}/initrd-${kname}.igz \ - -o /${clst_target_path}/netboot-${kname}.x86 \ - -x \ - -a "root=/dev/ram0 ${cmdline_opts}" \ - || exit 1 - ;; - *) - exit 1 - ;; - esac -done diff --git a/targets/netboot/controller.sh b/targets/netboot/controller.sh deleted file mode 100755 index 7d327325..00000000 --- a/targets/netboot/controller.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -source ${clst_shdir}/support/functions.sh -source ${clst_shdir}/support/filesystem-functions.sh - - -case ${1} in - #### Couldnt busybox step be in packages .... - build_packages) - shift - clst_root_path="/" \ - clst_packages="$*" \ - exec_in_chroot \ - ${clst_shdir}/${clst_target}/chroot.sh - ;; - - busybox) - # Custom busybox config support - if [ -f "${clst_netboot_busybox_config}" ] - then - mkdir -p ${clst_chroot_path}/etc/busybox/${clst_CHOST} - cp -v ${clst_netboot_busybox_config} \ - ${clst_chroot_path}/etc/busybox/${clst_CHOST}/busybox.config - clst_use="savedconfig" - fi - - # Main Busybox emerge - clst_root_path="/" \ - clst_use="${clst_use} netboot make-busybox-symlinks" \ - clst_myemergeopts="${clst_myemergeopts} -O" \ - clst_packages="busybox" \ - exec_in_chroot \ - ${clst_shdir}/${clst_target}/chroot.sh - ;; - - pre-kmerge) - # Sets up the build environment before any kernels are compiled - #exec_in_chroot ${clst_shdir}/support/pre-kmerge.sh - ;; - - post-kmerge) - # Cleans up the build environment after the kernels are compiled - #exec_in_chroot ${clst_shdir}/support/post-kmerge.sh - ;; - - kernel) - shift - export clst_kname="$1" - export clst_root_path="/" - #exec_in_chroot ${clst_shdir}/support/pre-kmerge.sh - #exec_in_chroot ${clst_shdir}/support/kmerge.sh - #exec_in_chroot ${clst_shdir}/support/post-kmerge.sh - #extract_kernels kernels - ;; - - image) - #Creates the base initrd image for the netboot - shift - # Could this step be a parameter in case there is a different - # baselayout to add??? - clst_myemergeopts="${clst_myemergeopts} --nodeps" \ - clst_packages="netboot-base" \ - exec_in_chroot \ - ${clst_shdir}/${clst_target}/chroot.sh - - clst_files="${@}" \ - exec_in_chroot \ - ${clst_shdir}/${clst_target}/image.sh - ;; - - finish) - ${clst_shdir}/${clst_target}/combine.sh - ;; - - clean) - exit 0;; - - *) - exit 1;; -esac - -exit $? diff --git a/targets/netboot/image.sh b/targets/netboot/image.sh deleted file mode 100755 index 10bdaed3..00000000 --- a/targets/netboot/image.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source /tmp/chroot-functions.sh - -update_env_settings - -echo "Copying files to ${clst_root_path}" -clst_files="/bin/busybox ${clst_files} " -for f in ${clst_files} -do - copy_file ${f} -done -echo "Done copying files"