Skip to content

Commit

Permalink
Merge pull request #26 from iyesin/fix_simplify_speedup
Browse files Browse the repository at this point in the history
Fix, simplify and speedup image build
  • Loading branch information
tmolteno authored Dec 21, 2022
2 parents a77903b + 7c5b446 commit 85f8ea0
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 119 deletions.
112 changes: 37 additions & 75 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,20 @@ FROM debian:bullseye as builder
MAINTAINER Tim Molteno "[email protected]"
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev swig libssl-dev python3-distutils python3-dev git
RUN apt-get update \
&& apt-get install -y eatmydata \
&& eatmydata apt-get install -y autoconf automake autotools-dev bc binfmt-support \
bison build-essential cpio curl debian-ports-archive-keyring \
dosfstools e2fsprogs fdisk flex gawk gcc-riscv64-linux-gnu \
git gperf g++-riscv64-linux-gnu kmod kpartx libexpat-dev \
libgmp-dev libmpc-dev libmpfr-dev libssl-dev \
libtool mmdebstrap multistrap openssl parted \
patchutils python3 python3-dev python3-distutils \
python3-setuptools qemu-user-static swig \
systemd-container texinfo zlib1g-dev

RUN apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
ENV CROSS="CROSS_COMPILE=riscv64-linux-gnu-"
RUN riscv64-linux-gnu-gcc --version | grep gcc | cut -d')' -f2
# WORKDIR /build
# ARG GNU_TOOLS_TAG
# RUN git config --global advice.detachedHead false
# RUN git clone --recursive --depth 1 --branch ${GNU_TOOLS_TAG} https://github.com/riscv/riscv-gnu-toolchain
# WORKDIR /build/riscv-gnu-toolchain
# RUN git checkout ${GNU_TOOLS_TAG}
# RUN ./configure --prefix=/opt/riscv64-unknown-linux-gnu --with-arch=rv64gc --with-abi=lp64d
# RUN make linux -j $(nproc)
# ENV PATH="/opt/riscv64-unknown-linux-gnu/bin:$PATH"

# ARG CROSS=CROSS_COMPILE=/build/riscv64-unknown-linux-gnu/bin/riscv64-unknown-linux-gnu-
# ENV CROSS=CROSS_COMPILE=riscv64-unknown-linux-gnu-

# Clean up
# WORKDIR /build
# RUN rm -rf riscv-gnu-toolchain



############################################################################################
Expand All @@ -34,7 +26,7 @@ FROM builder as build_opensbi
WORKDIR /build
RUN git clone --depth 1 https://github.com/riscv-software-src/opensbi
WORKDIR /build/opensbi
RUN make $CROSS PLATFORM=generic FW_PIC=y FW_OPTIONS=0x2
RUN eatmydata make $CROSS PLATFORM=generic FW_PIC=y FW_OPTIONS=0x2
# The binary is located here: /build/opensbi/build/platform/generic/firmware/fw_dynamic.bin


Expand All @@ -45,35 +37,31 @@ RUN make $CROSS PLATFORM=generic FW_PIC=y FW_OPTIONS=0x2
FROM builder as build_kernel
ARG KERNEL_TAG
ARG KERNEL_COMMIT
RUN apt-get install -y cpio # Required for kernel build
WORKDIR /build
RUN git clone --depth 1 --branch ${KERNEL_TAG} https://github.com/smaeul/linux
WORKDIR /build/linux
RUN git checkout ${KERNEL_COMMIT}
RUN eatmydata git clone --depth 1 --branch ${KERNEL_TAG} https://github.com/smaeul/linux
RUN cd linux && eatmydata git checkout ${KERNEL_COMMIT} && cd -
WORKDIR /build/linux/drivers/net/wireless
RUN git clone --depth 1 https://github.com/YuzukiHD/Xradio-XR829.git
RUN eatmydata git clone --depth 1 https://github.com/YuzukiHD/Xradio-XR829.git
RUN echo 'obj-$(CONFIG_XR829_WLAN) += Xradio-XR829/' >> Makefile
WORKDIR /build/linux
#RUN git checkout riscv/d1-wip
#RUN git checkout d1-wip-v5.18-rc4
COPY kernel/update_kernel_config.sh .
RUN ./update_kernel_config.sh defconfig
WORKDIR /build
RUN make ARCH=riscv -C linux O=../linux-build defconfig
RUN make -j $(nproc) -C linux-build ARCH=riscv $CROSS V=0
RUN eatmydata make ARCH=riscv -C linux O=../linux-build defconfig
RUN eatmydata make -j $(nproc) -C linux-build ARCH=riscv $CROSS V=0
# Files reside in /build/linux-build/arch/riscv/boot/Image.gz
RUN apt-get install -y kmod
# RUN make -j $(nproc) -C linux-build ARCH=riscv $CROSS INSTALL_MOD_PATH=/build/modules modules_install



