mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-09-11 05:09:56 -05:00
add utils for image modify
This commit is contained in:
@@ -38,3 +38,11 @@ on some system, qt5svg or qt5base will build failed on first build, please retry
|
||||
```
|
||||
build_all
|
||||
```
|
||||
|
||||
# how to modify image after build:
|
||||
|
||||
```
|
||||
./host/mount_image.sh install/xxxxxx/xxxx.img mountpoint
|
||||
cd mountpoint
|
||||
touch xxx
|
||||
```
|
||||
|
||||
BIN
host/fuse2fs
Executable file
BIN
host/fuse2fs
Executable file
Binary file not shown.
26
host/mount_image.sh
Executable file
26
host/mount_image.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
THISDIR=$(dirname $(realpath $0))
|
||||
|
||||
if [ -z $2 ]
|
||||
then
|
||||
echo "usage: $0 image dir"
|
||||
fi
|
||||
|
||||
if [ ! -e $2 ]
|
||||
then
|
||||
mkdir -pv $2
|
||||
fi
|
||||
|
||||
set -eux
|
||||
|
||||
PART=2
|
||||
|
||||
PART_OFFSET=$(partx -s $1 | head -n 3 | tail -n 1 | awk '{print $2}')
|
||||
PART_OFFSET=$((PART_OFFSET * 512)) # sector size is 512
|
||||
|
||||
echo "PART: $PART"
|
||||
echo "PART OFFSET: $PART_OFFSET"
|
||||
|
||||
# some old version fuse2fs not support offset
|
||||
$THISDIR/fuse2fs -o fakeroot -o offset=$PART_OFFSET $1 $2
|
||||
Reference in New Issue
Block a user