poky_stx_aio_ks.cfg: fix for creating rpm repo 57/3657/1
authorJackie Huang <jackie.huang@windriver.com>
Sat, 9 May 2020 03:54:06 +0000 (11:54 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Sat, 9 May 2020 09:42:21 +0000 (17:42 +0800)
- Update kickstart to generate DNF repo config files
  backport and ajust from:
  https://opendev.org/starlingx/metal/commit/09b95bf651c065e9fffae3255ecf0d0e52a61249

- Add a pre script to adjust the directoris since the
  anaconda image in poky has a different directory structure.

Issue-ID: INF-95
Issue-ID: INF-101
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: I5bd1664078882c6a2ac9c7310bd6bc44ed141b8e

meta-stx/conf/distro/files/ks/poky_stx_aio_ks.cfg

index e08d8fe..3fadb48 100644 (file)
@@ -207,6 +207,16 @@ echo "bootloader --location=mbr $boot_device_arg --timeout=5 --append=\"$append\
 echo "timezone --nontp --utc UTC" >/tmp/timezone-include
 %end
 
+##############################################################
+# pre script for poky-stx
+##############################################################
+%pre
+mkdir -p /run/install/repo
+cp installer-config/* /run/install/repo/
+rm -f /run/install/repo/Packages
+ln -sf /Packages /run/install/repo/Packages
+%end
+
 ##############################################################
 # Main kickstart
 ##############################################################
@@ -676,25 +686,26 @@ else
 fi
 
 . /etc/platform/platform.conf
-# Configure smart package manager channels
-rm -rf /var/lib/smart
-mkdir /var/lib/smart
-/usr/bin/smart channel -y \
-    --add rpmdb type=rpm-sys name="RPM Database"
-/usr/bin/smart channel -y \
-    --add base type=rpm-md name="Base" baseurl=http://controller:${http_port:-8080}/feed/rel-19.12
-/usr/bin/smart channel -y \
-    --add updates type=rpm-md name="Patches" baseurl=http://controller:${http_port:-8080}/updates/rel-19.12
-
-# Configure smart to use rpm --nolinktos option
-/usr/bin/smart config --set rpm-nolinktos=true
-
-# Configure smart to use rpm --nosignature option
-/usr/bin/smart config --set rpm-check-signatures=false
 
 # Delete the CentOS yum repo files
 rm -f /etc/yum.repos.d/CentOS-*
 
+# Create platform yum repo file
+mkdir -p /etc/yum.repos.d
+cat >/etc/yum.repos.d/platform.repo <<EOF
+[platform-base]
+name=platform-base
+baseurl=http://controller:${http_port:-8080}/feed/rel-19.12
+gpgcheck=0
+enabled=1
+
+[platform-updates]
+name=platform-updates
+baseurl=http://controller:${http_port:-8080}/updates/rel-19.12
+gpgcheck=0
+enabled=1
+EOF
+
 # Persist the boot device naming as UDEV rules so that if the network device
 # order changes post-install that we will still be able to DHCP from the
 # correct interface to reach the active controller.  For most nodes only the
@@ -971,8 +982,7 @@ fi
 
 if [ -d $srcdir/Packages ] ; then
     mkdir -p /mnt/sysimage/www/pages/feed/rel-19.12
-    cp -r $srcdir/Packages /mnt/sysimage/www/pages/feed/rel-19.12/Packages
-    cp -r $srcdir/repodata /mnt/sysimage/www/pages/feed/rel-19.12/repodata
+    cp -r $srcdir/Packages/* /mnt/sysimage/www/pages/feed/rel-19.12/
     cp $srcdir/*.cfg /mnt/sysimage/www/pages/feed/rel-19.12
 fi