update install instruction and etc
This commit is contained in:
parent
1dbd8f5609
commit
6b3a02f47b
6 changed files with 107 additions and 39 deletions
39
install-efi
39
install-efi
|
@ -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
|
|
10
rootfs/etc/issue
Normal file
10
rootfs/etc/issue
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Linux From Scratch \r (\l)
|
||||||
|
|
||||||
|
login: root
|
||||||
|
password: root
|
||||||
|
|
||||||
|
login: lfs
|
||||||
|
password: lfs
|
||||||
|
|
||||||
|
install: run 'lfs-readme' to view instruction
|
||||||
|
|
82
rootfs/root/README
Normal file
82
rootfs/root/README
Normal file
|
@ -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 <root mountpoint>' to extract squashed filesystem
|
||||||
|
into your root partition.
|
||||||
|
# lfs-install /mnt/lfs
|
||||||
|
|
||||||
|
4. chroot into your installed lfs system
|
||||||
|
- run 'lfs-chroot <root mountpoint>' 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 <yourusername>
|
||||||
|
- user's password
|
||||||
|
# passwd <yourusername>
|
||||||
|
|
||||||
|
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
|
|
@ -1,5 +1,13 @@
|
||||||
#!/bin/bash
|
#!/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
|
passwd -d root &>/dev/null
|
||||||
|
|
||||||
echo "root:root" | chpasswd -c SHA512
|
echo "root:root" | chpasswd -c SHA512
|
||||||
|
echo "$USER:$PASSWORD" | chpasswd -c SHA512
|
||||||
|
|
||||||
|
echo "lfs-livecd" > /etc/hostname
|
||||||
|
|
|
@ -63,6 +63,8 @@ fi
|
||||||
|
|
||||||
cp -L /etc/resolv.conf $LFS/etc
|
cp -L /etc/resolv.conf $LFS/etc
|
||||||
|
|
||||||
|
echo ":: entering chroot to $LFS."
|
||||||
|
|
||||||
chroot "$LFS" /usr/bin/env -i \
|
chroot "$LFS" /usr/bin/env -i \
|
||||||
HOME=/root \
|
HOME=/root \
|
||||||
TERM="$TERM" \
|
TERM="$TERM" \
|
||||||
|
@ -82,4 +84,6 @@ if [ -n "$EFI_SYSTEM" ]; then
|
||||||
fi
|
fi
|
||||||
umount $LFS/sys
|
umount $LFS/sys
|
||||||
|
|
||||||
|
echo ":: chroot exited."
|
||||||
|
|
||||||
exit $retval
|
exit $retval
|
||||||
|
|
3
rootfs/sbin/lfs-readme
Executable file
3
rootfs/sbin/lfs-readme
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
less /root/README
|
Loading…
Add table
Reference in a new issue