#
# Build wifi modules
#
WORKDIR /build
RUN git clone --depth 1 https://github.com/lwfinger/rtl8723ds.git
RUN eatmydata git clone --depth 1 https://github.com/lwfinger/rtl8723ds.git
WORKDIR /build/rtl8723ds
RUN make -j $(nproc) ARCH=riscv $CROSS KSRC=../linux-build modules
RUN eatmydata make -j $(nproc) ARCH=riscv $CROSS KSRC=../linux-build modules
RUN ls -l
# Module resides in /build/rtl8723ds/8723ds.ko

Expand All @@ -85,18 +73,15 @@ RUN ls -l
# Module resides in /build/xr829/xr829.ko




############################################################################################
#
# Build u-boot
#
FROM builder as build_uboot
ARG UBOOT_TAG
ARG BOARD
RUN apt-get install -y python3-setuptools git
WORKDIR /build
RUN git clone --depth 1 --branch ${UBOOT_TAG} https://github.com/smaeul/u-boot.git
RUN eatmydata git clone --depth 1 --branch ${UBOOT_TAG} https://github.com/smaeul/u-boot.git
WORKDIR /build/u-boot

# Make sure we update the device tree and add the overlays
Expand All @@ -108,16 +93,16 @@ RUN cat ./arch/riscv/dts/Makefile
RUN if [ "$BOARD" = "lichee_rv_86" ] ; then \
echo "Building for the RV_86_Panel"; \
./update_uboot_config.sh lichee_rv_86_panel_defconfig; \
make $CROSS lichee_rv_86_panel_defconfig; \
eatmydata make $CROSS lichee_rv_86_panel_defconfig; \
elif [ "$BOARD" = "lichee_rv_dock" ] || [ "$BOARD" = "lichee_rv_lcd" ] ; then \
echo "Building for Lichee RV Dock"; \
./update_uboot_config.sh lichee_rv_dock_defconfig; \
make $CROSS lichee_rv_dock_defconfig; \
eatmydata make $CROSS lichee_rv_dock_defconfig; \
else \
echo "ERROR: unknown board"; \
fi
COPY --from=build_opensbi /build/opensbi/build/platform/generic/firmware/fw_dynamic.bin ./
RUN make -j $(nproc) $CROSS all OPENSBI=fw_dynamic.bin V=1
RUN eatmydata make -j $(nproc) $CROSS all OPENSBI=fw_dynamic.bin V=1
RUN ls -l arch/riscv/dts/
# The binary is located here: u-boot/arch/riscv/dts/sun20i-d1-lichee-rv-dock.dtb
# The binary is located here: u-boot/arch/riscv/dts/sun20i-d1-lichee-rv-86-panel.dtb
Expand All @@ -128,60 +113,47 @@ RUN ls -l arch/riscv/dts/
WORKDIR /build
RUN ls -l
COPY config/bootscr_${BOARD}.txt .
RUN ./u-boot/tools/mkimage -T script -C none -O linux -A riscv -d bootscr_${BOARD}.txt boot.scr
RUN eatmydata ./u-boot/tools/mkimage -T script -C none -O linux -A riscv -d bootscr_${BOARD}.txt boot.scr
# The boot script is here: boot.scr




############################################################################################
#
# Build the root filesystem
#
FROM builder as build_rootfs
ARG BOARD


