diff --git a/install-efi b/install-efi deleted file mode 100644 index fa8724c..0000000 --- a/install-efi +++ /dev/null @@ -1,39 +0,0 @@ -1. make partition - cfdisk - 100MB EFI System - mkfs.vfat -F32 /dev/sda1 - mkswap /dev/sda2 - mkfs.ext4 -L LFS /dev/sda3 - -2. mount partition - mkdir -p /mnt/lfs - mount /dev/sda3 /mnt/lfs - mkdir -p /mnt/lfs/boot/efi - mount /dev/sda1 /mnt/lfs/boot/efi - -3. install lfs - lfs-install /mnt/lfs - -4. enter chroot - lfs-chroot /mnt/lfs - -5. configure fstab - /dev/sda1 /boot/efi vfat defaults 0 2 - -6. hostname - vim /etc/hostname - -7. root passwd - passwd - -8. add user - useradd -m -G users,wheel,audio,video -s /bin/bash emmett - -9. initramfs - mkinitramfs -o /boot/initrd-lfs.img - -10. grub - grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=lfs_grub --recheck /dev/sda1 - mkdir -p /boot/efi/EFI/BOOT - cp /boot/efi/EFI/lfs_grub/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI - grub-mkconfig -o /boot/grub/grub.cfg diff --git a/rootfs/etc/issue b/rootfs/etc/issue new file mode 100644 index 0000000..420461d --- /dev/null +++ b/rootfs/etc/issue @@ -0,0 +1,10 @@ +Linux From Scratch \r (\l) + +login: root +password: root + +login: lfs +password: lfs + +install: run 'lfs-readme' to view instruction + diff --git a/rootfs/root/README b/rootfs/root/README new file mode 100644 index 0000000..f75a100 --- /dev/null +++ b/rootfs/root/README @@ -0,0 +1,82 @@ + Linux From Scratch LiveCD (Unofficial + ===================================== + +Project: https://github.com/emmett1/lfs-scripts +Email : emmett1.2miligrams@gmail.com + +* installable (instruction below) +* use port system, pkgutils from CRUX (crux.nu) to manage packages +* multilib (32bit libraries in /usr/lib32) +* livecd support initramfs taken from Venom Linux (venomlinux.org) +* support UEFI +* support booting from ram + + +Install instruction +------------------- + +1. configure partition + - for UEFI, GPT partition is required and a FAT32 partition with + at least 100MB set as 'EFI System' must be created. + # cfdisk + # mkfs.vfat -F32 /dev/sda1 + # mkswap /dev/sda2 + # mkfs.ext4 -L LFS /dev/sda3 + +2. mount partition + - create mountpoint directory then mount your root partition. + # mkdir -p /mnt/lfs + # mount /dev/sda3 /mnt/lfs + - for UEFI, mount EFI partition created earlier to /boot/efi in + your root partition. + # mkdir -p /mnt/lfs/boot/efi + # mount /dev/sda1 /mnt/lfs/boot/efi + +3. install now + - run 'lfs-install ' to extract squashed filesystem + into your root partition. + # lfs-install /mnt/lfs + +4. chroot into your installed lfs system + - run 'lfs-chroot ' to enter chroot. + # lfs-chroot /mnt/lfs + +5. configure fstab + - on UEFI, make sure uncomment entry for EFI partition + # vim /etc/fstab + +6. configure hostname + # vim /etc/hostname + +7. configure root passwd + - root password is mandatory, you can't login for blank root password + # passwd + +8. configure user + - add user + # useradd -m -G users,wheel,audio,video -s /bin/bash + - user's password + # passwd + +9. generate initramfs + - initramfs is mandatory since shipped kernel installed is generic + kernel and most of config is built as module + # mkinitramfs -o /boot/initrd-lfs.img + +10. configure grub + - for BIOS + # grub-install /dev/sda + - for UEFI + # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=lfs_grub --recheck /dev/sda1 + - for UEFI in Virtualbox you need to configure this, else you gonna stuck at + Virtualbox UEFI + # mkdir -p /boot/efi/EFI/BOOT + # cp /boot/efi/EFI/lfs_grub/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI + - then generate grub config, for BIOS and UEFI + # grub-mkconfig -o /boot/grub/grub.cfg + +11. Exit chroot and reboot + # exit + # umount /mnt/lfs/boot/efi + # umount /mnt/lfs + # reboot diff --git a/rootfs/root/custom_script.sh b/rootfs/root/custom_script.sh index 59e6c29..6320fe8 100755 --- a/rootfs/root/custom_script.sh +++ b/rootfs/root/custom_script.sh @@ -1,5 +1,13 @@ #!/bin/bash +USER=lfs +PASSWORD=lfs + +useradd -m -G users,wheel,audio,video -s /bin/bash $USER +passwd -d $USER &>/dev/null passwd -d root &>/dev/null echo "root:root" | chpasswd -c SHA512 +echo "$USER:$PASSWORD" | chpasswd -c SHA512 + +echo "lfs-livecd" > /etc/hostname diff --git a/rootfs/sbin/lfs-chroot b/rootfs/sbin/lfs-chroot index 4f1f15a..2342297 100755 --- a/rootfs/sbin/lfs-chroot +++ b/rootfs/sbin/lfs-chroot @@ -63,6 +63,8 @@ fi cp -L /etc/resolv.conf $LFS/etc +echo ":: entering chroot to $LFS." + chroot "$LFS" /usr/bin/env -i \ HOME=/root \ TERM="$TERM" \ @@ -82,4 +84,6 @@ if [ -n "$EFI_SYSTEM" ]; then fi umount $LFS/sys +echo ":: chroot exited." + exit $retval diff --git a/rootfs/sbin/lfs-readme b/rootfs/sbin/lfs-readme new file mode 100755 index 0000000..0274dc3 --- /dev/null +++ b/rootfs/sbin/lfs-readme @@ -0,0 +1,3 @@ +#!/bin/bash + +less /root/README