User Tools

Site Tools


Sidebar

software:switch:fedora_packaging

This is an old revision of the document!


What is this?

An attempt to package as much as possible of the files of Fedora/switch. Could make deployment easier, replaying versions, rollbacks.

T1 xorg library/driver packaging setup

I use noarch for building. One can build the rpms for example on Fedora/x86_64 or rhel7/x86_64 and later install them on switch/aarch64. Used a Fedora30 system the following.

### acting as root
yum -y install rpm-build
useradd -m chris
su - chris

### acting as user from here.
echo '%_topdir /home/chris/Downloads/switch-rpmbuild-xorg' >~/.rpmmacros
# I am disabling binary stripping, not needed with the binaries
# and libraries we are packaging here
echo '%__os_install_post %{nil}' >>~/.rpmmacros

export RPMBLD='/home/chris/Downloads/switch-rpmbuild-xorg'
mkdir -p $RPMBLD/SPECS $RPMBLD/BUILD
cd $RPMBLD

# creating specfile
# see https://fluxcoil.net/files/tmp/switch-fedora-rpm/
$ cat >SPECS/t1-xorg.spec<<EOT
[..]
EOT
exit

### acting now as root
export BUILDROOT='/home/chris/Downloads/switch-rpmbuild-xorg/BUILD'

# mount L4T to /mnt/tmp2
mount /dev/mmcblk0p2 /mnt/tmp2
cd /mnt/tmp2

mkdir -p \
  $BUILDROOT/usr/lib64/xorg/modules/drivers \
  $BUILDROOT/usr/lib64/xorg/modules/extensions \
  $BUILDROOT/usr/bin \
  $BUILDROOT/usr/lib/aarch64-linux-gnu/tegra-egl \
  $BUILDROOT/lib/firmware/

# not only making a copy here, also converting to Fedora
# directory style: lib -> lib64
cp usr/lib/xorg/modules/drivers/nvidia_drv.so \
  $BUILDROOT/usr/lib64/xorg/modules/drivers/
cp usr/lib/xorg/modules/extensions/libglxserver_nvidia.so \
  $BUILDROOT/usr/lib64/xorg/modules/extensions/
cp usr/bin/dock-hotplug \
  $BUILDROOT/usr/bin
cp usr/lib/aarch64-linux-gnu/tegra-egl/* \
  $BUILDROOT/usr/lib/aarch64-linux-gnu/tegra-egl/
cp -r lib/firmware/tegra21x lib/firmware/gm20b \
  $BUILDROOT/lib/firmware/
cp lib/firmware/bcm4354.hcd \
  $BUILDROOT/lib/firmware/

# we also have subdirs and symlinks in here
cp -r usr/lib/aarch64-linux-gnu/tegra \
  $BUILDROOT/usr/lib/aarch64-linux-gnu/

su - chris

### acting as user from here.
# building
rpmbuild -bb SPECS/t1-xorg.spec --target aarch64

[chris@電脳 switch-rpmbuild-xorg]$ ll RPMS/aarch64/t1-xorg-0.1-1.aarch64.rpm 
-rw-rw-r--. 1 chris chris 29198080 Aug 31 12:39 RPMS/aarch64/t1-xorg-0.1-1.aarch64.rpm
[chris@電脳 switch-rpmbuild-xorg]$ 

T1 sound library/driver packaging setup

### acting as user from here.
echo '%_topdir /home/chris/Downloads/switch-rpmbuild-snd' >~/.rpmmacros
# I am disabling binary stripping, not needed with the binaries
# and libraries we are packaging here
echo '%__os_install_post %{nil}' >>~/.rpmmacros

export RPMBLD='/home/chris/Downloads/switch-rpmbuild-snd'
mkdir -p $RPMBLD/SPECS $RPMBLD/BUILD
cd $RPMBLD

# creating a sample specfile
# see https://fluxcoil.net/files/tmp/switch-fedora-rpm/
$ cat >SPECS/t1-sound.spec<<EOT
[..]
EOT
exit

### acting as root
export BUILDROOT='/home/chris/Downloads/switch-rpmbuild-snd/BUILD'

# mount L4T to /mnt/tmp2
mount /dev/mmcblk0p2 /mnt/tmp2
cd /mnt/tmp2

mkdir -p \
  $BUILDROOT/usr/share/alsa/ucm/ \
  $BUILDROOT/usr/share/alsa/cards \
  $BUILDROOT/opt \
  $BUILDROOT/usr/sbin/ \
  $BUILDROOT/etc/systemd/system
  
cp -r usr/share/alsa/ucm/tegra-snd-t210ref-mobile-rt565x \
  $BUILDROOT/usr/share/alsa/ucm/
cp usr/share/alsa/cards/tegra-hda.conf \
  $BUILDROOT/usr/share/alsa/cards/
cp -r opt/nvidia/ \
  $BUILDROOT/opt/
cp usr/sbin/nv* usr/sbin/brcm* \
  $BUILDROOT/usr/sbin/
cp -r etc/nv* \
  $BUILDROOT/etc/
cp etc/systemd/nv* \
  $BUILDROOT/etc/systemd
# symlink points to not existing path, ignorehttps://fluxcoil.net/software/switch/fedora_streamlined_inst
cp etc/systemd/system/nv*service \
  $BUILDROOT/etc/systemd/system/
cp etc/asound.conf.* \
  $BUILDROOT/etc/

su - chris

### acting as user from here.
# building
rpmbuild -bb SPECS/t1-sound.spec --target aarch64

[chris@電脳 switch-rpmbuild-snd]$ ll RPMS/aarch64/t1-sound-0.1-1.aarch64.rpm 
-rw-rw-r--. 1 chris chris 530156 Aug 31 19:50 RPMS/aarch64/t1-sound-0.1-1.aarch64.rpm
[chris@電脳 switch-rpmbuild-snd]$ 

repos

How to supply the rpm's in repos, instead of transferring them manually, or using “rpm -ivh http://..”?

# offer a directory via https, i.e. with apache.  For example /repo .
# copy the rpms you want in the directory to /repo
# run createrepo, it creates the indexes
# deploy a repo-file on the client, for example:

[chris@電脳 Downloads]$ cat >/etc/yum.repos.d/my.repo <<EOT
[myrepo]
name=myreponame
url=http://ip/repo
enabled=1
EOT
software/switch/fedora_packaging.1567250296.txt · Last modified: 2019/08/31 13:18 by chris