提交 9b9387ff 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!2 submit the source code of oemaker

Merge pull request !2 from zhuchunyi/master
<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel"/>
<%
configdir="tmp/config_files/aarch64"
PXEBOOTDIR="images/pxeboot"
KERNELDIR=PXEBOOTDIR
STAGE2IMG="images/install.img"
LORAXDIR="usr/share/lorax/"
from os.path import basename
%>
## Test ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
%>
mkdir images
install ${runtime_img} ${STAGE2IMG}
treeinfo stage2 mainimage ${STAGE2IMG}
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
## normal aarch64
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%endfor
#FIXME: this will need adjusted when we have a real bootloader.
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft="" %>
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
<%
efiarch32 = None
efiarch64 = 'AA64'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
%>
%for img in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
%endif
# Create optional product.img and updates.img
<% filegraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
treeinfo images-${basearch} ${img}.img images/${img}.img
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
filegraft += " " + workdir + "/iso-graft"
%>
# Add the license files
%for f in glob("/usr/share/licenses/*-release/*"):
install ${f} ${f|basename}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
-graft-points \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${STAGE2IMG}=${outroot}/${STAGE2IMG} \
${efigraft} ${filegraft}
treeinfo images-${basearch} boot.iso images/boot.iso
%endif
<?xml version="1.0" encoding="UTF-8"?>
<image>
<name>${name}</name>
<domain>
<boot type='hvm'>
<guest>
<arch>${arch}</arch>
</guest>
<os>
<loader dev='hd'/>
</os>
%for disk, letter in zip(disks, xrange(97, 123)):
<drive disk='${disk.name}' target='hd${chr(letter)}'/>
%endfor
</boot>
<devices>
<vcpu>${vcpus}</vcpu>
<memory>${memory}</memory>
%for net in networks:
<interface/>
%endfor
<graphics/>
</devices>
</domain>
<storage>
%for disk in disks:
<disk file='${disk.name}' use='system' format='${disk.format}'>
%if disk.checksum:
<checksum type='${disk.checksum_type}'>${disk.checksum}</checksum>
%endif
</disk>
%endfor
</storage>
</image>
<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/>
<%
configdir="tmp/config_files/uboot"
PXEBOOTDIR="images/pxeboot"
DTBDIR="images/pxeboot/dtb"
BOOTDIR="boot"
KERNELDIR=PXEBOOTDIR
STAGE2IMG="images/install.img"
LORAXDIR="usr/share/lorax/"
# keep a comma-delimited list of platforms installed to add to .treeinfo
platforms = ""
delimiter = ''
from os.path import basename
%>
## Test ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
%>
mkdir images
install ${runtime_img} ${STAGE2IMG}
treeinfo stage2 mainimage ${STAGE2IMG}
mkdir ${DTBDIR}
install boot/dtb-*/*dtb ${DTBDIR}/
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
%if kernel.flavor:
installkernel images-${kernel.flavor}-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
installinitrd images-${kernel.flavor}-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
<%
platforms = platforms + delimiter + kernel.flavor
delimiter = ','
%>
%else:
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%endif
%endfor
<% efiargs=""; efigraft="" %>
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
<%
efiarch32 = ARM
efiarch64 = None
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
%>
%for img in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
%endif
# add platform to treeinfo for Beaker support
treeinfo ${basearch} platforms ${platforms}
# Create optional product.img and updates.img
<% filegraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img
treeinfo images-${basearch} ${img}.img images/${img}.img
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
filegraft += " " + workdir + "/iso-graft"
%>
# Add the license files
%for f in glob("/usr/share/licenses/*-release/*"):
install ${f} ${f|basename}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
%if exists("boot/efi/EFI/*/gcdarm.efi"):
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
-graft-points \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${STAGE2IMG}=${outroot}/${STAGE2IMG} \
${efigraft} ${filegraft}
treeinfo images-${basearch} boot.iso images/boot.iso
%endif
splash.lss
- Press the 01<ENTER>07 key to begin the installation process.
#debug --graphics
default=0
splashimage=@SPLASHPATH@
timeout 5
hiddenmenu
title Install @PRODUCT@ 20.03 LTS
findiso
kernel @KERNELPATH@ @ROOT@ quiet
initrd @INITRDPATH@
title Test this media & install @PRODUCT@ 20.03 LTS
findiso
kernel @KERNELPATH@ @ROOT@ rd.live.check quiet
initrd @INITRDPATH@
set default="1"
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install @PRODUCT@ 20.03 LTS' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ ro inst.geoloc=0 console=tty0 smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15 video=efifb:off video=VGA-1:640x480-32@60me
initrd @INITRDPATH@
}
menuentry 'Test this media & install @PRODUCT@ 20.03 LTS' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ rd.live.check inst.geoloc=0 console=tty0 smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15 video=efifb:off video=VGA-1:640x480-32@60me
initrd @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ nomodeset inst.geoloc=0 console=tty0 smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15 video=efifb:off video=VGA-1:640x480-32@60me
initrd @INITRDPATH@
}
menuentry 'Rescue the @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ rescue console=tty0 smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15 video=efifb:off video=VGA-1:640x480-32@60me
initrd @INITRDPATH@
}
}
kill -USR1 `cat /var/run/anaconda.pid`
kill -USR2 `cat /var/run/anaconda.pid`
kill -HUP `cat /var/run/anaconda.pid`
udevadm info --export-db | less
tail -f /tmp/storage.log
echo b > /proc/sysrq-trigger
dmsetup table
multipath -d
HOME=/root chroot /mnt/sysimage bash -l -i
less /tmp/anaconda.log
grep -v _yum_lock /tmp/packaging.log
[defaults]
skeleton = /mnt/sysimage/etc/skel
mailspooldir = /mnt/sysimage/var/mail
crypt_style = md5
modules = files shadow
create_modules = files shadow
[files]
directory = /mnt/sysimage/etc
[shadow]
directory = /mnt/sysimage/etc
[org.gtk.Settings.Debug]
enable-inspector-keybinding=true
#%PAM-1.0
auth required pam_env.so
auth sufficient pam_unix.so likeauth nullok
auth required pam_deny.so
account required pam_unix.so
password sufficient pam_unix.so nullok use_authtok md5 shadow
password required pam_deny.so
session required pam_limits.so
session required pam_unix.so
PS1="[anaconda \u@\h \W]\\$ "
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin
export PATH PS1
# rsyslog configuration file
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
#### MODULES ####
# The imjournal module bellow is now used as a message source instead of imuxsock.
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$SystemLogRateLimitInterval 0 # disables message dropping, we need all of them
$ModLoad imjournal # provides access to the systemd journal
#$ModLoad imklog # reads kernel messages (the same are read from journald)
#$ModLoad immark # provides --MARK-- message capability
# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514
# Provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514
$ModLoad imfile
$InputFileName /tmp/X.log
$InputFileTag xserver:
$InputFileStateFile xserver-statefile
$InputFileFacility local1
$InputRunFileMonitor
$InputFileName /tmp/anaconda-tb-all.log
$InputFileTag anaconda-tb:
$InputFileStateFile anaconda-tb-statefile
$InputFileFacility local1
$InputRunFileMonitor
#### GLOBAL DIRECTIVES ####
# Where to place auxiliary files
#$WorkDirectory /var/lib/rsyslog
# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# File syncing capability is disabled by default. This feature is usually not required,
# not useful and an extreme performance hit
#$ActionFileEnableSync on
# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf
# Turn off message reception via local log socket;
# local messages are retrieved through imjournal now.
$OmitLocalLogging on
# File to store the position in the journal
$IMJournalStateFile imjournal.state
#### TEMPLATES ####
$template anaconda_tty4, "%syslogseverity-text:::uppercase% %programname%:%msg%\n"
$template anaconda_syslog, "%timestamp:8:$:date-rfc3164%,%timestamp:1:3:date-subseconds% %syslogseverity-text:::uppercase% %programname%:%msg%\n"
$template virtio_ForwardFormat, "<%PRI%>%TIMESTAMP:::date-rfc3339% localhost %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%\n"
#### RULES ####
# log everything except anaconda-specific records from local1 (those are stored
# directly into files via python logging)
# discard messages from dracut regenerating initrd
:programname,isequal,"dracut" ~
*.*;\
authpriv.none;\
local1.none /tmp/syslog;anaconda_syslog
& /dev/tty4;anaconda_tty4
# ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1m # space limit (use as much as possible)
$ActionQueueSaveOnShutdown off # do not save messages to disk on shutdown
#$ActionQueueType LinkedList # run asynchronously
#$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
# ### end of the forwarding rule ###
SELINUX=permissive
SELINUXTYPE=targeted
Port 22
PermitRootLogin yes
IgnoreRhosts yes
StrictModes yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd yes
XAuthLocation /bin/xauth
KeepAlive yes
SyslogFacility AUTHPRIV
RSAAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords yes
PermitUserEnvironment yes
splash.lss
- Press the 01<ENTER>07 key to begin the installation process.
#debug --graphics
default=1
splashimage=@SPLASHPATH@
timeout 60
hiddenmenu
title Install @PRODUCT@ 20.03 LTS
findiso
kernel @KERNELPATH@ @ROOT@ quiet
initrd @INITRDPATH@
title Test this media & install @PRODUCT@ 20.03 LTS
findiso
kernel @KERNELPATH@ @ROOT@ rd.live.check quiet
initrd @INITRDPATH@
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install @PRODUCT@ 20.03 LTS' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ quiet
initrdefi @INITRDPATH@
}
menuentry 'Test this media & install @PRODUCT@ 20.03 LTS' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.check quiet
initrdefi @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ nomodeset quiet
initrdefi @INITRDPATH@
}
menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rescue quiet
initrdefi @INITRDPATH@
}
}
default vesamenu.c32
timeout 600
display boot.msg
# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title @PRODUCT@ @VERSION@
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
# Border Area
menu color border * #00000000 #00000000 none
# Selected item
menu color sel 0 #ffffffff #00000000 none
# Title bar
menu color title 0 #ff7ba3d0 #00000000 none
# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none
# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none
# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none
# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none
# Help text
menu color help 0 #ffffffff #00000000 none
# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none
# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none
# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none
# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
menu tabmsg Press Tab for full configuration options on menu items.
menu separator # insert an empty line
menu separator # insert an empty line
label linux
menu label ^Install @PRODUCT@ @VERSION@
kernel vmlinuz
append initrd=initrd.img @ROOT@ quiet
label check
menu label Test this ^media & install @PRODUCT@ @VERSION@
menu default
kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.check quiet
menu separator # insert an empty line
# utilities submenu
menu begin ^Troubleshooting
menu title Troubleshooting
label vesa
menu indent count 5
menu label Install @PRODUCT@ @VERSION@ in ^basic graphics mode
text help
Try this option out if you're having trouble installing
@PRODUCT@ @VERSION@.
endtext
kernel vmlinuz
append initrd=initrd.img @ROOT@ nomodeset quiet
label rescue
menu indent count 5
menu label ^Rescue a @PRODUCT@ system
text help
If the system will not boot, this lets you access files
and edit config files to try to get it booting again.
endtext
kernel vmlinuz
append initrd=initrd.img @ROOT@ rescue quiet
label memtest
menu label Run a ^memory test
text help
If your system is having issues, a problem with your
system's memory may be the cause. Use this utility to
see if the memory is working correctly.
endtext
kernel memtest
menu separator # insert an empty line
label local
menu label Boot from ^local drive
localboot 0xffff
menu separator # insert an empty line
menu separator # insert an empty line
label returntomain
menu label Return to ^main menu
menu exit
menu end
<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/>
<%
EFIBOOTDIR="EFI/BOOT"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
%>
mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/
%if efiarch64:
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
%endif
%if efiarch32:
install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
%endif
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
## actually make the EFI images
${make_efiboot("images/efiboot.img")}
%if domacboot:
${make_efiboot("images/macboot.img", imgtype="apple")}
%endif
## This is kinda gross, but then... so's EFI.
<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')">
<%
kdir = EFIBOOTDIR if include_kernel else KERNELDIR
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
args = "--label=ANACONDA --debug"
if disk: args += " --disk"
if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version)
%>
%if include_kernel:
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif
install ${configdir}/grub2-efi.cfg ${eficonf}
replace @PRODUCT@ '${product.name}' ${eficonf}
replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
replace @ISOLABEL@ '${isolabel}' ${eficonf}
%if disk:
replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${eficonf}
%else:
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
%endif
%if efiarch32 == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
%endif
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
%if include_kernel:
remove ${EFIBOOTDIR}/vmlinuz
remove ${EFIBOOTDIR}/initrd.img
%endif
</%def>
<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel"/>
<%
configdir="tmp/config_files/aarch64"
PXEBOOTDIR="images/pxeboot"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
## Don't allow spaces or escape characters in the iso label
def valid_label(ch):
return ch.isalnum() or ch == '_'
isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel)
from os.path import basename
%>
## Test ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
## normal aarch64
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%endfor
#FIXME: this will need adjusted when we have a real bootloader.
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft="" %>
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
<%
efiarch32 = None
efiarch64 = 'AA64'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
%>
%for img in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
%endif
# Create optional product.img and updates.img
<% filegraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
treeinfo images-${basearch} ${img}.img images/${img}.img
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
filegraft += " " + workdir + "/iso-graft"
%>
# Add the license files
%for f in glob("/usr/share/licenses/*-release/*"):
install ${f} ${f|basename}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
-graft-points \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft} ${filegraft}
treeinfo images-${basearch} boot.iso images/boot.iso
%endif
<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/>
<%
configdir="tmp/config_files/uboot"
PXEBOOTDIR="images/pxeboot"
BOOTDIR="boot"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
from os.path import basename
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
%if kernel.flavor:
installkernel images-${kernel.flavor}-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
installinitrd images-${kernel.flavor}-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
treeinfo images-${kernel.flavor}-${basearch} uimage ${KERNELDIR}/uImage-${kernel.flavor}
treeinfo images-${kernel.flavor}-${basearch} uinitrd ${KERNELDIR}/uInitrd-${kernel.flavor}
%else:
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
treeinfo images-${basearch} uimage ${KERNELDIR}/uImage
treeinfo images-${basearch} uinitrd ${KERNELDIR}/uInitrd
%endif
%endfor
# Create optional product.img and updates.img
<% images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img
treeinfo images-${basearch} ${img}.img images/${img}.img
%endif
%endfor
# Add the license files
%for f in glob("/usr/share/licenses/*-release/*"):
install ${f} ${f|basename}
%endfor
## FIXME: ARM may need some extra boot config
set default="1"
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ rd.live.image quiet console=tty0 smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15
initrd @INITRDPATH@
}
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ rd.live.image rd.live.check quiet console=tty0 smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15
initrd @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ rd.live.image nomodeset quiet console=tty0 smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15
initrd @INITRDPATH@
}
}
splash.lss
- Press the 01<ENTER>07 key to begin the installation process.
#debug --graphics
default=1
splashimage=@SPLASHPATH@
timeout 60
hiddenmenu
title Start @PRODUCT@ @VERSION@
findiso
kernel @KERNELPATH@ @ROOT@ rd.live.image quiet
initrd @INITRDPATH@
title Test this media & start @PRODUCT@ @VERSION@
findiso
kernel @KERNELPATH@ @ROOT@ rd.live.image rd.live.check quiet
initrd @INITRDPATH@
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image quiet
initrdefi @INITRDPATH@
}
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.live.check quiet
initrdefi @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image nomodeset quiet
initrdefi @INITRDPATH@
}
}
default vesamenu.c32
timeout 600
display boot.msg
# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title @PRODUCT@ @VERSION@
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
# Border Area
menu color border * #00000000 #00000000 none
# Selected item
menu color sel 0 #ffffffff #00000000 none
# Title bar
menu color title 0 #ff7ba3d0 #00000000 none
# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none
# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none
# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none
# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none
# Help text
menu color help 0 #ffffffff #00000000 none
# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none
# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none
# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none
# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
menu tabmsg Press Tab for full configuration options on menu items.
menu separator # insert an empty line
menu separator # insert an empty line
label linux
menu label ^Start @PRODUCT@ @VERSION@
kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.image quiet
label check
menu label Test this ^media & start @PRODUCT@ @VERSION@
menu default
kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.image rd.live.check quiet
menu separator # insert an empty line
# utilities submenu
menu begin ^Troubleshooting
menu title Troubleshooting
label vesa
menu indent count 5
menu label Start @PRODUCT@ @VERSION@ in ^basic graphics mode
text help
Try this option out if you're having trouble starting
@PRODUCT@ @VERSION@.
endtext
kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.image nomodeset quiet
label memtest
menu label Run a ^memory test
text help
If your system is having issues, a problem with your
system's memory may be the cause. Use this utility to
see if the memory is working correctly.
endtext
kernel memtest
menu separator # insert an empty line
label local
menu label Boot from ^local drive
localboot 0xffff
menu separator # insert an empty line
menu separator # insert an empty line
label returntomain
menu label Return to ^main menu
menu exit
menu end
<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/>
<%
EFIBOOTDIR="EFI/BOOT"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
%>
mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/
%if efiarch64:
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
%endif
%if efiarch32:
install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
%endif
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
## actually make the EFI images
${make_efiboot("images/efiboot.img")}
%if domacboot:
${make_efiboot("images/macboot.img", imgtype="apple")}
%endif
## This is kinda gross, but then... so's EFI.
<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')">
<%
kdir = EFIBOOTDIR if include_kernel else KERNELDIR
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
args = "--label=ANACONDA"
if disk: args += " --disk"
if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version)
%>
%if include_kernel:
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif
install ${configdir}/grub2-efi.cfg ${eficonf}
replace @PRODUCT@ '${product.name}' ${eficonf}
replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
replace @ISOLABEL@ '${isolabel}' ${eficonf}
%if disk:
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
%else:
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf}
%endif
%if efiarch32 == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
%endif
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
%if include_kernel:
remove ${EFIBOOTDIR}/vmlinuz
remove ${EFIBOOTDIR}/initrd.img
%endif
</%def>
<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel"/>
<%
configdir="tmp/config_files/x86"
SYSLINUXDIR="usr/share/syslinux"
PXEBOOTDIR="images/pxeboot"
BOOTDIR="isolinux"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
## Don't allow spaces or escape characters in the iso label
#def valid_label(ch):
# return ch.isalnum() or ch == '_'
#isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel)
from os.path import basename
%>
## Test ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
## install bootloader and config files
mkdir ${BOOTDIR}
install ${SYSLINUXDIR}/isolinux.bin ${BOOTDIR}
install ${SYSLINUXDIR}/vesamenu.c32 ${BOOTDIR}
install ${SYSLINUXDIR}/ldlinux.c32 ${BOOTDIR}
install ${SYSLINUXDIR}/libcom32.c32 ${BOOTDIR}
install ${SYSLINUXDIR}/libutil.c32 ${BOOTDIR}
install ${configdir}/isolinux.cfg ${BOOTDIR}
install ${configdir}/boot.msg ${BOOTDIR}
install ${configdir}/grub.conf ${BOOTDIR}
install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png
install boot/memtest* ${BOOTDIR}/memtest
## configure bootloader
replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
%if kernel.flavor:
installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
installinitrd images-xen ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
%else:
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%endif
%endfor
hardlink ${KERNELDIR}/vmlinuz ${BOOTDIR}
hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%if basearch == 'x86_64':
treeinfo images-xen kernel ${KERNELDIR}/vmlinuz
treeinfo images-xen initrd ${KERNELDIR}/initrd.img
%endif
## WHeeeeeeee, EFI.
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
%if exists("boot/efi/EFI/*/gcdia32.efi"):
<% efiarch32 = 'IA32' %>
%endif
%if exists("boot/efi/EFI/*/gcdx64.efi"):
<% efiarch64 = 'X64' %>
%endif
%if (efiarch32 or efiarch64) and basearch != 'i386':
<%
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
if domacboot:
images.append("images/macboot.img")
%>
%for img in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<% efihybrid = "--uefi --mac" if domacboot else "--uefi" %>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
%endif
# Create optional product.img and updates.img
<% filegraft=""; images=["product", "updates"]; compressargs=""; %>
%if basearch == 'i386':
# Limit the amount of memory xz uses on i386
<% compressargs="--xz -9 --memlimit-compress=3700MiB" %>
%endif
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img
treeinfo images-${basearch} ${img}.img images/${img}.img
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Add the license files
%for f in glob("/usr/share/licenses/*-release/*"):
install ${f} ${f|basename}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
-boot-load-size 4 -boot-info-table -no-emul-boot \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
-graft-points \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft} ${filegraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso
# PXE configuration template generated by livemedia-creator
kernel <PXE_DIR>${kernel}
append initrd=<PXE_DIR>${initrd} root=live:<URL>/${liveimg} ${addargs}
## lorax template file: cleanup for the ramdisk (runtime image)
<%page args="libdir, product, root"/>
## remove the sources
remove usr/share/i18n
## not required packages installed as dependencies
## perl is needed by /usr/bin/rxe_cfg from libibverbs
## no sound support, thanks
removepkg flac gstreamer-tools libsndfile pulseaudio* sound-theme-freedesktop
## we don't create new initramfs/bootloader conf inside anaconda
## (that happens inside the target system after we install dracut/grubby)
removepkg dracut-network grubby anaconda-dracut
removefrom ${product.name}-logos /usr/share/plymouth/*
## In order to execute the /usr move on upgrades we need convertfs from dracut
## We also need dracut-shutdown.service and dracut-initramfs-restore to reboot
removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.sh \
/usr/lib/dracut/modules.d/99base/dracut-lib.sh \
/usr/lib/systemd/* /usr/lib/dracut/modules.d/98systemd/*.service \
/usr/lib/dracut/dracut-initramfs-restore
## we don't run SELinux (not in enforcing, anyway)
removepkg checkpolicy selinux-policy libselinux-utils
## selinux checks for the /etc/selinux/config file's existance
## The removepkg above removes it, create an empty one. See rhbz#1243168
append etc/selinux/config ""
## anaconda has its own repo files
removefrom fedora-release --allbut /etc/os-release /usr/lib/os-release \
/usr/lib/os.release.d/*
removepkg fedora-release-rawhide
## keep enough of shadow-utils to create accounts
removefrom shadow-utils --allbut /usr/bin/chage /usr/sbin/chpasswd \
/usr/sbin/groupadd /usr/sbin/useradd
## remove other account management tools
removepkg usermode usermode-gtk passwd
## no services to turn on/off (keep the /etc/init.d link though)
removefrom chkconfig --allbut /etc/init.d
## Miscellanous unnecessary gpg program
removepkg pinentry
## no storage device monitoring
removepkg dmraid-events sgpio
## keep library files
removefrom device-mapper-event --allbut \
/usr/lib64/libdevmapper-event.so.*
## no notifications in anaconda
removepkg notification-daemon
## logrotate isn't useful in anaconda
removepkg logrotate
remove /etc/logrotate.d
## anaconda needs this to do media check
removefrom isomd5sum --allbut /usr/bin/checkisomd5
## systemd-nspawn isn't very useful and doesn't link anyway without iptables,
## and there's no need for a bunch of zsh files without zsh
removefrom systemd /usr/bin/systemd-nspawn /usr/share/zsh
## various other things we remove to save space
removepkg avahi-autoipd coreutils-libs dash db4-utils diffutils file
removepkg genisoimage info
#keep libary files
removefrom iptables --allbut \
/usr/lib64/libxtables.so* /usr/lib64/libiptc.so* \
/usr/lib64/libip6tc.so* /usr/lib64/libip4tc.so*
removepkg libXxf86misc
removepkg libasyncns libhbaapi libhbalinux
removepkg libmcpp libtiff linux-atm-libs
removepkg lvm2-libs m4 mailx makebootfat mcpp
removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth
removepkg rmt rpcbind squashfs-tools system-config-firewall-base
removepkg tigervnc-license ttmkfdir xml-common xorg-x11-font-utils
removepkg xorg-x11-server-common firewalld
## other removals
remove /home /media /opt /srv /tmp/*
remove /usr/etc /usr/games /usr/local /usr/tmp
remove /usr/share/doc /usr/share/info /usr/share/man /usr/share/gnome
remove /usr/share/mime/application /usr/share/mime/audio /usr/share/mime/image
remove /usr/share/mime/inode /usr/share/mime/message /usr/share/mime/model
remove /usr/share/mime/multipart /usr/share/mime/packages /usr/share/mime/text
remove /usr/share/mime/video /usr/share/mime/x-content /usr/share/mime/x-epoc
remove /var/db /var/games /var/tmp /var/yp /var/nis /var/opt /var/local
remove /var/mail /var/spool /var/preserve /var/report
remove /var/lib/rpm/* /var/lib/yum /var/lib/dnf
## clean up the files created by various '> /dev/null's
remove /dev/*
## icons cache
remove /usr/share/icons/*/icon-theme.cache
## clean up kernel modules
removekmod sound drivers/media drivers/hwmon \
net/atm net/bluetooth net/sched net/sctp \
net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6 \
drivers/watchdog drivers/rtc drivers/input/joystick \
drivers/bluetooth drivers/edac drivers/staging \
drivers/usb/serial drivers/usb/host drivers/usb/misc \
fs/ocfs2 fs/ceph fs/nfsd fs/ubifs fs/nilfs2 \
arch/x86/kvm
## Need to keep virtio_console.ko and ipmi stuff in drivers/char
## Also keep virtio-rng so that the installer can get sufficient randomness for
## LUKS setup.
removekmod drivers/char --allbut virtio_console hw_random \
virtio-rng ipmi hmcdrv
removekmod drivers/hid --allbut hid-logitech-dj hid-logitech-hidpp
removekmod drivers/video --allbut hyperv_fb syscopyarea sysfillrect sysimgblt fb_sys_fops
remove lib/modules/*/{build,source,*.map}
## NOTE: depmod gets re-run after cleanup finishes
## remove unused themes, theme engines, icons, etc.
removefrom gtk2 /usr/${libdir}/gtk-2.0/*/{engines,printbackends}/*
removefrom gtk2 /usr/share/themes/*
## clearlooks is the theme we use for gtk2
removefrom gtk2-engines --allbut /usr/${libdir}/*/libclearlooks.so \
/usr/share/themes/Clearlooks/*
removefrom gtk3 /usr/${libdir}/gtk-3.0/*/printbackends/*
removefrom gtk3 /usr/share/themes/*
removefrom metacity --allbut /usr/bin/* /usr/${libdir}/* /etc/*
## filesystem tools
removefrom e2fsprogs /usr/share/locale/*
removefrom xfsprogs /usr/share/locale/* /usr/share/doc/* /usr/share/man/*
removefrom xfsdump --allbut /usr/sbin/*
## other package specific removals
removefrom GConf2 /etc/rpm/* /etc/xdg/* /usr/bin/*
removefrom GConf2 /usr/${libdir}/GConf/2/libgconfbackend-{evoldap,oldxml}*
removefrom GConf2 /usr/${libdir}/gio/modules/*
removefrom GConf2 /usr/libexec/gconf-defaults-mechanism /usr/share/GConf/*
removefrom GConf2 /usr/share/locale/* /usr/share/sgml/*
removefrom NetworkManager /usr/share/NetworkManager/*
removefrom NetworkManager /usr/share/locale/*/NetworkManager.mo
removefrom nm-connection-editor /usr/${libdir}/*
removefrom nm-connection-editor /usr/share/applications/*
removefrom anaconda /etc/* /usr/share/applications/* /usr/share/icons/*
removefrom atk /usr/share/locale/*
removefrom audit /etc/* /sbin/audispd /sbin/auditctl /sbin/aureport
removefrom audit /sbin/ausearch /sbin/autrace /usr/bin/*
removefrom audit-libs /etc/* /${libdir}/libauparse*
removefrom authconfig /usr/sbin/* /usr/share/*
removefrom bash /etc/* /usr/bin/bashbug* /usr/share/*
removefrom bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nsupdate
removefrom bitmap-fangsongti-fonts /usr/share/fonts/*
removefrom ca-certificates /etc/pki/java/*
removefrom ca-certificates /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/*
removefrom cairo /usr/${libdir}/libcairo-script* /usr/bin/cairo-sphinx
removefrom coreutils /etc/* /usr/bin/link /usr/bin/nice /usr/bin/stty /usr/bin/su /usr/bin/unlink
removefrom coreutils /usr/sbin/runuser /usr/bin/[ /usr/bin/base64 /usr/bin/chcon
removefrom coreutils /usr/bin/cksum /usr/bin/comm /usr/bin/csplit
removefrom coreutils /usr/bin/dir /usr/bin/dircolors
removefrom coreutils /usr/bin/expand /usr/bin/factor
removefrom coreutils /usr/bin/fold /usr/bin/groups /usr/bin/hostid
removefrom coreutils /usr/bin/install /usr/bin/join /usr/bin/logname
removefrom coreutils /usr/bin/mkfifo /usr/bin/nl /usr/bin/nohup /usr/bin/nproc
removefrom coreutils /usr/bin/pathchk
removefrom coreutils /usr/bin/pinky /usr/bin/pr /usr/bin/printenv
removefrom coreutils /usr/bin/printf /usr/bin/ptx /usr/bin/runcon
removefrom coreutils /usr/bin/sha224sum /usr/bin/sha384sum
removefrom coreutils /usr/bin/sha512sum /usr/bin/shuf /usr/bin/stat
removefrom coreutils /usr/bin/stdbuf /usr/bin/sum /usr/bin/test
removefrom coreutils /usr/bin/timeout /usr/bin/truncate /usr/bin/tsort
removefrom coreutils /usr/bin/unexpand /usr/bin/users /usr/bin/vdir
removefrom coreutils /usr/bin/who /usr/bin/whoami /usr/bin/yes /usr/share/*
removefrom cpio /usr/share/*
removefrom cracklib /usr/sbin/*
removefrom cracklib-dicts /usr/${libdir}/* /usr/sbin/*
removefrom cryptsetup-luks /usr/share/*
removefrom cyrus-sasl-lib /usr/sbin/*
removefrom db4 /usr/*
removefrom dbus-glib /usr/bin/*
removefrom dbus-x11 /etc/X11/*
removefrom dejavu-sans-fonts --allbut *.conf */DejaVuSans{,-Bold}.ttf
removefrom dejavu-sans-mono-fonts --allbut *.conf */DejaVuSansMono.ttf
removefrom dhclient /usr/lib/* /usr/share/*
removefrom dnsmasq /etc/rc.d/* /usr/sbin/*
removefrom elfutils-libelf /usr/share/locale/*
removefrom expat /usr/bin/*
removefrom file-libs /usr/share/*
removefrom findutils /usr/bin/oldfind /usr/share/*
removefrom fontconfig /usr/bin/*
removefrom gawk /usr/bin/{igawk,pgawk} /usr/libexec/* /usr/share/*
removefrom gdb /usr/share/* /usr/include/* /etc/gdbinit*
removefrom gdisk /usr/share/*
removefrom gdk-pixbuf2 /usr/share/locale*
removefrom glib2 /etc/* /usr/bin/* /usr/share/locale/*
removefrom glibc /etc/gai.conf /etc/localtime /etc/rpc
removefrom glibc /lib/*/nosegneg/* /${libdir}/libBrokenLocale*
removefrom glibc /${libdir}/libSegFault* /${libdir}/libanl*
removefrom glibc /${libdir}/libcidn* /${libdir}/libnss_compat*
removefrom glibc /${libdir}/libnss_hesiod* /${libdir}/libnss_nis*
# python-pyudev uses ctypes.util.find_library, which uses /sbin/ldconfig
removefrom glibc /${libdir}/rtkaio* /sbin/sln
removefrom glibc /usr/libexec/* /usr/sbin/*
removefrom glibc-common /etc/* /usr/bin/catchsegv /usr/bin/gencat
removefrom glibc-common /usr/bin/getent
removefrom glibc-common /usr/bin/locale /usr/bin/rpcgen /usr/bin/sprof
# NB: we keep /usr/bin/localedef so anaconda can inspect payload locale info
removefrom glibc-common /usr/bin/tzselect
removefrom glibc-common /usr/libexec/* /usr/sbin/*
removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.*
removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth*
removefrom gnome-bluetooth-libs /usr/share/*
removefrom gnutls /usr/share/locale/*
removefrom google-noto-sans-cjk-ttc-fonts /usr/share/fonts/google-noto-cjk/NotoSansCJK-{Black,Bold,*Light,Medium,Thin}.ttc
removefrom grep /etc/* /usr/share/locale/*
removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/*
removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/*
removefrom gtk2 /usr/bin/update-gtk-immodules
removefrom gtk3 /usr/${libdir}/gtk-3.0/*
removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew}
removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
removefrom hwdata /usr/share/hwdata/upgradelist
removefrom initscripts /etc/ppp/* /usr/sbin/* /usr/share/locale/*
removefrom iproute --allbut /usr/sbin/{ip,routef,routel,rtpr}
removefrom iscsi-initiator-utils /etc/rc.d/*
removefrom kbd --allbut */bin/{dumpkeys,kbd_mode,loadkeys,setfont,unicode_*,chvt}
removefrom less /etc/*
removefrom libX11-common /usr/share/X11/XErrorDB
removefrom libbonobo /etc/* /usr/bin/* /usr/sbin/* /usr/share/locale/*
removefrom libbonobo /usr/${libdir}/bonobo/monikers/*
removefrom libbonobo /usr/${libdir}/orbit-2.0/Bonobo_module.so
removefrom libcanberra /usr/${libdir}/libcanberra-*
removefrom libcanberra-gtk2 /usr/${libdir}/gtk-2.0/*
removefrom libcanberra-gtk3 /usr/bin/*
removefrom libcap /usr/sbin/*
removefrom libconfig /usr/${libdir}/libconfig++*
removefrom libcroco /usr/bin/*
removefrom libgnome-keyring /usr/share/locale/*
removefrom libgnomecanvas /usr/share/locale/*
removefrom libgpg-error /usr/bin/* /usr/share/locale/*
removefrom libgssglue /etc/*
removefrom libidn /usr/bin/* /usr/share/locale/*
removefrom libmlx4 /etc/rdma/* /usr/${libdir}/*
removefrom libnotify /usr/bin/*
removefrom librsvg2 /usr/bin/*
removefrom libselinux /usr/sbin/*
removefrom libsemanage /etc/selinux/*
removefrom libstdc++ /usr/share/*
removefrom libuser /usr/bin/* /usr/sbin/* /usr/share/locale/*
removefrom libvorbis /usr/${libdir}/libvorbisenc.*
removefrom libxml2 /usr/bin/*
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.a
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.la
removefrom lldpad /etc/*
removefrom lua /usr/bin/*
removefrom madan-fonts /usr/share/fonts/madan/*
removefrom mdadm /etc/*
removefrom module-init-tools /etc/* /usr/sbin/insmod.static /usr/sbin/weak-modules
removefrom mtools /etc/*
removefrom ncurses /usr/bin/captoinfo /usr/bin/infocmp /usr/bin/infotocap
removefrom ncurses /usr/bin/reset /usr/bin/tabs /usr/bin/tic /usr/bin/toe
removefrom ncurses /usr/bin/tput /usr/bin/tset
removefrom ncurses-libs /usr/${libdir}/libform*
removefrom ncurses-libs /usr/${libdir}/libmenu*
removefrom ncurses-libs /usr/${libdir}/libpanel.* /usr/${libdir}/libtic*
removefrom net-tools */bin/netstat */sbin/ether-wake */sbin/ipmaddr
removefrom net-tools */sbin/iptunnel */sbin/mii-diag */sbin/mii-tool
removefrom net-tools */sbin/nameif */sbin/plipconfig */sbin/slattach
removefrom net-tools /usr/share/locale/*
removefrom newt /usr/share/locale/*
removefrom nfs-utils /etc/nfsmount.conf
removefrom nfs-utils /etc/rc.d/init.d/* /lib/systemd/system/*
removefrom nfs-utils /etc/sysconfig/nfs /sbin/rpc.statd /usr/sbin/exportfs
removefrom nfs-utils /usr/sbin/gss_clnt_send_err /usr/sbin/gss_destroy_creds
removefrom nfs-utils /usr/sbin/mountstats /usr/sbin/nfsiostat
removefrom nfs-utils /usr/sbin/nfsstat /usr/sbin/rpc.gssd /usr/sbin/rpc.idmapd
removefrom nfs-utils /usr/sbin/rpc.mountd /usr/sbin/rpc.nfsd
removefrom nfs-utils /usr/sbin/rpc.svcgssd /usr/sbin/rpcdebug
removefrom nfs-utils /usr/sbin/showmount /usr/sbin/sm-notify
removefrom nfs-utils /usr/sbin/start-statd /var/lib/nfs/etab
removefrom nfs-utils /var/lib/nfs/rmtab /var/lib/nfs/state /var/lib/nfs/xtab
removefrom nss-softokn /usr/${libdir}/nss/*
removefrom openldap /etc/openldap/* /usr/${libdir}/libldap_r-*
removefrom openssh-clients /etc/ssh/* /usr/bin/ssh-*
removefrom openssh-clients /usr/libexec/*
removefrom openssh-server /etc/ssh/* /usr/libexec/openssh/sftp-server
removefrom openssl /etc/pki/* /usr/bin/* /usr/${libdir}/openssl/*
removefrom pam /usr/sbin/* /usr/share/locale/*
removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/*
removefrom polkit /usr/bin/*
removefrom polkit-desktop-policy /var/lib/*
removefrom popt /usr/share/locale/*
removefrom procps /usr/bin/free /usr/bin/pgrep /usr/bin/pkill
removefrom procps /usr/bin/pmap /usr/bin/pwdx /usr/bin/skill /usr/bin/slabtop
removefrom procps /usr/bin/snice /usr/bin/tload /usr/bin/uptime
removefrom procps /usr/bin/vmstat /usr/bin/w /usr/bin/watch
removefrom psmisc /usr/share/locale/*
removefrom pygtk2 /usr/bin/* /usr/${libdir}/pygtk/*
removefrom pykickstart /usr/bin/* /usr/share/locale/*
removefrom readline /usr/${libdir}/libhistory*
removefrom libreport /usr/bin/* /usr/share/locale/*
removefrom rpm /usr/bin/* /usr/share/locale/*
removefrom rsync /etc/*
removefrom sed /usr/share/locale/*
removefrom smartmontools /etc/* /usr/sbin/smartd
removefrom smartmontools /usr/sbin/update-smart-drivedb
removefrom smartmontools /usr/share/smartmontools/*
removefrom sqlite /usr/bin/*
removefrom system-config-date /etc/* /usr/bin/* /usr/share/icons/*
removefrom system-config-keyboard /etc/* /usr/bin/* /usr/share/icons/*
removefrom sysvinit-tools /usr/bin/*
removefrom tar /usr/share/locale/*
removefrom usbutils /usr/bin/*
removefrom util-linux --allbut \
/usr/bin/{dmesg,getopt,kill,login,lsblk,more,mount,umount,mountpoint,findmnt} \
/etc/mtab /etc/pam.d/login /etc/pam.d/remote \
/usr/sbin/{agetty,blkid,blockdev,clock,fdisk,fsck,fstrim,hwclock,losetup} \
/usr/sbin/{mkswap,swaplabel,nologin,sfdisk,swapoff,swapon,wipefs,partx,fsfreeze} \
/usr/bin/{logger,hexdump,flock} \
/usr/lib64/{libfdisk.so.*,libsmartcols.so.*,libmount.so.*,libblkid.so.*,libuuid.so.*}
removefrom volume_key-libs /usr/share/locale/*
removefrom wget /etc/* /usr/share/locale/*
removefrom xorg-x11-drv-intel /usr/${libdir}/libI*
removefrom xorg-x11-drv-openchrome /usr/${libdir}/libchrome*
removefrom xorg-x11-drv-synaptics /usr/bin/*
removefrom xorg-x11-drv-wacom /usr/bin/*
removefrom xorg-x11-fonts-misc --allbut /usr/share/X11/fonts/misc/{6x13,encodings,fonts,*cursor}*
removefrom xorg-x11-server-utils --allbut /usr/bin/xrandr /usr/share/X11/rgb.txt /usr/bin/xrdb
removefrom yum /etc/* /usr/share/locale/* /usr/share/yum-cli/*
removefrom ${product.name}-logos /etc/*
removefrom ${product.name}-logos /usr/share/icons/{Bluecurve,oxygen}/*
removefrom ${product.name}-logos /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/*
## cleanup_python_files()
runcmd find ${root} -name "*.pyo" -type f -delete
runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \;
## cleanup /boot/ leaving vmlinuz, and .*hmac files
runcmd chroot ${root} find /boot \! -name "vmlinuz*" \
-and \! -name ".vmlinuz*" \
-and \! -name boot -delete
## remove any broken links in /etc or /usr
## (broken systemd service links lead to confusing noise at boot)
## NOTE: not checking /var because we want to keep /var/run
## NOTE: Excluding /etc/mtab which links to /proc/self/mounts for systemd
runcmd chroot ${root} find -L /etc /usr -xdev -type l -and \! -name "mtab" \
-printf "removing broken symbolic link %p -> %l\n" -delete
## Clean up some of the mess pulled in by webkitgtk via yelp
## libwebkit2gtk links to a handful of libraries in gstreamer and
## gstreamer-plugins-base. Remove the rest of them.
removefrom gstreamer1 --allbut /usr/${libdir}/libgstbase-1.0.* \
/usr/${libdir}/libgstreamer-1.0.*
removefrom gstreamer1-plugins-base --allbut \
/usr/${libdir}/libgst{allocators,app,audio,badallocators,fft,gl,pbutils,tag,video}-1.0.*
## We have enough geoip libraries, thanks
removepkg geoclue2
## And remove the packages that those extra libraries pulled in
removepkg cdparanoia-libs opus libtheora libvisual flac-libs gsm avahi-glib avahi-libs \
ModemManager-glib
## metacity requires libvorbis and libvorbisfile, but enc/dec are no longer needed
removefrom libvorbis --allbut /usr/${libdir}/libvorbisfile.* /usr/${libdir}/libvorbis.*
## lorax template file: populate the ramdisk (runtime image)
<%page args="basearch, product"/>
## anaconda package
installpkg anaconda anaconda-widgets kexec-tools-anaconda-addon anaconda-install-env-deps
## Other available payloads
installpkg dnf
installpkg ostree
## speed up compression on multicore systems
installpkg pigz
## kernel and firmware
## NOTE: Without explicitly including kernel-modules-extra dnf will choose kernel-debuginfo-*
## to satify a gfs2-utils kmod requirement
##installpkg kernel kernel-modules kernel-modules-extra
installpkg kernel
installpkg grubby
## skip the firmware for sound, video, and scanners, none of which will
## do much good for the installer. Also skip uhd-firmware which is not
## even a kernel firmware package.
installpkg --optional *-firmware --except alsa* --except midisport-firmware \
--except crystalhd-firmware --except ivtv-firmware \
--except cx18-firmware --except iscan-firmware \
--except uhd-firmware --except lulzbot-marlin-firmware \
--except arm-trusted-firmware
installpkg b43-openfwwf
## install all of the glibc langpacks since otherwise we get no locales
installpkg glibc-all-langpacks
## arch-specific packages (bootloaders etc.)
%if basearch == "aarch64":
installpkg efibootmgr
installpkg grub2-efi-aa64-cdboot shim-aa64
installpkg uboot-tools
%endif
%if basearch in ("arm", "armhfp"):
installpkg efibootmgr
installpkg grub2-efi-arm-cdboot
installpkg kernel-lpae
installpkg uboot-tools
%endif
%if basearch == "x86_64":
installpkg grub2-tools-efi
installpkg efibootmgr
installpkg shim-x64 grub2-efi-x64-cdboot
installpkg syslinux
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
%endif
## yay, plymouth
installpkg plymouth
## extra dracut modules
installpkg anaconda-dracut dracut-network dracut-config-generic dracut-fips
## import-state.service for switchroot
installpkg initscripts
## rescue needs this
installpkg cryptsetup
## rpcbind or portmap needed by dracut nfs module
installpkg rpcbind
## required for dracut
installpkg kbd kbd-misc
## required for anaconda-dracut (img-lib etc.)
installpkg tar xz curl bzip2
## basic system stuff
installpkg systemd-sysv systemd-units
installpkg rsyslog
## xorg/GUI packages
installpkg xorg-x11-drivers xorg-x11-server-Xorg
installpkg xorg-x11-server-utils xorg-x11-xauth
installpkg dbus-x11 metacity gsettings-desktop-schemas
installpkg nm-connection-editor
installpkg librsvg2
## filesystem tools
installpkg btrfs-progs xfsprogs
installpkg device-mapper-persistent-data
installpkg xfsdump
## extra storage packages
# hostname is needed for iscsi to work, see RHBZ#1593917
installpkg udisks2 hostname
# udisks2-iscsi hostname
## extra libblockdev plugins
installpkg libblockdev-lvm-dbus
## needed for LUKS escrow
installpkg volume_key
installpkg nss-tools
## SELinux support
installpkg selinux-policy-targeted audit
## network tools/servers
installpkg ethtool openssh-server nfs-utils openssh-clients
installpkg tigervnc-server-minimal
installpkg tigervnc-server-module
installpkg net-tools
installpkg bridge-utils
installpkg nmap-ncat
## hardware utilities/libraries
installpkg pciutils usbutils ipmitool
installpkg smartmontools
installpkg hdparm
## see bug #1483278
%if basearch not in ("arm", "armhfp"):
installpkg libmlx4 rdma-core
%endif
installpkg rng-tools
## fonts & themes
installpkg xorg-x11-fonts-misc
installpkg abattis-cantarell-fonts
installpkg google-noto-sans-cjk-ttc-fonts
## debugging/bug reporting tools
installpkg gdb-gdbserver
installpkg libreport
installpkg fpaste
installpkg python3-pyatspi
## extra tools not required by anaconda
installpkg vim-minimal strace lsof xz less eject
installpkg wget rsync bind-utils ftp mtr vconfig
installpkg icfg spice-vdagent
installpkg gdisk sg3_utils
## satisfy libnotify's desktop-notification-daemon with the least crazy option
installpkg notification-daemon
## Docker enabled boot.iso
# Not all arches currently have docker
installpkg docker-anaconda-addon
## actually install all the requested packages
run_pkg_transaction
## runtime-postinstall.tmpl
## post-install setup required to make the system work.
<%page args="root, basearch, libdir, configdir"/>
<%
stubs = ("list-harddrives", "raidstart", "raidstop")
configdir = configdir + "/common"
%>
## move_stubs()
move usr/share/anaconda/restart-anaconda usr/bin
%for stub in stubs:
-move usr/share/anaconda/${stub}-stub usr/bin/${stub}
%endfor
## move_repos()
move etc/yum.repos.d etc/anaconda.repos.d
## Setup mdadm config to turn off homehost
remove etc/mdadm.conf
append etc/mdadm.conf "HOMEHOST <ignore>\n"
## Configure systemd to start anaconda
remove etc/systemd/system/default.target
symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
## Make sure tmpfs is enabled
mkdir etc/systemd/system/local-fs.target.wants/
symlink /lib/systemd/system/tmp.mount etc/systemd/system/local-fs.target.wants/tmp.mount
## Start rngd
mkdir etc/systemd/system/basic.target.wants/
symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
## Disable unwanted systemd services
systemctl disable systemd-readahead-collect.service \
systemd-readahead-replay.service \
mdmonitor.service \
mdmonitor-takeover.service \
lvm2-monitor.service \
dnf-makecache.timer
## These services can't be disabled normally (they're linked into place in
## /usr/lib/systemd rather than /etc/systemd), so we have to mask them.
systemctl mask fedora-configure.service fedora-loadmodules.service \
fedora-autorelabel.service fedora-autorelabel-mark.service \
fedora-wait-storage.service media.mount \
systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer \
ldconfig.service
## remove because it cannot be disabled
remove usr/lib/systemd/system-generators/lvm2-activation-generator
## Remove the more terrible parts of systemd-tmpfiles.
## etc.conf is written with the assumption that /etc/ is empty, which is
## ridiculous, and it also creates a broken /etc/resolv.conf, which breaks
## networking.
remove usr/lib/tmpfiles.d/etc.conf
## Make logind activate anaconda-shell@.service on switch to empty VT
symlink anaconda-shell@.service lib/systemd/system/autovt@.service
replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf
## Don't write the journal to the overlay, just keep it in RAM
remove var/log/journal
## install some basic configuration files
append etc/fstab ""
install ${configdir}/i18n etc/sysconfig
install ${configdir}/rsyslog.conf etc
install ${configdir}/bash_history root/.bash_history
install ${configdir}/profile root/.profile
install ${configdir}/libuser.conf etc
install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf
install ${configdir}/spice-vdagentd etc/sysconfig
mkdir etc/NetworkManager/conf.d
install ${configdir}/91-anaconda-autoconnect-slaves.conf etc/NetworkManager/conf.d
install ${configdir}/vconsole.conf etc
install ${configdir}/92-anaconda-loglevel-debug.conf etc/NetworkManager/conf.d
## set up sshd
install ${configdir}/sshd_config.anaconda etc/ssh
install ${configdir}/pam.sshd etc/pam.d/sshd
install ${configdir}/pam.sshd etc/pam.d/login
install ${configdir}/pam.sshd etc/pam.d/remote
## set up "install" user account
append etc/passwd "install:x:0:0:root:/root:/usr/libexec/anaconda/run-anaconda"
append etc/shadow "install::14438:0:99999:7:::"
## remove root password
replace "root:\*:" "root::" etc/shadow
## gsettings settings
install ${configdir}/org.gtk.Settings.Debug.gschema.override usr/share/glib-2.0/schemas
runcmd chroot ${root} glib-compile-schemas /usr/share/glib-2.0/schemas
move usr/libexec/anaconda/auditd sbin
## for compatibility with Ancient Anaconda Traditions
symlink lib/modules /modules
symlink lib/firmware /firmware
symlink ../run/install mnt/install
## create_depmod_conf()
append etc/depmod.d/dd.conf "search updates built-in"
## create multipath.conf so multipath gets auto-started
append etc/multipath.conf "defaults {\n\tfind_multipaths yes\n\tuser_friendly_names yes\n}\n"
## make lvm auto-activate
remove etc/lvm/archive/*
remove etc/lvm/archive
remove etc/lvm/backup/*
remove etc/lvm/backup
remove etc/lvm/cache/*
remove etc/lvm/cache
remove etc/lvm/lvm.conf
append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n"
## Record the package versions used to create the image
## rpm initializes nss, which requires /dev/urandom to be present, hence the mknod
runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/random c 1 8
runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/urandom c 1 9
runcmd chroot ${root} /usr/bin/rpm -qa --pipe "tee /root/lorax-packages.log"
## TODO: we could run prelink here if we wanted?
<%page args="kernels, runtime_img, runtime_base, basearch, inroot, outroot, product, isolabel"/>
<%
configdir="tmp/config_files/x86"
SYSLINUXDIR="usr/share/syslinux"
PXEBOOTDIR="images/pxeboot"
STAGE2IMG="images/install.img"
BOOTDIR="isolinux"
KERNELDIR=PXEBOOTDIR
LORAXDIR="usr/share/lorax/"
## Don't allow spaces or escape characters in the iso label
#def valid_label(ch):
# return ch.isalnum() or ch == '_'
#isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel)
from os.path import basename
%>
## Test ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
%>
mkdir images
install ${runtime_img} ${STAGE2IMG}
treeinfo stage2 mainimage images/${runtime_base}
## install bootloader and config files
mkdir ${BOOTDIR}
install ${SYSLINUXDIR}/isolinux.bin ${BOOTDIR}
install ${SYSLINUXDIR}/vesamenu.c32 ${BOOTDIR}
install ${SYSLINUXDIR}/ldlinux.c32 ${BOOTDIR}
install ${SYSLINUXDIR}/libcom32.c32 ${BOOTDIR}
install ${SYSLINUXDIR}/libutil.c32 ${BOOTDIR}
install ${configdir}/isolinux.cfg ${BOOTDIR}
install ${configdir}/boot.msg ${BOOTDIR}
install ${configdir}/grub.conf ${BOOTDIR}
install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png
## configure bootloader
replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
%if kernel.flavor:
## i386 PAE
installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
installinitrd images-xen ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
%else:
## normal i386, x86_64
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%endif
%endfor
hardlink ${KERNELDIR}/vmlinuz ${BOOTDIR}
hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%if basearch == 'x86_64':
treeinfo images-xen kernel ${KERNELDIR}/vmlinuz
treeinfo images-xen initrd ${KERNELDIR}/initrd.img
%endif
## WHeeeeeeee, EFI.
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
%if exists("boot/efi/EFI/*/gcdia32.efi"):
<% efiarch32 = 'IA32' %>
%endif
%if exists("boot/efi/EFI/*/gcdx64.efi"):
<% efiarch64 = 'X64' %>
%endif
%if (efiarch32 or efiarch64) and basearch != 'i386':
<%
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
if domacboot:
images.append("images/macboot.img")
%>
%for img in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<% efihybrid = "--uefi --mac" if domacboot else "--uefi" %>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
%endif
# Create optional product.img and updates.img
<% filegraft=""; images=["product", "updates"]; compressargs=""; %>
%if basearch == 'i386':
# Limit the amount of memory xz uses on i386
<% compressargs="--xz -9 --memlimit-compress=3700MiB" %>
%endif
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img
treeinfo images-${basearch} ${img}.img images/${img}.img
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
filegraft += " " + workdir + "/iso-graft"
%>
# Add the license files
%for f in glob("/usr/share/licenses/*-release/*"):
install ${f} ${f|basename}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
-boot-load-size 4 -boot-info-table -no-emul-boot \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
-graft-points \
${STAGE2IMG}=${outroot}/${STAGE2IMG} \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${efigraft} ${filegraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso
木兰宽松许可证, 第2版
木兰宽松许可证, 第2版
2020年1月 http://license.coscl.org.cn/MulanPSL2
您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
0. 定义
“软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
“贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
“贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
“法人实体”是指提交贡献的机构及其“关联实体”。
“关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
1. 授予版权许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
2. 授予专利许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
3. 无商标许可
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
4. 分发限制
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
5. 免责声明与责任限制
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
6. 语言
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
条款结束
如何将木兰宽松许可证,第2版,应用到您的软件
如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
3, 请将如下声明文本放入每个源文件的头部注释中。
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
Mulan Permissive Software License,Version 2
Mulan Permissive Software License,Version 2 (Mulan PSL v2)
January 2020 http://license.coscl.org.cn/MulanPSL2
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
0. Definition
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
Contribution means the copyrightable work licensed by a particular Contributor under this License.
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
Legal Entity means the entity making a Contribution and all its Affiliates.
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
1. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
2. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
3. No Trademark License
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4.
4. Distribution Restriction
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
5. Disclaimer of Warranty and Limitation of Liability
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
6. Language
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
END OF THE TERMS AND CONDITIONS
How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package;
iii Attach the statement to the appropriate annotated syntax at the beginning of each source file.
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
# oemaker
#### Description
a building tool for making DVD ISO
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
# oemaker # oemaker
#### 介绍 #### Description
a building tool for making DVD ISO
`oemaker` is a building tool for making DVD iso, include standard iso, debug iso and source iso.
#### 软件架构 `oemaker` uses local arch when building, did not support cross building.
软件架构说明 currently, `oemaker` support the arch of aarch64 and x86_64 for iso making.
#### Installation
#### 安装教程
To install `oemaker`, you can use `rpm` or `dnf` package manager command with openEuler repository.
1. xxxx
2. xxxx Install oemaker with dnf
3. xxxx ```sh
dnf install -y oemaker
#### 使用说明 ```
1. xxxx #### Instructions
2. xxxx
3. xxxx Generally, the disk space is more than 50g.
#### 参与贡献 #### Contribution
1. Fork 本仓库 oemaker <font color=#0000FF >_[-t Type] [-p Product] [-v Version] [-r RELEASE] [-s REPOSITORY]_</font>
2. 新建 Feat_xxx 分支
3. 提交代码 optional arguments:
4. 新建 Pull Request -t Type
ISO Type include standard debug and source
#### 码云特技 -p Product
Product Name, such as: openEuler
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -v Version
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 version identifier
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -r RELEASE
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) release information
-s REPOSITORY
source dnf repository address link(may be listed multiple times)
此差异已折叠。
CONFIG_YUM_REPOS="http://repo.openeuler.org/openEuler-20.03-LTS/everything/aarch64/"
CONFIG_PACKAGES_LIST_FILE="config/aarch64/normal.xml"
CONFIG_RPM_LIST="config/rpmlist.xml"
CONFIG_PRODUCT="openEuler"
CONFIG_VERSION="20.03"
CONFIG_RELEASE="LTS"
此差异已折叠。
#version=EulerOS V2.0SP5
# System authorization information
# Use CDROM installation media
# Use graphical install
# Run the Setup Agent on first boot
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
# Network information
# Root password
# System timezone
timezone Asia/Shanghai --isUtc --nontp
# System bootloader configuration
# Partition clearing information
%packages --multilib
@core
glibc.i686
gcc
gdb
make
%end
%post
grub2-set-default 1
%end
此差异已折叠。
CONFIG_YUM_REPOS="http://repo.openeuler.org/openEuler-20.03-LTS/everything/x86_64/"
CONFIG_PACKAGES_LIST_FILE="config/x86_64/normal.xml"
CONFIG_RPM_LIST="config/rpmlist.xml"
CONFIG_KS_FILE="config/x86_64/ks.cfg"
CONFIG_PRODUCT="openEuler"
CONFIG_VERSION="20.03"
CONFIG_RELEASE="LTS"
\ No newline at end of file
:<<!
* Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: zhuchunyi
* Create: 2020-08-05
* Description: provide container buffer functions
!
#!/bin/bash
set -e
function create_install_img()
{
echo "$YUMREPO" > yumrepo.file
lorax --isfinal -p "$NAME" -v "$VERSION" -r "$RELEASE" --sharedir 80-openeuler --rootfs-size=3 --buildarch="$ARCH" $(cat yumrepo.file) --nomacboot --noupgrade "${BUILD}"/iso > lorax.logfile 2>&1
if [ $? != 0 ] ; then
cat lorax.logfile
exit 1
fi
}
function create_repos()
{
mv /etc/yum.repos.d repos.old && mkdir /etc/yum.repos.d/
repos=($(echo "$YUMREPO" | sed 's/-s//g'))
for repo in ${repos[@]}
do
yum-config-manager --add-repo "$repo"
done
yum clean all
}
:<<!
* Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: zhuchunyi
* Create: 2020-08-05
* Description: provide container buffer functions
!
#!/bin/bash
set -e
function parse_cmd_line()
{
#param init
ARCH="$(uname -m)"
if [ "${ARCH}" = "aarch64" ] || [ "${ARCH}" = "x86_64" ];then
CONFIG_FILE="${CPATH}/config/${ARCH}/standard.conf"
source "${CONFIG_FILE}"
else
echo "unsupported architectures: ${ARCH}"
return 1;
fi
PRODUCT="${CONFIG_PRODUCT}"
VERSION="${CONFIG_VERSION}"
RELEASE="${CONFIG_RELEASE}"
REPOS1="${CONFIG_YUM_REPOS}"
ISOTYPE="standard"
# parse input params
while getopts ":p:v:r:s:t:" opt
do
case "$opt" in
p) PRODUCT="$OPTARG";;
v) VERSION="$OPTARG";;
r) RELEASE="$OPTARG";;
s) REPOS1="$OPTARG";;
t) ISOTYPE="$OPTARG";;
?) printf "Usage: %s: [-f config_file] args\n" "$0"
return 1;;
esac
done
for typename in standard source debug
do
if [ "${typename}" == "${ISOTYPE}" ];then
return 0
fi
done
echo "unsupported iso type: ${ISOTYPE}"
echo "supported iso types: standard source and debug"
return 1
}
function global_var_init()
{
if [ "X$CONFIG_FILE" != "X" -a -f "$CONFIG_FILE" ];then
source "${CONFIG_FILE}";
fi
TYPE="iso"
BUILD="${OUTPUT_DIR}"/tmp
SRC_DIR="${BUILD}"/src
DBG_DIR="${BUILD}"/dbg
if [ "${ISOTYPE}" == "debug" ]; then
source ./make_debug.sh
fi
RELEASE_NAME="${PRODUCT}-${VERSION}-${RELEASE}-${ARCH}"
ISO_NAME="${PRODUCT}-${VERSION}-${RELEASE}-${ARCH}-dvd.iso"
SRC_ISO_NAME="${PRODUCT}-${VERSION}-${RELEASE}-source-dvd.iso"
DBG_ISO_NAME="${PRODUCT}-${VERSION}-${RELEASE}-debug-${ARCH}-dvd.iso"
[ ! -d "${BUILD}" ] && mkdir -p "${BUILD}"
[ -d "${BUILD}"/iso ] && rm -rf "${BUILD}"/iso
set +e
setenforce 0
if [ "X$CONFIG_FILE" != "X" ];then
YUMREPO="$CONFIG_YUM_REPOS"
CONFIG="$CONFIG_PACKAGES_LIST_FILE"
else
YUMREPO="-s $YUM_REPO"
CONFIG=""
fi
REPOS=$(echo "$REPOS1")
if [ "X$REPOS" != "X" ];then
REPOS=$(echo " ""${REPOS}" | sed 's/ / -s /g')
YUMREPO="${REPOS}"
fi
set -e
return 0
}
#######################################
# copy config.
# Arguments:
# None
# Returns:
# Success: 0
# Failed: 1
#######################################
function init_config()
{
[ -f "${BUILD}"/isopackage.sdf ] && cp "${BUILD}"/isopackage.sdf "${BUILD}"/iso/
if [ ! -z "$CONFIG_KS_FILE" ]; then
mkdir -p "${BUILD}"/iso/ks
cp "$CONFIG_KS_FILE" "${BUILD}"/iso/ks/
fi
if [ ! -f "${BUILD}/docs/OpenEuler-Software-License.docx" ]; then
mkdir -p "${BUILD}"/iso/docs
cp "${CPATH}"/docs/* "${BUILD}"/iso/docs/
fi
return 0
}
:<<!
* Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: zhuchunyi
* Create: 2020-08-05
* Description: provide container buffer functions
!
#!/bin/bash
set -e
function gen_debug_iso()
{
rm -rf "${BUILD}"/iso/repodata/*
cp "$CONFIG" "${BUILD}"/iso/repodata/
rm -rf "$BUILD"/iso/Packages
mv "$DBG_DIR" "$BUILD"/iso/Packages
createrepo -g "${BUILD}"/iso/repodata/*.xml "${BUILD}"/iso
if [ "$ARCH" == "x86_64" ]; then
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${DBG_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
[ $? != 0 ] && return 1
elif [ "$ARCH" == "aarch64" ]; then
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${DBG_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
[ $? != 0 ] && return 1
fi
implantisomd5 /result/"${DBG_ISO_NAME}"
return 0
}
function gen_iso()
{
if [ "$ARCH" == "x86_64" ]; then
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
[ $? != 0 ] && return 1
elif [ "$ARCH" == "aarch64" ]; then
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
[ $? != 0 ] && return 1
fi
implantisomd5 /result/"${ISO_NAME}"
return 0
}
function gen_src_iso()
{
set +e
rm -rf "$BUILD"/iso/Packages
mv "$SRC_DIR" "$BUILD"/iso/Packages
if [ "$ARCH" == "x86_64" ]; then
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${SRC_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
[ $? != 0 ] && return 1
elif [ "$ARCH" == "aarch64" ]; then
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o /result/"${SRC_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
[ $? != 0 ] && return 1
fi
return 0
}
:<<!
* Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: zhuchunyi
* Create: 2020-08-05
* Description: provide container buffer functions
!
#!/bin/bash
CONFIG_DBG_LIST="config/standard/debug_rpmlist"
set -e
function down_ava_debug_rpm()
{
[ -d "$DBG_DIR" ] && rm -rf "$DBG_DIR"
yum list --installroot="${BUILD}"/tmp available | awk '{print $1}' | grep -E 'devel|debuginfo' | grep -v "i686" > ava_deb_lst
local yumdownloader_log_startline=$(($(awk 'END{print NR}' /var/log/dnf.log)+1))
yumdownloader --installroot="${BUILD}"/tmp --destdir="$DBG_DIR" $(cat ava_deb_lst | tr '\n' ' ') > /dev/null
if [ $? -ne 0 ] || sed -n ''${yumdownloader_log_startline}',$p' /var/log/dnf.log | grep -n 'conflicting requests'; then
return 1
fi
return 0
}
function get_debug_rpm()
{
rm -rf debug_rpm_lst
set +e
rpm -qpi "$BUILD"/iso/Packages/*.rpm | grep "Source RPM" | awk '{print $4}' | sort | uniq > iso_src_lst
for debug_rpm in $(ls "$DBG_DIR" | grep rpm$)
do
src_name=$(rpm -qpi "$DBG_DIR"/"$debug_rpm" | grep "Source RPM" | awk '{print $4}')
grep "^$src_name$" iso_src_lst > /dev/null 2>&1
if [ $? -ne 0 ]; then
[ -n "$debug_rpm" ] && rm -rf "$DBG_DIR"/"$debug_rpm"
else
rpm -qp --qf "%{NAME}.%{ARCH}\n" "$DBG_DIR"/"$debug_rpm" >> debug_rpm_lst
fi
done
set -e
local yumdownloader_log_startline=$(($(awk 'END{print NR}' /var/log/dnf.log)+1))
yumdownloader --resolve --installroot="${BUILD}"/tmp --destdir="$DBG_DIR" $(cat debug_rpm_lst | tr '\n' ' ')
if [ $? -ne 0 ] || sed -n ''${yumdownloader_log_startline}',$p' /var/log/dnf.log | grep -n 'conflicting requests'; then
return 1
fi
ls "${BUILD}"/iso/Packages/ | sort > iso_lst
ls "$DBG_DIR"/ |sort > deb_lst
for del_rpm in $(cat iso_lst deb_lst | sort -n | uniq -d)
do
[ -n "$del_rpm" ] && rm -rf "$DBG_DIR"/"$del_rpm"
done
return 0
}
:<<!
* Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: zhuchunyi
* Create: 2020-08-05
* Description: provide container buffer functions
!
#!/bin/bash
set -e
cd /opt/oemaker
REPOS=""
export OUTPUT_DIR="/result"
export CPATH=$(pwd)
umask 0022
source "${CPATH}"/init.sh
source "${CPATH}"/iso.sh
source "${CPATH}"/rpm.sh
source "${CPATH}"/img_repo.sh
function mkclean()
{
rm -rf /etc/yum/repos.d/*
[ -n "${BUILD}" ] && rm -rf "${BUILD}"
rm -rf /etc/yum.repos.d && mv repos.old /etc/yum.repos.d
}
function mk_euleros_main()
{
echo "Parsing cmd line..."
parse_cmd_line "$@"
if [ $? -ne 0 ]; then
echo "parse params error"
return 1
fi
echo "Initializing variables..."
global_var_init
if [ $? -ne 0 ]; then
echo "init env failed"
return 1
fi
create_install_img &
echo "Creating repos..."
create_repos
if [ $? -ne 0 ]; then
echo "create repo failed"
return 1
fi
echo "Downloading rpms..."
download_rpms
if [ $? -ne 0 ]; then
echo "down rpms failed"
return 1
fi
echo "Initializing config..."
wait && cat lorax.logfile
init_config
if [ $? -ne 0 ]; then
echo "init config failed"
return 1
fi
echo "Getting rpm public key..."
get_rpm_pub_key
if [ $? -ne 0 ]; then
echo "get rpm pub key failed"
return 1
fi
echo "Waiting for lorax to finish..."
if [ "${ISOTYPE}" == "debug" ]; then
gen_debug_iso
if [ $? -ne 0 ]; then
echo "create debug iso failed"
return 1
fi
mkclean
echo "${OUTPUT_DIR}/${DBG_ISO_NAME}"
elif [ "${ISOTYPE}" == "standard" ]; then
gen_iso
if [ $? -ne 0 ]; then
echo "create install iso failed"
return 1
fi
mkclean
echo "${OUTPUT_DIR}/${ISO_NAME}"
elif [ "${ISOTYPE}" == "source" ]; then
gen_src_iso
if [ $? -ne 0 ]; then
echo "create source iso failed"
return 1
fi
mkclean
echo "${OUTPUT_DIR}/${SRC_ISO_NAME}"
fi
return 0
}
mk_euleros_main "$@"
if [ $? -ne 0 ]; then
echo "make iso failed"
exit 1
fi
:<<!
* Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: zhuchunyi
* Create: 2020-08-05
* Description: provide container buffer functions
!
#!/bin/bash
set -e
function parse_rpmlist_xml()
{
packagetype=$1
xmllint --xpath "//packagelist[@type='${packagetype}']/node()" "${CONFIG_RPM_LIST}" > origin_rpmlist_${packagetype}
cat origin_rpmlist_${packagetype} | grep packagereq | cut -d ">" -f 2 | cut -d "<" -f 1 > parsed_rpmlist_${packagetype}
return 0
}
function download_rpms()
{
cat "${CONFIG}" | grep packagereq | cut -d ">" -f 2 | cut -d "<" -f 1 > _all_rpms.lst
parse_rpmlist_xml "${ARCH}"
cat parsed_rpmlist_${ARCH} >> _all_rpms.lst
parse_rpmlist_xml "common"
cat parsed_rpmlist_common >> _all_rpms.lst
sort -r -u _all_rpms.lst -o _all_rpms.lst
[ -d "${BUILD}"/tmp ] && rm -rf "${BUILD}"/tmp
ret=0
rm -rf not_find __*
yum list --installroot="${BUILD}"/tmp available | awk '{print $1}' > __list.arch
set +e
for rname in $(cat _all_rpms.lst)
do
if [ $(echo "$rname" | grep "\*$") ]; then
echo "$rname" >> __rpm.list
continue
fi
rname=$(echo "$rname")
rarch=${rname##*.}
if [ "X$rarch" == "Xi686" ] && [ "$ARCH" == "aarch64" ]; then
continue
fi
if [ "X$rarch" == "Xx86_64" ] && [ "$ARCH" == "aarch64" ]; then
rname=${rname%%.*}
rarch="aarch64"
fi
cat __list.arch | grep -w "^$rname" > /dev/null 2>&1
if [ $? != 0 ]; then
rname=`repoquery --queryformat="%{name}.%{arch}" -q --whatprovides $rname`
if [ -z "$rname" ]; then
echo "cannot find $rname in yum repo" >> not_find
ret=1
continue
else
echo "$rname" >> __rpm.list
continue
fi
fi
if [ "X$rarch" == "Xi686" ] || [ "X$rarch" == "Xx86_64" ] || [ "X$rarch" == "Xnoarch" ] || [ "X$rarch" == "Xaarch64" ]; then
rname="${rname}"
else
cat __list.arch | grep -w "^$rname.$ARCH" > /dev/null 2>&1
if [ $? == 0 ]; then
rname="${rname}"."${ARCH}"
else
cat __list.arch | grep -w "^$rname.noarch" > /dev/null 2>&1
if [ $? == 0 ]; then
rname="${rname}".noarch
else
echo "cannot find $rname in yum repo" >> not_find
ret=1
fi
fi
fi
echo "$rname" >> __rpm.list
done
if [ "${ret}" -ne 0 ]; then
cat not_find|sort|uniq
exit "${ret}"
fi
parse_rpmlist_xml "exclude"
local exclude_cmd=""
if [ -s parsed_rpmlist_exclude ];then
for rpmname in `cat parsed_rpmlist_exclude`;do
exclude_cmd="${exclude_cmd} -x ${rpmname}"
done
fi
local yumdownloader_log_startline=$(($(awk 'END{print NR}' /var/log/dnf.log)+1))
yumdownloader --resolve --installroot="${BUILD}"/tmp --destdir="${BUILD}"/iso/Packages/ $(cat __rpm.list | tr '\n' ' ') ${exclude_cmd}
if [ $? != 0 ] || sed -n ''${yumdownloader_log_startline}',$p' /var/log/dnf.log | grep -n 'conflicting requests'; then
echo "Download rpms failed!"
exit 133
fi
parse_rpmlist_xml "conflict"
set -e
if [ -s parsed_rpmlist_conflict ];then
yumdownloader --resolve --installroot="${BUILD}"/tmp --destdir="${BUILD}"/iso/Packages/ $(cat parsed_rpmlist_conflict | tr '\n' ' ') ${exclude_cmd}
fi
set +e
if [ "${ISOTYPE}" == "debug" ]; then
down_ava_debug_rpm
get_debug_rpm
elif [ "${ISOTYPE}" == "source" ]; then
[ -d "$SRC_DIR" ] && rm -rf "$SRC_DIR"
mkdir "$SRC_DIR"
ls "${BUILD}"/iso/Packages/ | sed 's/.rpm$//g'| tr '\n' ' ' | sort | uniq | xargs yumdownloader --installroot="${BUILD}"/tmp --source --destdir="$SRC_DIR"
yumdownloader kernel-source --installroot="${BUILD}"/tmp --destdir="$SRC_DIR"
fi
mkdir -p "${BUILD}"/iso/repodata
cp "$CONFIG" "${BUILD}"/iso/repodata/
createrepo -g "${BUILD}"/iso/repodata/*.xml "${BUILD}"/iso
return 0
}
function get_rpm_pub_key()
{
mkdir -p "${BUILD}"/iso/GPG_tmp
cp "${BUILD}"/iso/Packages/openEuler-gpg-keys* "${BUILD}"/iso/GPG_tmp
cd "${BUILD}"/iso/GPG_tmp
rpm2cpio openEuler-gpg-keys* | cpio -div ./etc/pki/rpm-gpg/RPM-GPG-KEY-openEuler
cd -
cp "${BUILD}"/iso/GPG_tmp/etc/pki/rpm-gpg/RPM-GPG-KEY-openEuler "${BUILD}"/iso
rm -rf "${BUILD}"/iso/GPG_tmp
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册