Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Kali support #148

Merged
merged 8 commits into from
Oct 25, 2021
Merged

Added Kali support #148

merged 8 commits into from
Oct 25, 2021

Conversation

takov751
Copy link
Contributor

I followed previous pull requests. Tested it's working as expected, however room for improvement

The config file name created is kali-2021.3.conf, which does not looking as good.

The size of the vm by default 16GB, which can be a problem as the system when installed by default takes 12GB. Is there a plan to change that value on creation?

@takov751
Copy link
Contributor Author

I almost forget I would like to add later a netinstaller pressed.conf combination as well.

Copy link
Member

@daPhipz daPhipz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I have some small comments to make, since Kali is a rolling release distro. Please have a look at them and feel free to comment what you think about my idea! Have nice weekend!

quickget Outdated
#local HASH=""
local ISO=""
local URL=""
https://cdimage.kali.org/kali-2021.3/kali-linux-2021.3-installer-amd64.iso
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is here by accident, isn't it? 🙈

Copy link
Contributor Author

@takov751 takov751 Oct 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed 😅😬

quickget Outdated Show resolved Hide resolved
quickget Outdated
Comment on lines 639 to 642
validate_release "releases_kali"
ISO="kali-linux-${RELEASE}-installer-amd64.iso"
HASH=$(wget -q -O- "https://cdimage.kali.org/kali-2021.3/SHA256SUMS" | grep '('"${ISO}"')' | cut -d' ' -f1)
URL="https://cdimage.kali.org/kali-${RELEASE}/${ISO}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Kali is a rolling release distro, it would make sense to always provide the latest ISO instead of one fixed release, to minimize post-install updates. I'd suggest updating the code to do that, like this:

Suggested change
validate_release "releases_kali"
ISO="kali-linux-${RELEASE}-installer-amd64.iso"
HASH=$(wget -q -O- "https://cdimage.kali.org/kali-2021.3/SHA256SUMS" | grep '('"${ISO}"')' | cut -d' ' -f1)
URL="https://cdimage.kali.org/kali-${RELEASE}/${ISO}"
validate_release "releases_kali"
web_get "https://cdimage.kali.org/current/SHA256SUMS" "${VM_PATH}"
HASH=$(head -1 "${VM_PATH}/SHA256SUMS" | cut -d' ' -f1)
ISO=$(head -1 "${VM_PATH}/SHA256SUMS" | cut -d' ' -f3)
URL="https://cdimage.kali.org/current/${ISO}"

First, download the checksum file. The current directory always contains the latest quarterly images. From the checksum file, extract the actual checksum and the ISO filename (which is different for each newly released ISO, of course - see also #146).

You may want to change the "release" name to latest, as well.

Copy link
Contributor Author

@takov751 takov751 Oct 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that my issue is that first we would need to download hash file determine latest release file name , digest hash and file name into HASH and RELEASE variable , then proceed to the downloading and verifying phase. I would say that's more of an improvement fix later on. Not something I would do at this point, but later i will and thank you for pointing it out.

quickget Outdated
@@ -143,6 +145,10 @@ function releases_fedora(){
35_beta
}

function releases_kali() {
echo 2021.3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to change the release name to latest if you incorporate my suggested changes from below.

@takov751
Copy link
Contributor Author

takov751 commented Oct 23, 2021

Thank you for your comments . All of them are valid and reasonable. I will make changes later to determine release version. It won't be that hard just need two different cut field when you grep hash value

@philclifford
Copy link
Contributor

Just a small suggestion: besides /current/ for latest stable there's /weekly/ (possible devel release).
There is also the live iso which I believe is tweaked a little for running in virtualized environments ... might be nice to have that as an optional release as well.

@takov751
Copy link
Contributor Author

takov751 commented Oct 23, 2021

Made changes to get latest release. Thanks for the advices @daPhipz .
Now with latest version it will parse current release sorted with last modified first, find current release version.Using that release version parse checksum as well.

Point made there @philclifford . I will think about how to do that as well. Might be good for QA testing for sure. Another improvement which i am thinking about.

UPDATE:

Weekly image added as well.

Would like to ask just code revision, if its ugly or not reasonable

@takov751
Copy link
Contributor Author

Now, I am somewhat happy with the result.

Next idea I had a netinstall and netinstall-unattended. Where you could specify preseed.conf and other scripts to setup the environment. So the netinstall-unattended would download and validate iso and then modify it to look for preseed on ftp/http server. Add example preseed.conf which can be modified by user later or provide variable for path in vm config file where to look for file prepared. Then during install it would be served to the vm. Which is why it's a bit complicated matter as you need to spin up a small service on host even on non-standard port to serve up files to guest. Similar to windows unatended install

quickget Outdated
Comment on lines 148 to 151
function releases_kali() {
echo latest
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add weekly here in order to make the weekly ISO builds available ;)

Suggested change
function releases_kali() {
echo latest
}
function releases_kali() {
echo latest \
weekly
}

quickget Outdated
Comment on lines 638 to 643
local SUBDIR="current"
validate_release "releases_kali"

if [[ "${RELEASE}" == *"weekly"* ]]; then
SUBDIR="kali-weekly"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be personal preference and I might be the odd one out here - and this is very nit picky:
IMO, the code would be easier to understand and more readable if we would check for "$RELEASE == "current" instead of assigning "current" to the SUBDIR variable directly. But as I said, probably just my personal preference ;)

Why are you surrounding "weekly" with asterisks *? I haven't seen that anywhere before, and I am curious what it does ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to be honest the asteriks there I have seen it above in the code. I have to double check that. Certainly. I have added current to subdir might be a meaningless effort

@takov751
Copy link
Contributor Author

takov751 commented Oct 24, 2021

Done fixes. There was differences in my local work and the one a pushed.

Update:
Finished now. Forgot to change readme

@flexiondotorg flexiondotorg merged commit f111497 into quickemu-project:master Oct 25, 2021
@takov751 takov751 deleted the patch-1 branch October 26, 2021 06:24
deraffe pushed a commit to deraffe/quickemu that referenced this pull request Apr 11, 2023
* Added Kali support

* Support for Kali

* remove link left in quickget

* made changes to get latest release.

* Added weekly iso as well

* few typo and clearing up choosing release version

* fixing readme about version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants