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

Fixes and improvements #27

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions initramfs/config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# add leds udev rule

mp=/tmp/newroot
default_debian_suite=buster
Copy link
Contributor

Choose a reason for hiding this comment

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

How is that related to the other change in config.sample:
GNUBEE_DEBIAN_SUITE="stable"

default_debian_mirror="http://httpredir.debian.org/debian"

set_host() {
case `hostname` in
Expand All @@ -32,6 +34,33 @@ set_host() {
return 1
}

set_debian() {
while [ -z "$debian_suite" ]; do
read -p "Which Debian suite do you want to install? (jessie | stretch | buster | bullseye | sid) [buster] " debian_suite
case "$debian_suite" in
"" ) debian_suite="$default_debian_suite" ;;
jessie | stretch | buster | bullseye | sid ) ;;
* ) echo "Unknown debian suite. Please enter one of the above choices."
esac
done
while [ -z "$debian_mirror" ]; do
read -p "Which Debian mirror do you want to use? [$default_debian_mirror]" debian_mirror
debian_mirror="${debian_mirror%/}"
case "$debian_mirror" in
"" ) debian_mirror="$default_debian_mirror" ;;
* )
echo -n "Validating mirror URL ... "
if wget -q --spider "$debian_mirror/debian/dists/$debian_suite/Release.gpg"; then
echo "OK."
else
echo "ERROR, please enter a valid Debian mirror URL."
debian_mirror=
fi
esac
done

}

check_net() {
net_dev=`ip route show match 0/0 | awk '$4 == "dev" {print $5 }'`
if [ -z "$net_dev" ]; then
Expand Down Expand Up @@ -146,7 +175,7 @@ bootstrap() {
fi
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH
export PATH
debootstrap --arch=mipsel --include=vim,openssh-server,ntpdate,cron,locales,udev,fake-hwclock,mtd-utils,ca-certificates,apt-transport-https,vlan,libnl-3-200,libnl-genl-3-200 stretch $mp http://httpredir.debian.org/debian || exit 1
debootstrap --arch=mipsel --include=vim,openssh-server,ntpdate,cron,locales,udev,fake-hwclock,mtd-utils,ca-certificates,apt-transport-https,vlan,libnl-3-200,libnl-genl-3-200 "$debian_version" "$mp" "$debian_mirror" || exit 1
return 1
}

Expand Down Expand Up @@ -223,7 +252,7 @@ fixup() {
return 0
}

until set_host && set_passwd && set_net && set_time && create_filesystem && bootstrap && fixup; do
until set_host && set_debian && set_passwd && set_net && set_time && create_filesystem && bootstrap && fixup; do
:
done

Expand Down