0

I need to create a bootable, live, desktop ISO.

This will be a utility disk, a bootable ISO image created for the sole purpose of allowing the user to run a script which will resize an existing local disk volume. This ISO will not be used to install anything.

I don't want anything to run unattended.
I don't want to edit the kickstart file unless there's no other option.
I do not want to mount existing volumes on the local hard drive.

I have a script for the volume resizing, and I need that script to be present (and executable) in the desktop directory of the live filesystem.

I have tried using livecd-tools on Fedora but can't see whether there's an option to add a file to the iso build.

I tried using livecd-creator with a few lines of added syntax:

touch /home/liveuser/Desktop/resize.sh
cat > /home/liveuser/Desktop/resize.sh <<EOF
lvchange -a y
ROOTVOL=/dev/mapper/vg_blago-lv_root
mkdir /tmp/lvroot
mount -t ext4 -o ro $ROOTVOL /tmp/lvroot
usedROOT=$(df -h $ROOTVOL |  tail -1 | awk '{print $2}' | awk '{printf("%d\n",$1 + 1)}')
umount /tmp/rootvol
/sbin/lvresize --resizefs --size $usedROOT\g  $ROOTVOL
e2fsck $ROOTVOL
sleep 1
# reduce home volume
HOMEVOL=/dev/mapper/vg_blago-lv_home
mkdir /tmp/lvhome
mount -t ext4 -o ro $HOMEVOL /tmp/lvhome
usedROOT=$(df -h $HOMEVOL |  tail -1 | awk '{print $2}' | awk '{printf("%d\n",$1 + 1)}')
umount /tmp/lvhome
e2fsck $HOMEVOL 
EOF

chmod: cannot access '/home/liveuser/Desktop/resize.sh': No such file or directory chown: invalid user: 'liveuser:liveuser' /tmp/ks-script-pek0yli8: line 54: restorecon: command not found ignoring %post failure (code 127) / 100.0%

mr.zog
  • 923
  • 3
  • 20
  • 39

0 Answers0