RUN apt-get install -y mmdebstrap qemu-user-static binfmt-support debian-ports-archive-keyring
RUN apt-get install -y multistrap systemd-container
RUN apt-get install -y kmod

WORKDIR /build
COPY rootfs/multistrap_$BOARD.conf multistrap.conf

RUN ls
RUN multistrap -f multistrap.conf

RUN eatmydata multistrap -f multistrap.conf

# Now install the kernel modules into the rootfs
WORKDIR /build
COPY --from=build_kernel /build/linux-build/ ./linux-build/
COPY --from=build_kernel /build/linux/ ./linux/
COPY --from=build_kernel /build/rtl8723ds/8723ds.ko .
WORKDIR /build/linux-build
RUN make ARCH=riscv INSTALL_MOD_PATH=/port/rv64-port modules_install

RUN eatmydata make ARCH=riscv INSTALL_MOD_PATH=/port/rv64-port modules_install

RUN ls /port/rv64-port/lib/modules/ > /kernel_ver
RUN echo "export MODDIR=$(ls /port/rv64-port/lib/modules/)" > /moddef
RUN ls /port/rv64-port/lib/modules/
RUN . /moddef; echo "Creating wireless module in ${MODDIR}"
RUN . /moddef; install -v -D -p -m 644 /build/8723ds.ko /port/rv64-port/lib/modules/${MODDIR}/kernel/drivers/net/wireless/8723ds.ko


RUN . /moddef && echo "Creating wireless module in ${MODDIR}"
RUN . /moddef && install -v -D -p -m 644 /build/8723ds.ko /port/rv64-port/lib/modules/${MODDIR}/kernel/drivers/net/wireless/8723ds.ko

RUN . /moddef; rm /port/rv64-port/lib/modules/${MODDIR}/build
RUN . /moddef; rm /port/rv64-port/lib/modules/${MODDIR}/source
RUN . /moddef && rm /port/rv64-port/lib/modules/${MODDIR}/build
RUN . /moddef && rm /port/rv64-port/lib/modules/${MODDIR}/source

RUN . /moddef; depmod -a -b /port/rv64-port "${MODDIR}"
RUN . /moddef && depmod -a -b /port/rv64-port "${MODDIR}"
RUN echo '8723ds' >> /port/rv64-port/etc/modules
RUN echo 'xr829' >> /port/rv64-port/etc/modules

# This may not be needed as it should be done by the networking setup.
# RUN cp /etc/resolv.conf /port/rv64-port/etc/resolv.conf



############################################################################################
#
# Now Build the disk image
Expand All @@ -197,24 +169,14 @@ ENV GNU_TOOLS_TAG=$GNU_TOOLS_TAG
ENV DISK_MB=$DISK_MB
ENV BOARD=$BOARD

RUN apt-get install -y kpartx parted

WORKDIR /builder
COPY --from=build_rootfs /kernel_ver ./kernel_ver
COPY --from=build_rootfs /kernel_ver ./
COPY --from=build_rootfs /port/rv64-port/ ./rv64-port/
COPY --from=build_kernel /build/linux-build/arch/riscv/boot/Image.gz /build/linux/arch/riscv/configs/defconfig ./
COPY --from=build_uboot /build/boot.scr /build/u-boot/u-boot-sunxi-with-spl.bin /build/u-boot/arch/riscv/dts/ov_lichee_rv_mini_lcd.dtb ./

COPY --from=build_kernel /build/linux-build/arch/riscv/boot/Image.gz .
COPY --from=build_kernel /build/linux/arch/riscv/configs/defconfig .

COPY --from=build_uboot /build/boot.scr .
COPY --from=build_uboot /build/u-boot/u-boot-sunxi-with-spl.bin .
COPY --from=build_uboot /build/u-boot/arch/riscv/dts/ov_lichee_rv_mini_lcd.dtb .

COPY rootfs/setup_rootfs.sh ./rv64-port/
COPY scripts/build.sh scripts/create_image.sh ./
RUN ls -l
RUN apt-get install -y kpartx openssl fdisk dosfstools e2fsprogs kmod parted

