Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dockers/docker-base-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ RUN apt-get -y purge \
RUN apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/*
rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache

COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"]
COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-base-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ RUN apt-get -y purge \
RUN apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/*
rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache/

COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"]
COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-config-engine-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ RUN apt-get purge -y \
apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /debs /python-wheels
rm -rf /debs /python-wheels ~/.cache
2 changes: 1 addition & 1 deletion dockers/docker-config-engine-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ RUN apt-get purge -y \
apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /debs /python-wheels
rm -rf /debs /python-wheels ~/.cache
2 changes: 1 addition & 1 deletion dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ RUN apt-get purge -y \
apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /debs
rm -rf /debs ~/.cache

COPY ["files/arp_update", "/usr/bin"]
COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"]
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

RUN apt-get remove -y g++ python3-dev
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
RUN rm -rf /debs ~/.cache

ENTRYPOINT ["/usr/local/bin/supervisord"]
7 changes: 6 additions & 1 deletion files/Aboot/boot0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ extract_image() {
unzip -oq "$swipath" -x boot0 "$dockerfs" -d "$image_path"

## detect rootfs type
rootfs_type=`grep " $target_path " /proc/mounts | cut -d' ' -f3`
local mountstr="$(grep " $target_path " /proc/mounts)"
local rootdev="$(echo $mountstr | cut -f1 -d' ')"
rootfs_type="$(echo $mountstr | cut -d' ' -f3)"

## Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $rootdev

info "Extracting $dockerfs from swi"
## Unpacking dockerfs delayed
Expand Down
10 changes: 10 additions & 0 deletions files/initramfs-tools/varlog
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,27 @@ case $1 in
;;
esac

logs_inram=false

# Extract kernel parameters
set -- $(cat /proc/cmdline)
for x in "$@"; do
case "$x" in
varlog_size=*)
varlog_size="${x#varlog_size=}"
;;
logs_inram=on)
logs_inram=true
;;
esac
done

[ -z "$varlog_size" ] && exit 0

# If logs are being stored in memory, then don't bother
# creating the log file just to have it deleted afterwards.
$logs_inram && exit 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen this syntax causing trouble when -x was used. Something related to newer version of sh treat unmatched condition as failure. It would be safer to use if statement.
I can see that this syntax was used at line 29 as well.

Not making this issue blocking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah true, I was a bit surprised that it was working here, but for now, I matched the syntax on line 29.


# exit when the var_log.ext4 exists and the size matches
if [ -e "${rootmnt}/host/disk-img/var-log.ext4" ]; then
cur_varlog_size=$(ls -l ${rootmnt}/host/disk-img/var-log.ext4 | awk '{print $5}')
Expand Down
5 changes: 5 additions & 0 deletions installer/arm64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ elif [ "$install_env" = "sonic" ]; then
rm -rf $f
fi
done

demo_dev=$(findmnt -n -o SOURCE --target /host)

# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
fi

# Create target directory or clean it up if exists
Expand Down
5 changes: 5 additions & 0 deletions installer/armhf/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ elif [ "$install_env" = "sonic" ]; then
rm -rf $f
fi
done

demo_dev=$(findmnt -n -o SOURCE --target /host)

# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
fi

# Create target directory or clean it up if exists
Expand Down
11 changes: 11 additions & 0 deletions installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ if [ "$install_env" = "onie" ]; then
# Make filesystem
mkfs.ext4 -L $demo_volume_label $demo_dev

# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev

# Mount demo filesystem
demo_mnt=$(${onie_bin} mktemp -d) || {
echo "Error: Unable to create file system mount point"
Expand Down Expand Up @@ -509,12 +512,20 @@ elif [ "$install_env" = "sonic" ]; then
rm -rf $f
fi
done

demo_dev=$(findmnt -n -o SOURCE --target /host)

# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev
else
demo_mnt="build_raw_image_mnt"
demo_dev=$cur_wd/"%%OUTPUT_RAW_IMAGE%%"

mkfs.ext4 -L $demo_volume_label $demo_dev

# Don't reserve any blocks just for root
tune2fs -m 0 -r 0 $demo_dev

echo "Mounting $demo_dev on $demo_mnt..."
mkdir $demo_mnt
mount -t auto -o loop $demo_dev $demo_mnt
Expand Down