Skip to content

Commit cfb7ee2

Browse files
committed
only copy disk to /mnt in docker
1 parent e83d7d1 commit cfb7ee2

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

scripts/create-image/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ENV ADD_PACKAGE="make,sysbench,git,vim,tmux,usbutils,tcpdump,net-tools"
2323
ENV FEATURE=minimal
2424
ENV SEEK=2047
2525
ENV PERF=false
26+
ENV IN_DOCKER=true
2627

2728
# Use COPY after agt-get to allow caching apt
2829
WORKDIR /src

scripts/create-image/configure.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# Copyright 2025 syzkaller project authors. All rights reserved.
33
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
44

5-
sudo mkdir -p /fs/$DIR /mnt
6-
pushd /mnt
7-
85
# Set some defaults and enable promtless ssh to the machine for root.
96
sudo sed -i '/^root/ { s/:x:/::/ }' $DIR/etc/passwd
107
echo 'T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100' | sudo tee -a $DIR/etc/inittab
@@ -61,4 +58,6 @@ sudo mount -o loop $RELEASE.img /fs/$DIR
6158
sudo cp -a $DIR/. /fs/$DIR/.
6259
sudo umount /fs/$DIR
6360

64-
popd
61+
if [ "$IN_DOCKER" = true ]; then
62+
cp -a $RELEASE.* /mnt
63+
fi

scripts/create-image/create-image.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RELEASE=trixie
2020
FEATURE=minimal
2121
SEEK=2047
2222
PERF=false
23+
IN_DOCKER=false
2324

2425
# Display help function
2526
display_help() {
@@ -77,7 +78,7 @@ if [ $PERF = "true" ] && [ -z ${KERNEL+x} ]; then
7778
fi
7879

7980
# If full feature is chosen, install more packages
80-
if [ $FEATURE = "full" ]; then
81+
if [ "$FEATURE" = "full" ]; then
8182
PREINSTALL_PKGS=$PREINSTALL_PKGS","$ADD_PACKAGE
8283
fi
8384

0 commit comments

Comments
 (0)