COPY rootfs/setup_rootfs.sh ./rv64-port/setup_rootfs.sh

COPY scripts/build.sh .
COPY scripts/create_image.sh .
CMD /builder/build.sh
CMD eatmydata /builder/build.sh
18 changes: 15 additions & 3 deletions kernel/update_kernel_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
CONF_FILE=./arch/riscv/configs/$1

function add_config() {
fgrep -v $1 ${CONF_FILE} > tmp_conf
grep -F -v "$1" "${CONF_FILE}" > tmp_conf
echo "$1=$2" >> tmp_conf
mv tmp_conf ${CONF_FILE}
mv tmp_conf "${CONF_FILE}"
}

function unset_config() {
grep -F -v "$1" "${CONF_FILE}" > tmp_conf
echo "# $1 is not set" >> tmp_conf
mv tmp_conf "${CONF_FILE}"
}

add_config 'CONFIG_DEFAULT_HOSTNAME' '"lichee"'
Expand Down Expand Up @@ -110,5 +116,11 @@ add_config 'CONFIG_CRC32' 'y'
add_config 'CONFIG_USE_OF' 'y'
add_config 'CONFIG_OF_LIBFDT_OVERLAY' 'y'

#
# Disable irrelevant time consuming modules build
#
unset_config 'CONFIG_DRM_RADEON'
unset_config 'CONFIG_DRM_NOUVEAU'

echo "Config File Follows #####################"
cat ${CONF_FILE}
cat "${CONF_FILE}"
3 changes: 2 additions & 1 deletion rootfs/multistrap_lichee_rv_86.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ cleanup=true

