OSDN Git Service

added squashfs
authorkokkiemouse <kokkiemouse@gmail.com>
Sat, 12 Sep 2020 05:12:37 +0000 (14:12 +0900)
committerkokkiemouse <kokkiemouse@gmail.com>
Sat, 12 Sep 2020 05:12:37 +0000 (14:12 +0900)
channels/share/packages.x86_64
lfbs

index a5959ba..c3d602a 100644 (file)
@@ -1,2 +1,6 @@
 # base
 kernel
+squashfs-tools
+dump
+isomd5sum
+dracut-live
diff --git a/lfbs b/lfbs
index 8e3d77d..9b328c9 100755 (executable)
--- a/lfbs
+++ b/lfbs
@@ -291,15 +291,29 @@ make_cp_airootfs() {
 }
 
 make_config() {
-    run_cmd truncate -s 0 /etc/machine-id
     if [ -f ${work_dir}/airootfs/root/customize_airootfs.sh ]; then
         run_cmd /root/customize_airootfs.sh
     fi
+    run_cmd truncate -s 0 /etc/machine-id
 }
 make_clean() {
     run_cmd dnf -y remove $(run_cmd dnf repoquery --installonly --latest-limit=-1 -q)
     run_cmd dnf clean all
 }
+
+make_squashfs() {
+    # prepare
+    [[ -d "${bootfiles_dir}" ]] && rm -r "${bootfiles_dir}"
+    mkdir -p "${bootfiles_dir}"/{isolinux,fedora,boot}
+
+    #generate initrd
+    run_cmd dracut --xz --add "dmsquash-live convertfs pollcdrom" --omit plymouth --no-hostonly --no-early-microcode /boot/initrd0 `run_cmd ls /lib/modules`
+    cp ${work_dir}/airootfs/boot/vmlinuz-$(run_cmd ls /lib/modules) ${bootfiles_dir}/boot/vmlinuz
+    mv ${work_dir}/airootfs/boot/initrd0 ${bootfiles_dir}/boot/initrd
+    # make squashfs
+    mksquashfs "${work_dir}/airootfs" "${bootfiles_dir}/fedora/airootfs.sfs"
+}
+
 # 引数解析()
 # 参考記事:https://0e0.pw/ci83 https://0e0.pw/VJlg