Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
initrd
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
initrd
Commits
ad168f29
Kaydet (Commit)
ad168f29
authored
Agu 09, 2021
tarafından
root
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
fix conflict
üst
0807ecd8
1f2067e2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
34 deletions
+15
-34
00-modules.sh
src/addons/00-modules.sh
+1
-0
functions.sh
src/functions.sh
+3
-3
02-modules.sh
src/scripts/02-modules.sh
+2
-0
96-fsmount.sh
src/scripts/96-fsmount.sh
+9
-31
No files found.
src/addons/00-modules.sh
Dosyayı görüntüle @
ad168f29
...
...
@@ -14,6 +14,7 @@ elif [ "$minimal" == true ]; then
cp
-prf
${
MODDIR
}
/kernel/drivers/
{
ata,md,mmc,firewire
}
${
WORKDIR
}
/
${
MODDIR
}
cp
-prf
${
MODDIR
}
/kernel/drivers/
{
scsi,pcmcia,virtio
}
${
WORKDIR
}
/
${
MODDIR
}
cp
-prf
${
MODDIR
}
/kernel/drivers/usb/
${
WORKDIR
}
/
${
MODDIR
}
cp
-prf
${
MODDIR
}
/kernel/drivers/acpi/
${
WORKDIR
}
/
${
MODDIR
}
# Some kernels not have this directories.
cp
-prf
${
MODDIR
}
/kernel/drivers/
{
block,cdrom
}
/
${
WORKDIR
}
/
${
MODDIR
}
||
true
else
...
...
src/functions.sh
Dosyayı görüntüle @
ad168f29
...
...
@@ -8,7 +8,7 @@ generate_rootfs(){
/busybox
--install
-s
/bin
msg
'Creating initrd'
/busybox
mkdir
/dev
||
true
/busybox mdev
-s
2>/dev/null
/busybox mdev
-s
2>/dev/null
||
true
}
run_modules
(){
for
i
in
$(
ls
/scripts |
sort
)
...
...
@@ -26,14 +26,14 @@ mount_handler(){
/busybox mount
-t
tmpfs tmpfs /run
||
true
if
[
-e
/sys/firmware/efi
]
;
then
inf
"UEFI mode detected"
mount
-t
efivarfs efivarfs /sys/firmware/efi/efivars
-o
nosuid,nodev,noexec
mount
-t
efivarfs efivarfs /sys/firmware/efi/efivars
-o
nosuid,nodev,noexec
||
true
fi
export
memtotal
=
$(
cat
/proc/meminfo |
grep
MemTotal |
sed
"s/.* //"
|
sed
"s/ .*//g"
)
}
parse_cmdline
(){
for
i
in
$(
cat
/proc/cmdline
)
do
echo export
$(
echo
$i
|
tr
-d
'.,\!\(\[\{'
)
>>
/env
echo export
$(
echo
$i
|
tr
-d
'
-
.,\!\(\[\{'
)
>>
/env
done
.
/env
||
true
}
...
...
src/scripts/02-modules.sh
Dosyayı görüntüle @
ad168f29
#!/busybox sh
[
-n
"
$debug
"
]
&&
/busybox ash
# Disable selinux
[
-d
/sys/fs/selinux
]
&&
echo
0
>
/sys/fs/selinux/enforce
msg
"Loading filesystem drivers"
find /lib/modules/
*
/fs/
-type
f |
sed
"s/.*
\/
//g"
|
sed
"s/^/modprobe /g"
|
sed
"s/
\.
ko//g"
|
sed
"s/
$/
&/g"
>
/fs
sh /fs &>/dev/null
...
...
src/scripts/96-fsmount.sh
Dosyayı görüntüle @
ad168f29
...
...
@@ -24,42 +24,19 @@ overlay_mount(){
debug
"Creating overlayfs"
mount
-t
overlay
-o
lowerdir
=
/source/,upperdir
=
/root/a,workdir
=
/root/b overlay /rootfs
if
[
"
$overlay
"
==
"zram"
]
;
then
modprobe zram
num_devices
=
1
2>/dev/null
||
true
modprobe zram
num_devices
=
2
2>/dev/null
||
true
echo
$memtotal
>
/sys/block/zram0/disksize
echo
$memtotal
>
/sys/block/zram1/disksize
mkfs.ext2 /dev/zram0
mkfs.ext2 /dev/zram1
mount
-t
auto /dev/zram0 /root/a
mount
-t
tmpfs
-o
size
=
100% none
/root/b
mount
-t
auto /dev/zram1
/root/b
else
mount
-t
tmpfs
-o
size
=
100% none /root/b
mount
-t
tmpfs
-o
size
=
100% none /root/a
fi
}
live_config
(){
if
[
-f
/rootfs/
$subdir
/sbin/openrc-run
]
;
then
if
[
"
${
live_user
}
"
==
""
]
;
then
export
live_user
=
"user"
fi
if
[
"
${
live_pass
}
"
==
""
]
;
then
export
live_pass
=
"live"
fi
if
[
"
${
live_hostname
}
"
==
""
]
;
then
export
live_hostname
=
"SulinOS"
fi
chroot
/rootfs/
$subdir
/ sh
-c
"useradd
${
live_user
}
"
||
true
chroot
/rootfs/
$subdir
/ sh
-c
"echo -ne
\"
${
live_pass
}
\\
n
${
live_pass
}
\\
n
\"
| passwd
${
live_user
}
"
||
true
chroot
/rootfs/
$subdir
/ sh
-c
"echo -ne
\"
${
live_pass
}
\\
n
${
live_pass
}
\\
n
\"
| passwd"
||
true
echo
${
live_hostname
}
>
/rootfs/
$subdir
/etc/hostname
if
[
"
${
live_locale
}
"
!=
""
]
;
then
export
LANG
=
${
live_locale
}
export
LC_ALL
=
${
live_locale
}
fi
if
[
"
${
live_keymap
}
"
!=
""
]
;
then
echo
-e
"keymap=
\"
${
live_keymap
}
\"
"
>
/rootfs/
$subdir
/etc/conf.d/keymaps
fi
else
warn
"Live config cannot works without openrc"
fi
}
live_boot
(){
# load loop module
if
find /lib/modules |
grep
"/loop.ko$"
;
then
...
...
@@ -97,14 +74,15 @@ live_boot(){
fi
overlay_mount
[
-d
/output/merge
]
&&
cp
-prf
/output/merge/
*
/rootfs/ &>/dev/null
[
-n
"
${
no
-live-config
}
"
]
&&
live_config
common_boot
||
fallback_shell
}
freeze_boot
(){
mkdir
-p
/source/
# lower
debug
"Mounting freeze media"
mount
-t
auto
-o
defaults,r
o
$root
/source
mount
-t
auto
-o
defaults,r
w
$root
/source
overlay_mount
[
-d
/rootfs/home
]
&&
mount
--bind
/source/home /rootfs/home
[
-d
/rootfs/data
]
&&
mount
--bind
/source/data /rootfs/data
common_boot
||
fallback_shell
}
image_boot
(){
...
...
@@ -171,7 +149,7 @@ elif [ "$boot" == "freeze" ]; then
elif
[
"
$boot
"
==
"image"
]
;
then
wait_device
image_boot
||
fallback_shell
msg
"Booting from"
"
$root
(
freez
e)"
msg
"Booting from"
"
$root
(
imag
e)"
else
wait_device
classic_boot
||
fallback_shell
...
...
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