Skip to content

Commit

Permalink
Fixed issues found from v1.9.0-beta2
Browse files Browse the repository at this point in the history
- Replaced default console with Debian console
- Included Project Burmilla to ros command info
- Fixed docker-machine compability
- Bump up kernel to 4.14.207
- Include /etc/lsb-release file to Debian console
- Updated ifconfig parsing command to match Debian console syntax
- Corrected Burmilla URLs
- Use fixed version of open-vm-tools
- Create /var/log/wtmp file on first boot so "last" command will works
- Use /etc/issue file as motd
- Support to create ISO file without firmware files
  • Loading branch information
olljanat committed Nov 23, 2020
1 parent 5a13f03 commit 4e5d248
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 83 deletions.
1 change: 0 additions & 1 deletion .github/workflows/add-platform-specific.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
exit 1
fi
export ARCH=amd64
export APPEND_SYSTEM_IMAGES="burmilla/os-debianconsole:$VERSION"
make ${{ github.event.inputs.platform }}
- name: Login to DockerHub
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: release
on:
workflow_dispatch:
inputs:
arch:
description: 'Architecture'
default: 'amd64'
firmware:
description: 'Include firmwares'
default: 'true'
required: true

jobs:
Expand All @@ -28,14 +28,10 @@ jobs:
echo "Build is not started from tag. Will exit..."
exit 1
fi
export ARCH=${{ github.event.inputs.arch }}
export APPEND_SYSTEM_IMAGES="burmilla/os-debianconsole:$VERSION"
export OS_FIRMWARE=${{ github.event.inputs.firmware }}
export ARCH=amd64
make release
if [ "$ARCH" == "arm64" ]; then
make rpi64
fi
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ARG DISTRIB_ID=BurmillaOS

ARG SELINUX_POLICY_URL=https://github.com/burmilla/refpolicy/releases/download/v0.0.3/policy.29

ARG KERNEL_VERSION=4.14.206-burmilla
ARG KERNEL_VERSION=4.14.207-burmilla
ARG KERNEL_URL_amd64=https://github.com/burmilla/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-x86.tar.gz
ARG KERNEL_URL_arm64=https://github.com/burmilla/os-kernel/releases/download/v${KERNEL_VERSION}/linux-${KERNEL_VERSION}-arm64.tar.gz

Expand All @@ -72,7 +72,7 @@ ARG OS_RELEASES_YML=https://raw.githubusercontent.com/burmilla/releases/kernel-4
ARG OS_SERVICES_REPO=https://raw.githubusercontent.com/${OS_REPO}/os-services
ARG IMAGE_NAME=${OS_REPO}/os

ARG OS_CONSOLE=debian
ARG OS_CONSOLE=default
ARG OS_AUTOFORMAT=false
ARG OS_FIRMWARE=true

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,32 @@ rpi64: .dapper
vmware: .dapper
mkdir -p dist
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="$(APPEND_SYSTEM_IMAGES) burmilla/os-openvmtools:11.2.0-1" \
APPEND_SYSTEM_IMAGES="burmilla/os-openvmtools:11.2.0-5" \
./.dapper release-vmware

hyperv: .dapper
mkdir -p dist
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="$(APPEND_SYSTEM_IMAGES) burmilla/os-hypervvmtools:v4.14.206-burmilla-1" \
APPEND_SYSTEM_IMAGES="burmilla/os-hypervvmtools:v4.14.206-burmilla-1" \
./.dapper release-hyperv

azurebase: .dapper
mkdir -p dist
AZURE_SERVICE="true" \
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="$(APPEND_SYSTEM_IMAGES) burmilla/os-hypervvmtools:v4.14.206-burmilla-1 burmilla/os-waagent:v2.2.49.2-1" \
APPEND_SYSTEM_IMAGES="burmilla/os-hypervvmtools:v4.14.206-burmilla-1 burmilla/os-waagent:v2.2.49.2-1" \
./.dapper release-azurebase

4glte: .dapper
mkdir -p dist
APPEND_SYSTEM_IMAGES="$(APPEND_SYSTEM_IMAGES) burmilla/os-modemmanager:v1.6.4-1" \
APPEND_SYSTEM_IMAGES="burmilla/os-modemmanager:v1.6.4-1" \
./.dapper release-4glte

