Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RapidSpace Autoinstall OS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
RapidSpace Autoinstall OS
Commits
7ba31c7f
Commit
7ba31c7f
authored
Jun 01, 2020
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reorganize the scripts and add changes for hsinchu
parent
bebb5aab
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
289 additions
and
15 deletions
+289
-15
dnsmasq_hsinchu.sh
dnsmasq_hsinchu.sh
+31
-2
dnsmasq_hydro66.sh
dnsmasq_hydro66.sh
+137
-0
dnsmasq_xinzhou.sh
dnsmasq_xinzhou.sh
+30
-1
download_boot_systems.sh
download_boot_systems.sh
+6
-12
preseed_hsinchu.cfg
preseed_hsinchu.cfg
+42
-0
preseed_hydro66.cfg
preseed_hydro66.cfg
+43
-0
preseed_xinzhou.cfg
preseed_xinzhou.cfg
+0
-0
No files found.
gen
_hsinchu.sh
→
dnsmasq
_hsinchu.sh
View file @
7ba31c7f
#!/bin/sh
set
-e
common
=
console
=
ttyS1,57600
SCRIPT_DIR
=
$(
realpath
`
dirname
"
$0
"
`
)
$SCRIPT_DIR
/download_boot_systems.sh
#UPDATE THOSE VARIABLES DEPENDING ON YOUR SITE
MY_IF_NAME
=
VLAN100
MY_IP_ADDR
=
10.0.45.1
DHCP_RANGE
=
10.0.45.100,static,255.255.255.0
ROUTER_ADDR
=
10.0.45.1
DNS_SERVER
=
1.2.4.8
common
=
console
=
ttyS0,57600
mac
=
'
98:03:9b:9b:8a:46
...
...
@@ -36,7 +48,7 @@ else unset timeout
fi
menuentry 'Install Debian' {
linux /debian-installer/amd64/linux vga=788 url=tftp://
\$
pxe_default_server/preseed.cfg language=C country=CN keymap=us hostname=
${
hostname_prefix
}
\$
i domain= --- mitigations=off
$common
linux /debian-installer/amd64/linux vga=788 url=tftp://
\$
pxe_default_server/preseed
_hsinchu
.cfg language=C country=CN keymap=us hostname=
${
hostname_prefix
}
\$
i domain= --- mitigations=off
$common
initrd /debian-installer/amd64/initrd.gz
}
menuentry 'SystemRescueCd' {
...
...
@@ -84,3 +96,20 @@ iface ens9f1 inet static
EOF
i
=
`
expr
$i
+ 1
`
done
exec
dnsmasq
-d
--port
=
0
--log-dhcp
\
--interface
=
$MY_IF_NAME
\
--bind-interfaces
\
--except-interface
=
lo
\
--listen-address
=
$MY_IP_ADDR
\
--dhcp-range
=
$DHCP_RANGE
\
--dhcp-option
=
option:router,
$ROUTER_ADDR
\
--dhcp-option
=
option:dns-server,
$DNS_SERVER
\
--dhcp-boot
=
debian-installer/amd64/grubx64.efi
\
--enable-tftp
--tftp-root
=
$(
realpath
`
dirname
"
$0
"
`
)
\
--conf-file
=
/dev/null
\
--dhcp-host
=
98:03:9b:9b:8a:47,10.0.45.101,1h
gen
_hydro66.sh
→
dnsmasq
_hydro66.sh
View file @
7ba31c7f
#!/bin/sh
set
-e
SCRIPT_DIR
=
$(
realpath
`
dirname
"
$0
"
`
)
$SCRIPT_DIR
/download_boot_systems.sh
#UPDATE THOSE VARIABLES DEPENDING ON YOUR SITE
MY_IF_NAME
=
VLAN100
MY_IP_ADDR
=
10.0.45.1
DHCP_RANGE
=
10.0.45.100,static,255.255.255.0
ROUTER_ADDR
=
10.0.45.1
DNS_SERVER
=
1.2.4.8
common
=
console
=
ttyS1,57600
(
mac
=
'
...
...
@@ -41,10 +53,13 @@ f4:52:14:f3:d5:d2
f4:52:14:fa:37:e8
e4:1d:2d:52:29:6a
'
i
=
0
hostname_prefix
=
hydro66-leopard
(
#echo set timeout=0
echo
if
false
echo
then
true
i
=
0
for
mac
in
$mac
;
do
echo
"elif [
\$
net_default_mac =
$mac
]"
echo
then
set
i
=
`
printf
%03u
$i
`
...
...
@@ -55,7 +70,7 @@ else unset timeout
fi
menuentry 'Install Debian' {
linux /debian-installer/amd64/linux vga=788 url=tftp://
\$
pxe_default_server/preseed
.cfg language=C country=SE keymap=us hostname=hydro66-leopard-
\$
i domain= --- mitigations=off
$common
linux /debian-installer/amd64/linux vga=788 url=tftp://
\$
pxe_default_server/preseed
_hydro66.cfg language=C country=SE keymap=us hostname=
${
hostname_prefix
}
\$
i domain= --- mitigations=off
$common
initrd /debian-installer/amd64/initrd.gz
}
menuentry 'SystemRescueCd' {
...
...
@@ -67,3 +82,56 @@ menuentry 'Exit' {
}
EOF
)
>
debian-installer/amd64/grub/grub.cfg
for
mac
in
$mac
do
hostname
=
${
hostname_prefix
}
$(
printf
%03u
$i
)
mkdir
-p
$hostname
cat
>
$hostname
/interfaces
<<
EOF
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eno1
#iface eno1 inet dhcp
iface eno1 inet static
address 192.168.46.
$((
50
+
$i
))
/24
allow-hotplug ens9f1
iface ens9f1 inet static
address 10.0.45.
$((
50
+
$i
))
/24
gateway 10.0.45.1
dns-nameservers 1.2.4.8 223.5.5.5 223.6.6.6
#allow-hotplug ens9f0
##iface ens9f0 inet dhcp
#iface ens9f0 inet static
# address 113.24.192.26/30
# gateway 113.24.192.25
EOF
i
=
`
expr
$i
+ 1
`
done
exec
dnsmasq
-d
--port
=
0
--log-dhcp
\
--interface
=
$MY_IF_NAME
\
--bind-interfaces
\
--except-interface
=
lo
\
--listen-address
=
$MY_IP_ADDR
\
--dhcp-range
=
$DHCP_RANGE
\
--dhcp-option
=
option:router,
$ROUTER_ADDR
\
--dhcp-option
=
option:dns-server,
$DNS_SERVER
\
--dhcp-boot
=
debian-installer/amd64/grubx64.efi
\
--enable-tftp
--tftp-root
=
$(
realpath
`
dirname
"
$0
"
`
)
\
--conf-file
=
/dev/null
\
--dhcp-host
=
98:03:9b:9b:8a:47,10.0.45.101,1h
gen
_xinzhou.sh
→
dnsmasq
_xinzhou.sh
View file @
7ba31c7f
#!/bin/sh
set
-e
SCRIPT_DIR
=
$(
realpath
`
dirname
"
$0
"
`
)
$SCRIPT_DIR
/download_boot_systems.sh
#UPDATE THOSE VARIABLES DEPENDING ON YOUR SITE
MY_IF_NAME
=
VLAN100
MY_IP_ADDR
=
10.0.45.1
DHCP_RANGE
=
10.0.45.100,static,255.255.255.0
ROUTER_ADDR
=
10.0.45.1
DNS_SERVER
=
1.2.4.8
common
=
console
=
ttyS1,57600
mac
=
'
...
...
@@ -29,7 +41,7 @@ else unset timeout
fi
menuentry 'Install Debian' {
linux /debian-installer/amd64/linux vga=788 url=tftp://
\$
pxe_default_server/preseed.cfg language=C country=CN keymap=us hostname=
${
hostname_prefix
}
\$
i domain= --- mitigations=off
$common
linux /debian-installer/amd64/linux vga=788 url=tftp://
\$
pxe_default_server/preseed
_xinzhou
.cfg language=C country=CN keymap=us hostname=
${
hostname_prefix
}
\$
i domain= --- mitigations=off
$common
initrd /debian-installer/amd64/initrd.gz
}
menuentry 'SystemRescueCd' {
...
...
@@ -77,3 +89,20 @@ iface ens9f1 inet static
EOF
i
=
`
expr
$i
+ 1
`
done
exec
dnsmasq
-d
--port
=
0
--log-dhcp
\
--interface
=
$MY_IF_NAME
\
--bind-interfaces
\
--except-interface
=
lo
\
--listen-address
=
$MY_IP_ADDR
\
--dhcp-range
=
$DHCP_RANGE
\
--dhcp-option
=
option:router,
$ROUTER_ADDR
\
--dhcp-option
=
option:dns-server,
$DNS_SERVER
\
--dhcp-boot
=
debian-installer/amd64/grubx64.efi
\
--enable-tftp
--tftp-root
=
$(
realpath
`
dirname
"
$0
"
`
)
\
--conf-file
=
/dev/null
\
--dhcp-host
=
98:03:9b:9b:8a:47,10.0.45.101,1h
d
nsmasq
→
d
ownload_boot_systems.sh
View file @
7ba31c7f
#!/bin/sh
#UPDATE THOSE VARIABLES DEPENDING ON YOUR SITE
MY_IF_NAME
=
VLAN100
MY_IP_ADDR
=
10.0.45.1
DHCP_RANGE
=
10.0.45.100,static,255.255.255.0
ROUTER_ADDR
=
10.0.45.1
DNS_SERVER
=
1.2.4.8
LOCAL_SCRIPT
=
$(
realpath
`
dirname
"
$0
"
`
)
/gen_hsinchu.sh
download_debian_10_if_needed
()
{
if
[
!
-f
version.info
]
then
wget http://ftp.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/netboot.tar.gz
tar
-xzvf
netboot.tar.gz
ln
-s
debian-installer/amd64/grubx64.efi
fi
}
download_sysrescuecd_if_needed
()
{
if
[
!
-f
sysresccd/sysresccd/pkglist.x86_64.txt
]
then
wget https://osdn.net/projects/systemrescuecd/storage/releases/6.1.1/systemrescuecd-amd64-6.1.1.iso
mkdir
-p
sysresccd
mount
-o
loop systemrescuecd-amd64-6.1.1.iso sysresccd
fi
$LOCAL_SCRIPT
}
launch_dnsmasq
()
{
exec
dnsmasq
-d
--port
=
0
--log-dhcp
\
--interface
=
$MY_IF_NAME
\
--bind-interfaces
\
...
...
@@ -36,3 +29,4 @@ exec dnsmasq -d --port=0 --log-dhcp \
--enable-tftp
--tftp-root
=
$(
realpath
`
dirname
"
$0
"
`
)
\
--conf-file
=
/dev/null
\
--dhcp-host
=
98:03:9b:9b:8a:47,10.0.45.101,1h
}
preseed_hsinchu.cfg
0 → 100644
View file @
7ba31c7f
#d-i anna/choose_modules string network-console
#d-i network-console/password password jsdlhhil
#d-i network-console/password-again password jsdlhhil
d-i apt-setup/enable-source-repositories string false
d-i auto-install/enable string true
d-i base-installer/install-recommends string false
d-i debconf/priority string critical
#d-i finish-install/reboot_in_progress string note
d-i grub-installer/force-efi-extra-removable string true
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.tw.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string http://124.219.111.34:3142
d-i partman/early_command string set -e; x=`grep -l 500118192 /sys/block/*/size`; x=${x%/*}; x=/dev/${x##*/}; debconf-set partman-auto/disk $x; debconf-set grub-installer/bootdev $x
d-i partman-auto/expert_recipe string : 36 1 36 free method{ efi } format{ } . 1 1 -1 xfs method{ format } format{ } use_filesystem{ } filesystem{ xfs } mountpoint{ / } options/noatime{ } .
d-i partman-auto/method string regular
d-i partman-basicfilesystems/no_swap string false
d-i partman/choose_partition string finish
d-i partman/confirm string true
d-i partman/confirm_nooverwrite string true
d-i partman-efi/non_efi_system boolean true
d-i passwd/make-user string false
d-i passwd/root-login string true
d-i passwd/root-password string willbedeleted
d-i passwd/root-password-again string willbedeleted
d-i pkgsel/include string ssh aptitude bwm-ng ca-certificates dbus-user-session debian-goodies dnsutils eatmydata efibootmgr gdb git gnupg host htop iotop linux-cpupower linux-perf lm-sensors lsof man-db ndisc6 netcat-openbsd python resolvconf rsync screen smartmontools socat strace systemd-coredump vim wget xz-utils
# - fix UTF-8 (C.UTF-8 globally, no C override for root)
# - only login with a ssh-key
# - restore network settings
# - ignore other OS (in particular if there are VM using whole physical drives)
# - I don't like 'quiet' on servers (https://bugs.launchpad.net/bugs/581796)
# - enable page up/down to search the history
d-i preseed/late_command string set -e; \
cd /target/root; sed -i /^mesg/q .profile; \
mkdir -m 0700 .ssh; cd .ssh; tftp -g -r authorized_keys 124.219.111.33; \
cd ../../etc; rm -f grub.d/30_otheros; echo LANG=C.UTF-8 >default/locale; \
sed -i '/history-search-/s/# //' inputrc; \
cd network; tftp -g -r `hostname`/interfaces 124.219.111.33; \
in-target sh -ec 'passwd -ld root; sed -i /^GRUB_CMDLINE_LINUX_DEFAULT=/s/quiet// /etc/default/grub; update-grub'
d-i time/zone string UTC
tasksel tasksel/first string
preseed_hydro66.cfg
0 → 100644
View file @
7ba31c7f
++ b/preseed.cfg
#d-i anna/choose_modules string network-console
#d-i network-console/password password jsdlhhil
#d-i network-console/password-again password jsdlhhil
d-i apt-setup/enable-source-repositories string false
d-i auto-install/enable string true
d-i base-installer/install-recommends string false
d-i debconf/priority string critical
#d-i finish-install/reboot_in_progress string note
d-i grub-installer/force-efi-extra-removable string true
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.se.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i partman/early_command string set -e; x=`grep -l 234441648 /sys/block/*/size`; x=${x%/*}; x=/dev/${x##*/}; debconf-set partman-auto/disk $x; debconf-set grub-installer/bootdev $x
d-i partman-auto/expert_recipe string : 36 1 36 free method{ efi } format{ } . 1 1 -1 xfs method{ format } format{ } use_filesystem{ } filesystem{ xfs } mountpoint{ / } options/noatime{ } .
d-i partman-auto/method string regular
d-i partman-basicfilesystems/no_swap string false
d-i partman/choose_partition string finish
d-i partman/confirm string true
d-i partman/confirm_nooverwrite string true
d-i partman-efi/non_efi_system boolean true
d-i passwd/make-user string false
d-i passwd/root-login string true
d-i passwd/root-password string willbedeleted
d-i passwd/root-password-again string willbedeleted
d-i pkgsel/include string ssh aptitude bwm-ng ca-certificates dbus-user-session debian-goodies dnsutils eatmydata efibootmgr gdb git gnupg host htop iotop linux-cpupower linux-perf lm-sensors lsof man-db ndisc6 netcat-openbsd python resolvconf rsync screen smartmontools socat strace systemd-coredump vim wget xz-utils
# - fix UTF-8 (C.UTF-8 globally, no C override for root)
# - only login with a ssh-key
# - restore network settings
# - ignore other OS (in particular if there are VM using whole physical drives)
# - I don't like 'quiet' on servers (https://bugs.launchpad.net/bugs/581796)
# - enable page up/down to search the history
d-i preseed/late_command string set -e; \
cd /target/root; sed -i /^mesg/q .profile; \
mkdir -m 0700 .ssh; cd .ssh; tftp -g -r authorized_keys 10.0.45.50; \
cd ../../etc; rm -f grub.d/30_otheros; echo LANG=C.UTF-8 >default/locale; \
sed -i '/history-search-/s/# //' inputrc; \
cd network; tftp -g -r `hostname`/interfaces 10.0.45.50; \
in-target sh -ec 'passwd -ld root; sed -i /^GRUB_CMDLINE_LINUX_DEFAULT=/s/quiet// /etc/default/grub; update-grub'
d-i time/zone string UTC
tasksel tasksel/first string
preseed.cfg
→
preseed
_xinzhou
.cfg
View file @
7ba31c7f
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment