From 51dece94abb3340912607a29e09ee08b2c03d14f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 12 May 2021 18:13:55 -0400 Subject: [PATCH] Add draft for what will be genimage Still very much prototype, but put it in github to prepare to bring it together. --- .../diskless/build/dracut/add_root | Bin 0 -> 16984 bytes .../diskless/build/dracut/install | 36 ++++++++++++++++++ .../diskless/build/dracut/installkernel | 11 ++++++ .../diskless/build/dracut/start_root | Bin 0 -> 14464 bytes confluent_osdeploy/diskless/build/genimage | 15 ++++++++ confluent_osdeploy/diskless/build/pkglist | 2 + 6 files changed, 64 insertions(+) create mode 100755 confluent_osdeploy/diskless/build/dracut/add_root create mode 100644 confluent_osdeploy/diskless/build/dracut/install create mode 100644 confluent_osdeploy/diskless/build/dracut/installkernel create mode 100755 confluent_osdeploy/diskless/build/dracut/start_root create mode 100644 confluent_osdeploy/diskless/build/genimage create mode 100644 confluent_osdeploy/diskless/build/pkglist diff --git a/confluent_osdeploy/diskless/build/dracut/add_root b/confluent_osdeploy/diskless/build/dracut/add_root new file mode 100755 index 0000000000000000000000000000000000000000..76d1d0a7355a82dc73c89b2dbf99dd9405aa7c13 GIT binary patch literal 16984 zcmeHOeQX@X6`%9Pv4P}#ff$^mNv@PuA=Gzva4Z9LbLWp_T{*!db^$@yobNXFN%xW7 z?SY;0;Whzb5kvY{{RcupYDH8~MJ1#Hs)~aPA}Xy&TU8)h)kRHlDxkq7Q7Aaq_h#N( z@9pgswdx;LyOW%M^M3DRX5Y^4?cB~h(A&Sg#^)1U{Nk$urMaMDqNJF&$0#oogzSeR`W+{~iE9}HN_#GGJcsstX2}B2)QUR-sLWQpbCFo75>U9d}|f{0pLUMah6Ac2sufR zah$sK6YmRGyV#4wXg-%Sg)wF%(xR9xjK=c@kjYeD=z3x-uJ2D}4aV|<9Soh#8X*;GM?ymv7^7Qt6Sd^ZnJ7z!dr#jH@H(z8hK+RRWObG;Lh%JE^7?N zhtmc`8_DFd6irvAu7=q48aUfE@}H9MT>C)o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hU=np9T)|$Nu~~(KJ11j-r#Tus`E+aJKu4C>ggX~Ak8sxZrem)J7 zztbMuvX@oVKABr8_WzQ_s0#brk;jhRw1Wa3ryIk1P$I?s;rlQC{>6Q_`_JJQ6O<<$ X!MR8i?t31hbaC5K}IQE literal 0 HcmV?d00001 diff --git a/confluent_osdeploy/diskless/build/dracut/install b/confluent_osdeploy/diskless/build/dracut/install new file mode 100644 index 00000000..9799ff13 --- /dev/null +++ b/confluent_osdeploy/diskless/build/dracut/install @@ -0,0 +1,36 @@ +dracut_install /usr/bin/clevis-encrypt-tpm2 /usr/bin/clevis-decrypt-tpm2 /usr/bin/jose /usr/bin/mktemp +dracut_install /lib64/libtss2-tcti-device.so.0 +dracut_install /usr/bin/tpm2_create /usr/bin/tpm2_pcrread /usr/bin/tpm2_createpolicy /usr/bin/tpm2_createprimary /usr/bin/tpm2_load /usr/bin/tpm2_unseal +dracut_install curl openssl tar cpio gzip lsmod ethtool xz lsmod ethtool +dracut_install modprobe touch echo cut wc bash netstat uniq grep ip hostname +dracut_install awk egrep dirname expr sort +dracut_install ssh sshd reboot parted mkfs mkfs.ext4 mkfs.xfs xfs_db mkswap +dracut_install efibootmgr +dracut_install du df ssh-keygen scp clear dhclient +dracut_install /lib64/libnss_dns-2.28.so /lib64/libnss_dns.so.2 +dracut_install /usr/lib64/libnl-3.so.200 +dracut_install /etc/nsswitch.conf /etc/services /etc/protocols +dracut_install chmod whoami head tail basename tr +inst /bin/bash /bin/sh +dracut_install /lib64/libfuse.so.2 /lib64/libfuse.so.2.9.7 +dracut_install chown chroot dd expr kill parted rsync sort blockdev findfs insmod lvm +dracut_install /usr/lib/udev/rules.d/10-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules + + + + + + + + +#this would be nfs with lock, but not needed, go nolock +#dracut_install mount.nfs rpcbind rpc.statd /etc/netconfig sm-notify +dracut_install mount.nfs /etc/netconfig +inst /usr/lib/dracut/modules.d/40network/net-lib.sh /lib/net-lib.sh + + + +# network mount, and disk imaging helpers can come from a second stage +# this is narrowly focused on getting network up and fetching images +# and those images may opt to do something with cloning or whatever + diff --git a/confluent_osdeploy/diskless/build/dracut/installkernel b/confluent_osdeploy/diskless/build/dracut/installkernel new file mode 100644 index 00000000..c2e9cfdb --- /dev/null +++ b/confluent_osdeploy/diskless/build/dracut/installkernel @@ -0,0 +1,11 @@ +#!/bin/bash +instmods nfsv3 nfs_acl nfsv4 dns_resolver lockd fscache sunrpc +instmods e1000 e1000e igb sfc mlx5_ib mlx5_core mlx4_en cxgb3 cxgb4 tg3 bnx2 bnx2x bna ixgb ixgbe qlge mptsas mpt2sas mpt3sas megaraid_sas ahci xhci-hcd sd_mod pmcraid be2net vfat ext3 ext4 usb_storage scsi_wait_scan ipmi_si ipmi_devintf qlcnic xfs +instmods nvme +instmods cdc_ether +instmods mptctl +instmods mlx4_ib mlx5_ub ib_umad ib_ipoib +instmods i40e hfi1 bnxt_en qed qede +instmods dm-mod dm-log raid0 raid1 raid10 raid456 dm-raid dm-thin-pool dm-crypt dm-snapshot linear dm-era +# nfs root and optionally gocryptfs +instmods fuse overlay squashfs loop diff --git a/confluent_osdeploy/diskless/build/dracut/start_root b/confluent_osdeploy/diskless/build/dracut/start_root new file mode 100755 index 0000000000000000000000000000000000000000..2b2a821820477139ae9444a3432cd6323531a2ef GIT binary patch literal 14464 zcmeHOeQX>@6`!-?=9J)fEt<59I4@2AvK7qG6f;{i}VjrD^%)WR0ScZQ;`ycDpHgP8#Tc_ni6Q7<-Oha z*6Wom5FZjqJJ#KA-tWEN%Xv# z-ajmE6E}dp!R8!))B*51}oh`Ktgtbw;VH1yyU9w8#?)+=Kh9S@_Zb!^mC zVU=t@9;I9n=7?-F& zM$RYZ1Yd1*9DbC+hefvEh4AYRkj{^t6wio#V0q}GnfO=w+ef-%vfYgEBlp9|{p|-G z=H;I)e3~Dm{?{S`sI)O=#8fz7Z=R?Kpq{4$+E~8{ zUKnE^f9MNP6BWp9hSwSWm#N+5<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_{~n`LuB*5 zzHMal9=m$7d4C_?6JcThmFrdp?HSq}=iXaTh4;FhCO_|S`vHoe@ZP*S#}r!$8Av8d zv`>!r=9MS_@0+mjUcp-(Q=FrYnRhnBu8jK}#qpj&?*De;`S{+qoa2MM+7vv>w2yb5 zjt`y;+BWAMZaHoHhvfe&*?b(-{C^C1pSQokCOY3y!hM8;gjvE#LcjhW+2N=Y(X)5& zee#ZhA=uqokRwe>v(nTMxwl~3k)6Z{q2$N%X3o@xgkq%Oo<1v-bjH+`(R4w9FAlPL z&YbX2Lj?nNQX2`PVjaB=rZy_<@G&hvCX~cPIzN$e(9AiWNA+CZ$fQ>paq#8zq=o{j zWs@e30=`60psI|*ZeF{R*N25->f>O-wp|0FGYQSqgrbkdM{-(9kB=pwHMX2K;#w}J z!O&5`b?8b<8PJ#`AIj&2GMq`Jbl3s>?-t(M&DTL4O)N&fKDi&Bmu%x@@7?3tMtVk> z0}1&$VES&Tc=ZQJ&xqfTc*_Q_0rlPR^6EcJdPdn7@7MQ$|2?>-`1pCLkf#O{~B<(X0V>u2}WLTdHfv5 zm^C8TtPYQds=wAHO5>>SbEL7_+u&<&E6jym-c^FHry^$8!s8GtT(*Gvr_# zWFaBz7{BM!!;cJ{LRfH5j6<`IqQv*1;yr%;KhDVi-#Ol&Kb)Vace{}(lJFRr41WE~ z;PC2?v5v5lg@k_n&w=;q=SjzCJ3Vdi{9)=WRA5h%eGMYVpIi9%I{tXJ8Q%g;jYrR) zYfiwN+9m!poSb{)O!xZQXB=^yq_;V#emyIsbqU@R6d Ta^H@}d2gi#H*p|2eWv(3?PxuU literal 0 HcmV?d00001 diff --git a/confluent_osdeploy/diskless/build/genimage b/confluent_osdeploy/diskless/build/genimage new file mode 100644 index 00000000..0240aede --- /dev/null +++ b/confluent_osdeploy/diskless/build/genimage @@ -0,0 +1,15 @@ +installroot=$1 + +touch $installroot/.testcap +if setcap cap_net_raw+p $installroot/.testcap >& /dev/null; then + capsargs="" +else + capsargs="--setopt=tsflags=nocapps" +fi +rm $installroot/.testcap +yum $capsargs --releasever=8 --installroot=/var/tmp/testgenimage/ --releasever=8.3 install '@minimal-environment' chrony kernel net-tools nfs-utils openssh-server rsync tar util-linux python3 tar dracut dracut-network ethtool parted openssl dhclient openssh-clients bash vim-minimal rpm iputils shim-x64 grub2-efi-x64 +dracut -v --xz -N -m "stateless base terminfo" -f boot/initramfs-diskless 4.18.0-240.22.1.el8_3.x86_64 +# link kernel, initrd, grub, and shim as appropriate + +# use xz, minimize https burden and transfer penalty +mksquashfs -comp xz diff --git a/confluent_osdeploy/diskless/build/pkglist b/confluent_osdeploy/diskless/build/pkglist new file mode 100644 index 00000000..25242303 --- /dev/null +++ b/confluent_osdeploy/diskless/build/pkglist @@ -0,0 +1,2 @@ +'@minimal-environment' chrony kernel net-tools nfs-utils openssh-server rsync tar util-linux python3 tar dracut dracut-network ethtool parted openssl dhclient openssh-clients bash vim-minimal rpm iputils clevis lvm2 efibootmgr shim-x64.x86_64 grub2-efi-x64 attr +