2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 04:50:21 +00:00
confluent/genesis/buildgenesis.sh

51 lines
2.2 KiB
Bash
Raw Normal View History

2022-04-25 17:14:02 +00:00
pushd $(dirname $0)
2022-04-25 18:46:50 +00:00
rm -rf licenses
2020-08-10 15:39:03 +00:00
cp -a 97genesis /usr/lib/dracut/modules.d/
cat /usr/lib/dracut/modules.d/97genesis/install-* > /usr/lib/dracut/modules.d/97genesis/install
chmod +x /usr/lib/dracut/modules.d/97genesis/install /usr/lib/dracut/modules.d/97genesis/installkernel
2020-08-10 15:39:03 +00:00
mkdir -p boot/initramfs
mkdir -p boot/efi/boot
dracut --no-early-microcode --xz -N -m "genesis base" -f boot/initramfs/distribution $(uname -r)
tdir=$(mktemp -d)
tfile=$(mktemp)
cp boot/initramfs/distribution $tdir
2022-04-25 17:11:43 +00:00
pushd $tdir
xzcat distribution|cpio -dumi
rm distribution
find . -type f -exec rpm -qf /{} \; 2> /dev/null | grep -v 'not owned' | sort -u > $tfile
2022-04-25 17:11:43 +00:00
popd
rm -rf $tdir
cp $tfile rpmlist
cp confluent-genesis.spec confluent-genesis-out.spec
for r in $(cat rpmlist); do
#rpm -qi $r | grep ^License|sed -e 's/^.*:/${r}:/' >> licenselist
for l in $(rpm -qL $r); do
lo=${l#/usr/share/}
2022-04-25 18:46:50 +00:00
lo=${lo#licenses/}
mkdir -p licenses/$(dirname $lo)
2022-04-25 18:15:07 +00:00
cp $l licenses/$lo
2022-04-25 19:46:29 +00:00
echo %license /opt/confluent/genesis/%{arch}/licenses/$lo >> confluent-genesis-out.spec
done
done
2020-08-10 15:39:03 +00:00
cp -f /boot/vmlinuz-$(uname -r) boot/kernel
cp /boot/efi/EFI/BOOT/BOOTX64.EFI boot/efi/boot
cp /boot/efi/EFI/centos/grubx64.efi boot/efi/boot/grubx64.efi
mkdir -p ~/rpmbuild/SOURCES/
2022-04-25 18:02:08 +00:00
tar cf ~/rpmbuild/SOURCES/confluent-genesis.tar boot rpmlist licenses
rpmbuild -bb confluent-genesis-out.spec
2020-08-10 15:39:03 +00:00
rm -rf /usr/lib/dracut/modules.d/97genesis
2022-04-25 17:14:02 +00:00
popd
# getting src rpms would be nice, but centos isn't consistent..
# /usr/lib/dracut/skipcpio /opt/confluent/genesis/x86_64/boot/initramfs/distribution | xzcat | cpio -dumiv
# rpm -qf $(find . -type f | sed -e 's/^.//') |sort -u|grep -v 'not owned' > ../rpmlist
# for f in $(find . -type f | sed -e 's/^.//'); do echo -n $f:; rpm -qf $f ; done > ../annotedrprmlist
# for i in $(cat rpmlist); do rpm -qi $i|grep Source; done |awk '{print $4}'|sort -u > srcrpmlist
# for i in $(cat ../srcrpmlist); do wget --continue http://vault.centos.org/8.2.2004/BaseOS/Source/SPackages/$i; done
# ls > downloadedsrcpmlist
# diff -u srcpmlist downloadedsrcrpmlist
# diff -u srcrpmlist downloadedsrcpmrlist |grep ^-|grep -v srcrpmlist
# for i in $(diff -u srcrpmlist downloadedsrcpmrlist |grep ^-|grep -v srcrpmlist|sed -e s/-//); do wget --continue http://vault.centos.org/8.2.2004/AppStream/Source/SPackages/$i; done