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
f2671ba7
Commit
f2671ba7
authored
Mar 18, 2020
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt for Xinzhou rack
parent
f1dceea5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
8 deletions
+116
-8
README
README
+9
-0
dnsmasq
dnsmasq
+32
-4
gen_hydro66.sh
gen_hydro66.sh
+0
-0
gen_xinzhou.sh
gen_xinzhou.sh
+71
-0
preseed.cfg
preseed.cfg
+4
-4
No files found.
README
View file @
f2671ba7
This repository is used to store the basic scripts needed to automatically install a RapidSpace host machine Debian system.
This repository is used to store the basic scripts needed to automatically install a RapidSpace host machine Debian system.
HOWTO
1. create your gen_XXXX.sh script depending on your location and the machines (this script generates the grub config file and the network files)
2. adapt the variables in dnsmasq script
3. adapt "mirror/http/hostname" in preseed.cfg
4. adapt "partman/early_command" in preseed.cfg depending on the size of the small disk
5. adapt "late_command" in preseed.cfg depending on the network config you want
dnsmasq
View file @
f2671ba7
#!/bin/sh
#!/bin/sh
# apt install dnsmasq-base
#UPDATE THOSE VARIABLES DEPENDING ON YOUR SITE
MY_IF_NAME
=
eno1
MY_IP_ADDR
=
192.168.46.2
DHCP_RANGE
=
192.168.46.100,192.168.46.200,255.255.255.0
ROUTER_ADDR
=
192.168.46.2
LOCAL_SCRIPT
=
gen_xinzhou.sh
# apt install -y dnsmasq-base
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
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
exec
dnsmasq
-d
--port
=
0
--log-dhcp
\
exec
dnsmasq
-d
--port
=
0
--log-dhcp
\
--interface
=
ens1
--listen-address
=
10.0.45.50
\
--interface
=
$MY_IF_NAME
\
--dhcp-range
=
10.0.45.200,10.0.45.239,255.255.255.0
\
--bind-interfaces
\
--dhcp-option
=
option:router,10.0.45.1
\
--except-interface
=
lo
\
--listen-address
=
$MY_IP_ADDR
\
--dhcp-range
=
$DHCP_RANGE
\
--dhcp-option
=
option:router,
$ROUTER_ADDR
\
--dhcp-option
=
option:dns-server,80.80.80.80,80.80.81.81
\
--dhcp-option
=
option:dns-server,80.80.80.80,80.80.81.81
\
--dhcp-boot
=
debian-installer/amd64/grubx64.efi
\
--dhcp-boot
=
debian-installer/amd64/grubx64.efi
\
--enable-tftp
--tftp-root
=
$(
realpath
`
dirname
"
$0
"
`
)
--enable-tftp
--tftp-root
=
$(
realpath
`
dirname
"
$0
"
`
)
g
rub
→
g
en_hydro66.sh
View file @
f2671ba7
File moved
gen_xinzhou.sh
0 → 100755
View file @
f2671ba7
#!/bin/sh
set
-e
common
=
console
=
ttyS1,57600
mac
=
'
00:22:4d:d9:48:74
'
i
=
2
hostname_prefix
=
xinzhou-tiogapass-
(
#echo set timeout=0
echo
if
false
echo
then
true
for
mac
in
$mac
;
do
echo
"elif [
\$
net_default_mac =
$mac
]"
echo
then
set
i
=
`
printf
%03u
$i
`
i
=
`
expr
$i
+ 1
`
done
cat
<<
EOF
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
initrd /debian-installer/amd64/initrd.gz
}
menuentry 'SystemRescueCd' {
linux /sysresccd/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd archiso_http_srv=http://
\$
pxe_default_server:69/sysresccd/ checksum ip=dhcp
$common
initrd /sysresccd/sysresccd/boot/intel_ucode.img /sysresccd/sysresccd/boot/amd_ucode.img /sysresccd/sysresccd/boot/x86_64/sysresccd.img
}
menuentry 'Exit' {
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 172.16.0.
$((
50
+
$i
))
/24
gateway 172.16.0.1
#allow-hotplug ens9f0
##iface ens9f0 inet dhcp
#iface ens9f0 inet static
# address 113.24.192.26/30
# gateway 113.24.192.25
EOF
done
preseed.cfg
View file @
f2671ba7
...
@@ -9,10 +9,10 @@ d-i debconf/priority string critical
...
@@ -9,10 +9,10 @@ d-i debconf/priority string critical
#d-i finish-install/reboot_in_progress string note
#d-i finish-install/reboot_in_progress string note
d-i grub-installer/force-efi-extra-removable string true
d-i grub-installer/force-efi-extra-removable string true
d-i mirror/country string manual
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.
se
.debian.org
d-i mirror/http/hostname string ftp.
cn
.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i mirror/http/proxy string
d-i partman/early_command string set -e; x=`grep -l
23444164
8 /sys/block/*/size`; x=${x%/*}; x=/dev/${x##*/}; debconf-set partman-auto/disk $x; debconf-set grub-installer/bootdev $x
d-i partman/early_command string set -e; x=`grep -l
46886212
8 /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/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-auto/method string regular
d-i partman-basicfilesystems/no_swap string false
d-i partman-basicfilesystems/no_swap string false
...
@@ -33,10 +33,10 @@ d-i pkgsel/include string ssh aptitude bwm-ng ca-certificates dbus-user-session
...
@@ -33,10 +33,10 @@ d-i pkgsel/include string ssh aptitude bwm-ng ca-certificates dbus-user-session
# - enable page up/down to search the history
# - enable page up/down to search the history
d-i preseed/late_command string set -e; \
d-i preseed/late_command string set -e; \
cd /target/root; sed -i /^mesg/q .profile; \
cd /target/root; sed -i /^mesg/q .profile; \
mkdir -m 0700 .ssh; cd .ssh; tftp -g -r authorized_keys 1
0.0.45.50
; \
mkdir -m 0700 .ssh; cd .ssh; tftp -g -r authorized_keys 1
92.168.46.2
; \
cd ../../etc; rm -f grub.d/30_otheros; echo LANG=C.UTF-8 >default/locale; \
cd ../../etc; rm -f grub.d/30_otheros; echo LANG=C.UTF-8 >default/locale; \
sed -i '/history-search-/s/# //' inputrc; \
sed -i '/history-search-/s/# //' inputrc; \
cd network; tftp -g -r `hostname`/interfaces 1
0.0.45.50
; \
cd network; tftp -g -r `hostname`/interfaces 1
92.168.46.2
; \
in-target sh -ec 'passwd -ld root; sed -i /^GRUB_CMDLINE_LINUX_DEFAULT=/s/quiet// /etc/default/grub; update-grub'
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
d-i time/zone string UTC
tasksel tasksel/first string
tasksel tasksel/first string
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