-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initrd script for packing virtio-gpu related files
- Loading branch information
1 parent
1120c97
commit 791d6d9
Showing
2 changed files
with
44 additions
and
0 deletions.
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,29 @@ | ||
#!/usr/bin/bash | ||
|
||
IMG=ext4.img | ||
KERNEL_VER=$(git -C linux/ tag | sed "s/^v//") | ||
SRC=linux/out/lib/modules/$KERNEL_VER | ||
DEST=rootfs/lib/modules/$KERNEL_VER | ||
|
||
# Add path of kernel modules to load with dependency file, for example: | ||
# for example: | ||
# FILES='kernel/drivers/gpu/drm/drm.ko | ||
# modules.dep' | ||
FILES='' | ||
|
||
for file in $FILES; do | ||
mkdir -p `dirname $DEST/$file` | ||
cp -f $SRC/$file $DEST/$file | ||
done | ||
|
||
cp -r directfb rootfs | ||
cp target/run.sh rootfs | ||
|
||
# DirectFB-example requires ~60MiB of space | ||
dd if=/dev/zero of=${IMG} bs=4k count=20000 | ||
mkfs.ext4 -F ${IMG} -d rootfs | ||
|
||
rm -rf rootfs | ||
|
||
# show image size | ||
du -h ${IMG} |
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,15 @@ | ||
#!/usr/bin/bash | ||
|
||
# Install kernel modules | ||
if [ -d "/lib/modules/" ]; then | ||
mkdir -p /lib/modules/ | ||
cp -r ./lib/modules/* /lib/modules/ | ||
fi | ||
|
||
# Install DirectFB and examples | ||
cp -r ./usr/local /usr/ | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib | ||
export PATH=$PATH:/usr/local/bin/ | ||
|
||
# Load kernel modules if exists | ||
# modprobe virtio-gpu |