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