Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
mkimage-profiles
Commits
36d25f43
Commit
36d25f43
authored
Aug 07, 2023
by
Anton Midyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tar2fs, e2k: replace creating boot.conf from tar2fs to feature e2k
parent
a37b3d80
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
45 deletions
+47
-45
tar2fs
bin/tar2fs
+8
-43
40-e2k-boot-conf
features.in/e2k/image-scripts.d/40-e2k-boot-conf
+39
-0
50-e2k-serial
features.in/e2k/rootfs/image-scripts.d/50-e2k-serial
+0
-2
No files found.
bin/tar2fs
View file @
36d25f43
...
@@ -340,54 +340,11 @@ if [ -n "$EFIPART" ]; then
...
@@ -340,54 +340,11 @@ if [ -n "$EFIPART" ]; then
echo
"
$EFIDEV
/boot/efi vfat umask=0,quiet,showexec,iocharset=utf8,codepage=866 1 2"
>>
"
$ROOTFS
/etc/fstab"
echo
"
$EFIDEV
/boot/efi vfat umask=0,quiet,showexec,iocharset=utf8,codepage=866 1 2"
>>
"
$ROOTFS
/etc/fstab"
fi
fi
# Query ARCH in chroot and redefine arch-dependent variable
ARCH
=
"
$(
chroot
"
$ROOTFS
"
rpm
--eval
'%_host_cpu'
)
"
# NB: don't stick BOOTFS here, it has slightly different semantics
pushd
$ROOTFS
/boot
# 4.9.76-elbrus-def-alt1.11.1 -> def
get_label
()
{
echo
"
${
1
# *
}
"
|
sed
-r
's,.*elbrus-([0-9a-z]+)-.*$,\1,'
;
}
KVERSIONS
=
KVERSIONS
=
"
$(
chroot
"
$ROOTFS
"
rpm
-qa
'kernel-image*'
\
--qf
'%{installtime} %{version}-%{name}-%{release}\n'
\
|
sort
-n
\
|
cut
-f
2
-d
' '
\
|
sed
's/kernel-image-//'
)
"
[
-n
"
$KVERSIONS
"
]
||
fatal
"unable to deduce kernel version"
rm
-f
.origver
# clean fstab
# clean fstab
sed
-i
"/LABEL=ROOT/d"
"
$ROOTFS
/etc/fstab"
sed
-i
"/LABEL=ROOT/d"
"
$ROOTFS
/etc/fstab"
# ...target device too
# ...target device too
sed
-i
"s,
$LOOPROOT
,
$ROOTDEV
,"
"
$ROOTFS
/etc/fstab"
sed
-i
"s,
$LOOPROOT
,
$ROOTDEV
,"
"
$ROOTFS
/etc/fstab"
echo
"** KVERSIONS=[
$KVERSIONS
]"
>
&2
if
[
"
`
echo
$KVERSIONS
|
wc
-w
`
"
=
1
]
;
then
# 2+ labels
echo
-e
"default=
`
get_label
$KVERSIONS
`
\n
"
>>
boot.conf
fi
# FIXME: relies on particular (current) kernel package naming scheme
for
v
in
$KVERSIONS
;
do
l
=
"
`
get_label
"
$v
"
`
"
cat
>>
boot.conf
<<
EOF
label=
$l
partition=0
image=/image-
$v
initrd=/initrd-
$v
.img
cmdline=console=ttyS0,115200 console=tty0 consoleblank=0 hardreset root=UUID=
$ROOTUUID
EOF
done
echo
"** start of boot.conf"
cat
boot.conf
echo
"** end of boot.conf"
popd
# Update cmdline.txt for Raspberry Pi
# Update cmdline.txt for Raspberry Pi
[
-f
"
$ROOTFS
/boot/efi/cmdline.txt"
]
&&
[
-f
"
$ROOTFS
/boot/efi/cmdline.txt"
]
&&
sed
-i
"s/LABEL=ROOT/
$ROOTDEV
/"
"
$ROOTFS
/boot/efi/cmdline.txt"
sed
-i
"s/LABEL=ROOT/
$ROOTDEV
/"
"
$ROOTFS
/boot/efi/cmdline.txt"
...
@@ -411,6 +368,14 @@ if [ -f "$ROOTFS/boot/extlinux/extlinux.conf" ]; then
...
@@ -411,6 +368,14 @@ if [ -f "$ROOTFS/boot/extlinux/extlinux.conf" ]; then
fi
fi
fi
fi
# e2k
if
[
-f
"
$ROOTFS
/boot/boot.conf"
]
;
then
sed
-i
"s/LABEL=ROOT/
$ROOTDEV
/g"
"
$ROOTFS
/boot/boot.conf"
fi
# Query ARCH in chroot and redefine arch-dependent variable
ARCH
=
"
$(
chroot
"
$ROOTFS
"
rpm
--eval
'%_host_cpu'
)
"
# Setup bootloader
# Setup bootloader
case
"
$BOOTLOADER
"
in
case
"
$BOOTLOADER
"
in
lilo
)
lilo
)
...
...
features.in/e2k/image-scripts.d/40-e2k-boot-conf
0 → 100755
View file @
36d25f43
#!/bin/sh -efu
# NB: don't stick BOOTFS here, it has slightly different semantics
# 4.9.76-elbrus-def-alt1.11.1 -> def
get_label
()
{
echo
"
${
1
# *
}
"
|
sed
-r
's,.*elbrus-([0-9a-z]+)-.*$,\1,'
;
}
KVERSIONS
=
"
$(
rpm
-qa
'kernel-image*'
\
--qf
'%{installtime} %{version}-%{name}-%{release}\n'
\
|
sort
-n
\
|
cut
-f
2
-d
' '
\
|
sed
's/kernel-image-//'
)
"
[
-n
"
$KVERSIONS
"
]
||
{
echo
"** unable to deduce kernel version"
>
&2
;
exit
1
;
}
cd
/boot
#rm -f .origver
echo
"** KVERSIONS=[
$KVERSIONS
]"
>
&2
if
[
"
`
echo
$KVERSIONS
|
wc
-w
`
"
=
1
]
;
then
# 2+ labels
echo
-e
"default=
`
get_label
$KVERSIONS
`
\n
"
>>
boot.conf
fi
# FIXME: relies on particular (current) kernel package naming scheme
for
v
in
$KVERSIONS
;
do
l
=
"
`
get_label
"
$v
"
`
"
cat
>>
boot.conf
<<
EOF
label=
$l
partition=0
image=/image-
$v
initrd=/initrd-
$v
.img
cmdline=console=tty0 consoleblank=0 hardreset LABEL=ROOT
EOF
done
echo
"** start of boot.conf"
>
&2
cat
boot.conf
>
&2
echo
"** end of boot.conf"
>
&2
features.in/e2k/rootfs/image-scripts.d/50-e2k-serial
View file @
36d25f43
...
@@ -10,5 +10,3 @@ CFG="/boot/boot.conf"
...
@@ -10,5 +10,3 @@ CFG="/boot/boot.conf"
# tty0 first
# tty0 first
sed
-i
"s/console=tty0 /console=
$GLOBAL_TTY_DEV
,
$GLOBAL_TTY_RATE
&/"
"
$CFG
"
sed
-i
"s/console=tty0 /console=
$GLOBAL_TTY_DEV
,
$GLOBAL_TTY_RATE
&/"
"
$CFG
"
### NB: there's no boot.conf yet! could only be the sample one
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