#version=DEVEL # Firewall configuration firewall --enabled --service=mdns,ssh repo --name="fedora" --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch repo --name="updates" --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch repo --name="fedora-ac100" --baseurl=http://repos.fedorapeople.org/repos/kwizart/ac100/fedora-$releasever/armhfp/ repo --name="kwizart" --baseurl=http://rpms.kwizart.net/fedora/$releasever/armhfp/ repo --name="kwizart-testing" --baseurl=http://rpms.kwizart.net/fedora/testing/$releasever/armhfp/ # System authorization information auth --useshadow --enablemd5 # Run the Setup Agent on first boot firstboot --reconfig # System language lang en_US.UTF-8 # SELinux configuration selinux --enforcing # Installation logging level logging --level=info # System services services --disabled="network" --enabled="sshd,NetworkManager,avahi-daemon,chronyd" # System bootloader configuration bootloader --location=none # Disk partitioning information part /boot --fstype="ext4" --size=300 --label=bootfs part / --fstype="ext4" --grow --size=3500 --label=rootfs %post # setup systemd to boot to the right runlevel echo -n "Setting default runlevel to multiuser graphical mode" rm -f /etc/systemd/system/default.target ln -s /lib/systemd/system/graphical.target /etc/systemd/system/default.target echo . echo -n "Enabling initial-setup text mode on startup" ln -fs /usr/lib/systemd/system/initial-setup-graphical.service /etc/systemd/system/graphical.target.wants/initial-setup-graphical.service echo . # Tweak cma - Allow plymouth to boot with serial console set sed -i -e 's/rootwait/rootwait cma=128M plymouth.ignore-serial-consoles/' /etc/sysconfig/arm-boot-config #from fedora-arm-base.ks /usr/sbin/a-b-c #Exclude kernel from fedora-release repos sed -i -e "s/\[updates\]/\[updates\]\nexclude=kernel/1" /etc/yum.repos.d/fedora-updates.repo # Add fedora-ac100.repo cat > /etc/yum.repos.d/fedora-ac100.repo<<'EOF' # Place this file in your /etc/yum.repos.d/ directory [fedora-ac100] name=Add ac100 support to fedora baseurl=http://repos.fedorapeople.org/repos/kwizart/ac100/fedora-$releasever/$basearch/ enabled=1 skip_if_unavailable=1 gpgcheck=0 [fedora-ac100-source] name=Add ac100 support to fedora - Source baseurl=http://repos.fedorapeople.org/repos/kwizart/ac100/fedora-$releasever/SRPMS enabled=0 skip_if_unavailable=1 gpgcheck=0 EOF # zram module cat > /etc/modules-load.d/zram.conf< /etc/modprobe.d/zram.conf< /etc/udev/rules.d/10-zram.rules< /boot/simple-boot.cmd<<'EOF' # simple-boot.cmd # mkimage -A arm -O linux -T script -C none -d /boot/simple-boot.cmd /boot/boot.scr.uimg if test $soc = tegra2; then setenv soc tegra20 fi if test -z $fdt_high ; then setenv fdt_high 0x2C000000 fi ext2load $devtype $devnum $kernel_addr_r /vmlinuz${u_kernel} ext2load $devtype $devnum $ramdisk_addr_r /uInitrd${u_kernel} ext2load $devtype $devnum $fdt_addr_r /dtb${u_kernel}/$soc-$board.dtb setenv bootargs 'console=ttyS0,115200n8 root=@ROOT_UUID@ ro rootwait rhgb quiet rd.fstab=0' sleep $bootdelay bootz $kernel_addr_r $ramdisk_addr_r $fdt_addr_r EOF ROOT_UUID=$(grep ^u_root= /boot/boot.cmd) sed -i "s/@ROOT_UUID@/${ROOT_UUID}/" /boot/simple-boot.cmd mkimage -A arm -O linux -T script -C none -d /boot/simple-boot.cmd /boot/simple-boot.scr cat > /etc/kernel/postinst.d/52-arm-simple-boot.postinst.sh<<'EOF' #!/bin/bash rm -f /boot/vmlinuz /boot/dtb ln /boot/vmlinuz-$1 /boot/vmlinuz ln -s dtb-$1 /boot/dtb EOF chmod +x /etc/kernel/postinst.d/52-arm-simple-boot.postinst.sh ln /boot/vmlinuz-$(cat /boot/klist.txt) /boot/vmlinuz ln -s dtb-$(cat /boot/klist.txt) /boot/dtb # Remove dracut-config-generic yum -y remove dracut-config-generic # Update u-boot script cat > /usr/local/bin/tegra-bootloader-update<<'EOF' #!/bin/bash # Tegra eMMC bootloader update script # # Nicolas Chauvet - 2014 # # Only tested on paz00 and jetson-tk1 with emmc boot area # sed -e TEGRA_DEVICE=${1:-paz00} TEGRA_BCT=${TEGRA_DEVICE}.bct TEGRA_UBOOT=/usr/share/uboot/${TEGRA_DEVICE}/u-boot-dtb-tegra.bin # Check that we are on internal/external mmc if [ -b /dev/mmcblk0boot0 ] ; then TEGRA_MMC=mmcblk0 elif [ -b /dev/mmcblk1boot0 ] ; then TEGRA_MMC=mmcblk1 else echo "Error: your device boot device should have been either mmcblk0/mmcblk1" exit 1 fi # Extract the bct and dissassemble to test usability if [ ! -f ${TEGRA_BCT}.cfg ] ; then # It is not allowed to redistribute this file by Toshiba dd if=/dev/${TEGRA_MMC}boot0 of=${TEGRA_BCT}_old bs=4080 count=1 bct_dump ${TEGRA_BCT}_old > ${TEGRA_BCT}.cfg ret=$? [ $ret == 0 ] || rm -fr ${TEGRA_BCT}* cbootimage -gbct ${TEGRA_BCT}.cfg -s tegra20 ${TEGRA_BCT} fi if [ -f ${TEGRA_UBOOT} ] ; then cp -p ${TEGRA_UBOOT} $HOME fi cat > paz00-emmc.img.cfg< jetson-tk1-emmc.img.cfg< /sys/block/${TEGRA_MMC}boot0/force_ro echo "Now you can update uboot running as root:" echo "cat ${TEGRA_DEVICE}-emmc.img > /dev/${TEGRA_MMC}boot0" echo "" EOF chmod +x /usr/local/bin/tegra-bootloader-update mkdir -p /usr/share/alsa/ucm/{PAZ00,tegraalc5632} cat > /usr/share/alsa/ucm/tegraalc5632/tegraalc5632.conf<<'EOF' # UCM configuration for tegra-alc5632 ValueDefaults { PlaybackCTL "hw:0" CaptureCTL "hw:0" } SectionDefaults [ exec "echo Im setting defaults for tegra-alc5632" cdev "hw:tegraalc5632" cset "name='Master Playback Switch' on" cset "name='Master Playback Volume' 44,44" cset "name='Headphone Playback Switch' on" cset "name='Headphone Playback Volume' 21,21" cset "name='Speaker Playback Switch' on" cset "name='Speaker Playback Volume' 21,21" cset "name='Speaker Mix DAC2SPK Playback Switch' on" cset "name='SpeakerOut Mux' 2" cset "name='SpeakerOut N Mux' LN/-R" cset "name='AB-D Amp Mux' 0" cset "name='HPL Mix DACL2HP Playback Switch' on" cset "name='HPR Mix DACR2HP Playback Switch' on" cset "name='Int Spk Switch' on" cset "name='Left Headphone Mux' 1" cset "name='Right Headphone Mux' 1" cset "name='DMIC En Capture Switch' on" cset "name='DMIC PreFilter Capture Switch' on" cset "name='DMIC Boost Capture Volume' 4" cset "name='Rec Capture Volume' 24" ] EOF cat > /usr/share/alsa/ucm/PAZ00/PAZ00.conf<<'EOF' Comment "PAZ00 alc5632" ValueDefaults { PlaybackCTL "hw:0" CaptureCTL "hw:0" } SectionDefaults [ cdev "hw:PAZ00" cset "name='Master Playback Switch' on" cset "name='Master Playback Volume' 44,44" cset "name='Headphone Playback Volume' 21,21" cset "name='Speaker Playback Volume' 21,21" cset "name='SpeakerOut Mux' 2" cset "name='SpeakerOut N Mux' LN/-R" cset "name='AB-D Amp Mux' 0" cset "name='Left Headphone Mux' 1" cset "name='Right Headphone Mux' 1" cset "name='DMIC Boost Capture Volume' 4" cset "name='Rec Capture Volume' 24" # Fix external mic record volumes cset "name='Mic 1 Boost Volume' 0" #cset "name='Mic1 Capture Volume' 0" cset "name='Rec Capture Volume' 0" ] SectionUseCase."HiFi" { File "HiFi.conf" Comment "Music playback" } SectionUseCase."Record" { File "Record.conf" Comment "Playback and capture" } EOF cat > /usr/share/alsa/ucm/PAZ00/HiFi.conf<<'EOF' SectionVerb { EnableSequence [ cdev "hw:PAZ00" cset "name='Speaker Playback Switch' on" cset "name='Int Spk Switch' on" cset "name='Speaker Mix DAC2SPK Playback Switch' on" cset "name='DMICL Mix DMICL2ADC Capture Switch' on" cset "name='DMIC En Capture Switch' on" cset "name='DMIC PreFilter Capture Switch' on" ] DisableSequence [ cset "name='Speaker Playback Switch' off" cset "name='Int Spk Switch' off" cset "name='Speaker Mix DAC2SPK Playback Switch' off" cset "name='DMICL Mix DMICL2ADC Capture Switch' off" cset "name='DMIC En Capture Switch' off" cset "name='DMIC PreFilter Capture Switch' off" ] } SectionDevice."Headset".0 { Comment "3.5mm Headset" Value { JackName "Paz00 Headset Jack" } EnableSequence [ cdev "hw:PAZ00" # Internal speaker cset "name='Int Spk Switch' off" # Internal mic cset "name='DMIC En Capture Switch' off" # Headphones cset "name='Headphone Playback Switch' on" cset "name='HPL Mix DACL2HP Playback Switch' on" cset "name='HPR Mix DACR2HP Playback Switch' on" # External min cset "name='Left Capture Mix MIC12REC_L Capture Switch' on" ] DisableSequence [ cdev "hw:PAZ00" # Headphones cset "name='Headphone Playback Switch' off" cset "name='HPL Mix DACL2HP Playback Switch' off" cset "name='HPR Mix DACR2HP Playback Switch' off" # External mic cset "name='Left Capture Mix MIC12REC_L Capture Switch' on" # Internal speaker cset "name='Int Spk Switch' on" # Internal mic cset "name='DMIC En Capture Switch' on" ] } EOF cat > /usr/share/alsa/ucm/PAZ00/Record.conf<<'EOF' SectionVerb { EnableSequence [ cdev "hw:PAZ00" cset "name='Speaker Playback Switch' on" cset "name='Int Spk Switch' on" cset "name='Speaker Mix DAC2SPK Playback Switch' on" cset "name='DMICL Mix DMICL2ADC Capture Switch' on" cset "name='DMIC En Capture Switch' on" cset "name='DMIC PreFilter Capture Switch' on" ] DisableSequence [ cset "name='Speaker Playback Switch' off" cset "name='Int Spk Switch' off" cset "name='Speaker Mix DAC2SPK Playback Switch' off" cset "name='DMICL Mix DMICL2ADC Capture Switch' off" cset "name='DMIC En Capture Switch' off" cset "name='DMIC PreFilter Capture Switch' off" ] } SectionDevice."Headset".0 { Comment "3.5mm Headset" Value { JackName "Paz00 Headset Jack" } EnableSequence [ cdev "hw:PAZ00" # Internal speaker cset "name='Int Spk Switch' off" # Internal mic cset "name='DMIC En Capture Switch' off" # Headphones cset "name='Headphone Playback Switch' on" cset "name='HPL Mix DACL2HP Playback Switch' on" cset "name='HPR Mix DACR2HP Playback Switch' on" # External min cset "name='Left Capture Mix MIC12REC_L Capture Switch' on" ] DisableSequence [ cdev "hw:PAZ00" # Headphones cset "name='Headphone Playback Switch' off" cset "name='HPL Mix DACL2HP Playback Switch' off" cset "name='HPR Mix DACR2HP Playback Switch' off" # External mic cset "name='Left Capture Mix MIC12REC_L Capture Switch' on" # Internal speaker cset "name='Int Spk Switch' on" # Internal mic cset "name='DMIC En Capture Switch' on" ] } EOF cat > /usr/local/bin/manage-soundcard<<'FOE' #!/usr/bin/bash action=$1 amixer -c 0 -sq <<-EOF set 'Speaker Mix DAC2SPK' $action set 'Speaker Mix MIC12SPK' $action set 'HPR Mix DACR2HP' $action set 'HPL Mix DACL2HP' $action EOF FOE chmod +x /usr/local/bin/manage-soundcard cat > /etc/systemd/system/manager-soundcard.service<<'EOF' [Unit] Description=Mute Soundcard [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/local/bin/manage-soundcard unmute ExecStop=/usr/local/bin/manage-soundcard mute StandardOutput=syslog [Install] WantedBy=basic.target EOF %end %packages @base-x @core @fonts @input-methods @lxde-apps @lxde-desktop @lxde-media @lxde-office @multimedia @networkmanager-submodules @printing @standard arm-boot-config cbootimage chrony criu dracut-config-generic dracut-modules-growroot extlinux-bootloader f2fs-tools fedora-release fedora-release-notes gdisk gnash-plugin gnome-power-manager initial-setup initial-setup-gui kernel kmscon metacity midori notification-daemon parted system-config-date system-config-keyboard system-config-language uboot-images-armv7 xorg-x11-drv-evdev xorg-x11-drv-fbdev xorg-x11-drv-freedreno xorg-x11-drv-modesetting xorg-x11-drv-opentegra -PackageKit* -acpid -autofs -desktop-backgrounds-basic -dvd+rw-tools -foomatic -foomatic-db-ppds -fprintd-pam -gimp-help -gnome-disk-utility -gnomebaker -ibus-typing-booster -pcmciautils -policycoreutils-gui -polkit-gnome -polkit-kde -prelink -realmd -rng-tools -stix-fonts -system-config-network -system-config-rootpassword -transmission -transmission-cli -transmission-common -transmission-gtk -xfce4-notifyd -xorg-x11-drv-ati -xorg-x11-drv-mga -xorg-x11-drv-omap -xscreensaver-extras %end