-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added e2fsprogs bundle, Log to virt disk test
- Loading branch information
1 parent
6c93d18
commit 84b5f4e
Showing
7 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
E2FSPROGS_SOURCE_URL=https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/snapshot/e2fsprogs-$E2FSPROGS_VERSION.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
. ../../common.sh | ||
. ../../../settings | ||
|
||
# Read the common configuration properties. | ||
DOWNLOAD_URL=`read_property E2FSPROGS_SOURCE_URL` | ||
USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE` | ||
|
||
# Grab everything after the last '/' character. | ||
ARCHIVE_FILE=${DOWNLOAD_URL##*/} | ||
|
||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then | ||
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded." | ||
USE_LOCAL_SOURCE="false" | ||
fi | ||
|
||
cd $MAIN_SRC_DIR/source/overlay | ||
|
||
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then | ||
# Downloading util-linux source bundle file. The '-c' option allows the download to resume. | ||
echo "Downloading jq source bundle from $DOWNLOAD_URL" | ||
wget -c $DOWNLOAD_URL | ||
else | ||
echo "Using local jq source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" | ||
fi | ||
|
||
# Delete folder with previously extracted jq. | ||
echo "Removing util-linux work area. This may take a while." | ||
rm -rf $WORK_DIR/overlay/$BUNDLE_NAME | ||
mkdir $WORK_DIR/overlay/$BUNDLE_NAME | ||
|
||
# Extract util-linux to folder 'work/overlay/util_linux'. | ||
# Full path will be something like 'work/overlay/util_linux/util-linux-2.31'. | ||
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/$BUNDLE_NAME | ||
|
||
cd $SRC_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
. ../../common.sh | ||
. ../../../settings | ||
|
||
cd $WORK_DIR/overlay/$BUNDLE_NAME | ||
|
||
# Change to the util-linux source directory which ls finds, e.g. 'util-linux-2.34'. | ||
cd $(ls -d e2fsprogs-$E2FSPROGS_VERSION) | ||
|
||
if [ -f Makefile ] ; then | ||
echo "Preparing '$BUNDLE_NAME' work area. This may take a while." | ||
make -j $NUM_JOBS clean | ||
else | ||
echo "The clean phase for '$BUNDLE_NAME' has been skipped." | ||
fi | ||
|
||
rm -rf $DEST_DIR | ||
mkdir -p $DEST_DIR/bin | ||
mkdir -p $DEST_DIR/lib | ||
|
||
echo "Configuring '$BUNDLE_NAME'." | ||
|
||
CFLAGS="$CFLAGS" ./configure --prefix=/usr \ | ||
--bindir=/bin \ | ||
--sysconfdir=/etc \ | ||
--enable-elf-shlibs \ | ||
#--disable-libblkid \ | ||
#--disable-libuuid \ | ||
#--disable-uuidd \ | ||
#--disable-fsck | ||
|
||
echo "Building '$BUNDLE_NAME'." | ||
make -j $NUM_JOBS | ||
|
||
echo "Installing '$BUNDLE_NAME'." | ||
make check | ||
#make -j $NUM_JOBS install | ||
|
||
cp -r misc/mke2fs $DEST_DIR/bin/mke2fs | ||
cp -r lib/libext2fs.so.2.4 $DEST_DIR/lib/libext2fs.so.2.4 | ||
cp -r lib/libext2fs.so.2 $DEST_DIR/lib/libext2fs.so.2 | ||
cp -r lib/libext2fs.so $DEST_DIR/lib/libext2fs.so | ||
cp -r lib/libcom_err.so.2.1 $DEST_DIR/lib/libcom_err.so.2.1 | ||
cp -r lib/libcom_err.so.2 $DEST_DIR/lib/libcom_err.so.2 | ||
cp -r lib/libcom_err.so $DEST_DIR/lib/libcom_err.so | ||
cp -r lib/libe2p.so.2.3 $DEST_DIR/lib/libe2p.so.2.3 | ||
cp -r lib/libe2p.so.2 $DEST_DIR/lib/libe2p.so.2 | ||
cp -r lib/libe2p.so $DEST_DIR/lib/libe2p.so | ||
cd $DEST_DIR/bin | ||
ln mke2fs mkfs.ext2 | ||
ln mke2fs mkfs.ext3 | ||
ln mke2fs mkfs.ext4 | ||
cd $(ls -d e2fsprogs-$E2FSPROGS_VERSION) | ||
|
||
echo "Reducing '$BUNDLE_NAME' size." | ||
reduce_size $DEST_DIR | ||
|
||
install_to_overlay bin | ||
install_to_overlay lib | ||
|
||
echo "Bundle '$BUNDLE_NAME' has been installed." | ||
|
||
cd $SRC_DIR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
. ../../common.sh | ||
|
||
./01_get.sh | ||
./02_build.sh | ||
|
||
cd $SRC_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/minimal_rootfs/etc/autorun/50_log_something_on_disk.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
UNFORMATTED=$(lsblk --fs --json | jq -r '.blockdevices[] | select(.children == null and .fstype == null) | .name'| grep -i "vd") | ||
if [ -n "$UNFORMATTED" ]; then | ||
sfdisk /dev/$UNFORMATTED <<EOF | ||
label: gpt | ||
,$(( $(blockdev --getsize64 /dev/$UNFORMATTED) / 1024 ))KiB,, | ||
EOF | ||
mkfs.ext4 /dev/${UNFORMATTED}1 | ||
fi | ||
mkdir -p /mnt/virtdrive | ||
mount /dev/${UNFORMATTED}1 /mnt/virtdrive | ||
echo "$(date) hello" >> /mnt/virtdrive/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
KERNEL_VERSION=6.7.5 | ||
GLIBC_VERSION=2.39 | ||
BUSYBOX_VERSION=1.36.1 | ||
ADD_BUNDLES=dhcp,util_linux,passwd,jq | ||
ADD_BUNDLES=dhcp,util_linux,passwd,jq,e2fsprogs | ||
UTIL_LINUX_VERSION=2.39.3 | ||
NCURSES_VERSION=6.3 | ||
PKG_CONFIG_VERSION=0.29.2 | ||
JQ_VERSION=1.7.1 | ||
E2FSPROGS_VERSION=1.47.0 |