Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
initramfs-mender
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
initramfs-mender
Commits
1c4928cb
Commit
1c4928cb
authored
Nov 02, 2021
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support of boot up with RBD device as data partition
parent
44351a57
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
init
init
+15
-3
initramfs.list
initramfs.list
+3
-0
No files found.
init
View file @
1c4928cb
...
@@ -101,17 +101,29 @@ else
...
@@ -101,17 +101,29 @@ else
pool
=
`
/bin/uci
-q
get
-c
/data/etc/config rbd.rbd.pool
`
pool
=
`
/bin/uci
-q
get
-c
/data/etc/config rbd.rbd.pool
`
image
=
`
/bin/uci
-q
get
-c
/data/etc/config rbd.rbd.image
`
image
=
`
/bin/uci
-q
get
-c
/data/etc/config rbd.rbd.image
`
if
[
!
-z
$monitors
]
&&
[
!
-z
$username
]
&&
[
!
-z
$secret
]
&&
[
!
-z
$pool
]
&&
[
!
-z
$image
]
;
then
if
[
!
-z
$monitors
]
&&
[
!
-z
$username
]
&&
[
!
-z
$secret
]
&&
[
!
-z
$pool
]
&&
[
!
-z
$image
]
;
then
/bin/dhclient
-1
-
v
-
lf
/dhclient.leases
/bin/dhclient
-1
-lf
/dhclient.leases
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
echo
"
$monitors
name=
$username
,secret=
$secret
$pool
$image
"
>
/sys/bus/rbd/add_single_major
echo
"
$monitors
name=
$username
,secret=
$secret
$pool
$image
"
>
/sys/bus/rbd/add_single_major
if
[
-b
/dev/rbd0
]
;
then
if
[
-b
/dev/rbd0
]
;
then
fsck.ext4
-y
/dev/rbd0
>
/dev/null 2> /dev/null
fstype
=
`
/bin/lsblk
-n
-o
FSTYPE /dev/rbd0
`
resize2fs
-f
/dev/rbd0
>
/dev/null 2> /dev/null
if
[
-z
$fstype
]
;
then
echo
"Creating new file system on RBD device"
mke2fs
-t
ext4 /dev/rbd0
>
/dev/null 2> /dev/null
else
fsck.ext4
-y
/dev/rbd0
>
/dev/null 2> /dev/null
resize2fs
-f
/dev/rbd0
>
/dev/null 2> /dev/null
fi
mount
-o
rw,discard /dev/rbd0 /rbd
mount
-o
rw,discard /dev/rbd0 /rbd
cp
-an
/data/
*
/rbd
cp
-an
/data/
*
/rbd
umount /data
umount /data
mount
--move
/rbd /data
mount
--move
/rbd /data
mkdir
-p
/run/systemd/system/final.target.requires
ln
-s
/lib/systemd/system/rbd-detach.service /run/systemd/system/final.target.requires/rbd-detach.service
else
echo
"No RBD device is present, proceeding with local /data partition"
fi
fi
else
echo
"Could not obtain DHCP lease, proceeding with local /data partition"
fi
fi
fi
fi
...
...
initramfs.list
View file @
1c4928cb
...
@@ -64,6 +64,8 @@ file /bin/echo /bin/echo 755 0 0
...
@@ -64,6 +64,8 @@ file /bin/echo /bin/echo 755 0 0
file /bin/rm /bin/rm 755 0 0
file /bin/rm /bin/rm 755 0 0
file /bin/mv /bin/mv 755 0 0
file /bin/mv /bin/mv 755 0 0
file /bin/cp /bin/cp 755 0 0
file /bin/cp /bin/cp 755 0 0
file /bin/ln /bin/ln 755 0 0
file /bin/mkdir /bin/mkdir 755 0 0
file /bin/mount /bin/mount 755 0 0
file /bin/mount /bin/mount 755 0 0
file /bin/umount /bin/umount 755 0 0
file /bin/umount /bin/umount 755 0 0
file /bin/sleep /bin/sleep 755 0 0
file /bin/sleep /bin/sleep 755 0 0
...
@@ -75,6 +77,7 @@ file /bin/sed /bin/sed 755 0 0
...
@@ -75,6 +77,7 @@ file /bin/sed /bin/sed 755 0 0
file /bin/sfdisk /sbin/sfdisk 755 0 0
file /bin/sfdisk /sbin/sfdisk 755 0 0
file /bin/fsck.ext4 /sbin/fsck.ext4 755 0 0
file /bin/fsck.ext4 /sbin/fsck.ext4 755 0 0
file /bin/resize2fs /sbin/resize2fs 755 0 0
file /bin/resize2fs /sbin/resize2fs 755 0 0
file /bin/mke2fs /sbin/mke2fs 755 0 0
file /bin/xz /bin/xz 755 0 0
file /bin/xz /bin/xz 755 0 0
slink /bin/unxz xz 777 0 0
slink /bin/unxz xz 777 0 0
file /bin/dhclient /tmp/dhcp/client/dhclient 755 0 0
file /bin/dhclient /tmp/dhcp/client/dhclient 755 0 0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment