diff --git a/matter-base/main.sh b/matter-base/main.sh index 975697e..ad2313e 100644 --- a/matter-base/main.sh +++ b/matter-base/main.sh @@ -1,6 +1,6 @@ #!/bin/bash -# matter-base | Matterlinux Release Archive Script +# matter-base | Matterlinux Release Archive Build Script # Copyright (C) 2023 Matterlinux # This program is free software: you can redistribute it and/or modify @@ -120,9 +120,6 @@ EOF 127.0.0.1 localhost ::1 localhost EOF - - cp /etc/mp/cfg etc/mp/cfg - #cp ~/.gnupg/pubring.kbx root/.gnupg/pubring.kbx popd > /dev/null export MP_ROOT="$TARGET" MP_YES=1 @@ -138,7 +135,7 @@ export MP_ROOT="$TARGET" MP_YES=1 openssl sed shadow tar tcl mandb \ man-pages tzdata util-linux which \ mp gettext iproute procps psmisc \ - mandb kbd dbus vim nano libxml2 + mandb kbd dbus vim nano libxml2 check_ret "mp-install command failed" unset MP_ROOT MP_YES success "Installed the base system" diff --git a/matter-chroot/main.sh b/matter-chroot/main.sh index ba5d5ff..0a9f13a 100644 --- a/matter-chroot/main.sh +++ b/matter-chroot/main.sh @@ -31,6 +31,12 @@ error() { #################### ## util functions ## #################### +linkresolv(){ + if [ ! -f "$TARGET/etc/resolv.conf" ]; then + ln -sf /run/systemd/resolve/resolv.conf "$TARGET/etc/resolv.conf" + fi +} + chrt() { mount -t proc proc "$TARGET/proc" mount -t sysfs sysfs "$TARGET/sys" @@ -40,13 +46,15 @@ chrt() { mount -o bind /dev "$TARGET/dev" mount -t devpts none "$TARGET/dev/pts" - mount -t tmpfs tmpfs "$TARGET/run" + mount --bind /run "$TARGET/run" + linkresolv if [ -h $TARGET/dev/shm ]; then mkdir -p $TARGET/$(readlink $TARGET/dev/shm) else mount -t tmpfs -o nosuid,nodev tmpfs "$TARGET/dev/shm" fi + local prompt='\['$BOLD'\['$RED'(chroot)\['$RESET'\['$BOLD' \u@\h:\w#\['$RESET' ' chroot "$TARGET" /usr/bin/env -i \ diff --git a/matter-iso/main.sh b/matter-iso/main.sh index 91e89cb..8e12b5a 100755 --- a/matter-iso/main.sh +++ b/matter-iso/main.sh @@ -73,18 +73,10 @@ check_retc() { if [ $? -ne 0 ]; then errorne "$1" clean_tmpdir + exit 1 fi } -setup_dns() { - info "Setting up DNS" - echo "nameserver 1.1.1.1" >> "$TMPDIR/etc/resolv.conf" -} - -clean_dns(){ - rm "$TMPDIR/etc/resolv.conf" -} - clean_tmpdir(){ if [ -d $TMPDIR ]; then info "Cleaning up temp directory" @@ -186,20 +178,18 @@ for p2 in "${PKGS2[@]}"; do fi done -setup_dns - info "Adding public keys" - matter-chroot "$TMPDIR" gpg --receive-keys $keys_str - check_retc "Failed to add public keys" +info "Adding public keys" +matter-chroot "$TMPDIR" gpg --receive-keys $keys_str +check_retc "Failed to add public keys" - if [ ! -z "${PKGS1}" ]; then - info "Installing extra packages (1)" - matter-chroot "$TMPDIR" mp-sync - check_retc "Sync failed" +if [ ! -z "${PKGS1}" ]; then + info "Installing extra packages (1)" + matter-chroot "$TMPDIR" mp-sync + check_retc "Sync failed" - matter-chroot "$TMPDIR" MP_YES=1 mp-install $pkgs1_str - check_retc "Install failed" - fi -clean_dns + matter-chroot "$TMPDIR" MP_YES=1 mp-install $pkgs1_str + check_retc "Install failed" +fi info "Running build script" echo "source /iso.sh && build" > "$TMPDIR/stager.sh" @@ -218,10 +208,8 @@ popd > /dev/null if [ ! -z "${PKGS2}" ]; then info "Installing extra packages (2)" - setup_dns - matter-chroot "$TMPDIR" MP_YES=1 mp-install $pkgs2_str - check_ret "Install failed" - clean_dns + matter-chroot "$TMPDIR" MP_YES=1 mp-install $pkgs2_str + check_ret "Install failed" fi info "Copying over the bootdir"