From a784b433ca3f0cdb3b7c40e1c417be45c4049a3f Mon Sep 17 00:00:00 2001 From: LEI WANG Date: Tue, 27 Aug 2024 18:37:10 +0800 Subject: [PATCH] restore initctl, setup ttyS0, mkfs.ext4 -O Signed-off-by: LEI WANG --- builder.go | 2 +- templates/ubuntu12.Dockerfile | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/builder.go b/builder.go index 11edf44..942b7df 100644 --- a/builder.go +++ b/builder.go @@ -284,7 +284,7 @@ func (b *builder) mountImg(ctx context.Context) error { r := ctx.Value("release").(OSRelease) if r.ID == ReleaseUbuntu { if strings.HasPrefix(r.VersionID, "12.") { - mkfsExt4Opts = append(mkfsExt4Opts, "-O", "^has_journal") + mkfsExt4Opts = append(mkfsExt4Opts, "-O", "^has_journal,^metadata_csum") } } logrus.Infof("mounting raw image") diff --git a/templates/ubuntu12.Dockerfile b/templates/ubuntu12.Dockerfile index dea0aa9..528fce4 100644 --- a/templates/ubuntu12.Dockerfile +++ b/templates/ubuntu12.Dockerfile @@ -2,6 +2,12 @@ FROM {{ .Image }} USER root +# restore initctl +RUN rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl + +# setup ttyS0 +RUN cp /etc/init/tty1.conf /etc/init/ttyS0.conf && sed -i s/tty1/ttyS0/g /etc/init/ttyS0.conf + RUN ARCH="$([ "$(uname -m)" = "x86_64" ] && echo amd64 || echo arm64)"; \ apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \