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
e34291af
Kaydet (Commit)
e34291af
authored
Nis 04, 2020
tarafından
Your Name
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
boot=live düzeltildi
üst
611c261c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
23 deletions
+24
-23
common.sh
src/common.sh
+1
-1
functions.sh
src/functions.sh
+3
-2
50-networking.sh
src/scripts/50-networking.sh
+0
-0
97-fsmount.sh
src/scripts/97-fsmount.sh
+11
-11
99-fsswitch.sh
src/scripts/99-fsswitch.sh
+9
-9
No files found.
src/common.sh
Dosyayı görüntüle @
e34291af
if
[
-t
0
]
&&
[
"
$nocolor
"
==
"fals
e"
]
;
then
if
[
-t
0
]
&&
[
"
$nocolor
"
!=
"tru
e"
]
;
then
C_BLACK
=
'\e[1;30m'
C_RED
=
'\e[1;31m'
C_GREEN
=
'\e[1;32m'
...
...
src/functions.sh
Dosyayı görüntüle @
e34291af
...
...
@@ -31,7 +31,7 @@ mount_handler(){
parse_cmdline
(){
for
i
in
$(
cat
/proc/cmdline
)
do
export
$i
export
$i
||
true
done
}
...
...
@@ -74,7 +74,8 @@ detect_root(){
/dev/
*
)
device
=
$root
;;
UUID
=
*
)
eval
$root
;
device
=
"/dev/disk/by-uuid/
$UUID
"
;;
LABEL
=
*
)
eval
$root
;
device
=
"/dev/disk/by-label/
$LABEL
"
;;
""
)
err
"No root device specified."
""
)
[
"
$boot
"
==
"live"
]
&&
return
0
err
"No root device specified."
echo
-ne
"
\0
33[33;1m * Where is the root >
\0
33[;0m"
while
read
root
do
...
...
src/scripts/50-networking.sh
Dosyayı görüntüle @
e34291af
No preview for this file type
src/scripts/97-fsmount.sh
Dosyayı görüntüle @
e34291af
...
...
@@ -9,11 +9,12 @@ common_boot(){
mount
--move
/run /rootfs/run
}
live_boot
(){
[
"
$sfs
"
==
""
]
&&
sfs
=
"/main.sfs"
list
=
$(
ls
/sys/class/block/ |
grep
".*[0-9]$"
|
grep
-v
loop |
grep
-v
ram |
grep
-v
nbd |
sed
"s|^|/dev/|g"
)
for
part
in
$list
do
debug
"Looking for
$part
"
if
is_file_avaiable
"
$part
"
"
main.sfs
"
if
is_file_avaiable
"
$part
"
"
${
sfs
}
"
then
debug
"Detected live media:
$part
"
export
root
=
$part
...
...
@@ -21,19 +22,19 @@ live_boot(){
done
mkdir
-p
/root/a
# upper
mkdir
-p
/root/b
# workdir
mkdir
-p
/
live_root
/
mkdir
-p
/
rootfs
/
mkdir
-p
/source/
# lower
mkdir
-p
/output
debug
"Mounting live media"
mount
-t
auto
$root
/output
mount /output/
main.sfs
/source
mount /output/
${
sfs
}
/source
umount /root/a 2>/dev/null
umount /root/b 2>/dev/null
debug
"Creating overlayfs"
mount
-t
overlay
-o
lowerdir
=
/source/,upperdir
=
/root/a/,workdir
=
/root/b overlay /rootfs
mount
-t
tmpfs
-o
size
=
100% none /root/a
mount
-t
tmpfs
-o
size
=
100% none /root/b
common_boot
common_boot
||
fallback_shell
}
normal_boot
(){
debug
"Mounting rootfs"
...
...
@@ -54,24 +55,23 @@ normal_boot(){
mkdir
-p
/rootfs/
$i
mount
--bind
/newroot/
$i
/rootfs/
$i
done
common_boot
common_boot
||
fallback_shell
}
classic_boot
(){
debug
"Mounting rootfs"
mkdir
-p
/rootfs
mount
-t
auto
$root
/rootfs
common_boot
common_boot
||
fallback_shell
}
if
[
"
$boot
"
==
"live"
]
;
then
msg
"Booting from live-media"
live_boot
fi
if
[
"
$boot
"
==
"normal"
]
;
then
live_boot
||
fallback_shell
elif
[
"
$boot
"
==
"normal"
]
;
then
msg
"Booting from
$root
"
normal_boot
normal_boot
||
fallback_shell
else
msg
"Booting from
$root
(classic)"
classic_boot
classic_boot
||
fallback_shell
fi
src/scripts/99-fsswitch.sh
Dosyayı görüntüle @
e34291af
if
[
-f
/new_root/etc/os-release
]
;
then
msg
"Wellcome to
$(
cat
/new_root/etc/os-release |
grep
'^NAME='
|
head
-n
1 |
sed
's/^.*=//g'
)
"
else
msg
"Wellcome to GNU/Linux..."
fi
[
-d
"/new_root/
$subdir
"
]
||
subdir
=
"/"
[
-d
"/rootfs/
$subdir
"
]
||
subdir
=
"/"
debug
"Subdir=
$subdir
"
[
"
$init
"
!=
""
]
||
init
=
/sbin/init
debug
"init=
$init
"
if
[
-f
/new_root/
$subdir
/etc/initrd.local
]
;
then
if
[
-f
/rootfs/
$subdir
/etc/os-release
]
;
then
msg
"Wellcome to
${
C_PURPLE
}$(
cat
/rootfs/
$subdir
/etc/os-release |
grep
'^NAME='
|
head
-n
1 |
sed
's/^.*=//g'
)
$C_CLEAR
"
else
msg
"Wellcome to
${
C_PURPLE
}
GNU/Linux...
${
C_CLEAR
}
"
fi
sleep
2
if
[
-f
/rootfs/
$subdir
/etc/initrd.local
]
;
then
inf
"Running local initrd scripts"
.
/
new_root
/
$subdir
/etc/initrd.local
||
true
.
/
rootfs
/
$subdir
/etc/initrd.local
||
true
fi
debug
"Switching root"
...
...
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