Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build_debian.sh]: Create loop device for /var/log #284

Merged
merged 1 commit into from
Feb 17, 2017
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: 2 additions & 0 deletions files/initramfs-tools/union-mount.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ mount --bind ${rootmnt}/host/{{ DOCKERFS_DIR }} ${rootmnt}/var/lib/docker
## Mount the boot directory in the raw partition, bypass the aufs
mkdir -p ${rootmnt}/boot
mount --bind ${rootmnt}/host/boot ${rootmnt}/boot
## Mount loop device for /var/log
[ -f ${rootmnt}/host/disk-img/var-log.ext4 ] && mount -t ext4 -o loop,rw ${rootmnt}/host/disk-img/var-log.ext4 ${rootmnt}/var/log
11 changes: 11 additions & 0 deletions installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ CONSOLE_SPEED=9600

# Get platform specific linux kernel command line arguments
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=""

# Default var/log device size in MB
VAR_LOG_SIZE=4096

[ -r platforms/$onie_platform ] && source platforms/$onie_platform

# Install demo on same block device as ONIE
Expand Down Expand Up @@ -401,6 +405,13 @@ if [ -f $demo_mnt/$FILESYSTEM_DOCKERFS ]; then
cd $demo_mnt && mkdir -p $DOCKERFS_DIR && tar xf $FILESYSTEM_DOCKERFS -C $DOCKERFS_DIR; cd $OLDPWD
fi

# Create loop device for /var/log to limit its size to $VAR_LOG_SIZE MB
if [ "$VAR_LOG_SIZE" != "0" ]; then
mkdir -p $demo_mnt/disk-img
dd if=/dev/zero of=$demo_mnt/disk-img/var-log.ext4 count=$((2048*$VAR_LOG_SIZE))
mkfs.ext4 -q $demo_mnt/disk-img/var-log.ext4 -F
fi

# Store machine description in target file system
cp /etc/machine.conf $demo_mnt

Expand Down