[Debian]
packages=adduser apt base-files base-passwd bash bsdutils coreutils dash debconf debian-archive-keyring debianutils diffutils dpkg e2fsprogs findutils gcc-12-base gcc-9-base gpgv grep gzip hostname libacl1 libapt-pkg6.0 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libc-bin libc6 libcap-ng0 libcap2 libcom-err2 libcrypt1 libdb5.3 libdebconfclient0 libext2fs2 libffi8 libgcc-s1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libhogweed6 libidn2-0 liblz4-1 liblzma5 libmount1 libnettle8 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre2-8-0 libpcre3 libseccomp2 libselinux1 libsemanage-common libsemanage2 libsepol2 libsmartcols1 libss2 libstdc++6 libtasn1-6 libtinfo6 libudev1 libunistring2 libuuid1 libxxhash0 libzstd1 login logsave lsb-base mawk mount ncurses-base ncurses-bin passwd perl-base sed tar tzdata
packages=zlib1g apt-utils cpio cron debconf-i18n dmidecode dmsetup fdisk ifupdown iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kmod less libapparmor1 libargon2-1 libbpf1 libbsd0 libcap2-bin libcryptsetup12 libdevmapper1.02.1 libedit2 libelf1 libestr0 libfastjson4 libfdisk1 libip4tc2 libjansson4 libjson-c5 libkmod2 liblocale-gettext-perl liblognorm5 libmd0 libmnl0 libncurses6 libncursesw6 libnewt0.52 libnftables1 libnftnl11 libpopt0 libprocps8 libreadline8 libslang2 libssl3 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libxtables12 logrotate nano netbase nftables procps readline-common sensible-utils
packages=zlib1g apt-utils cpio cron debconf-i18n dmidecode dmsetup fdisk ifupdown iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kmod less libapparmor1 libargon2-1 libbpf1 libbsd0 libcap2-bin libcryptsetup12 libdevmapper1.02.1 libedit2 libelf1 libestr0 libfastjson4 libfdisk1 libip4tc2 libjansson4 libjson-c5 libkmod2 liblocale-gettext-perl liblognorm5 libmd0 libmnl0 libncurses6 libncursesw6 libnewt0.52 libnftables1 libnftnl11 libpopt0 libreadline8 libslang2 libssl3 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libxtables12 logrotate nano netbase nftables procps readline-common sensible-utils
packages=pciutils p11-kit udev vim whiptail xxd
packages=util-linux util-linux-extra rsyslog dbus
packages=systemd systemd-sysv libsystemd0 sysvinit-utils init-system-helpers init
packages=tasksel tasksel-data
packages=net-tools wireless-tools firmware-realtek ntp ntpdate openssh-client openssh-server wireless-regdb wpasupplicant network-manager isc-dhcp-client
packages=curl gpg openssl ca-certificates sudo psmisc swig iotop tmux
packages=lshw lm-sensors
packages=eatmydata
source=http://ftp.ports.debian.org/debian-ports/
keyring=debian-ports-archive-keyring
suite=unstable
Expand Down
3 changes: 2 additions & 1 deletion rootfs/multistrap_lichee_rv_dock.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ cleanup=true
[Debian]
packages=adduser base-passwd base-files bash bsdutils coreutils dash
packages=apt debconf debian-archive-keyring debianutils diffutils dpkg e2fsprogs findutils gcc-12-base gcc-9-base gpgv grep gzip hostname libacl1 libapt-pkg6.0 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libc-bin libc6 libcap-ng0 libcap2 libcom-err2 libcrypt1 libdb5.3 libdebconfclient0 libext2fs2 libffi8 libgcc-s1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libhogweed6 libidn2-0 liblz4-1 liblzma5 libmount1 libnettle8 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre2-8-0 libpcre3 libseccomp2 libselinux1 libsemanage-common libsemanage2 libsepol2 libsmartcols1 libss2 libstdc++6 libtasn1-6 libtinfo6 libudev1 libunistring2 libuuid1 libxxhash0 libzstd1 login logsave lsb-base mawk mount ncurses-base ncurses-bin passwd perl-base sed tar tzdata
packages=zlib1g apt-utils cpio cron debconf-i18n dmidecode dmsetup fdisk ifupdown iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kmod less libapparmor1 libargon2-1 libbpf1 libbsd0 libcap2-bin libcryptsetup12 libdevmapper1.02.1 libedit2 libelf1 libestr0 libfastjson4 libfdisk1 libip4tc2 libjansson4 libjson-c5 libkmod2 liblocale-gettext-perl liblognorm5 libmd0 libmnl0 libncurses6 libncursesw6 libnewt0.52 libnftables1 libnftnl11 libpopt0 libprocps8 libreadline8 libslang2 libssl3 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libxtables12 logrotate nano netbase nftables procps readline-common sensible-utils
packages=zlib1g apt-utils cpio cron debconf-i18n dmidecode dmsetup fdisk ifupdown iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kmod less libapparmor1 libargon2-1 libbpf1 libbsd0 libcap2-bin libcryptsetup12 libdevmapper1.02.1 libedit2 libelf1 libestr0 libfastjson4 libfdisk1 libip4tc2 libjansson4 libjson-c5 libkmod2 liblocale-gettext-perl liblognorm5 libmd0 libmnl0 libncurses6 libncursesw6 libnewt0.52 libnftables1 libnftnl11 libpopt0 libreadline8 libslang2 libssl3 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libxtables12 logrotate nano netbase nftables procps readline-common sensible-utils
packages=pciutils p11-kit udev vim whiptail xxd
packages=util-linux util-linux-extra rsyslog dbus
packages=systemd systemd-sysv libsystemd0 sysvinit-utils init-system-helpers init
packages=tasksel tasksel-data
packages=net-tools wireless-tools firmware-realtek ntp ntpdate openssh-client openssh-server wireless-regdb wpasupplicant network-manager isc-dhcp-client
packages=curl gpg openssl ca-certificates sudo psmisc swig iotop tmux
packages=lshw lm-sensors
packages=eatmydata
source=http://ftp.ports.debian.org/debian-ports/
keyring=debian-ports-archive-keyring
suite=unstable
Expand Down
3 changes: 2 additions & 1 deletion rootfs/multistrap_lichee_rv_lcd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ cleanup=true

