Adding cert installation got matter-setup script

This commit is contained in:
ngn 2024-01-06 18:23:08 +03:00
parent 8a71420b6f
commit 2e40ea1e62

View File

@ -61,12 +61,11 @@ if ! type mp > /dev/null; then
fi
info "Creating directory structure"
pushd $TARGET
mkdir -p {dev,proc,sys,run,tmp,root,home}
mkdir -p etc/mp
pushd $TARGET > /dev/null
mkdir -p {dev,proc,sys,run,tmp,root,home,boot}
mkdir -p var/{log,mail,lib}
mkdir -p usr/{bin,lib,sbin}
mkdir root/.gnupg
mkdir -p etc/mp
ln -sf usr/lib lib
ln -sf usr/lib lib64
@ -117,8 +116,8 @@ EOF
EOF
cp /etc/mp/cfg etc/mp/cfg
cp ~/.gnupg/pubring.kbx root/.gnupg/pubring.kbx
popd
#cp ~/.gnupg/pubring.kbx root/.gnupg/pubring.kbx
popd > /dev/null
export MP_ROOT="$TARGET"
info "Syncing repositories"
@ -133,7 +132,7 @@ export MP_ROOT="$TARGET"
openssl sed shadow tar tcl mandb \
man-pages tzdata util-linux which \
mp gettext iproute procps psmisc \
mandb kbd dbus
mandb kbd dbus vim nano
check_ret "mp-install command failed"
unset MP_ROOT
success "Installed the base system"
@ -182,9 +181,15 @@ cat > $TARGET/etc/shells << "EOF"
/bin/bash
EOF
info "Entering chroot, the rest is up to you!"
matter-chroot "$TARGET"
info "Installing certs"
wget -q https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt -O "$TARGET/certdata.txt"
matter-chroot $TARGET make-ca > /dev/null
check_ret "Failed to run make-ca, install certs manually"
rm -f "$TARGET/certdata.txt"
info "Setup complete, feel free to chroot"
# user is expected to do the following:
# - configure /etc/resolv.conf
# - install systemd
# - systemd-machine-id-setup
# - systemctl preset-all