Kaydet (Commit) 93b3304e authored tarafından Ali Rıza KESKİN's avatar Ali Rıza KESKİN

live config eklendi

üst 2c1816ee
......@@ -25,7 +25,7 @@ overlay_mount(){
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
echo $(($memtotal)) > /sys/block/zram0/disksize
echo $memtotal > /sys/block/zram0/disksize
sh
mkfs.ext2 /dev/zram0
mount -t auto /dev/zram0 /root/a
......@@ -35,6 +35,22 @@ overlay_mount(){
mount -t tmpfs -o size=100% none /root/a
fi
}
live_config(){
if [ -f /rootfs/$subdir/sbin/openrc-run ] ; then
if [ "${live.user}" != "" ] ; then
chroot /rootfs/$subdir/ useradd "$live_user" || true
fi
if [ "${live.keyboard}" != "" ] ; then
echo "keymap=\"${live.keymap}\"" > /rootfs/$subdir/etc/conf.d/keymaps
fi
if [ "${live.locale}" != "" ] ; then
export LANG=${live.locale}
export LC_ALL=${live.locale}
fi
else
warn "Live config cannot works without openrc"
fi
}
live_boot(){
[ "$sfs" == "" ] && sfs="/main.sfs"
if [ "$root" == "" ] ; then
......@@ -58,6 +74,7 @@ live_boot(){
mount /output/${sfs} /source
overlay_mount
[ -d /output/merge ] && cp -prfv /output/merge/* /rootfs/
live_config
common_boot || fallback_shell
}
freeze_boot(){
......
#!/busybox ash
tmpfile="/rootfs/$subdir/etc/initrd.remove"
rmv(){
while read line
do
if [ -f "$line" ] || [ -d "$line" ]; then
rm -rvf -- "$line"
fi
done
}
if [ -f "$tmpfile" ] ; then
cat "$tmpfile" | rmv
rm -f "$tmpfile"
touch "$tmpfile" 2>/dev/null || true
fi
homedir=/rootfs/$subdir/data/user/
[ -d $homedir ] || homedir=/rootfs/$subdir/home
if [ -d $homedir ] ; then
for user in $(ls $homedir)
do
rm -rf $homedir/$user/.cache
done
fi
......@@ -9,7 +9,6 @@ if [ -f /rootfs/$subdir/etc/os-release ]; then
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"
. /rootfs/$subdir/etc/initrd.local || true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment