replace "FedoraBook" with ${NAME}
This commit is contained in:
parent
8f708e13bc
commit
4f679cde73
11
clonedisk.sh
11
clonedisk.sh
|
@ -12,6 +12,8 @@ Usage: $PROGNAME [OPTION]
|
|||
EOF
|
||||
}
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
TEMP=$(
|
||||
getopt -o '' \
|
||||
--long crypt \
|
||||
|
@ -163,10 +165,17 @@ umount boot
|
|||
rmdir boot
|
||||
|
||||
if ! [[ $UPDATE ]]; then
|
||||
for i in FED1 FED2 FED3 FED4; do
|
||||
efibootmgr -B -b $i || :
|
||||
done
|
||||
efibootmgr -B -b FED1 || :
|
||||
efibootmgr -C -b FED1 -d ${OUT_DEV} -p 1 -L "FedoraBook 1" -l '\efi\fedorabook\1.efi'
|
||||
efibootmgr -C -b FED1 -d ${OUT_DEV} -p 1 -L "${NAME} 1" -l "\efi\${NAME}\1.efi"
|
||||
efibootmgr -C -b FED2 -d ${OUT_DEV} -p 1 -L "${NAME} 2" -l "\efi\${NAME}\2.efi"
|
||||
efibootmgr -C -b FED3 -d ${OUT_DEV} -p 1 -L "${NAME} Old 1" -l "\efi\${NAME}\_1.efi"
|
||||
efibootmgr -C -b FED4 -d ${OUT_DEV} -p 1 -L "${NAME} Old 2" -l "\efi\${NAME}\_2.efi"
|
||||
BOOT_ORDER=$(efibootmgr | grep BootOrder: | { read _ a; echo "$a"; })
|
||||
if ! [[ $BOOT_ORDER == *FED1* ]]; then
|
||||
efibootmgr -o "FED1,FED2,FED3,FED4,$BOOT_ORDER"
|
||||
efibootmgr -o "FED1,$BOOT_ORDER"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -33,7 +33,6 @@ fi
|
|||
|
||||
eval set -- "$TEMP"
|
||||
unset TEMP
|
||||
. /etc/os-release
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
|
|
|
@ -333,17 +333,22 @@ for i in passwd shadow group gshadow subuid subgid; do
|
|||
chmod u+r "${STATEDIR}/$i"
|
||||
done
|
||||
|
||||
cp "$BASEDIR"/FedoraBook.te "$BASEDIR"/FedoraBook.fc "$sysroot"/var/tmp
|
||||
chroot "$sysroot" bash -c '
|
||||
cd /var/tmp
|
||||
make -f /usr/share/selinux/devel/Makefile
|
||||
semodule --noreload -i FedoraBook.pp
|
||||
'
|
||||
if [[ -f "${BASEDIR}/${NAME}.te" ]] || [[ -f "${BASEDIR}/${NAME}.te" ]]; then
|
||||
for i in "${BASEDIR}/${NAME}.te" "${BASEDIR}/${NAME}.te"; do
|
||||
[[ -f "$i" ]] && cp "$i" "$sysroot"/var/tmp
|
||||
done
|
||||
chroot "$sysroot" bash -c "
|
||||
cd /var/tmp
|
||||
make -f /usr/share/selinux/devel/Makefile
|
||||
semodule --noreload -i ${NAME}.pp
|
||||
"
|
||||
fi
|
||||
|
||||
chroot "$sysroot" semanage fcontext --noreload -a -e /etc /cfg
|
||||
|
||||
cp "$BASEDIR/clonedisk.sh" "$sysroot"/usr/bin/fedorabook-clonedisk
|
||||
cp "$BASEDIR/update.sh" "$sysroot"/usr/bin/fedorabook-update
|
||||
cp "$BASEDIR/mkimage.sh" "$sysroot"/usr/bin/fedorabook-mkimage
|
||||
cp "$BASEDIR/clonedisk.sh" "$sysroot"/usr/bin/${NAME,,}-clonedisk
|
||||
cp "$BASEDIR/update.sh" "$sysroot"/usr/bin/${NAME,,}-update
|
||||
cp "$BASEDIR/mkimage.sh" "$sysroot"/usr/bin/${NAME,,}-mkimage
|
||||
|
||||
mkdir -p "$sysroot"/etc/pki/${NAME}
|
||||
openssl x509 -in "${BASEDIR}/${CRT}" -pubkey -noout > "$sysroot"/etc/pki/${NAME}/pubkey
|
||||
|
|
Loading…
Reference in a new issue