proxmoxve: .dapper
mkdir -p dist
PROXMOXVE_SERVICE="true" \
OS_FIRMWARE="false" \
APPEND_SYSTEM_IMAGES="$(APPEND_SYSTEM_IMAGES) burmilla/os-qemuguestagent:v3.1.0-1" \
APPEND_SYSTEM_IMAGES="burmilla/os-qemuguestagent:v3.1.0-1" \
./.dapper release-proxmoxve

help:
Expand Down
4 changes: 2 additions & 2 deletions cmd/control/autologin.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func AutologinMain() {
app.Name = os.Args[0]
app.Usage = "autologin console"
app.Version = config.Version
app.Author = "Rancher Labs, Inc."
app.Email = "sven@rancher.com"
app.Author = "Project Burmilla\n\tRancher Labs, Inc."
app.Email = "burmilla@localhost.local"
app.EnableBashCompletion = true
app.Action = autologinAction
app.HideHelp = true
Expand Down
2 changes: 1 addition & 1 deletion cmd/control/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Main() {
app.Name = os.Args[0]
app.Usage = fmt.Sprintf("Control and configure BurmillaOS\nbuilt: %s", config.BuildDate)
app.Version = config.Version
app.Author = "Rancher Labs, Inc."
app.Author = "Project Burmilla\n\tRancher Labs, Inc."
app.EnableBashCompletion = true
app.Before = func(c *cli.Context) error {
if os.Geteuid() != 0 {
Expand Down
4 changes: 2 additions & 2 deletions cmd/control/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestGenTpl(t *testing.T) {
services:
{{if eq "amd64" .ARCH -}}
acpid:
image: rancher/os-acpid:0.x.x
image: burmilla/os-acpid:0.x.x
labels:
io.rancher.os.scope: system
net: host
Expand All @@ -34,7 +34,7 @@ func TestGenTpl(t *testing.T) {
{"amd64", `
services:
acpid:
image: rancher/os-acpid:0.x.x
image: burmilla/os-acpid:0.x.x
labels:
io.rancher.os.scope: system
net: host
Expand Down
2 changes: 1 addition & 1 deletion cmd/control/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ func CurrentConsole() (console string) {
console = "default"
return
}
console = strings.TrimPrefix(strings.TrimSuffix(image.Name(), "console"), "rancher/os-")
console = strings.TrimPrefix(strings.TrimSuffix(image.Name(), "console"), "burmilla/os-")
return
}
36 changes: 24 additions & 12 deletions cmd/control/console_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ func consoleInitFunc() error {
defer f.Close()
}

// last command need this file
if _, err := os.Stat("/var/log/wtmp"); os.IsNotExist(err) {
f, err := os.OpenFile("/var/log/wtmp", os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
log.Error(err)
}
defer f.Close()
}

// some software need this dir, like open-iscsi
if _, err := os.Stat(runLockDir); os.IsNotExist(err) {
if err = os.Mkdir(runLockDir, 0755); err != nil {
Expand Down Expand Up @@ -145,17 +154,20 @@ func consoleInitFunc() error {
})
}

if cfg.Rancher.Console == "default" {
// add iptables symlinks for default console
baseSymlink = append(baseSymlink, []symlink{
{"/usr/sbin/iptables", "/usr/sbin/iptables-save"},
{"/usr/sbin/iptables", "/usr/sbin/iptables-restore"},
{"/usr/sbin/iptables", "/usr/sbin/ip6tables"},
{"/usr/sbin/iptables", "/usr/sbin/ip6tables-save"},
{"/usr/sbin/iptables", "/usr/sbin/ip6tables-restore"},
{"/usr/sbin/iptables", "/usr/bin/iptables-xml"},
}...)
}
// Disbled because Debian is now default console
/*
if cfg.Rancher.Console == "default" {
// add iptables symlinks for default console
baseSymlink = append(baseSymlink, []symlink{
{"/usr/sbin/iptables", "/usr/sbin/iptables-save"},
{"/usr/sbin/iptables", "/usr/sbin/iptables-restore"},
{"/usr/sbin/iptables", "/usr/sbin/ip6tables"},
{"/usr/sbin/iptables", "/usr/sbin/ip6tables-save"},
{"/usr/sbin/iptables", "/usr/sbin/ip6tables-restore"},
{"/usr/sbin/iptables", "/usr/bin/iptables-xml"},
}...)
}
*/

for _, link := range baseSymlink {
syscall.Unlink(link.newname)
Expand Down Expand Up @@ -211,7 +223,7 @@ func consoleInitFunc() error {
}
}

cmd = exec.Command("bash", "-c", `echo $(/sbin/ifconfig | grep -B1 "inet addr" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3}') >> /etc/issue`)
cmd = exec.Command("bash", "-c", `echo $(/sbin/ifconfig | grep -B1 "inet" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $3 == "mtu" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3}') >> /etc/issue`)
if err := cmd.Run(); err != nil {
log.Error(err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/control/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var installCommand = cli.Command{
Action: installAction,
Flags: []cli.Flag{
cli.StringFlag{
// TODO: need to validate ? -i rancher/os:v0.3.1 just sat there.
// TODO: need to validate ? -i burmilla/os:v0.3.1 just sat there.
Name: "image, i",
Usage: `install from a certain image (e.g., 'rancher/os:v0.7.0')
use 'ros os list' to see what versions are available.`,
Expand Down Expand Up @@ -417,7 +417,7 @@ func layDownOS(image, installType, cloudConfig, device, partition, statedir, kap
// ENV == installType
//[[ "$ARCH" == "arm" && "$ENV" != "upgrade" ]] && ENV=arm

// image == rancher/os:v0.7.0_arm
// image == burmilla/os:v0.7.0_arm
// TODO: remove the _arm suffix (but watch out, its not always there..)
VERSION := image[strings.Index(image, ":")+1:]

Expand Down
4 changes: 2 additions & 2 deletions cmd/power/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func Shutdown() {
app := cli.NewApp()

app.Name = filepath.Base(os.Args[0])
app.Usage = fmt.Sprintf("%s RancherOS\nbuilt: %s", app.Name, config.BuildDate)
app.Usage = fmt.Sprintf("%s BurmillaOS\nbuilt: %s", app.Name, config.BuildDate)
app.Version = config.Version
app.Author = "Rancher Labs, Inc."
app.Author = "Project Burmilla\n\tRancher Labs, Inc."
app.EnableBashCompletion = true
app.Action = shutdown
app.Flags = []cli.Flag{
Expand Down
4 changes: 2 additions & 2 deletions cmd/respawn/respawn.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func Main() {
app := cli.NewApp()

app.Name = os.Args[0]
app.Usage = fmt.Sprintf("%s RancherOS\nbuilt: %s", app.Name, config.BuildDate)
app.Usage = fmt.Sprintf("%s BurmillaOS\nbuilt: %s", app.Name, config.BuildDate)
app.Version = config.Version
app.Author = "Rancher Labs, Inc."
app.Author = "Project Burmilla\n\tRancher Labs, Inc."

app.Flags = []cli.Flag{
cli.StringFlag{
Expand Down
4 changes: 2 additions & 2 deletions config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ var (
"EXTRA_CMDLINE",
}
SupportedDinds = []string{
"rancher/os-dind:17.12.1",
"rancher/os-dind:18.03.1",
"burmilla/os-dind:17.12.1",
"burmilla/os-dind:18.03.1",
}
)

Expand Down
42 changes: 30 additions & 12 deletions images/02-console/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
FROM burmilla/os-base
COPY build/lsb-release /etc/
FROM debian:stable-slim

COPY build/sshd_config.append.tpl /etc/ssh/
COPY prompt.sh /etc/profile.d/
RUN sed -i 's/rancher:!/rancher:*/g' /etc/shadow && \
sed -i 's/docker:!/docker:*/g' /etc/shadow && \
echo '## allow password less for rancher user' >> /etc/sudoers && \
echo 'rancher ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
echo '## allow password less for docker user' >> /etc/sudoers && \
echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
cat /etc/ssh/sshd_config > /etc/ssh/sshd_config.tpl && \
cat /etc/ssh/sshd_config.append.tpl >> /etc/ssh/sshd_config.tpl && \
rm -f /etc/ssh/sshd_config.append.tpl /etc/ssh/sshd_config
COPY build/lsb-release /etc/

RUN apt-get update \
&& apt-get install -y --no-install-recommends iptables openssh-server rsync locales \
sudo less curl ca-certificates psmisc htop kmod iproute2 \
net-tools bash-completion wget \
nano open-iscsi iputils-ping \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /etc/ssh/*key* \
&& echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \
&& locale-gen \
&& find /usr/share/i18n/charmaps -not -path /usr/share/i18n/charmaps/UTF-8.gz -name '*.gz' -exec rm -rf {} \; \
&& find /usr/share/i18n/locales -not -path /usr/share/i18n/locales/en_US -name '*_*' -exec rm -rf {} \; \
&& addgroup --gid 1100 rancher \
&& addgroup --gid 1101 docker \
&& useradd -u 1100 -g rancher -G docker,sudo -m -s /bin/bash rancher \
&& useradd -u 1101 -g docker -G docker,sudo -m -s /bin/bash docker \
&& echo '## allow password less for rancher user' >> /etc/sudoers \
&& echo 'rancher ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& echo '## allow password less for docker user' >> /etc/sudoers \
&& echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& ln -s /bin/ps /usr/bin/ps \
&& cat /etc/ssh/sshd_config > /etc/ssh/sshd_config.tpl \
&& cat /etc/ssh/sshd_config.append.tpl >> /etc/ssh/sshd_config.tpl \
&& rm -f /etc/ssh/sshd_config.append.tpl /etc/ssh/sshd_config \
&& rm -f /etc/motd \
&& ln -s /etc/issue /etc/motd
ENTRYPOINT ["/usr/bin/ros", "entrypoint"]
17 changes: 1 addition & 16 deletions images/02-console/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,10 @@ cd $(dirname $0)

rm -rf ./build
mkdir -p ./build
cp sshd_config.append.tpl ./build/

cat > ./build/lsb-release << EOF
DISTRIB_ID=${DISTRIB_ID}
DISTRIB_RELEASE=${VERSION}
DISTRIB_DESCRIPTION="${DISTRIB_ID} ${VERSION}"
EOF

cat > ./build/sshd_config.append.tpl << EOF
{{- if .Port}}
Port {{.Port}}
{{- end}}
{{- if .ListenAddress}}
ListenAddress {{.ListenAddress}}
{{- end}}
ClientAliveInterval 180
UseDNS no
PermitRootLogin no
AllowGroups docker
EOF
1 change: 0 additions & 1 deletion images/02-console/prompt.sh

This file was deleted.

23 changes: 23 additions & 0 deletions images/02-console/sshd_config.append.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

{{- if .Port}}
Port {{.Port}}
{{- end}}

{{- if .ListenAddress}}
ListenAddress {{.ListenAddress}}
{{- end}}

ClientAliveInterval 180

UseDNS no

AllowGroups docker

# Enforce security settings
Protocol 2
PermitRootLogin no
MaxAuthTries 4
IgnoreRhosts yes
HostbasedAuthentication no
PermitEmptyPasswords no
AllowTcpForwarding no
9 changes: 5 additions & 4 deletions os-config.tpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ rancher:
command: ros console-init
labels:
io.rancher.os.scope: system
io.rancher.os.after: cloud-init-execute
io.docker.compose.rebuild: always
io.rancher.os.console: debian
io.rancher.os.after: network
io.docker.compose.rebuild: "false"
io.rancher.os.console: default
environment:
- HTTP_PROXY
- HTTPS_PROXY
Expand All @@ -246,7 +246,8 @@ rancher:
volumes_from:
- all-volumes
volumes:
- /usr/bin/iptables:/sbin/iptables:ro
- /media:/media:shared
- /mnt:/mnt:shared
logrotate:
image: {{.OS_REPO}}/os-logrotate:{{.VERSION}}{{.SUFFIX}}
command: /usr/sbin/logrotate -v /etc/logrotate.conf
Expand Down
6 changes: 3 additions & 3 deletions scripts/layout-initrd
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ rm -f ${INITRD_DIR}/usr/bin/system-docker-proxy
cat <<HERE > ${INITRD_DIR}/usr/share/ros/os-release
NAME="BurmillaOS"
VERSION=${VERSION}
ID=burmillaos
ID=rancheros
ID_LIKE=
VERSION_ID=${VERSION}
PRETTY_NAME="BurmillaOS ${VERSION}"
HOME_URL="https://burmilla.github.io"
SUPPORT_URL="https://github.com/burmilla/os/issues"
HOME_URL="https://burmillaos.org"
SUPPORT_URL="https://github.com/burmilla/os"
BUG_REPORT_URL="https://github.com/burmilla/os/issues"
BUILD_ID=
HERE
Expand Down
Loading

0 comments on commit 4e5d248

Please sign in to comment.