unixabg / cryptmypi

Project to assist users in building an encrypted raspberry pi
GNU General Public License v3.0
61 stars 21 forks source link

Scripts fails due to not being able to resolve hosts. #23

Closed KoalaV2 closed 4 years ago

KoalaV2 commented 4 years ago

As said in title the scripts fails when it's trying to install dropbear because it cannot resolve hosts, my guess would be incorrect DNS name server names in the /etc/resolv.conf file, I've got no clue how to fix it with the script so sadly cant make any pull requests. To add: Running rasp pi 4 with nightly build of the kali image.

KoalaV2 commented 4 years ago

Here's the output: `Removing current build files...

Executing both stages

############################################################################### C R Y P T M Y P I ---- Stage 1 ---- v4.1-beta ###############################################################################

--- Custom STAGE1 SELECTED stage1profile_complete

--- Executing:

Attempting to run stage1 hooks ...

unixabg commented 4 years ago

Greetings,

First let me say thank you for the report and testing with the project. Would you be able to attempt a build using the next-4.x branch? Also if so please do a git pull --rebase and note that if your config used a setup.sh script that will need renamed to setup-stage1.sh. I believe the issue you are encountering is resolved in the next-4.x branch. Please report back and close if that resolves your issue.

KoalaV2 commented 4 years ago

Hey, yeah absolutely, I'll try it when I get home in a couple of hours and report back

On Wed, Sep 2, 2020, 22:04 Richard Nelson notifications@github.com wrote:

Greetings,

First let me say thank you for the report and testing with the project. Would you be able to attempt a build using the next-4.x branch? Also if so please do a git pull --rebase and note that if your config used a setup.sh script that will need renamed to setup-stage1.sh. I believe the issue you are encountering is resolved in the next-4.x branch. Please report back and close if that resolves your issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/unixabg/cryptmypi/issues/23#issuecomment-685966689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOUI3TBP3A6CBNTUSWYX6TSD2QMLANCNFSM4QR7WCSA .

BMXT commented 4 years ago

Hi, I get the same problem using the kali-complete example and next-4.x branch. Tested on Ubuntu 20.04.1. Captura de pantalla de 2020-09-03 14-34-46

unixabg commented 4 years ago

Greetings,

Oops I see you are using the next-4.x branch? Did you do a git pull --rebase and note that if your config used a setup.sh script that will need renamed to setup-stage1.sh. I believe the issue you are encountering should be resolved in the next-4.x branch. With respect to Ubuntu I only at this time test with kali-linux atm. However it should work fine on Ubuntu. Please know that I do intend to do verify all working with stock Debian in order to submit to Debian as a package, so it would become part of both Kali and Ubuntu by default.

ebourmalo commented 4 years ago

Hi,

I fixed this issue on my fork, didn't have time to make a pull request. You can update the chroot_update method in chroot.fns with this (fix is commented):

chroot_update(){
    [ -z "${CHROOTDIR}" ] && {
        echo_error "Chroot dir was not defined! Aborting..."
        exit 1
    }

    echo_debug "${CHROOTDIR}"
    echo_debug "Updating apt-get"
    # -----> Fix expired keys of repo http://http.re4son-kernel.com/re4son
    chroot ${CHROOTDIR} apt-key adv --keyserver keys.gnupg.net --recv-keys 11764EE8AC24832F
    chroot ${CHROOTDIR} apt-get update

    echo_debug "Updating sytem packages"
    # chroot ${CHROOTDIR} apt-get -y upgrade
}

The issue was reported here: https://www.reddit.com/r/Kalilinux/comments/ij7trs/unable_to_update_kali_on_pi/

ebourmalo commented 4 years ago

I also had to run the hook optional-sys-dns to set the DNS before chroot_update otherwise, you can't download a thing.

File hooks/2200-stage1-setup-chroot.hook

chroot_mount ${_BUILDDIR}/root
# Run hook DNS to fix issues "Temporary failure resolving..."
myhooks "optional-sys-dns"
chroot_update

With these 2 updates, you'll be good for the fetch of the repos. Hope this helps

unixabg commented 4 years ago

Greetings,

I just finished running a test build with latest next-4.x with examples/kali-encrypted-basic and all appears in good order. The commit that addresses the case is 95a4680 . Again if you are failing on next-4.x branch please verify you are up to date with git pull --rebase.

KoalaV2 commented 4 years ago

Greetings,

I just finished running a test build with latest next-4.x with examples/kali-encrypted-basic and all appears in good order. The commit that addresses the case is 95a4680 . Again if you are failing on next-4.x branch please verify you are up to date with git pull --rebase.

Hello only updating to the new commit does not help the issue. even including the optional-sys-dns like in the kali-full example

KoalaV2 commented 4 years ago

I also had to run the hook optional-sys-dns to set the DNS before chroot_update otherwise, you can't download a thing.

File hooks/2200-stage1-setup-chroot.hook

chroot_mount ${_BUILDDIR}/root
# Run hook DNS to fix issues "Temporary failure resolving..."
myhooks "optional-sys-dns"
chroot_update

With these 2 updates, you'll be good for the fetch of the repos. Hope this helps

although while this doesnt seem to work it atleast gives me some progreess, i now get that "not found 104.18.103.100 80" on the kali.download/kali Release repo and then i get that it does not have a release file so apt update and install dropbear still cancells. `apt-get failed: Trying to recover...

unixabg commented 4 years ago

Greetings,

Please note that the commit I listed checks for resolv.conf and if one does not exist, then it populates one. So should be no need unless you want to override see hooks/0300-preconditions-dns.hook which populates the DNS variables that I use in that commit if not already set. I think the issue is that you are hitting now is a repo that has an issue. For now I am going to close this issue.