[Debian]
packages=adduser apt base-files base-passwd bash bsdutils coreutils dash debconf debian-archive-keyring debianutils diffutils dpkg e2fsprogs findutils gcc-12-base gcc-9-base gpgv grep gzip hostname libacl1 libapt-pkg6.0 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libc-bin libc6 libcap-ng0 libcap2 libcom-err2 libcrypt1 libdb5.3 libdebconfclient0 libext2fs2 libffi8 libgcc-s1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libhogweed6 libidn2-0 liblz4-1 liblzma5 libmount1 libnettle8 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre2-8-0 libpcre3 libseccomp2 libselinux1 libsemanage-common libsemanage2 libsepol2 libsmartcols1 libss2 libstdc++6 libtasn1-6 libtinfo6 libudev1 libunistring2 libuuid1 libxxhash0 libzstd1 login logsave lsb-base mawk mount ncurses-base ncurses-bin passwd perl-base sed tar tzdata
packages=zlib1g apt-utils cpio cron debconf-i18n dmidecode dmsetup fdisk ifupdown iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kmod less libapparmor1 libargon2-1 libbpf1 libbsd0 libcap2-bin libcryptsetup12 libdevmapper1.02.1 libedit2 libelf1 libestr0 libfastjson4 libfdisk1 libip4tc2 libjansson4 libjson-c5 libkmod2 liblocale-gettext-perl liblognorm5 libmd0 libmnl0 libncurses6 libncursesw6 libnewt0.52 libnftables1 libnftnl11 libpopt0 libprocps8 libreadline8 libslang2 libssl3 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libxtables12 logrotate nano netbase nftables procps readline-common sensible-utils
packages=zlib1g apt-utils cpio cron debconf-i18n dmidecode dmsetup fdisk ifupdown iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kmod less libapparmor1 libargon2-1 libbpf1 libbsd0 libcap2-bin libcryptsetup12 libdevmapper1.02.1 libedit2 libelf1 libestr0 libfastjson4 libfdisk1 libip4tc2 libjansson4 libjson-c5 libkmod2 liblocale-gettext-perl liblognorm5 libmd0 libmnl0 libncurses6 libncursesw6 libnewt0.52 libnftables1 libnftnl11 libpopt0 libreadline8 libslang2 libssl3 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libxtables12 logrotate nano netbase nftables procps readline-common sensible-utils
packages=pciutils p11-kit udev vim whiptail xxd
packages=util-linux util-linux-extra rsyslog dbus
packages=systemd systemd-sysv libsystemd0 sysvinit-utils init-system-helpers init
packages=tasksel tasksel-data
packages=net-tools wireless-tools firmware-realtek ntp ntpdate openssh-client openssh-server wireless-regdb wpasupplicant network-manager isc-dhcp-client
packages=curl gpg openssl ca-certificates sudo psmisc swig iotop tmux
packages=lshw lm-sensors
packages=eatmydata
source=http://ftp.ports.debian.org/debian-ports/
keyring=debian-ports-archive-keyring
suite=unstable
Expand Down
8 changes: 4 additions & 4 deletions rootfs/setup_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ chmod 0666 /dev/null
#
# Change root password to 'licheerv'
#
usermod --password $(echo licheerv | openssl passwd -1 -stdin) root
usermod --password "$(echo licheerv | openssl passwd -1 -stdin)" root

#
# Add a new user rv
Expand All @@ -30,7 +30,7 @@ useradd --password dummy \
--home-dir /home/rv --shell /bin/bash rv
chown rv:rv /home/rv
# Set password to 'lichee'
usermod --password $(echo lichee | openssl passwd -1 -stdin) rv
usermod --password "$(echo lichee | openssl passwd -1 -stdin)" rv

#
# Enable system services
Expand All @@ -41,5 +41,5 @@ systemctl enable systemd-resolved.service
# Clean apt cache on the system
#
apt-get clean
rm -rf /var/lib/apt/lists/*

rm -rf /var/lib/apt/lists/* /var/cache/*
find /var/log -type f -print0 | xargs -0 truncate --size=0
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#/bin/sh
#!/bin/sh
# Author. Tim Molteno [email protected]
# (C) 2022.

cp /etc/resolv.conf /builder/rv64-port/etc/resolv.conf
cp -av /etc/resolv.conf /builder/rv64-port/etc/resolv.conf


# Run the script to create the disk image
Expand Down
Loading

0 comments on commit 85f8ea0

Please sign in to comment.