From 313feb43204fbdb0ced49a5ecf84d1b926513a7c Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Tue, 11 Sep 2018 12:11:07 -0500 Subject: [PATCH 1/3] Update .gitreview for f/centos75 Change-Id: I472a972e1863816e7b5d942c08b0671bb450077f Signed-off-by: Dean Troyer --- .gitreview | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitreview b/.gitreview index ce33edad..facd0563 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.openstack.org port=29418 project=openstack/stx-root.git +defaultbranch=f/centos75 From ef31a4c57dbf207f794ee527bc084fd219c1e7c6 Mon Sep 17 00:00:00 2001 From: slin14 Date: Thu, 13 Sep 2018 23:46:05 +0800 Subject: [PATCH 2/3] Add lz4 to squashfs img and clean unused rpm Story: 2003389 Task: 26436 new systemd depends on lz4. And systemd is included in squashfs, so need to add lz4 to squashfs also. Removed rpms and rt kernel from the image, since they are not used. Change-Id: Ic0d8be91b747369bb9a068f41e7c4785d29f8881 Signed-off-by: slin14 --- build-tools/make-installer-images.sh | 31 ++--- build-tools/update-pxe-network-installer | 141 ++--------------------- 2 files changed, 19 insertions(+), 153 deletions(-) diff --git a/build-tools/make-installer-images.sh b/build-tools/make-installer-images.sh index 7307adce..d2ac8a85 100755 --- a/build-tools/make-installer-images.sh +++ b/build-tools/make-installer-images.sh @@ -42,24 +42,17 @@ EOF echo "This script makes new initrd.img, vmlinuz and squashfs.img." echo "NOTE: it has to be executed with *root*!" -if [ $# -lt 2 ];then - echo "$0 " - echo "kernel_mode: std or rt" +if [ $# -lt 1 ];then + echo "$0 " exit -1; fi work_dir=$1 -mode=$2 output_dir=$work_dir/output if [ ! -d $output_dir ]; then mkdir -p $output_dir; fi -if [ "$mode" != "std" ] && [ "$mode" != "rt" ]; then - echo "ERROR: wrong kernel mode, must be std or rt" - exit -1 -fi - timestamp=$(date +%F_%H%M) echo "---------------- start to make new initrd.img and vmlinuz -------------" @@ -90,7 +83,7 @@ echo "--> clean up $initrd_root" clean_rootfs $initrd_root echo "--> extract files from new kernel and its modular rpms to initrd root" -for kf in $kernel_rpms_dir/$mode/*.rpm ; do rpm2cpio $kf | cpio -idu; done +for kf in ${kernel_rpms_dir}/std/*.rpm ; do rpm2cpio $kf | cpio -idu; done # by now new kernel and its modules exist! # find new kernel in /boot/ @@ -99,17 +92,11 @@ new_kernel="$(ls ./boot/vmlinuz-*)" echo $new_kernel if [ -f $new_kernel ];then #copy out the new kernel - if [ $mode == "std" ];then - if [ -f $output_dir/new-vmlinuz ]; then - mv -f $output_dir/new-vmlinuz $output_dir/vmlinuz-bakcup-$timestamp - fi - cp -f $new_kernel $output_dir/new-vmlinuz - else - if [ -f $output_dir/new-vmlinuz-rt ]; then - mv -f $output_dir/new-vmlinuz-rt $output_dir/vmlinuz-rt-bakcup-$timestamp - fi - cp -f $new_kernel $output_dir/new-vmlinuz-rt + if [ -f $output_dir/new-vmlinuz ]; then + mv -f $output_dir/new-vmlinuz $output_dir/vmlinuz-backup-$timestamp fi + cp -f $new_kernel $output_dir/new-vmlinuz + kernel_name=$(basename $new_kernel) new_ver=$(echo $kernel_name | cut -d'-' -f2-) echo $new_ver @@ -129,7 +116,7 @@ EOF echo "--> Rebuild the initrd" if [ -f $output_dir/new-initrd.img ]; then - mv -f $output_dir/new-initrd.img $output_dir/initrd.img-bakcup-$timestamp + mv -f $output_dir/new-initrd.img $output_dir/initrd.img-backup-$timestamp fi find . | cpio -o -H newc | xz --check=crc32 --x86 --lzma2=dict=512KiB > $output_dir/new-initrd.img if [ $? != 0 ];then @@ -214,7 +201,7 @@ echo "--> extract files from rootfs-rpms to squashfs root" for ff in $rootfs_rpms_dir/*.rpm ; do rpm2cpio $ff | cpio -idu; done echo "--> extract files from kernel and its modular rpms to squashfs root" -for kf in $kernel_rpms_dir/$mode/*.rpm ; do rpm2cpio $kf | cpio -idu; done +for kf in ${kernel_rpms_dir}/std/*.rpm ; do rpm2cpio $kf | cpio -idu; done echo "-->check module dependencies in new squashfs.img in chroot context" #we are using the same new kernel-xxx.rpm, so the $new_ver is the same diff --git a/build-tools/update-pxe-network-installer b/build-tools/update-pxe-network-installer index f32d9297..2aed5dec 100755 --- a/build-tools/update-pxe-network-installer +++ b/build-tools/update-pxe-network-installer @@ -4,20 +4,6 @@ ## created by Yong Hu (yong.hu@intel.com), 05/24/2018 -kernel_mode=0 -for arg in "$@"; do - case "$1" in - --std) kernel_mode=0 ;; - --rt) kernel_mode=1 ;; - --help) echo "Update pxe-network-installer images"; - echo "$(basename $0) --std for standard kernel mode, or" - echo "$(basename $0) --rt for realtime kernel mode"; - exit 0;; - *) echo "unknown argument"; - exit 1;; - esac -done - echo "Start to update pxe-network-installer images .... " timestamp=$(date +%F_%H%M) cur_dir=$PWD @@ -36,14 +22,6 @@ if [ ! -d $orig_img_dir ];then mkdir -p $orig_img_dir fi -orig_kernel_img="$MY_REPO/$CENTOS_REPO/Binary/images/pxeboot/vmlinuz" -if [ -f $orig_kernel_img ]; then - cp -f $orig_kernel_img $pxe_network_installer_dir/$orig_img_dir/. -else - echo "$orig_kernel_img does not exit" - exit -1 -fi - orig_initrd_img="$MY_REPO/$CENTOS_REPO/Binary/images/pxeboot/initrd.img" if [ -f $orig_initrd_img ]; then cp -f $orig_initrd_img $pxe_network_installer_dir/$orig_img_dir/. @@ -125,24 +103,6 @@ else exit -1 fi -echo "--> find mlnx-ofa_kernel" -mlnx_ofa_kernel=$(find $MY_BUILD_DIR/std/rpmbuild/RPMS -type f -name "mlnx-ofa_kernel-[0-9]*.x86_64.rpm") -if [ -n $mlnx_ofa_kernel ] && [ -f $mlnx_ofa_kernel ];then - cp -f $mlnx_ofa_kernel $kernel_rpms_std/. -else - echo "ERROR: failed to find mlnx-ofa_kernel module RPM!" - exit -1 -fi - -echo "--> find mlnx-ofa_kernel-devel" -mlnx_ofa_kernel_devel=$(find $MY_BUILD_DIR/std/rpmbuild/RPMS -type f -name "mlnx-ofa_kernel-devel-[0-9]*.x86_64.rpm") -if [ -n $mlnx_ofa_kernel_devel ] && [ -f $mlnx_ofa_kernel_devel ];then - cp -f $mlnx_ofa_kernel_devel $kernel_rpms_std/. -else - echo "ERROR: failed to find mlnx-ofa_kernel-devel module RPM!" - exit -1 -fi - echo "--> find mlnx-ofa_kernel_modules" mlnx_ofa_kernel_modules=$(find $MY_BUILD_DIR/std/rpmbuild/RPMS -type f -name "mlnx-ofa_kernel-modules-[0-9]*.x86_64.rpm") if [ -n $mlnx_ofa_kernel_modules ] && [ -f $mlnx_ofa_kernel_modules ];then @@ -153,52 +113,6 @@ else fi echo " -------- successfully found standard kernel rpm and related kernel modules --------" echo "" -echo "" -echo " -------- start to search realtime kernel rpm and related kernel modules --------" -echo "--> find realtime kernel rpm" -rt_kernel=$(find $MY_BUILD_DIR/export/dist/isolinux/Packages/ -type f -name "kernel-rt-[0-9]*.rpm") -if [ -n $rt_kernel ] && [ -f $rt_kernel ];then - cp -f $rt_kernel $kernel_rpms_rt/. -else - echo "ERROR: failed to find realtime kernel RPM!" - exit -1 -fi - -echo "--> find realtime e1000e kernel module" -rt_e1000e_module=$(find $MY_BUILD_DIR/rt/rpmbuild/RPMS -type f -name "kmod-e1000e-rt-[0-9]*.x86_64.rpm") -if [ -n $rt_e1000e_module ] && [ -f $rt_e1000e_module ];then - cp -f $rt_e1000e_module $kernel_rpms_rt/. -else - echo "ERROR: failed to find realtime e1000e kernel module RPM!" - exit -1 -fi - -echo "--> find realtime i40e kernel module" -rt_i40e_module=$(find $MY_BUILD_DIR/rt/rpmbuild/RPMS -type f -name "kmod-i40e-rt-[0-9]*.x86_64.rpm") -if [ -n $rt_i40e_module ] && [ -f $rt_i40e_module ];then - cp -f $rt_i40e_module $kernel_rpms_rt/. -else - echo "ERROR: failed to find realtime i40e kernel module RPM!" - exit -1 -fi - -echo "--> find realtime ixgbe kernel module" -rt_ixgbe_module=$(find $MY_BUILD_DIR/rt/rpmbuild/RPMS -type f -name "kmod-ixgbe-rt-[0-9]*.x86_64.rpm") -if [ -n $rt_ixgbe_module ] && [ -f $rt_ixgbe_module ];then - cp -f $rt_ixgbe_module $kernel_rpms_rt/. -else - echo "ERROR: failed to find realtime ixgbe kernel module RPM!" - exit -1 -fi - -echo "--> find realtime tpm kernel module" -rt_tpm_module=$(find $MY_BUILD_DIR/rt/rpmbuild/RPMS -type f -name "kmod-tpm-rt-[0-9]*.x86_64.rpm") -if [ -n $rt_tpm_module ] && [ -f $rt_tpm_module ];then - cp -f $rt_tpm_module $kernel_rpms_rt/. -else - echo "ERROR: failed to find realtime tpm kernel module RPM!" - exit -1 -fi rootfs_rpms="$pxe_network_installer_dir/rootfs-rpms" if [ -d $rootfs_rpms ];then @@ -206,10 +120,6 @@ if [ -d $rootfs_rpms ];then fi mkdir -p $rootfs_rpms - -echo " -------- successfully found realtime kernel rpm and related kernel modules --------" -echo "" - echo " step 3: start to search rpms for rootfs" echo "--> find anaconda rpm" anaconda=$(find $MY_BUILD_DIR/installer/rpmbuild/RPMS -type f -name "anaconda-[0-9]*.x86_64.rpm") @@ -229,33 +139,6 @@ else exit -1 fi -echo "--> find anaconda-debuginfo rpm" -anaconda_debuginfo=$(find $MY_BUILD_DIR/installer/rpmbuild/RPMS -type f -name "anaconda-debuginfo-[0-9]*.x86_64.rpm") -if [ -n $anaconda_debuginfo ] && [ -f $anaconda_debuginfo ];then - cp -f $anaconda_debuginfo $rootfs_rpms/. -else - echo "ERROR: failed to find anaconda-debuginfo RPM!" - exit -1 -fi - -echo "--> find anaconda-dracut rpm" -anaconda_dracut=$(find $MY_BUILD_DIR/installer/rpmbuild/RPMS -type f -name "anaconda-dracut-[0-9]*.x86_64.rpm") -if [ -n $anaconda_dracut ] && [ -f $anaconda_dracut ];then - cp -f $anaconda_dracut $rootfs_rpms/. -else - echo "ERROR: failed to find anaconda-dracut RPM!" - exit -1 -fi - -echo "--> find anaconda-gui rpm" -anaconda_gui=$(find $MY_BUILD_DIR/installer/rpmbuild/RPMS -type f -name "anaconda-gui-[0-9]*.x86_64.rpm") -if [ -n $anaconda_gui ] && [ -f $anaconda_gui ];then - cp -f $anaconda_gui $rootfs_rpms/. -else - echo "ERROR: failed to find anaconda-gui RPM!" - exit -1 -fi - echo "--> find anaconda-tui rpm" anaconda_tui=$(find $MY_BUILD_DIR/installer/rpmbuild/RPMS -type f -name "anaconda-tui-[0-9]*.x86_64.rpm") if [ -n $anaconda_tui ] && [ -f $anaconda_tui ];then @@ -274,15 +157,6 @@ else exit -1 fi -echo "--> find anaconda-widgets-devel rpm" -anaconda_widgets_devel=$(find $MY_BUILD_DIR/installer/rpmbuild/RPMS -type f -name "anaconda-widgets-devel-[0-9]*.x86_64.rpm") -if [ -n $anaconda_widgets_devel ] && [ -f $anaconda_widgets_devel ];then - cp -f $anaconda_widgets_devel $rootfs_rpms/. -else - echo "ERROR: failed to find anaconda-widgets-devel RPM!" - exit -1 -fi - echo "--> find rpm-xx.x86_64 rpm" rpm_rpm=$(find $MY_BUILD_DIR/installer/rpmbuild/RPMS -type f -name "rpm-[0-9]*.x86_64.rpm") if [ -n $rpm_rpm ] && [ -f $rpm_rpm ];then @@ -364,6 +238,15 @@ else exit -1 fi +echo "--> find lz4 rpm" +lz4_rpm=$(find $MY_BUILD_DIR/export/dist/isolinux/Packages -type f -name "lz4-[0-9]*.x86_64.rpm") +if [ -n $lz4_rpm ] && [ -f $lz4_rpm ];then + cp -f $lz4_rpm $rootfs_rpms/. +else + echo "ERROR: failed to find lz4_rpm RPM!" + exit -1 +fi + echo "--> find bind-utils rpm" bind_utils=$(find $MY_BUILD_DIR/export/dist/isolinux/Packages -type f -name "bind-utils-[0-9]*.x86_64.rpm") if [ -n $bind_utils ] && [ -f $bind_utils ];then @@ -386,11 +269,7 @@ echo " ---------------- successfully found rpms for rootfs --------------------- echo "step 4: make installer images in this work dir" same_folder="$(dirname ${BASH_SOURCE[0]})" mk_images_tool="$same_folder/make-installer-images.sh" -if [ $kernel_mode -eq 0 ];then - sudo $mk_images_tool $pxe_network_installer_dir "std" -else - sudo $mk_images_tool $pxe_network_installer_dir "rt" -fi +sudo $mk_images_tool $pxe_network_installer_dir cd $cur_dir echo "updating pxe-network-installer images -- done!" From 99573f2f5e9b35fec31f76359c9f224f3e1ed367 Mon Sep 17 00:00:00 2001 From: slin14 Date: Wed, 5 Sep 2018 20:04:12 +0800 Subject: [PATCH 3/3] upgrade package name to CentOS 7.5 version Story: 2003389 Task: 24556 Depends-On: https://review.openstack.org/597982 Change-Id: Ie3e6d90dce146d49323d4b2d653917f08e0a64da Signed-off-by: slin14 --- build-tools/build_iso/minimal_rpm_list.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/build_iso/minimal_rpm_list.txt b/build-tools/build_iso/minimal_rpm_list.txt index 04e17176..3d7a7418 100644 --- a/build-tools/build_iso/minimal_rpm_list.txt +++ b/build-tools/build_iso/minimal_rpm_list.txt @@ -201,7 +201,7 @@ policycoreutils popt procps-ng pth -pygobject3-base +python-gobject-base pygpgme pyliblzma python